| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // TODO(fxb/39732): This should be read as "library zx". |
| library zz; |
| |
| [Transport = "Syscall"] |
| protocol vcpu { |
| /// Create a VCPU. |
| /// Rights: guest must be of type ZX_OBJ_TYPE_GUEST and have ZX_RIGHT_MANAGE_PROCESS. |
| vcpu_create(handle<guest> guest, uint32 options, vaddr entry) -> (status status, handle<vcpu> out); |
| |
| // See port.fidl for definition of PortPacket. |
| /// Resume execution of a VCPU. |
| /// Rights: handle must be of type ZX_OBJ_TYPE_VCPU and have ZX_RIGHT_EXECUTE. |
| [blocking] |
| vcpu_resume(handle<vcpu> handle) -> (status status, PortPacket packet); |
| |
| /// Raise an interrupt on a VCPU. |
| /// Rights: handle must be of type ZX_OBJ_TYPE_VCPU and have ZX_RIGHT_SIGNAL. |
| vcpu_interrupt(handle<vcpu> handle, uint32 vector) -> (status status); |
| |
| /// Read the state of a VCPU. |
| /// Rights: handle must be of type ZX_OBJ_TYPE_VCPU and have ZX_RIGHT_READ. |
| vcpu_read_state(handle<vcpu> handle, uint32 kind) -> (status status, vector_void buffer); |
| |
| /// Write the state of a VCPU. |
| /// Rights: handle must be of type ZX_OBJ_TYPE_VCPU and have ZX_RIGHT_WRITE. |
| vcpu_write_state(handle<vcpu> handle, uint32 kind, vector_void buffer) -> (status status); |
| }; |