diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-08-04 12:29:59 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-08-04 16:53:16 +0200 |
| commit | 5ed76afa814812edaeaff2ea7b3227c18d5de5a6 (patch) | |
| tree | 9074ce6cb6d39bd008c841c574b8621581904972 /sys/fuchsia | |
| parent | 80a0690249dc4dbbbed95ba197192b99c73694c5 (diff) | |
pkg/compiler: check for unused resources
If a resource is never used as an input, it is not useful.
It's effectively the same as using an integer.
Detect such cases, they are quite confusing.
Fix all existing errors in descriptions.
This uncovered some interesting bugs as well,
e.g. use of a completely unrelated fd subtype after copy-paste
(while the resource that was supposed to be used there is completely unused).
Diffstat (limited to 'sys/fuchsia')
| -rw-r--r-- | sys/fuchsia/events.txt | 7 | ||||
| -rw-r--r-- | sys/fuchsia/fuchsia_io.syz.txt | 10 | ||||
| -rw-r--r-- | sys/fuchsia/objects.txt | 3 | ||||
| -rw-r--r-- | sys/fuchsia/posix.txt | 3 | ||||
| -rw-r--r-- | sys/fuchsia/streams.txt | 2 |
5 files changed, 9 insertions, 16 deletions
diff --git a/sys/fuchsia/events.txt b/sys/fuchsia/events.txt index a7cf33ddf..16d8f4f99 100644 --- a/sys/fuchsia/events.txt +++ b/sys/fuchsia/events.txt @@ -3,8 +3,5 @@ include <zircon/syscalls.h> -resource zx_event[zx_handle] -resource zx_eventpair[zx_handle] - -zx_event_create(options const[0], out ptr[out, zx_event]) -zx_eventpair_create(options const[0], out0 ptr[out, zx_event], out1 ptr[out, zx_event]) +zx_event_create(options const[0], out ptr[out, zx_handle]) +zx_eventpair_create(options const[0], out0 ptr[out, zx_handle], out1 ptr[out, zx_handle]) diff --git a/sys/fuchsia/fuchsia_io.syz.txt b/sys/fuchsia/fuchsia_io.syz.txt index e103f908f..ec2f893ce 100644 --- a/sys/fuchsia/fuchsia_io.syz.txt +++ b/sys/fuchsia/fuchsia_io.syz.txt @@ -11,8 +11,8 @@ fuchsia_io_ServiceHandles { } [packed] fuchsia_io_FileObjectHandles { - event zx_event - stream zx_stream + event zx_handle + stream zx_handle } [packed] fuchsia_io_DirectoryObjectHandles { @@ -28,15 +28,15 @@ fuchsia_io_VmofileHandles { } [packed] fuchsia_io_DeviceHandles { - event zx_eventpair + event zx_handle } [packed] fuchsia_io_TtyHandles { - event zx_eventpair + event zx_handle } [packed] fuchsia_io_DatagramSocketHandles { - event zx_eventpair + event zx_handle } [packed] fuchsia_io_StreamSocketHandles { diff --git a/sys/fuchsia/objects.txt b/sys/fuchsia/objects.txt index 922038525..2809de782 100644 --- a/sys/fuchsia/objects.txt +++ b/sys/fuchsia/objects.txt @@ -8,8 +8,7 @@ include <zircon/syscalls/port.h> resource koid[int64]: 0 -# TODO: temporary disabled as it crashes kernel left and right. -# zx_object_get_child(handle zx_handle, koid koid, rights flags[zx_rights], out ptr[out, zx_handle]) +zx_object_get_child(handle zx_handle, koid koid, rights flags[zx_rights], out ptr[out, zx_handle]) zx_object_get_info$ZX_INFO_HANDLE_VALID(handle zx_handle, topic const[ZX_INFO_HANDLE_VALID], buffer const[0], buffer_size const[0], actual ptr[out, intptr], avail ptr[out, intptr]) zx_object_get_info$ZX_INFO_HANDLE_BASIC(handle zx_handle, topic const[ZX_INFO_HANDLE_BASIC], buffer ptr[out, zx_info_handle_basic], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) zx_object_get_info$ZX_INFO_HANDLE_COUNT(handle zx_handle, topic const[ZX_INFO_HANDLE_COUNT], buffer ptr[out, zx_info_handle_count], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) diff --git a/sys/fuchsia/posix.txt b/sys/fuchsia/posix.txt index 519b8d3bc..b0864abf6 100644 --- a/sys/fuchsia/posix.txt +++ b/sys/fuchsia/posix.txt @@ -15,7 +15,6 @@ include <unistd.h> include <utime.h> resource fd[int32]: 0xffffffffffffffff, AT_FDCWD -resource pid[int32]: 0, 0xffffffffffffffff resource uid[int32]: 0, 0xffffffffffffffff resource gid[int32]: 0, 0xffffffffffffffff @@ -78,7 +77,7 @@ chdir(dir ptr[in, filename]) getgid() gid getuid() uid -getpid() pid +getpid() pipe(pipefd ptr[out, pipefd]) diff --git a/sys/fuchsia/streams.txt b/sys/fuchsia/streams.txt index beb05e2d6..6426963c3 100644 --- a/sys/fuchsia/streams.txt +++ b/sys/fuchsia/streams.txt @@ -3,6 +3,4 @@ include <zircon/syscalls.h> -resource zx_stream[zx_handle] - # TODO: Add stream-related system calls. |
