blob: c29e54fd1e89e49ee648f77eefa29a957d641dff [file] [log] [blame]
// 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;
@transport("Syscall")
protocol Ktrace {
// TODO(scottmg): This is another one where it's:
// (handle, data, offset, data_size)
// rather than:
// (handle, data, data_size, offset).
/// ## Summary
///
/// TODO(fxbug.dev/32938)
///
/// ## Declaration
///
/// ```c
/// #include <zircon/syscalls.h>
///
/// zx_status_t zx_ktrace_read(zx_handle_t handle,
/// void* data,
/// uint32_t offset,
/// size_t data_size,
/// size_t* actual);
/// ```
///
/// ## Description
///
/// To use the `zx_ktrace_read()` function, you must specify
/// `kernel.enable-debugging-syscalls=true` on the kernel command line. Otherwise,
/// the function returns **ZX_ERR_NOT_SUPPORTED**.
///
/// TODO(fxbug.dev/32938)
///
/// ## Rights
///
/// *handle* must have resource kind **ZX_RSRC_KIND_ROOT**.
///
/// ## Return value
///
/// TODO(fxbug.dev/32938)
///
/// ## Errors
///
/// TODO(fxbug.dev/32938)
///
/// ## See also
///
/// TODO(fxbug.dev/32938)
Read(resource struct {
handle Handle:RESOURCE;
@out
@voidptr
data experimental_pointer<byte>;
offset uint32;
data_size usize64;
}) -> (struct {
actual usize64;
}) error Status;
// TODO(scottmg): syscalls.banjo had the length of |ptr| being |action|?
/// ## Summary
///
/// TODO(fxbug.dev/32938)
///
/// ## Declaration
///
/// ```c
/// #include <zircon/syscalls.h>
///
/// zx_status_t zx_ktrace_control(zx_handle_t handle,
/// uint32_t action,
/// uint32_t options,
/// void* ptr);
/// ```
///
/// ## Description
///
/// To use the `zx_trace_control()` function, you must specify
/// `kernel.enable-debugging-syscalls=true` on the kernel command line. Otherwise,
/// the function returns **ZX_ERR_NOT_SUPPORTED**.
///
/// TODO(fxbug.dev/32938)
///
/// ## Rights
///
/// *handle* must have resource kind **ZX_RSRC_KIND_ROOT**.
///
/// ## Return value
///
/// TODO(fxbug.dev/32938)
///
/// ## Errors
///
/// TODO(fxbug.dev/32938)
///
/// ## See also
///
/// TODO(fxbug.dev/32938)
Control(resource struct {
handle Handle:RESOURCE;
action uint32;
options uint32;
@inout
@voidptr
ptr experimental_pointer<byte>;
}) -> () error Status;
/// ## Summary
///
/// TODO(fxbug.dev/32938)
///
/// ## Declaration
///
/// ```c
/// #include <zircon/syscalls.h>
///
/// zx_status_t zx_ktrace_write(zx_handle_t handle,
/// uint32_t id,
/// uint32_t arg0,
/// uint32_t arg1);
/// ```
///
/// ## Description
///
/// To use the `zx_ktrace_write()` function, you must specify
/// `kernel.enable-debugging-syscalls=true` on the kernel command line. Otherwise,
/// the function returns **ZX_ERR_NOT_SUPPORTED**.
///
/// TODO(fxbug.dev/32938)
///
/// ## Rights
///
/// *handle* must have resource kind **ZX_RSRC_KIND_ROOT**.
///
/// ## Return value
///
/// TODO(fxbug.dev/32938)
///
/// ## Errors
///
/// TODO(fxbug.dev/32938)
///
/// ## See also
///
/// TODO(fxbug.dev/32938)
Write(resource struct {
handle Handle:RESOURCE;
id uint32;
arg0 uint32;
arg1 uint32;
}) -> () error Status;
};