1# zx_interrupt_bind_vcpu 2 3## NAME 4 5<!-- Updated by update-docs-from-abigen, do not edit. --> 6 7interrupt_bind_vcpu - bind an interrupt object to a VCPU 8 9## SYNOPSIS 10 11<!-- Updated by update-docs-from-abigen, do not edit. --> 12 13``` 14#include <zircon/syscalls.h> 15 16zx_status_t zx_interrupt_bind_vcpu(zx_handle_t handle, 17 zx_handle_t vcpu, 18 uint32_t options); 19``` 20 21## DESCRIPTION 22 23`zx_interrupt_bind_vcpu()` binds an interrupt object to a VCPU. When the 24interrupt object is triggered, the interrupt is redirected to the VCPU, in order 25to be processed by a guest with no host intervention. 26 27An interrupt object may be bound to multiple VCPUs, in order to distribute the 28interrupt. Simply invoke `zx_interrupt_bind_vcpu()` with the same *handle*, but 29different *vcpu*s. However, all VCPUs must belong to a single guest. 30 31## RIGHTS 32 33<!-- Updated by update-docs-from-abigen, do not edit. --> 34 35*handle* must be of type **ZX_OBJ_TYPE_INTERRUPT** and have **ZX_RIGHT_READ**. 36 37*vcpu* must be of type **ZX_OBJ_TYPE_VCPU** and have **ZX_RIGHT_WRITE**. 38 39## RETURN VALUE 40 41`zx_interrupt_bind_vcpu()` returns **ZX_OK** on success. On failure, an error value 42is returned. 43 44## ERRORS 45 46**ZX_ERR_BAD_HANDLE** *handle* or *vcpu* are not valid handles. 47 48**ZX_ERR_WRONG_TYPE** *handle* is not an interrupt object or *vcpu* is not a 49VCPU. 50 51**ZX_ERR_CANCELED** [`zx_interrupt_destroy()`] was called on *handle*. 52 53**ZX_ERR_BAD_STATE** a thread is waiting on the interrupt using 54[`zx_interrupt_wait()`]. 55 56**ZX_ERR_ACCESS_DENIED** *handle* lacks **ZX_RIGHT_READ** or *vcpu* lacks 57**ZX_RIGHT_WRITE**. 58 59**ZX_ERR_ALREADY_BOUND** *handle* is already bound to another guest or to a 60port. 61 62**ZX_ERR_INVALID_ARGS** *vcpu* is bound to a different guest than previously 63bound VCPUs, or *options* is non-zero. 64 65## SEE ALSO 66 67 - [`zx_guest_create()`] 68 - [`zx_interrupt_create()`] 69 - [`zx_vcpu_create()`] 70 71<!-- References updated by update-docs-from-abigen, do not edit. --> 72 73[`zx_guest_create()`]: guest_create.md 74[`zx_interrupt_create()`]: interrupt_create.md 75[`zx_interrupt_destroy()`]: interrupt_destroy.md 76[`zx_interrupt_wait()`]: interrupt_wait.md 77[`zx_vcpu_create()`]: vcpu_create.md 78