aboutsummaryrefslogtreecommitdiffstats
path: root/sys/fuchsia
diff options
context:
space:
mode:
authorChris Palmer <snackypants@gmail.com>2022-08-12 11:53:56 -0700
committerGitHub <noreply@github.com>2022-08-12 11:53:56 -0700
commit8dfcaa3d2828a113ae780da01f5f73ad64710e31 (patch)
tree9b2bb79deccc7555dcfe8660ed88d7fc2fec9bda /sys/fuchsia
parentc393bad66b9323baffc125f885ed2cdbc37b8137 (diff)
sys/fuchsia: update the guest system calls (#3286)
zx_vcpu_* calls will re-appear in a new file, vcpu.txt. Co-authored-by: Chris Palmer <palmer@google.com>
Diffstat (limited to 'sys/fuchsia')
-rw-r--r--sys/fuchsia/guest.txt16
-rw-r--r--sys/fuchsia/guests_amd64.const (renamed from sys/fuchsia/hypervisor_guests_amd64.const)0
-rw-r--r--sys/fuchsia/guests_arm64.const (renamed from sys/fuchsia/hypervisor_guests_arm64.const)0
-rw-r--r--sys/fuchsia/hypervisor_guests.txt18
4 files changed, 16 insertions, 18 deletions
diff --git a/sys/fuchsia/guest.txt b/sys/fuchsia/guest.txt
new file mode 100644
index 000000000..7b49320d2
--- /dev/null
+++ b/sys/fuchsia/guest.txt
@@ -0,0 +1,16 @@
+# Copyright 2022 syzkaller project authors. All rights reserved.
+# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+# See https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/vdso/guest.fidl
+
+include <zircon/syscalls.h>
+
+resource zx_guest[zx_handle]
+
+# The documentation does not mention any values for `options`, so we could
+# express it as `const[0]`, but it might be good to test that `options`
+# continues to mean nothing.
+zx_guest_create(handle zx_resource, options int32, guest ptr[out, zx_guest], vmar ptr[out, zx_vmar])
+
+# TODO: teach this how to use ports & keys
+zx_guest_set_trap(handle zx_guest, kind int32, vaddr intptr, size int64, port_handle zx_port, key int64)
diff --git a/sys/fuchsia/hypervisor_guests_amd64.const b/sys/fuchsia/guests_amd64.const
index a6ff852b2..a6ff852b2 100644
--- a/sys/fuchsia/hypervisor_guests_amd64.const
+++ b/sys/fuchsia/guests_amd64.const
diff --git a/sys/fuchsia/hypervisor_guests_arm64.const b/sys/fuchsia/guests_arm64.const
index a6ff852b2..a6ff852b2 100644
--- a/sys/fuchsia/hypervisor_guests_arm64.const
+++ b/sys/fuchsia/guests_arm64.const
diff --git a/sys/fuchsia/hypervisor_guests.txt b/sys/fuchsia/hypervisor_guests.txt
deleted file mode 100644
index c41561c62..000000000
--- a/sys/fuchsia/hypervisor_guests.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2018 syzkaller project authors. All rights reserved.
-# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-
-include <zircon/syscalls.h>
-
-resource zx_guest[intptr]
-resource zx_vcpu[zx_handle]
-
-zx_guest_create(root_resource zx_root_resource, options const[0], guest ptr[out, zx_guest], vmar ptr[out, zx_vmar])
-# TODO: teach this how to use ports & keys
-zx_guest_set_trap(guest zx_guest, kind int32, vaddr intptr, len intptr, port const[ZX_HANDLE_INVALID], key int64)
-
-zx_vcpu_create(guest zx_guest, options int32, vaddr intptr, out ptr[out, zx_vcpu])
-# TODO: teach this about the port_packet_t struct
-zx_vcpu_enter(vcpu zx_vcpu, port_packet ptr[out, zx_port_packet])
-zx_vcpu_interrupt(vcpu zx_vcpu, vector int32)
-zx_vcpu_read_state(vcpu zx_vcpu, kind int32, buffer buffer[in], buflen len[buffer])
-zx_vcpu_write_state(vcpu zx_vcpu, kind int32, buffer buffer[out], buflen len[buffer])