| // 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. |
| |
| // !!! THIS FILE IS NOT YET USED !!! |
| // See //zircon/system/public/zircon/syscalls.banjo. |
| // !!! THIS FILE IS NOT YET USED !!! |
| |
| library zz; |
| |
| [Transport="Syscall"] |
| protocol Task { |
| // TODO(scottmg): Need something like handle<task> in this file to mean {job, process, thread}. |
| // Or otherwise some way to express multiple options for constraints on inputs in this protocol. |
| |
| // TODO(ZX-2967): No rights required on either? |
| /// Bind to, or unbind from, the exception port corresponding to a given job, process, or thread. |
| /// Rights: port must be of type ZX_OBJ_TYPE_PORT. |
| BindExceptionPort(handle handle, handle<port> port, uint64 key, uint32 options) -> |
| (status status); |
| |
| /// Suspend the given task. Currently only thread or process handles may be suspended. |
| /// Rights: handle must be of type ZX_OBJ_TYPE_THREAD or ZX_OBJ_TYPE_PROCESS and have ZX_RIGHT_WRITE. |
| Suspend(handle handle) -> (status status, handle token); |
| |
| /// Suspend the given task. Currently only thread or process handles may be suspended. |
| /// Rights: handle must be of type ZX_OBJ_TYPE_THREAD or ZX_OBJ_TYPE_PROCESS and have ZX_RIGHT_WRITE. |
| SuspendToken(handle handle) -> (status status, handle token); |
| |
| // TODO(ZX-2967): No rights required on either? |
| /// Resume the given task after an exception has been reported. |
| /// Rights: handle must be of type ZX_OBJ_TYPE_THREAD. |
| /// Rights: port must be of type ZX_OBJ_TYPE_PORT. |
| ResumeFromException(handle<thread> handle, handle<port> port, uint32 options) -> |
| (status status); |
| |
| /// Create an exception channel for a given job, process, or thread. |
| /// Rights: handle must have ZX_RIGHT_INSPECT and have ZX_RIGHT_DUPLICATE and have ZX_RIGHT_TRANSFER and have ZX_RIGHT_MANAGE_THREAD. |
| /// Rights: If handle is of type ZX_OBJ_TYPE_JOB or ZX_OBJ_TYPE_PROCESS, it must have ZX_RIGHT_ENUMERATE. |
| CreateExceptionChannel(handle handle, uint32 options) -> (status status, handle<channel> out); |
| |
| /// Kill the provided task (job, process, or thread). |
| /// Rights: handle must have ZX_RIGHT_DESTROY. |
| Kill(handle handle) -> (status status); |
| }; |