blob: cfd7985423539af5a4225fb0cdfba7163200d2de [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 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);
};