aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / native / kernel / x86 / local_tools.h
| 1 | /* Intel-only, bounded native Omega tools. No external executable admission. */ |
| 2 | #ifndef CK_LOCAL_TOOLS_H |
| 3 | #define CK_LOCAL_TOOLS_H |
| 4 | #include <stddef.h> |
| 5 | #include <stdint.h> |
| 6 | #include "x86.h" |
| 7 | #define CK_LOCAL_INPUT 4096u |
| 8 | #define CK_LOCAL_OUTPUT 4096u |
| 9 | #define CK_LOCAL_CALLS 4u |
| 10 | enum { CK_LOCAL_IDLE, CK_LOCAL_RUNNING, CK_LOCAL_RETURNED, CK_LOCAL_TRAPPED, |
| 11 | CK_LOCAL_REFUSED, CK_LOCAL_ABNORMAL }; |
| 12 | enum { CK_LOCAL_FAULT = 1, CK_LOCAL_CPU, CK_LOCAL_ELAPSED, CK_LOCAL_CANCELLED, |
| 13 | CK_LOCAL_BAD_RETURN, CK_LOCAL_BAD_REQUEST, CK_LOCAL_LIMIT, CK_LOCAL_ADMISSION }; |
| 14 | struct ck_local_result { |
| 15 | uint64_t request, invocation; |
| 16 | unsigned state, reason, length; |
| 17 | uint8_t output[CK_LOCAL_OUTPUT]; |
| 18 | }; |
| 19 | void ck_local_init(uint64_t root, uint64_t hz); |
| 20 | void ck_local_begin(uint64_t request); |
| 21 | const struct ck_local_result *ck_local_start(uint64_t request, uint64_t invocation, |
| 22 | unsigned tool, const void *input, size_t length); |
| 23 | const struct ck_local_result *ck_local_status(uint64_t request, uint64_t invocation); |
| 24 | void ck_local_step(void); |
| 25 | void ck_local_cancel(void); |
| 26 | void ck_local_snapshot(uint64_t cores, uint64_t ram, uint64_t width, uint64_t height, uint64_t network); |
| 27 | void ck_local_trap(struct ck_x86_frame *f); |
| 28 | void ck_local_selftest(void); |
| 29 | /* Once-per-boot public model experiment; never submits a private conversation. */ |
| 30 | const char *ck_local_model_demo_step(void); |
| 31 | /* kmain owns BSP TSS and APIC. All entry/exit paths have interrupts disabled. */ |
| 32 | void ck_local_machine_stack(uint64_t top); |
| 33 | int ck_local_machine_timer(int enable); |
| 34 | void ck_local_machine_eoi(uint64_t vector); |
| 35 | #endif |