| // 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. |
| library zx; |
| |
| // This file is copies of some syscalls that cover more unusual features (see |
| // annotations at the method). |
| |
| alias const_futexptr = int32; |
| alias Futex = int32; |
| alias mutable_uint32 = uint32; |
| alias mutable_vector_void = vector<byte>; |
| alias optional_signals = signals; |
| alias vector_void_u32size = vector<byte>; |
| type Clock = strict enum : uint32 { |
| MONOTONIC = 0; |
| UTC = 1; |
| THREAD = 2; |
| }; |
| |
| |
| @transport("Syscall") |
| protocol Selection { |
| // Special futex handling. |
| FutexRequeue(resource struct { |
| value_ptr const_futexptr; |
| wake_count uint32; |
| current_value Futex; |
| requeue_ptr const_futexptr; |
| requeue_count uint32; |
| new_requeue_owner handle; |
| }) -> (struct { |
| status status; |
| }); |
| |
| // Optional output (signals). |
| ObjectWaitOne(resource struct { |
| handle handle; |
| signals signals; |
| deadline time; |
| }) -> (struct { |
| status status; |
| observed optional_signals; |
| }); |
| |
| // Argument reordering. |
| @arg_reorder("handle,data,offset,data_size,actual") |
| KtraceRead(resource struct { |
| handle handle:RESOURCE; |
| data mutable_vector_void; |
| offset uint32; |
| }) -> (struct { |
| status status; |
| actual usize; |
| }); |
| |
| // Mutable uint32 in the middle of input parameters (rather than as an |
| // output). |
| PciCfgPioRw(resource struct { |
| handle handle:RESOURCE; |
| bus uint8; |
| dev uint8; |
| func uint8; |
| offset uint8; |
| val mutable_uint32; |
| width usize; |
| write bool; |
| }) -> (struct { |
| status status; |
| }); |
| |
| // uint32_t for size of a "vector". |
| JobSetPolicy(resource struct { |
| handle handle:JOB; |
| options uint32; |
| topic uint32; |
| policy vector_void_u32size; |
| }) -> (struct { |
| status status; |
| }); |
| |
| // Handling of enums. |
| ClockGet(struct { |
| clock_id Clock; |
| }) -> (struct { |
| status status; |
| out time; |
| }); |
| }; |