1/* @ajax/mesh-abi-fault: P_FAULT codes.
2 *
3 * Part of alpha-c-mesh, a C port of alpha-rust-mesh (README.md says from where). */
4#ifndef MESH_ABI_FAULT_H
5#define MESH_ABI_FAULT_H
67#include <stdbool.h>
8#include <stddef.h>
9#include <stdint.h>
1011/* P_FAULT codes (low byte), with detail in the high bits (e.g. the bad offset << 8). */
12#define MESH_FAULT_VIEW_BOUNDS 1u
13#define MESH_FAULT_PEER_VIEW 2u
14#define MESH_FAULT_RESP_BOUNDS 3u
15/* The backend reported an error for the slot's GPU work (Metal: a command
16 * buffer that ended in error); detail: the backend's error code. */
17#define MESH_FAULT_GPU 4u
18/* wasm: the guest trapped (unreachable, a panic, an out-of-bounds access to
19 * its own linear memory, a stack overflow); detail: wasmtime's trap code + 1
20 * (0: not a wasm trap code). */
21#define MESH_FAULT_TRAP 5u
22/* wasm: the task ran past its manifest's `task_ms` (epoch deadline); the lane
23 * interrupted it. */
24#define MESH_FAULT_TIME 6u
25/* A push into a slot this program does not feed (no connected `feeds`
26 * entry for it), or a record of another size than the consumer's inbox;
27 * detail: the slot. */
28#define MESH_FAULT_PIPE 7u
29/* A shared-memory access outside the program's `shared_bytes` (or
30 * misaligned for its type): `ctx.shared(off, len)`; detail: the offset. */
31#define MESH_FAULT_SHARED_BOUNDS 8u
3233#endif