2023-05-29 00:32:54 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2023-06-06 15:01:31 -07:00
|
|
|
#define Z_INVALID 0x0
|
2023-05-30 20:55:03 -07:00
|
|
|
|
2023-06-06 15:01:31 -07:00
|
|
|
#define ZC_WRITE 0x01
|
|
|
|
#define ZC_READ 0x02
|
2023-05-30 20:55:03 -07:00
|
|
|
|
2023-06-06 15:01:31 -07:00
|
|
|
#define Z_PROCESS_EXIT 0x01
|
|
|
|
#define Z_PROCESS_SPAWN 0x02
|
|
|
|
#define Z_PROCESS_START 0x03
|
|
|
|
|
|
|
|
#define Z_PROCESS_SPAWN_ELF 0x1'00000002
|
|
|
|
|
|
|
|
#define ZC_PROC_SPAWN_PROC 0x100
|
|
|
|
#define ZC_PROC_SPAWN_THREAD 0x101
|
|
|
|
|
|
|
|
#define Z_THREAD_CREATE 0x10
|
|
|
|
#define Z_THREAD_START 0x11
|
|
|
|
#define Z_THREAD_EXIT 0x12
|
|
|
|
|
|
|
|
#define Z_DEBUG_PRINT 0x10000000
|
2023-05-29 00:32:54 -07:00
|
|
|
|
2023-05-29 13:51:00 -07:00
|
|
|
uint64_t ZDebug(const char* message);
|
2023-05-30 20:55:03 -07:00
|
|
|
|
|
|
|
// TODO: Move structs into an internal header.
|
2023-06-06 15:01:31 -07:00
|
|
|
struct ZProcessSpawnElfReq {
|
2023-05-30 23:55:42 -07:00
|
|
|
uint64_t cap_id;
|
2023-05-30 20:55:03 -07:00
|
|
|
uint64_t elf_base;
|
|
|
|
uint64_t elf_size;
|
|
|
|
};
|
|
|
|
|
2023-06-06 15:01:31 -07:00
|
|
|
uint64_t ZProcessSpawnElf(uint64_t cap_id, uint64_t elf_base,
|
|
|
|
uint64_t elf_size);
|