clean up and standardize types across the codebase, unify atomic operations, improve UTF-8 handling throughout the system, remove obsolete input and named queue interfaces, redesign process preparation and creation, tighten IPC and service boundaries, improve error handling and reliability, minor documentation cleanup, fix doom surfaces, fix panic in ini parsing.
This commit is contained in:
1 parent
899225f551
commit
c0ad63c27f
226 files changed
+6562
-4147
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <ntlite/status.h>
|
||||
|
||||
@@ -17,9 +18,9 @@ typedef struct HAL_PROCESSOR_INFO {
|
||||
uint32_t FirmwareId;
|
||||
uint32_t HardwareId;
|
||||
uint32_t Flags;
|
||||
uint8_t Enabled;
|
||||
uint8_t IsBootProcessor;
|
||||
uint8_t Startable;
|
||||
bool Enabled;
|
||||
bool IsBootProcessor;
|
||||
bool Startable;
|
||||
uint8_t Reserved;
|
||||
} HAL_PROCESSOR_INFO;
|
||||
|
||||
@@ -56,17 +57,17 @@ typedef struct HAL_FRAMEBUFFER_INFO {
|
||||
|
||||
typedef struct HAL_SCREEN {
|
||||
void (*Clear)(uint32_t color);
|
||||
void (*PutPixel)(int x, int y, uint32_t color);
|
||||
void (*Blit)(int x, int y, int w, int h, const uint32_t* pixels);
|
||||
void (*GetSize)(int* width, int* height);
|
||||
void (*PutPixel)(int32_t x, int32_t y, uint32_t color);
|
||||
void (*Blit)(int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t* pixels);
|
||||
void (*GetSize)(int32_t* width, int32_t* height);
|
||||
KSTATUS (*GetFramebuffer)(HAL_FRAMEBUFFER_INFO* outInfo);
|
||||
void (*Scroll)(int lines);
|
||||
void (*PutChar)(char c, int x, int y, uint32_t fg, uint32_t bg);
|
||||
void (*Scroll)(int32_t lines);
|
||||
void (*PutChar)(char c, int32_t x, int32_t y, uint32_t fg, uint32_t bg);
|
||||
// Writes only to the boot framebuffer text console. Stream routing belongs to HAL_OUTPUT_ROUTER.
|
||||
void (*PrintChar)(char c, uint32_t fg, uint32_t bg);
|
||||
// Legacy software cursor hooks kept for early-boot/panic fallback only.
|
||||
// Normal input cursor ownership lives in ke_display.
|
||||
void (*DrawCursor)(int x, int y);
|
||||
void (*DrawCursor)(int32_t x, int32_t y);
|
||||
void (*EraseCursor)(void);
|
||||
} HAL_SCREEN;
|
||||
|
||||
@@ -219,7 +220,7 @@ typedef struct HAL_INIT_PARAMS {
|
||||
uint64_t PhysicalWindowBase;
|
||||
|
||||
// Debug.
|
||||
int Debug;
|
||||
bool Debug;
|
||||
|
||||
void* (*AllocatePool)(size_t size);
|
||||
} HAL_INIT_PARAMS;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <ntlite/ddk/file.h>
|
||||
#include <kernel/ke_list.h>
|
||||
#include <ntlite/ddi/io_driver.h>
|
||||
@@ -41,7 +42,7 @@ struct IO_VOLUME {
|
||||
uint32_t InstanceId;
|
||||
uint32_t State;
|
||||
uint32_t RemovalReason;
|
||||
uint8_t RegistryLinked;
|
||||
bool RegistryLinked;
|
||||
IO_VOLUME_SOURCE Source;
|
||||
DEVICE_OBJECT* BackingDevice;
|
||||
IO_VOLUME_PROVIDER Provider;
|
||||
|
||||
@@ -65,7 +65,7 @@ struct KAPC {
|
||||
void* NormalContext;
|
||||
void* SystemArgument1;
|
||||
void* SystemArgument2;
|
||||
volatile long Inserted;
|
||||
volatile int32_t Inserted;
|
||||
};
|
||||
|
||||
void KiInitializeApcState(THREAD* thread);
|
||||
|
||||
@@ -59,10 +59,10 @@ typedef struct KE_AUDIO_ENDPOINT_INFO {
|
||||
IO_AUDIO_FORMAT HardwareFormat;
|
||||
uint32_t PeriodCount;
|
||||
uint32_t FramesPerPeriod;
|
||||
uint8_t Available;
|
||||
uint8_t IsDefault;
|
||||
uint8_t HardwareRunning;
|
||||
uint8_t MasterMuted;
|
||||
bool Available;
|
||||
bool IsDefault;
|
||||
bool HardwareRunning;
|
||||
bool MasterMuted;
|
||||
int32_t MasterHardwareGainMilliDb;
|
||||
float MasterRequestedVolume;
|
||||
uint32_t StreamCount;
|
||||
@@ -108,7 +108,7 @@ typedef struct KE_AUDIO_STREAM_INFO {
|
||||
KSTATUS FailureStatus;
|
||||
float Volume;
|
||||
float Pan;
|
||||
uint8_t Muted;
|
||||
bool Muted;
|
||||
} KE_AUDIO_STREAM_INFO;
|
||||
|
||||
// Initializes endpoint registry and mixer ownership before drivers load.
|
||||
|
||||
@@ -37,8 +37,8 @@ typedef struct KCPU {
|
||||
uint32_t FirmwareId;
|
||||
uint32_t BootProcessorIndex;
|
||||
|
||||
volatile long State;
|
||||
uint8_t IsBootProcessor;
|
||||
volatile int32_t State;
|
||||
bool IsBootProcessor;
|
||||
|
||||
// CPUID/MADT-derived SMT topology. PackageId/CoreId/ThreadId are decoded
|
||||
// from the processor hardware ID using CPUID leaf 0x1F/0x0B when available, with a
|
||||
@@ -54,7 +54,7 @@ typedef struct KCPU {
|
||||
uint32_t PhysicalCoreIndex;
|
||||
uint64_t CoreSiblingMask;
|
||||
uint64_t PackageMask;
|
||||
uint8_t IsPrimaryThread;
|
||||
bool IsPrimaryThread;
|
||||
uint8_t SmtThreadCount;
|
||||
uint16_t TopologyFlags;
|
||||
|
||||
@@ -67,7 +67,7 @@ typedef struct KCPU {
|
||||
|
||||
KIRQL CurrentIrql;
|
||||
uint32_t InterruptDepth;
|
||||
volatile long ReschedulePending;
|
||||
volatile int32_t ReschedulePending;
|
||||
|
||||
TSS64 Tss;
|
||||
uint64_t Gdt[KE_GDT_ENTRIES];
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#define KE_DEBUG_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <ntlite/status.h>
|
||||
#include <ntlite/string_view.h>
|
||||
@@ -16,8 +17,8 @@ __declspec(dllexport) void DbgPrint(const char* fmt, ...);
|
||||
__declspec(dllexport) void KePrintConsole(const char* buf, size_t len);
|
||||
KSTATUS KeFlushDebugLogToSystemRoot(const char* relativePath);
|
||||
|
||||
__declspec(dllexport) _Noreturn void KePanic(int code, const char* fmt, ...);
|
||||
__declspec(dllexport) int KeHandleNmiIpi(void);
|
||||
__declspec(dllexport) _Noreturn void KePanic(int32_t code, const char* fmt, ...);
|
||||
__declspec(dllexport) bool KeHandleNmiIpi(void);
|
||||
|
||||
// Fault dispatch - called from the IDT fault stubs (ke_syscall.asm).
|
||||
|
||||
@@ -57,7 +58,7 @@ typedef struct KFAULT_FRAME {
|
||||
__declspec(dllexport) KSTATUS KeFaultDispatchFrame(KFAULT_FRAME* frame);
|
||||
|
||||
// Compatibility wrapper for any older assembly/object still calling this.
|
||||
__declspec(dllexport) _Noreturn void KeFaultDispatch(int vector, uintptr_t rip,
|
||||
__declspec(dllexport) _Noreturn void KeFaultDispatch(uint32_t vector, uintptr_t rip,
|
||||
uintptr_t errCode, uintptr_t cr2,
|
||||
uintptr_t cs);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <kernel/hal/hal_api.h>
|
||||
|
||||
#ifndef DISPLAY_API
|
||||
@@ -28,7 +29,7 @@ typedef struct DISPLAY_CLOCK_OBJECT {
|
||||
uint64_t PeriodTicks;
|
||||
uint64_t NextTick;
|
||||
uint64_t LastFrameGeneration;
|
||||
uint8_t Linked;
|
||||
bool Linked;
|
||||
} DISPLAY_CLOCK_OBJECT;
|
||||
|
||||
void KeDisplayInitialize(const HAL_API* hal);
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
#include <ntlite/status.h>
|
||||
|
||||
typedef struct KE_ID_ALLOCATOR {
|
||||
volatile long long Next;
|
||||
volatile int64_t Next;
|
||||
} KE_ID_ALLOCATOR;
|
||||
|
||||
#define KE_ID_ALLOCATOR_INIT(first_) { (long long)(uint32_t)(first_) }
|
||||
#define KE_ID_ALLOCATOR_INIT(first_) { (int64_t)(uint32_t)(first_) }
|
||||
|
||||
// Allocates one 32-bit identifier and never reuses an issued value during the boot.
|
||||
KSTATUS KeAllocateId32(KE_ID_ALLOCATOR* allocator, uint32_t* idOut);
|
||||
@@ -8,9 +8,7 @@
|
||||
#include <ntlite/status.h>
|
||||
#include <kernel/ob_object.h>
|
||||
#include <kernel/ke_event.h>
|
||||
#include <kernel/ke_dpc.h>
|
||||
|
||||
typedef struct SYS_GLOBAL_INPUT_STATE SYS_GLOBAL_INPUT_STATE;
|
||||
typedef struct SYS_INPUT_MANAGER_EVENT SYS_INPUT_MANAGER_EVENT;
|
||||
|
||||
typedef struct KE_INPUT_MANAGER_EVENT {
|
||||
@@ -22,54 +20,23 @@ typedef struct KE_INPUT_MANAGER_EVENT {
|
||||
} Data;
|
||||
} KE_INPUT_MANAGER_EVENT;
|
||||
|
||||
typedef struct INPUT_KEY_QUEUE_ENTRY {
|
||||
INPUT_KEY Key;
|
||||
char Character;
|
||||
uint32_t Modifiers;
|
||||
} INPUT_KEY_QUEUE_ENTRY;
|
||||
|
||||
typedef struct KE_INPUT_CONTEXT {
|
||||
const HAL_API* Hal;
|
||||
volatile uint8_t KeyDown[256];
|
||||
volatile uint32_t Modifiers;
|
||||
volatile long long Generation;
|
||||
|
||||
INPUT_KEY_QUEUE_ENTRY KeyQueue[256];
|
||||
volatile int KeyHead;
|
||||
volatile int KeyTail;
|
||||
volatile INPUT_KEY RepeatKey;
|
||||
volatile uint64_t RepeatNextTick;
|
||||
KDPC RepeatDpc;
|
||||
|
||||
INPUT_MOUSE_EVENT MouseQueue[128];
|
||||
volatile int MouseHead;
|
||||
volatile int MouseTail;
|
||||
|
||||
KE_INPUT_MANAGER_EVENT ManagerQueue[256];
|
||||
volatile int ManagerHead;
|
||||
volatile int ManagerTail;
|
||||
volatile long long ManagerSequence;
|
||||
volatile int32_t ManagerHead;
|
||||
volatile int32_t ManagerTail;
|
||||
volatile int64_t ManagerSequence;
|
||||
EVENT* ManagerWaitEvent;
|
||||
volatile int MouseX;
|
||||
volatile int MouseY;
|
||||
volatile int MouseBoundsWidth;
|
||||
volatile int MouseBoundsHeight;
|
||||
volatile int MouseWheel;
|
||||
volatile uint8_t MouseButtons;
|
||||
|
||||
EVENT* WaitEvent;
|
||||
volatile int32_t MouseX;
|
||||
volatile int32_t MouseY;
|
||||
volatile int32_t MouseBoundsWidth;
|
||||
volatile int32_t MouseBoundsHeight;
|
||||
} KE_INPUT_CONTEXT;
|
||||
|
||||
typedef struct KE_INPUT_MANAGER {
|
||||
OBJECT Header;
|
||||
} KE_INPUT_MANAGER;
|
||||
|
||||
typedef struct INPUT_QUEUE {
|
||||
OBJECT Header;
|
||||
KE_INPUT_CONTEXT* Context;
|
||||
EVENT* WaitEvent;
|
||||
} INPUT_QUEUE;
|
||||
|
||||
void KeInputInitialize(const HAL_API* hal);
|
||||
KSTATUS KeInputReferenceManager(KE_INPUT_MANAGER** managerOut);
|
||||
KSTATUS KeInputManagerReadEvent(KE_INPUT_MANAGER* manager, uint64_t timeoutMs, SYS_INPUT_MANAGER_EVENT* eventOut);
|
||||
@@ -78,26 +45,7 @@ __declspec(dllexport) KSTATUS KeInputRegisterDevice(const char* name, uint32_t f
|
||||
__declspec(dllexport) void KeInputSubmitKey(const INPUT_KEY_EVENT* event);
|
||||
__declspec(dllexport) void KeInputSubmitMouse(const INPUT_MOUSE_EVENT* event);
|
||||
__declspec(dllexport) void KeInputSubmitMouseAbsolute(const INPUT_MOUSE_ABSOLUTE_EVENT* event);
|
||||
__declspec(dllexport) void KeInputSubmitMouseAbsoluteScaled(uint32_t rawX, uint32_t rawY, uint32_t maxX, uint32_t maxY, int wheel, uint8_t buttons);
|
||||
__declspec(dllexport) void KeInputSubmitMouseAbsoluteScaled(uint32_t rawX, uint32_t rawY, uint32_t maxX, uint32_t maxY, int32_t wheel, uint8_t buttons);
|
||||
|
||||
INPUT_KEY KeInputKbPoll(void);
|
||||
KSTATUS KeInputWaitKey(uint8_t alertable, uint64_t timeoutMs);
|
||||
void KeInputTimerTick(void);
|
||||
bool KeInputIsKeyDown(INPUT_KEY key);
|
||||
bool KeInputPeekEvent(INPUT_KEY_RECORD* record);
|
||||
bool KeInputReadEvent(INPUT_KEY_RECORD* record);
|
||||
KSTATUS KeInputOpenQueue(INPUT_QUEUE** out);
|
||||
bool KeInputQueuePeekEvent(INPUT_QUEUE* queue, INPUT_KEY_RECORD* record);
|
||||
bool KeInputQueueReadEvent(INPUT_QUEUE* queue, INPUT_KEY_RECORD* record);
|
||||
KSTATUS KeInputQueueWaitKey(INPUT_QUEUE* queue, uint8_t alertable, uint64_t timeoutMs);
|
||||
EVENT* KeInputQueueWaitEvent(INPUT_QUEUE* queue);
|
||||
INPUT_KEY KeInputReadKey(void);
|
||||
char KeInputReadChar(void);
|
||||
uint32_t KeInputGetModifiers(void);
|
||||
KSTATUS KeInputQueryGlobalState(SYS_GLOBAL_INPUT_STATE* out);
|
||||
|
||||
bool KeInputMousePeek(INPUT_MOUSE_EVENT* event);
|
||||
bool KeInputMouseRead(INPUT_MOUSE_EVENT* event);
|
||||
void KeInputMouseGetPosition(int* x, int* y);
|
||||
void KeInputMouseSetPosition(int x, int y);
|
||||
void KeInputMouseSetBounds(int w, int h);
|
||||
void KeInputMouseSetPosition(int32_t x, int32_t y);
|
||||
void KeInputMouseSetBounds(int32_t w, int32_t h);
|
||||
@@ -6,6 +6,7 @@
|
||||
// The level constants are DDK-visible because current synchronization and IRP
|
||||
// layouts expose KIRQL. Kernel routines remain declared here.
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <ntlite/ddk/irql.h>
|
||||
|
||||
// Return the current processor's software IRQL.
|
||||
@@ -24,7 +25,7 @@ __declspec(dllexport) void KeAssertIrql(KIRQL expected);
|
||||
__declspec(dllexport) void KeAssertIrqlAtOrBelow(KIRQL maxIrql);
|
||||
|
||||
// Return nonzero when the current context may block.
|
||||
__declspec(dllexport) int KeCanWait(void);
|
||||
__declspec(dllexport) bool KeCanWait(void);
|
||||
|
||||
// Return a diagnostic name for an IRQL.
|
||||
__declspec(dllexport) const char* KeIrqlName(KIRQL irql);
|
||||
@@ -1,6 +1,7 @@
|
||||
// Kernel mutex declarations shared by implementation files and kernel clients.
|
||||
|
||||
#pragma once
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <kernel/ob_object.h>
|
||||
#include <kernel/ke_spinlock.h>
|
||||
@@ -18,8 +19,8 @@ typedef struct MUTEX {
|
||||
LIST_ENTRY OwnerLink;
|
||||
KE_SCHEDULING_CLASS DonationClass;
|
||||
uint32_t DonationPriority;
|
||||
uint8_t HasDonation;
|
||||
uint8_t Abandoned;
|
||||
bool HasDonation;
|
||||
bool Abandoned;
|
||||
} MUTEX;
|
||||
|
||||
// Tests whether a mutex acquisition transferred ownership to the caller.
|
||||
@@ -31,7 +32,7 @@ __declspec(dllexport) KSTATUS KeAcquireMutex(MUTEX* mutex, uint64_t timeoutMilli
|
||||
__declspec(dllexport) void KeReleaseMutex(MUTEX* mutex);
|
||||
|
||||
// Removes one blocked waiter while preserving priority-inheritance state.
|
||||
int KiMutexAbortWait(MUTEX* mutex, struct THREAD* thread);
|
||||
bool KiMutexAbortWait(MUTEX* mutex, struct THREAD* thread);
|
||||
|
||||
// Releases every mutex owned by a terminating thread as abandoned.
|
||||
void KiMutexRundownThread(struct THREAD* thread);
|
||||
@@ -1,12 +0,0 @@
|
||||
// Named queue registry hooks shared by process handle cleanup and syscalls.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ntlite/handle.h>
|
||||
|
||||
struct PROCESS;
|
||||
struct OBJECT;
|
||||
|
||||
// Removes registry entries owned by the given process handle/object pair.
|
||||
void KeNamedQueueUnpublishHandle(struct PROCESS* process, SYS_HANDLE handle, struct OBJECT* object);
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <kernel/ke_handle.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <ntlite/string_view.h>
|
||||
#include <kernel/ke_userenv.h>
|
||||
|
||||
@@ -57,14 +58,14 @@ typedef struct PROCESS {
|
||||
struct SECURITY_CONTEXT* SecurityContext;
|
||||
|
||||
int32_t ExitCode;
|
||||
volatile long Terminating;
|
||||
volatile long Exited;
|
||||
volatile long ResourcesReleased;
|
||||
volatile int32_t Terminating;
|
||||
volatile int32_t Exited;
|
||||
volatile int32_t ResourcesReleased;
|
||||
|
||||
// Userspace image construction is authorized by SYS_PROCESS_RIGHT_BUILD.
|
||||
// BuildOperations closes the race between memory construction and the one-way start transition.
|
||||
volatile long BuildState;
|
||||
volatile long BuildOperations;
|
||||
volatile int32_t BuildState;
|
||||
volatile int32_t BuildOperations;
|
||||
|
||||
// Main executable image. Used for cleanup.
|
||||
uintptr_t ImageBase;
|
||||
@@ -124,8 +125,8 @@ void KeStopProcessConstruction(PROCESS* process);
|
||||
KSTATUS KeExitProcess(PROCESS* process, int32_t exitCode);
|
||||
KSTATUS KeTerminateProcess(PROCESS* process, int32_t exitCode);
|
||||
void KeCompleteProcessExitIfLastThread(PROCESS* process);
|
||||
int KeIsProcessTerminating(PROCESS* process);
|
||||
int KeIsProcessTerminationProtected(PROCESS* process);
|
||||
bool KeIsProcessTerminating(PROCESS* process);
|
||||
bool KeIsProcessTerminationProtected(PROCESS* process);
|
||||
KSTATUS KeGetProcessExitCode(PROCESS* process, int32_t* exitCodeOut);
|
||||
void KeQueryExceptionStats(struct SYS_EXCEPTION_STATS* statsOut);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Kernel ke sched declarations shared by implementation files and kernel clients.
|
||||
|
||||
#pragma once
|
||||
#include <stdbool.h>
|
||||
// The scheduler combines dynamic normal queues with static real-time queues.
|
||||
// Per-processor timer IRQs drive KeSchedulerTick.
|
||||
#include <kernel/ke_thread.h>
|
||||
@@ -55,8 +56,8 @@ typedef struct KE_THREAD_SCHEDULER_SNAPSHOT {
|
||||
uint32_t WaitObjectType;
|
||||
KSTATUS WaitStatus;
|
||||
struct MUTEX* WaitingMutex;
|
||||
uint8_t Queued;
|
||||
uint8_t AlertableWait;
|
||||
bool Queued;
|
||||
bool AlertableWait;
|
||||
} KE_THREAD_SCHEDULER_SNAPSHOT;
|
||||
|
||||
// Copies scheduler-owned thread state into a stable diagnostic snapshot.
|
||||
@@ -64,7 +65,7 @@ void KiSchedulerSnapshotThread(THREAD* thread, KE_THREAD_SCHEDULER_SNAPSHOT* sna
|
||||
|
||||
// Selects waiters and refreshes donations while the mutex lock is held.
|
||||
struct THREAD* KiSchedulerSelectMutexWaiter(struct MUTEX* mutex);
|
||||
int KiSchedulerRefreshMutexDonation(struct MUTEX* mutex);
|
||||
bool KiSchedulerRefreshMutexDonation(struct MUTEX* mutex);
|
||||
|
||||
// Updates one thread's normal-class base priority.
|
||||
KSTATUS KiSchedulerSetNormalPriority(THREAD* thread, THREAD_PRIORITY priority);
|
||||
@@ -82,7 +83,7 @@ struct MUTEX* KiSchedulerFirstOwnedMutex(THREAD* thread);
|
||||
void KiSchedulerNotePriorityPropagation(uint32_t depth);
|
||||
|
||||
// Recomputes effective rank and optionally returns a referenced upstream mutex.
|
||||
int KiSchedulerRefreshEffectivePriority(THREAD* thread, struct MUTEX** waitingMutexOut);
|
||||
bool KiSchedulerRefreshEffectivePriority(THREAD* thread, struct MUTEX** waitingMutexOut);
|
||||
|
||||
// Called once by KernelMain before any threads are created.
|
||||
void KeInitializeScheduler(void);
|
||||
@@ -107,7 +108,7 @@ void KeSchedulerTick(void);
|
||||
// is cheap and can be called from interrupt context. KiScheduleFromInterrupt
|
||||
// consumes the pending request and performs the context switch, if needed.
|
||||
void KiRequestReschedule(void);
|
||||
int KiIsReschedulePending(void);
|
||||
bool KiIsReschedulePending(void);
|
||||
void KiScheduleFromInterrupt(void);
|
||||
void KiSchedulerNoteVoluntaryBlock(THREAD* thread);
|
||||
void KiSchedulerMarkThreadWaiting(THREAD* thread);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// ke_thread.h - thread model
|
||||
// A THREAD is the unit of scheduling. Every thread belongs to exactly one process.
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <kernel/ob_object.h>
|
||||
#include <kernel/ke_list.h>
|
||||
#include <kernel/ke_process.h>
|
||||
@@ -131,8 +132,8 @@ struct THREAD {
|
||||
// Scheduler hardening state. Queued means membership in a scheduler ready
|
||||
// queue only; wait-object membership is tracked by WaitListHead. Idle
|
||||
// threads are CPU-local and never enter a global ready queue.
|
||||
uint8_t Queued;
|
||||
uint8_t IsIdleThread;
|
||||
bool Queued;
|
||||
bool IsIdleThread;
|
||||
uint16_t SchedulerFlags;
|
||||
uint32_t LastCpu;
|
||||
uint64_t AffinityMask;
|
||||
@@ -143,9 +144,9 @@ struct THREAD {
|
||||
// FpuContext.
|
||||
KSTATUS WaitStatus;
|
||||
LIST_ENTRY* WaitListHead;
|
||||
uint8_t AlertableWait;
|
||||
bool AlertableWait;
|
||||
LIST_ENTRY TimeoutLink;
|
||||
uint8_t TimeoutArmed;
|
||||
bool TimeoutArmed;
|
||||
uint64_t TimeoutTick;
|
||||
KSTATUS TimeoutStatus;
|
||||
|
||||
@@ -157,9 +158,9 @@ struct THREAD {
|
||||
// when that thread reaches PASSIVE_LEVEL with APC delivery enabled.
|
||||
LIST_ENTRY ApcQueue;
|
||||
SPINLOCK ApcLock;
|
||||
volatile long KernelApcPending;
|
||||
volatile int32_t KernelApcPending;
|
||||
int32_t KernelApcDisable;
|
||||
uint8_t ApcDeliveryActive;
|
||||
bool ApcDeliveryActive;
|
||||
|
||||
// Non-NULL while executing on a syscall/interrupt/fault entry frame.
|
||||
// The pointed-to frame lives on this thread's kernel stack.
|
||||
@@ -170,10 +171,10 @@ struct THREAD {
|
||||
// user-mode dispatcher stub.
|
||||
LIST_ENTRY UserApcQueue;
|
||||
SPINLOCK UserApcLock;
|
||||
volatile long UserApcPending;
|
||||
volatile int32_t UserApcPending;
|
||||
uintptr_t UserApcDispatcher;
|
||||
uint8_t UserApcDeliverable;
|
||||
uint8_t UserApcDeliveryActive;
|
||||
bool UserApcDeliverable;
|
||||
bool UserApcDeliveryActive;
|
||||
uintptr_t UserApcFrameUserAddress;
|
||||
uint64_t UserApcReturnToken;
|
||||
uint64_t UserApcSavedRip;
|
||||
@@ -192,12 +193,12 @@ struct THREAD {
|
||||
// Synchronous kernel work can temporarily retain caller-owned stack or
|
||||
// process memory. Process termination must wait until that ownership has
|
||||
// returned instead of freeing the thread underneath an active driver.
|
||||
volatile long TerminationDeferralCount;
|
||||
volatile int32_t TerminationDeferralCount;
|
||||
|
||||
// Set once terminal thread teardown begins. Interrupts may continue to
|
||||
// run, but interrupt-return scheduling must not abandon this kernel stack
|
||||
// before KeFinalizeThreadExit and process-exit publication complete.
|
||||
volatile long ExitInProgress;
|
||||
volatile int32_t ExitInProgress;
|
||||
};
|
||||
|
||||
// Creates and queues a user thread. On success, *out receives a referenced
|
||||
@@ -224,7 +225,7 @@ __declspec(dllexport) KSTATUS KeCreateKernelThread(uintptr_t fn, uintptr_t arg,
|
||||
THREAD** out);
|
||||
|
||||
// Mark a thread dead and deschedule it permanently.
|
||||
__declspec(dllexport) void KeExitThread(THREAD* thread, int code);
|
||||
__declspec(dllexport) void KeExitThread(THREAD* thread, int32_t code);
|
||||
|
||||
// Publishes completion, releases per-thread user memory, and removes one dead
|
||||
// thread from its process live-thread set. Retained handles remain waitable.
|
||||
@@ -251,7 +252,7 @@ KSTATUS KeCommitBlockThread(THREAD* thread, uint8_t alertable);
|
||||
KSTATUS KeBlockThread(THREAD* thread, OBJECT* waitObject, uint8_t alertable);
|
||||
void KeUnblockThreadWithStatus(THREAD* thread, KSTATUS status);
|
||||
void KeUnblockThreadFromWaitListWithStatus(THREAD* thread, KSTATUS status);
|
||||
int KeAbortThreadWait(THREAD* thread, KSTATUS status);
|
||||
bool KeAbortThreadWait(THREAD* thread, KSTATUS status);
|
||||
void KeUnblockThread(THREAD* thread);
|
||||
KSTATUS KeAlertThread(THREAD* thread);
|
||||
void KiWakeThreadForKernelApc(THREAD* thread);
|
||||
@@ -260,8 +261,8 @@ void KiWakeThreadForUserApc(THREAD* thread);
|
||||
// Defers process termination while kernel work owns caller-backed storage.
|
||||
void KeEnterTerminationDeferral(void);
|
||||
void KeLeaveTerminationDeferral(void);
|
||||
int KeThreadTerminationDeferred(const THREAD* thread);
|
||||
int KeThreadExitInProgress(const THREAD* thread);
|
||||
bool KeThreadTerminationDeferred(const THREAD* thread);
|
||||
bool KeThreadExitInProgress(const THREAD* thread);
|
||||
|
||||
// Assembly stub - implemented in ke_switch.asm.
|
||||
void KeSwitchContext(THREAD* from, THREAD* to);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
// ke_timer.h - waitable one-shot and periodic timers.
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <kernel/ke_event.h>
|
||||
#include <kernel/ke_list.h>
|
||||
#include <kernel/ke_spinlock.h>
|
||||
@@ -15,8 +16,8 @@ typedef struct KTIMER {
|
||||
LIST_ENTRY Link;
|
||||
uint64_t DueMicroseconds;
|
||||
uint64_t PeriodMicroseconds;
|
||||
uint8_t Active;
|
||||
uint8_t Linked;
|
||||
bool Active;
|
||||
bool Linked;
|
||||
} KTIMER;
|
||||
|
||||
// Creates an unset waitable timer object.
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
// and KiExitTrapFrame commits those values back to the hardware IRET slots.
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <ntlite/status.h>
|
||||
|
||||
#define KTRAP_FRAME_MAGIC 0x4650545241544B31ULL
|
||||
@@ -80,7 +81,7 @@ typedef struct SYS_TRAP_FRAME_INFO_K {
|
||||
void KiEnterTrapFrame(KTRAP_FRAME* frame);
|
||||
void KiExitTrapFrame(KTRAP_FRAME* frame);
|
||||
KTRAP_FRAME* KeGetCurrentTrapFrame(void);
|
||||
int KeTrapFrameFromUser(const KTRAP_FRAME* frame);
|
||||
bool KeTrapFrameFromUser(const KTRAP_FRAME* frame);
|
||||
void KiValidateSyscallTrapFrame(uint64_t nr, uint64_t a0, uint64_t a1,
|
||||
uint64_t a2, uint64_t a3);
|
||||
KSTATUS KeQueryCurrentTrapFrame(SYS_TRAP_FRAME_INFO_K* out);
|
||||
@@ -15,7 +15,7 @@ typedef struct KWORK_ITEM {
|
||||
LIST_ENTRY Link;
|
||||
KWORK_ROUTINE Routine;
|
||||
void* Context;
|
||||
volatile long Queued;
|
||||
volatile int32_t Queued;
|
||||
} KWORK_ITEM;
|
||||
|
||||
void KeInitializeWorkItem(KWORK_ITEM* item, KWORK_ROUTINE routine, void* context);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <kernel/mm_phys.h>
|
||||
#include <ntlite/status.h>
|
||||
@@ -59,7 +60,7 @@ void MmFileCacheReleasePage(MM_FILE_CACHE_PAGE* page);
|
||||
|
||||
// Returns a retained coherent cache page suitable for a shared writable mapping.
|
||||
KSTATUS MmFileCacheGetWritablePage(FILE_OBJECT* file, uint64_t offset,
|
||||
uint64_t fileSizeBefore, int needExistingBytes,
|
||||
uint64_t fileSizeBefore, bool needExistingBytes,
|
||||
MM_FILE_CACHE_PAGE* outPage);
|
||||
|
||||
// Marks one coherent cache page dirty after a shared writable mapping is written.
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <ntlite/ddk/memory.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <kernel/mm_phys.h>
|
||||
#include <ntlite/status.h>
|
||||
@@ -87,10 +88,10 @@ __declspec(dllexport) KSTATUS MmPteProtectRange(uintptr_t virt, size_t size, uin
|
||||
|
||||
// Tests and clears the hardware accessed bit on one mapped 4 KiB leaf.
|
||||
// Returns nonzero when the page had been accessed and was given a second chance.
|
||||
__declspec(dllexport) int MmPteTestAndClearAccessed(uintptr_t virt);
|
||||
__declspec(dllexport) bool MmPteTestAndClearAccessed(uintptr_t virt);
|
||||
|
||||
// Tests and clears the hardware dirty bit on one mapped 4 KiB leaf.
|
||||
__declspec(dllexport) int MmPteTestAndClearDirty(uintptr_t virt);
|
||||
__declspec(dllexport) bool MmPteTestAndClearDirty(uintptr_t virt);
|
||||
|
||||
// Translates a virtual address through the current shared page tables.
|
||||
__declspec(dllexport) PHYSICAL_ADDRESS MmPteTranslate(uintptr_t virt);
|
||||
@@ -106,7 +107,7 @@ void MmPteFlushLocal(uintptr_t virt);
|
||||
void MmPteFlushKernelAddress(uintptr_t virt);
|
||||
|
||||
// Handles the fixed-vector NMI used for kernel TLB shootdowns.
|
||||
int MmPteHandleShootdownNmi(void);
|
||||
bool MmPteHandleShootdownNmi(void);
|
||||
|
||||
// Returns page-table operation counters used by memory telemetry.
|
||||
void MmPteQueryStats(MM_PTE_STATS* out);
|
||||
@@ -3,12 +3,13 @@
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <ntlite/status.h>
|
||||
#include <kernel/mm_phys.h>
|
||||
|
||||
typedef struct MM_SWAP_STATS {
|
||||
uint64_t Enabled;
|
||||
bool Enabled;
|
||||
uint64_t TotalSlots;
|
||||
uint64_t UsedSlots;
|
||||
uint64_t FreeSlots;
|
||||
@@ -23,7 +24,7 @@ typedef struct MM_SWAP_STATS {
|
||||
} MM_SWAP_STATS;
|
||||
|
||||
KSTATUS MmSwapInitialize(const char* relativePath, uint64_t sizeBytes);
|
||||
int MmSwapIsEnabled(void);
|
||||
bool MmSwapIsEnabled(void);
|
||||
KSTATUS MmSwapPageOut(PHYSICAL_ADDRESS frame, uint32_t* slotOut);
|
||||
KSTATUS MmSwapPageIn(uint32_t slot, PHYSICAL_ADDRESS frame);
|
||||
void MmSwapFreeSlot(uint32_t slot);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
// mm_virt.h - virtual memory manager (VMM)
|
||||
// Manages the single shared PML4, kernel pool, and VAD-backed user VM ownership.
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <kernel/mm_phys.h>
|
||||
#include <kernel/mm_pte.h>
|
||||
@@ -92,7 +93,7 @@ __declspec(dllexport) void MmUnpinUserPage(MM_PINNED_USER_PAGE* page);
|
||||
// Locks a user buffer for asynchronous kernel access. The containing VADs stay
|
||||
// alive and protected, and resident PFNs stay pinned until the buffer is
|
||||
// unlocked. WriteAccess describes kernel writes to the user buffer.
|
||||
__declspec(dllexport) KSTATUS MmLockUserBuffer(PROCESS* process, void* userAddress, size_t size, int writeAccess, MM_LOCKED_USER_BUFFER** out);
|
||||
__declspec(dllexport) KSTATUS MmLockUserBuffer(PROCESS* process, void* userAddress, size_t size, bool writeAccess, MM_LOCKED_USER_BUFFER** out);
|
||||
__declspec(dllexport) void MmUnlockUserBuffer(MM_LOCKED_USER_BUFFER* buffer);
|
||||
size_t MmLockedUserBufferPageCount(const MM_LOCKED_USER_BUFFER* buffer);
|
||||
PHYSICAL_ADDRESS MmLockedUserBufferPageFrame(const MM_LOCKED_USER_BUFFER* buffer, size_t index);
|
||||
|
||||
@@ -68,145 +68,129 @@
|
||||
#define SYS_SIGNAL_EVENT 53
|
||||
#define SYS_CLEAR_EVENT 54
|
||||
|
||||
// Queues and named queues.
|
||||
// Anonymous queues.
|
||||
#define SYS_CREATE_QUEUE 55
|
||||
#define SYS_SEND_QUEUE 56
|
||||
#define SYS_RECV_QUEUE 57
|
||||
#define SYS_PUBLISH_QUEUE 58
|
||||
#define SYS_OPEN_NAMED_QUEUE 59
|
||||
#define SYS_OPEN_NAMED_QUEUE_OWNER_PROCESS 60
|
||||
#define SYS_UNPUBLISH_QUEUE 61
|
||||
|
||||
// LPC-like Ports and well-known system services.
|
||||
#define SYS_CREATE_PORT 62
|
||||
#define SYS_CONNECT_PORT 63
|
||||
#define SYS_ACCEPT_PORT 64
|
||||
#define SYS_SEND_PORT 65
|
||||
#define SYS_RECEIVE_PORT 66
|
||||
#define SYS_CALL_PORT 67
|
||||
#define SYS_REPLY_PORT 68
|
||||
#define SYS_DISCONNECT_PORT 69
|
||||
#define SYS_OPEN_PORT_PEER_PROCESS 70
|
||||
#define SYS_REGISTER_SYSTEM_SERVICE 71
|
||||
#define SYS_UNREGISTER_SYSTEM_SERVICE 72
|
||||
#define SYS_CONNECT_SYSTEM_SERVICE 73
|
||||
#define SYS_CREATE_PORT 58
|
||||
#define SYS_CONNECT_PORT 59
|
||||
#define SYS_ACCEPT_PORT 60
|
||||
#define SYS_SEND_PORT 61
|
||||
#define SYS_RECEIVE_PORT 62
|
||||
#define SYS_CALL_PORT 63
|
||||
#define SYS_REPLY_PORT 64
|
||||
#define SYS_DISCONNECT_PORT 65
|
||||
#define SYS_OPEN_PORT_PEER_PROCESS 66
|
||||
#define SYS_REGISTER_SYSTEM_SERVICE 67
|
||||
#define SYS_UNREGISTER_SYSTEM_SERVICE 68
|
||||
#define SYS_CONNECT_SYSTEM_SERVICE 69
|
||||
|
||||
// Mounted-volume manager control plane.
|
||||
#define SYS_QUERY_VOLUMES 74
|
||||
#define SYS_OPEN_VOLUME 75
|
||||
#define SYS_WAIT_VOLUME_CHANGE 76
|
||||
#define SYS_QUERY_VOLUMES 70
|
||||
#define SYS_OPEN_VOLUME 71
|
||||
#define SYS_WAIT_VOLUME_CHANGE 72
|
||||
|
||||
// Files and directories.
|
||||
#define SYS_OPEN_FILE_AT 77
|
||||
#define SYS_OPEN_DIR_AT 78
|
||||
#define SYS_STAT_AT 79
|
||||
#define SYS_DELETE_AT 80
|
||||
#define SYS_RENAME_AT 81
|
||||
#define SYS_CREATE_DIR_AT 82
|
||||
#define SYS_REMOVE_DIR_AT 83
|
||||
#define SYS_READ_FILE 84
|
||||
#define SYS_WRITE_FILE 85
|
||||
#define SYS_READ_FILE_ASYNC 86
|
||||
#define SYS_WRITE_FILE_ASYNC 87
|
||||
#define SYS_CANCEL_IO 88
|
||||
#define SYS_SEEK_FILE 89
|
||||
#define SYS_GET_FILE_POS 90
|
||||
#define SYS_GET_FILE_SIZE 91
|
||||
#define SYS_GET_FILE_STAT 92
|
||||
#define SYS_TRUNCATE_FILE 93
|
||||
#define SYS_FLUSH_FILE 94
|
||||
#define SYS_LOCK_FILE 95
|
||||
#define SYS_UNLOCK_FILE 96
|
||||
#define SYS_QUERY_FILE_LOCK 97
|
||||
#define SYS_SET_FILE_STATUS 98
|
||||
#define SYS_CREATE_PIPE 99
|
||||
#define SYS_NOTIFY_PIPE 100
|
||||
#define SYS_READ_DIR 101
|
||||
#define SYS_OPEN_FILE_AT 73
|
||||
#define SYS_OPEN_DIR_AT 74
|
||||
#define SYS_STAT_AT 75
|
||||
#define SYS_DELETE_AT 76
|
||||
#define SYS_RENAME_AT 77
|
||||
#define SYS_CREATE_DIR_AT 78
|
||||
#define SYS_REMOVE_DIR_AT 79
|
||||
#define SYS_READ_FILE 80
|
||||
#define SYS_WRITE_FILE 81
|
||||
#define SYS_READ_FILE_ASYNC 82
|
||||
#define SYS_WRITE_FILE_ASYNC 83
|
||||
#define SYS_CANCEL_IO 84
|
||||
#define SYS_SEEK_FILE 85
|
||||
#define SYS_GET_FILE_POS 86
|
||||
#define SYS_GET_FILE_SIZE 87
|
||||
#define SYS_GET_FILE_STAT 88
|
||||
#define SYS_TRUNCATE_FILE 89
|
||||
#define SYS_FLUSH_FILE 90
|
||||
#define SYS_LOCK_FILE 91
|
||||
#define SYS_UNLOCK_FILE 92
|
||||
#define SYS_QUERY_FILE_LOCK 93
|
||||
#define SYS_SET_FILE_STATUS 94
|
||||
#define SYS_CREATE_PIPE 95
|
||||
#define SYS_NOTIFY_PIPE 96
|
||||
#define SYS_READ_DIR 97
|
||||
|
||||
// Console, display, and surfaces.
|
||||
#define SYS_WRITE_CONSOLE 102
|
||||
#define SYS_GET_CONSOLE_INFO 103
|
||||
#define SYS_SET_CONSOLE_CURSOR 104
|
||||
#define SYS_FILL_CONSOLE_CHARACTER 105
|
||||
#define SYS_FILL_CONSOLE_ATTRIBUTE 106
|
||||
#define SYS_PUT_SCREEN_CHAR 107
|
||||
#define SYS_CLEAR_SCREEN 108
|
||||
#define SYS_GET_SCREEN_SIZE 109
|
||||
#define SYS_QUERY_DISPLAY_INFO 110
|
||||
#define SYS_QUERY_DISPLAY_MANAGER_INFO 111
|
||||
#define SYS_PRESENT_DISPLAY_MANAGER_SURFACE 112
|
||||
#define SYS_SET_DISPLAY_MANAGER_CURSOR 113
|
||||
#define SYS_WRITE_DISPLAY_MANAGER_CONSOLE 114
|
||||
#define SYS_QUERY_DISPLAY_MANAGER_CONSOLE_INFO 115
|
||||
#define SYS_SET_DISPLAY_MANAGER_CONSOLE_CURSOR 116
|
||||
#define SYS_FILL_DISPLAY_MANAGER_CONSOLE_CHARACTER 117
|
||||
#define SYS_FILL_DISPLAY_MANAGER_CONSOLE_ATTRIBUTE 118
|
||||
#define SYS_PUT_DISPLAY_MANAGER_CONSOLE_CHARACTER 119
|
||||
#define SYS_CLEAR_DISPLAY_MANAGER_CONSOLE 120
|
||||
#define SYS_OPEN_DISPLAY_CLOCK 121
|
||||
#define SYS_CREATE_SURFACE 122
|
||||
#define SYS_MAP_SURFACE 123
|
||||
#define SYS_UNMAP_SURFACE 124
|
||||
#define SYS_QUERY_SURFACE 125
|
||||
#define SYS_COMMIT_SURFACE 126
|
||||
#define SYS_WRITE_CONSOLE 98
|
||||
#define SYS_GET_CONSOLE_INFO 99
|
||||
#define SYS_SET_CONSOLE_CURSOR 100
|
||||
#define SYS_FILL_CONSOLE_CHARACTER 101
|
||||
#define SYS_FILL_CONSOLE_ATTRIBUTE 102
|
||||
#define SYS_PUT_SCREEN_CHAR 103
|
||||
#define SYS_CLEAR_SCREEN 104
|
||||
#define SYS_GET_SCREEN_SIZE 105
|
||||
#define SYS_QUERY_DISPLAY_INFO 106
|
||||
#define SYS_QUERY_DISPLAY_MANAGER_INFO 107
|
||||
#define SYS_PRESENT_DISPLAY_MANAGER_SURFACE 108
|
||||
#define SYS_SET_DISPLAY_MANAGER_CURSOR 109
|
||||
#define SYS_WRITE_DISPLAY_MANAGER_CONSOLE 110
|
||||
#define SYS_QUERY_DISPLAY_MANAGER_CONSOLE_INFO 111
|
||||
#define SYS_SET_DISPLAY_MANAGER_CONSOLE_CURSOR 112
|
||||
#define SYS_FILL_DISPLAY_MANAGER_CONSOLE_CHARACTER 113
|
||||
#define SYS_FILL_DISPLAY_MANAGER_CONSOLE_ATTRIBUTE 114
|
||||
#define SYS_PUT_DISPLAY_MANAGER_CONSOLE_CHARACTER 115
|
||||
#define SYS_CLEAR_DISPLAY_MANAGER_CONSOLE 116
|
||||
#define SYS_OPEN_DISPLAY_CLOCK 117
|
||||
#define SYS_CREATE_SURFACE 118
|
||||
#define SYS_MAP_SURFACE 119
|
||||
#define SYS_UNMAP_SURFACE 120
|
||||
#define SYS_QUERY_SURFACE 121
|
||||
#define SYS_COMMIT_SURFACE 122
|
||||
|
||||
// Native render audio.
|
||||
#define SYS_AUDIO_ENUMERATE_ENDPOINTS 127
|
||||
#define SYS_AUDIO_OPEN_STREAM 128
|
||||
#define SYS_AUDIO_WRITE 129
|
||||
#define SYS_AUDIO_ARM_WAIT 130
|
||||
#define SYS_AUDIO_QUERY_STREAM 131
|
||||
#define SYS_AUDIO_START 132
|
||||
#define SYS_AUDIO_PAUSE 133
|
||||
#define SYS_AUDIO_RESUME 134
|
||||
#define SYS_AUDIO_DRAIN 135
|
||||
#define SYS_AUDIO_STOP 136
|
||||
#define SYS_AUDIO_RESET 137
|
||||
#define SYS_AUDIO_SET_VOLUME 138
|
||||
#define SYS_AUDIO_SET_MASTER_VOLUME 139
|
||||
#define SYS_AUDIO_ENUMERATE_ENDPOINTS 123
|
||||
#define SYS_AUDIO_OPEN_STREAM 124
|
||||
#define SYS_AUDIO_WRITE 125
|
||||
#define SYS_AUDIO_ARM_WAIT 126
|
||||
#define SYS_AUDIO_QUERY_STREAM 127
|
||||
#define SYS_AUDIO_START 128
|
||||
#define SYS_AUDIO_PAUSE 129
|
||||
#define SYS_AUDIO_RESUME 130
|
||||
#define SYS_AUDIO_DRAIN 131
|
||||
#define SYS_AUDIO_STOP 132
|
||||
#define SYS_AUDIO_RESET 133
|
||||
#define SYS_AUDIO_SET_VOLUME 134
|
||||
#define SYS_AUDIO_SET_MASTER_VOLUME 135
|
||||
|
||||
// Input.
|
||||
#define SYS_READ_INPUT_MANAGER_EVENT 140
|
||||
#define SYS_POLL_KEYBOARD 141
|
||||
#define SYS_IS_KEY_DOWN 142
|
||||
#define SYS_READ_KEYBOARD_CHAR 143
|
||||
#define SYS_READ_KEY 144
|
||||
#define SYS_GET_KEY_MODIFIERS 145
|
||||
#define SYS_QUERY_GLOBAL_INPUT_STATE 146
|
||||
#define SYS_OPEN_INPUT_QUEUE 147
|
||||
#define SYS_READ_INPUT_EVENT 148
|
||||
#define SYS_PEEK_INPUT_EVENT 149
|
||||
#define SYS_PEEK_MOUSE 150
|
||||
#define SYS_READ_MOUSE 151
|
||||
#define SYS_GET_MOUSE_POS 152
|
||||
#define SYS_READ_INPUT_MANAGER_EVENT 136
|
||||
|
||||
// Time, debug, and system information.
|
||||
#define SYS_CREATE_TIMER 153
|
||||
#define SYS_SET_TIMER 154
|
||||
#define SYS_CANCEL_TIMER 155
|
||||
#define SYS_GET_TICK 156
|
||||
#define SYS_GET_TICK_FREQUENCY 157
|
||||
#define SYS_GET_SYSTEM_TIME 158
|
||||
#define SYS_PRINT_DEBUG 159
|
||||
#define SYS_QUERY_TRAP_FRAME 160
|
||||
#define SYS_GET_MEMORY_STATUS 161
|
||||
#define SYS_QUERY_KERNEL_STATS 162
|
||||
#define SYS_CREATE_TIMER 137
|
||||
#define SYS_SET_TIMER 138
|
||||
#define SYS_CANCEL_TIMER 139
|
||||
#define SYS_GET_TICK 140
|
||||
#define SYS_GET_TICK_FREQUENCY 141
|
||||
#define SYS_GET_SYSTEM_TIME 142
|
||||
#define SYS_PRINT_DEBUG 143
|
||||
#define SYS_QUERY_TRAP_FRAME 144
|
||||
#define SYS_GET_MEMORY_STATUS 145
|
||||
#define SYS_QUERY_KERNEL_STATS 146
|
||||
|
||||
// Native sockets and polling.
|
||||
#define SYS_CREATE_SOCKET 163
|
||||
#define SYS_SOCKET_IO_ASYNC 164
|
||||
#define SYS_BIND_SOCKET 165
|
||||
#define SYS_LISTEN_SOCKET 166
|
||||
#define SYS_ACCEPT_SOCKET 167
|
||||
#define SYS_CONNECT_SOCKET 168
|
||||
#define SYS_SEND_SOCKET 169
|
||||
#define SYS_RECV_SOCKET 170
|
||||
#define SYS_SHUTDOWN_SOCKET 171
|
||||
#define SYS_SEND_TO_SOCKET 172
|
||||
#define SYS_RECV_FROM_SOCKET 173
|
||||
#define SYS_RESOLVE_HOST 174
|
||||
#define SYS_SET_SOCKET_OPTION 175
|
||||
#define SYS_GET_SOCKET_OPTION 176
|
||||
#define SYS_POLL 177
|
||||
#define SYS_CREATE_SOCKET 147
|
||||
#define SYS_SOCKET_IO_ASYNC 148
|
||||
#define SYS_BIND_SOCKET 149
|
||||
#define SYS_LISTEN_SOCKET 150
|
||||
#define SYS_ACCEPT_SOCKET 151
|
||||
#define SYS_CONNECT_SOCKET 152
|
||||
#define SYS_SEND_SOCKET 153
|
||||
#define SYS_RECV_SOCKET 154
|
||||
#define SYS_SHUTDOWN_SOCKET 155
|
||||
#define SYS_SEND_TO_SOCKET 156
|
||||
#define SYS_RECV_FROM_SOCKET 157
|
||||
#define SYS_RESOLVE_HOST 158
|
||||
#define SYS_SET_SOCKET_OPTION 159
|
||||
#define SYS_GET_SOCKET_OPTION 160
|
||||
#define SYS_POLL 161
|
||||
|
||||
#define SYS_MAX 178
|
||||
#define SYS_MAX 162
|
||||
Reference in new issue
Block a user