2023-06-17 01:45:53 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2023-06-21 18:28:54 -07:00
|
|
|
// Error codes defined in glacier/status/error.h
|
2023-06-17 01:45:53 -07:00
|
|
|
typedef uint64_t z_err_t;
|
|
|
|
|
|
|
|
/* ------------------------------
|
|
|
|
* Syscall Types
|
|
|
|
* ------------------------------*/
|
|
|
|
|
|
|
|
// Process Calls.
|
2023-06-20 13:50:18 -07:00
|
|
|
const uint64_t kZionProcessExit = 0x1;
|
2023-06-20 14:01:43 -07:00
|
|
|
const uint64_t kZionProcessSpawn = 0x2;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
|
|
|
// Thread Calls.
|
2023-06-20 13:50:18 -07:00
|
|
|
const uint64_t kZionThreadCreate = 0x10;
|
2023-06-20 14:10:28 -07:00
|
|
|
const uint64_t kZionThreadStart = 0x11;
|
|
|
|
const uint64_t kZionThreadExit = 0x12;
|
2023-06-22 02:17:50 -07:00
|
|
|
const uint64_t kZionThreadWait = 0x13;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
|
|
|
// Memory Calls
|
2023-06-20 14:26:06 -07:00
|
|
|
const uint64_t kZionAddressSpaceMap = 0x21;
|
2023-11-19 18:55:44 -08:00
|
|
|
const uint64_t kZionAddressSpaceUnmap = 0x22;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
2023-06-20 14:26:06 -07:00
|
|
|
const uint64_t kZionMemoryObjectCreate = 0x30;
|
|
|
|
const uint64_t kZionMemoryObjectCreatePhysical = 0x31;
|
|
|
|
const uint64_t kZionMemoryObjectCreateContiguous = 0x32;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
2023-08-01 17:46:26 -07:00
|
|
|
const uint64_t kZionMemoryObjectDuplicate = 0x38;
|
2023-11-19 19:02:55 -08:00
|
|
|
const uint64_t kZionMemoryObjectInspect = 0x39;
|
2023-08-01 17:46:26 -07:00
|
|
|
|
2023-06-17 01:45:53 -07:00
|
|
|
// IPC Calls
|
2023-06-20 14:41:44 -07:00
|
|
|
const uint64_t kZionChannelCreate = 0x40;
|
|
|
|
const uint64_t kZionChannelSend = 0x41;
|
|
|
|
const uint64_t kZionChannelRecv = 0x42;
|
|
|
|
const uint64_t kZionChannelSendRecv = 0x43;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
2023-06-20 14:55:54 -07:00
|
|
|
const uint64_t kZionPortCreate = 0x50;
|
|
|
|
const uint64_t kZionPortSend = 0x51;
|
|
|
|
const uint64_t kZionPortRecv = 0x52;
|
|
|
|
const uint64_t kZionPortPoll = 0x53;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
2023-06-20 14:55:54 -07:00
|
|
|
const uint64_t kZionIrqRegister = 0x58;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
2023-06-21 21:26:24 -07:00
|
|
|
const uint64_t kZionEndpointCreate = 0x60;
|
|
|
|
const uint64_t kZionEndpointSend = 0x61;
|
|
|
|
const uint64_t kZionEndpointRecv = 0x62;
|
|
|
|
const uint64_t kZionReplyPortSend = 0x63;
|
|
|
|
const uint64_t kZionReplyPortRecv = 0x64;
|
|
|
|
const uint64_t kZionEndpointCall = 0x65;
|
|
|
|
|
2023-06-17 01:45:53 -07:00
|
|
|
#define Z_IRQ_PCI_BASE 0x30
|
|
|
|
|
|
|
|
// Capability Calls
|
2023-06-20 15:03:33 -07:00
|
|
|
const uint64_t kZionCapDuplicate = 0x70;
|
2023-11-19 17:53:56 -08:00
|
|
|
const uint64_t kZionCapRelease = 0x71;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
2023-10-25 14:47:45 -07:00
|
|
|
// Syncronization Calls
|
|
|
|
const uint64_t kZionMutexCreate = 0x80;
|
|
|
|
const uint64_t kZionMutexLock = 0x81;
|
|
|
|
const uint64_t kZionMutexRelease = 0x82;
|
2023-11-22 10:19:56 -08:00
|
|
|
const uint64_t kZionSemaphoreCreate = 0x83;
|
|
|
|
const uint64_t kZionSemaphoreWait = 0x84;
|
|
|
|
const uint64_t kZionSemaphoreSignal = 0x85;
|
2023-10-25 14:47:45 -07:00
|
|
|
|
2023-06-17 01:45:53 -07:00
|
|
|
// Debugging Calls.
|
2023-06-20 15:03:33 -07:00
|
|
|
const uint64_t kZionDebug = 0x1'0000;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
|
|
|
/* ------------------------------
|
|
|
|
* Capability Types
|
|
|
|
* ------------------------------*/
|
2023-06-17 01:53:19 -07:00
|
|
|
|
|
|
|
typedef uint64_t z_cap_t;
|
2023-11-02 22:12:55 -07:00
|
|
|
typedef uint64_t z_perm_t;
|
2023-06-17 01:53:19 -07:00
|
|
|
|
2023-10-24 23:32:05 -07:00
|
|
|
const uint64_t kZionInvalidCapability = 0x0;
|
|
|
|
|
2023-06-17 01:45:53 -07:00
|
|
|
// General Capability Permissions
|
2023-08-01 18:22:41 -07:00
|
|
|
const uint64_t kZionPerm_Write = 0x1;
|
|
|
|
const uint64_t kZionPerm_Read = 0x2;
|
|
|
|
|
|
|
|
const uint64_t kZionPerm_Transmit = 0x10;
|
|
|
|
const uint64_t kZionPerm_Duplicate = 0x20;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
|
|
|
// Capability Specific Permissions
|
2023-08-01 18:22:41 -07:00
|
|
|
|
|
|
|
// Permissions held on process capabilities.
|
|
|
|
const uint64_t kZionPerm_SpawnProcess = 0x100;
|
|
|
|
const uint64_t kZionPerm_SpawnThread = 0x200;
|
2023-06-17 01:45:53 -07:00
|
|
|
|
2023-10-25 14:47:45 -07:00
|
|
|
// Permissions on mutexes.
|
|
|
|
const uint64_t kZionPerm_Lock = 0x100;
|
|
|
|
const uint64_t kZionPerm_Release = 0x200;
|
2023-11-22 10:19:56 -08:00
|
|
|
// Permissions on semaphores.
|
|
|
|
const uint64_t kZionPerm_Wait = 0x100;
|
|
|
|
const uint64_t kZionPerm_Signal = 0x200;
|
2023-10-25 14:47:45 -07:00
|
|
|
|
2023-11-02 22:12:55 -07:00
|
|
|
const z_perm_t kZionPerm_None = 0;
|
|
|
|
const z_perm_t kZionPerm_All = -1;
|
|
|
|
|
2023-06-17 01:45:53 -07:00
|
|
|
/* ------------------------------
|
|
|
|
* Process Init Types
|
|
|
|
*
|
|
|
|
* Used to pull capabilites off
|
|
|
|
* the initialization port.
|
|
|
|
*
|
|
|
|
* Start at a high number only to
|
|
|
|
* make them distinctive as a raw
|
|
|
|
* value.
|
|
|
|
* ------------------------------*/
|
|
|
|
#define Z_INIT_SELF_PROC 0x4000'0000
|
|
|
|
#define Z_INIT_SELF_VMAS 0x4000'0001
|
|
|
|
|
2023-06-21 23:14:42 -07:00
|
|
|
#define Z_INIT_ENDPOINT 0x4100'0000
|
2023-06-17 01:45:53 -07:00
|
|
|
|
|
|
|
#define Z_BOOT_DENALI_VMMO 0x4200'0000
|
2023-06-22 00:22:59 -07:00
|
|
|
#define Z_BOOT_VICTORIA_FALLS_VMMO 0x4200'0001
|
2023-08-01 17:13:16 -07:00
|
|
|
#define Z_BOOT_PCI_VMMO 0x4200'0002
|
2023-11-09 11:20:41 -08:00
|
|
|
#define Z_BOOT_FRAMEBUFFER_INFO_VMMO 0x4200'0003
|
|
|
|
|
|
|
|
struct ZFramebufferInfo {
|
|
|
|
uint64_t address_phys;
|
|
|
|
uint64_t width;
|
|
|
|
uint64_t height;
|
|
|
|
uint64_t pitch;
|
|
|
|
uint16_t bpp;
|
|
|
|
uint8_t memory_model;
|
|
|
|
uint8_t red_mask_size;
|
|
|
|
uint8_t red_mask_shift;
|
|
|
|
uint8_t green_mask_size;
|
|
|
|
uint8_t green_mask_shift;
|
|
|
|
uint8_t blue_mask_size;
|
|
|
|
uint8_t blue_mask_shift;
|
|
|
|
};
|