Refactor all Zion decls into one header
This commit is contained in:
parent
7dcbbd671e
commit
5e99dbf7d1
|
@ -1,6 +1,5 @@
|
|||
#include <zcall.h>
|
||||
#include <zglobal.h>
|
||||
#include <zinit.h>
|
||||
|
||||
#include "stdlib.h"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <zerrors.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
class Channel {
|
||||
public:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <zerrors.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
void dbgln(const char* fmt, ...);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <zerrors.h>
|
||||
#include <zglobal.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
z_err_t ParseInitPort(uint64_t init_port_cap);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <zcall.h>
|
||||
#include <zerrors.h>
|
||||
|
||||
class Port {
|
||||
public:
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <zcall.h>
|
||||
#include <zerrors.h>
|
||||
|
||||
void dbgln_internal(const char* str) { // Safe to ignore the result since right
|
||||
// now this doesn't throw.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "mammoth/init.h"
|
||||
|
||||
#include <zinit.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
#include "mammoth/debug.h"
|
||||
#include "mammoth/port.h"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "mammoth/memory_region.h"
|
||||
|
||||
#include <zcall.h>
|
||||
#include <zinit.h>
|
||||
|
||||
#include "mammoth/debug.h"
|
||||
#include "mammoth/init.h"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include "mammoth/process.h"
|
||||
|
||||
#include <zcall.h>
|
||||
#include <zerrors.h>
|
||||
#include <zinit.h>
|
||||
|
||||
#include "mammoth/channel.h"
|
||||
#include "mammoth/debug.h"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "mammoth/thread.h"
|
||||
|
||||
#include <zcall.h>
|
||||
#include <zinit.h>
|
||||
|
||||
#include "mammoth/debug.h"
|
||||
#include "mammoth/init.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <mammoth/memory_region.h>
|
||||
#include <zerrors.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
#include "ahci/ahci.h"
|
||||
#include "ahci/command.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <mammoth/thread.h>
|
||||
#include <zerrors.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
#include "ahci/ahci.h"
|
||||
#include "ahci/ahci_device.h"
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <mammoth/debug.h>
|
||||
#include <mammoth/init.h>
|
||||
#include <zcall.h>
|
||||
#include <zinit.h>
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <mammoth/init.h>
|
||||
#include <mammoth/process.h>
|
||||
#include <zcall.h>
|
||||
#include <zinit.h>
|
||||
|
||||
#include "hw/pcie.h"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "include/zerrors.h"
|
||||
#include "include/ztypes.h"
|
||||
|
||||
void ProbeRsdp();
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "include/zerrors.h"
|
||||
#include "include/ztypes.h"
|
||||
|
||||
void dbg(const char* fmt, ...);
|
||||
void dbgln(const char* str, ...);
|
||||
|
|
|
@ -2,55 +2,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "zerrors.h"
|
||||
|
||||
#define Z_INVALID 0x0
|
||||
|
||||
#define ZC_WRITE 0x01
|
||||
#define ZC_READ 0x02
|
||||
|
||||
// Process Calls.
|
||||
#define Z_PROCESS_EXIT 0x01
|
||||
#define Z_PROCESS_SPAWN 0x02
|
||||
#define Z_PROCESS_START 0x03
|
||||
|
||||
#define ZC_PROC_SPAWN_PROC 0x100
|
||||
#define ZC_PROC_SPAWN_THREAD 0x200
|
||||
|
||||
// Thread Calls.
|
||||
#define Z_THREAD_CREATE 0x10
|
||||
#define Z_THREAD_START 0x11
|
||||
#define Z_THREAD_EXIT 0x12
|
||||
|
||||
// Memory Calls
|
||||
#define Z_ADDRESS_SPACE_MAP 0x21
|
||||
#define Z_ADDRESS_SPACE_UNMAP 0x22
|
||||
|
||||
#define Z_MEMORY_OBJECT_CREATE 0x30
|
||||
#define Z_MEMORY_OBJECT_CREATE_PHYSICAL 0x31
|
||||
|
||||
#define Z_TEMP_PCIE_CONFIG_OBJECT_CREATE 0x3F
|
||||
|
||||
// IPC Calls
|
||||
#define Z_CHANNEL_CREATE 0x40
|
||||
#define Z_CHANNEL_SEND 0x41
|
||||
#define Z_CHANNEL_RECV 0x42
|
||||
#define Z_CHANNEL_SENDRECV 0x43
|
||||
|
||||
#define Z_PORT_CREATE 0x50
|
||||
#define Z_PORT_SEND 0x51
|
||||
#define Z_PORT_RECV 0x52
|
||||
#define Z_PORT_POLL 0x53
|
||||
|
||||
#define Z_IRQ_REGISTER 0x58
|
||||
|
||||
#define Z_IRQ_PCI_BASE 0x30
|
||||
|
||||
// Capability Calls
|
||||
#define Z_CAP_DUPLICATE 0x60
|
||||
|
||||
// Debugging Calls.
|
||||
#define Z_DEBUG_PRINT 0x10000000
|
||||
#include "ztypes.h"
|
||||
|
||||
void ZProcessExit(uint64_t code);
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define Z_OK 0x0
|
||||
#define Z_ERR_NOT_FOUND 0x1
|
||||
#define Z_ERR_INVALID 0x2
|
||||
#define Z_ERR_DENIED 0x3
|
||||
#define Z_ERR_UNIMPLEMENTED 0x4
|
||||
#define Z_ERR_BUFF_SIZE 005
|
||||
#define Z_ERR_NULL 0x6
|
||||
#define Z_ERR_EXISTS 0x7
|
||||
#define Z_ERR_EMPTY 0x8
|
||||
|
||||
#define Z_ERR_CAP_NOT_FOUND 0x100
|
||||
#define Z_ERR_CAP_TYPE 0x101
|
||||
#define Z_ERR_CAP_DENIED 0x102
|
||||
|
||||
typedef uint64_t z_err_t;
|
|
@ -1,8 +1 @@
|
|||
#pragma once
|
||||
|
||||
#define Z_INIT_SELF_PROC 0x100
|
||||
#define Z_INIT_SELF_VMAS 0x101
|
||||
|
||||
#define Z_INIT_CHANNEL 0x200
|
||||
|
||||
#define Z_BOOT_DENALI_VMMO 0x1000
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* ------------------------------
|
||||
* Error Types
|
||||
*
|
||||
* Bit 31 always set to 1 to
|
||||
* distinguish from user-space errors.
|
||||
* ------------------------------*/
|
||||
#define Z_OK 0x0
|
||||
|
||||
#define Z_ERR_NOT_FOUND 0x1000'0001
|
||||
#define Z_ERR_INVALID 0x1000'0002
|
||||
#define Z_ERR_DENIED 0x1000'0003
|
||||
#define Z_ERR_UNIMPLEMENTED 0x1000'0004
|
||||
#define Z_ERR_BUFF_SIZE 001000'0005
|
||||
#define Z_ERR_NULL 0x1000'0006
|
||||
#define Z_ERR_EXISTS 0x1000'0007
|
||||
#define Z_ERR_EMPTY 0x1000'0008
|
||||
|
||||
#define Z_ERR_CAP_NOT_FOUND 0x1001'0000
|
||||
#define Z_ERR_CAP_TYPE 0x1001'0001
|
||||
#define Z_ERR_CAP_DENIED 0x1001'0002
|
||||
|
||||
typedef uint64_t z_err_t;
|
||||
|
||||
/* ------------------------------
|
||||
* Syscall Types
|
||||
* ------------------------------*/
|
||||
|
||||
// Process Calls.
|
||||
#define Z_PROCESS_EXIT 0x01
|
||||
#define Z_PROCESS_SPAWN 0x02
|
||||
#define Z_PROCESS_START 0x03
|
||||
|
||||
// Thread Calls.
|
||||
#define Z_THREAD_CREATE 0x10
|
||||
#define Z_THREAD_START 0x11
|
||||
#define Z_THREAD_EXIT 0x12
|
||||
|
||||
// Memory Calls
|
||||
#define Z_ADDRESS_SPACE_MAP 0x21
|
||||
#define Z_ADDRESS_SPACE_UNMAP 0x22
|
||||
|
||||
#define Z_MEMORY_OBJECT_CREATE 0x30
|
||||
#define Z_MEMORY_OBJECT_CREATE_PHYSICAL 0x31
|
||||
|
||||
#define Z_TEMP_PCIE_CONFIG_OBJECT_CREATE 0x3F
|
||||
|
||||
// IPC Calls
|
||||
#define Z_CHANNEL_CREATE 0x40
|
||||
#define Z_CHANNEL_SEND 0x41
|
||||
#define Z_CHANNEL_RECV 0x42
|
||||
#define Z_CHANNEL_SENDRECV 0x43
|
||||
|
||||
#define Z_PORT_CREATE 0x50
|
||||
#define Z_PORT_SEND 0x51
|
||||
#define Z_PORT_RECV 0x52
|
||||
#define Z_PORT_POLL 0x53
|
||||
|
||||
#define Z_IRQ_REGISTER 0x58
|
||||
|
||||
#define Z_IRQ_PCI_BASE 0x30
|
||||
|
||||
// Capability Calls
|
||||
#define Z_CAP_DUPLICATE 0x60
|
||||
|
||||
// Debugging Calls.
|
||||
#define Z_DEBUG_PRINT 0x10000000
|
||||
|
||||
/* ------------------------------
|
||||
* Capability Types
|
||||
* ------------------------------*/
|
||||
#define Z_INVALID 0x0
|
||||
|
||||
// General Capability Permissions
|
||||
#define ZC_WRITE 0x01
|
||||
#define ZC_READ 0x02
|
||||
|
||||
// Capability Specific Permissions
|
||||
#define ZC_PROC_SPAWN_PROC 0x100
|
||||
#define ZC_PROC_SPAWN_THREAD 0x200
|
||||
|
||||
/* ------------------------------
|
||||
* 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
|
||||
|
||||
#define Z_INIT_CHANNEL 0x4100'0000
|
||||
|
||||
#define Z_BOOT_DENALI_VMMO 0x4200'0000
|
|
@ -3,7 +3,6 @@
|
|||
#include "boot/boot_info.h"
|
||||
#include "debug/debug.h"
|
||||
#include "include/zcall.h"
|
||||
#include "include/zinit.h"
|
||||
#include "lib/ref_ptr.h"
|
||||
#include "memory/paging_util.h"
|
||||
#include "object/process.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "object/channel.h"
|
||||
|
||||
#include "include/zerrors.h"
|
||||
#include "include/ztypes.h"
|
||||
#include "scheduler/scheduler.h"
|
||||
|
||||
Pair<RefPtr<Channel>, RefPtr<Channel>> Channel::CreateChannelPair() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "capability/capability.h"
|
||||
#include "include/zerrors.h"
|
||||
#include "include/ztypes.h"
|
||||
#include "lib/linked_list.h"
|
||||
#include "lib/mutex.h"
|
||||
#include "lib/pair.h"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "debug/debug.h"
|
||||
#include "include/zcall.h"
|
||||
#include "include/zinit.h"
|
||||
#include "memory/paging_util.h"
|
||||
#include "memory/physical_memory.h"
|
||||
#include "object/thread.h"
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "common/msr.h"
|
||||
#include "debug/debug.h"
|
||||
#include "include/zcall.h"
|
||||
#include "include/zerrors.h"
|
||||
#include "interrupt/interrupt.h"
|
||||
#include "memory/physical_memory.h"
|
||||
#include "object/channel.h"
|
||||
|
|
Loading…
Reference in New Issue