blob: 9754d057023a3c40b9a735f520a757b62b85ec89 [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.
// TODO(fxb/39732): This should be read as "library zx".
library zz;
[Transport = "Syscall"]
protocol thread {
/// Terminate the current running thread.
[noreturn]
thread_exit();
/// Create a thread.
/// Rights: process must be of type ZX_OBJ_TYPE_PROCESS and have ZX_RIGHT_MANAGE_THREAD.
thread_create(handle<process> process, string name, uint32 options)
-> (status status, handle<thread> out);
/// Start execution on a thread.
/// Rights: handle must be of type ZX_OBJ_TYPE_THREAD and have ZX_RIGHT_MANAGE_THREAD.
thread_start(handle<thread> handle, vaddr thread_entry, vaddr stack, uintptr arg1, uintptr arg2)
-> (status status);
/// Read one aspect of thread state.
/// Rights: handle must be of type ZX_OBJ_TYPE_THREAD and have ZX_RIGHT_READ.
thread_read_state(handle<thread> handle, uint32 kind) -> (status status, vector_void buffer);
/// Write one aspect of thread state.
/// Rights: handle must be of type ZX_OBJ_TYPE_THREAD and have ZX_RIGHT_WRITE.
thread_write_state(handle<thread> handle, uint32 kind, vector_void buffer) -> (status status);
};