add a realtime scheduler class and priority-inheritance mutexes with timeouts and abandonment, add an HDA audio driver and a SYS_AUDIO_* syscall family, flesh out kernel32 with Win32 threads, events, mutexes, critical sections, and condition variables, add SYS_RESUME_THREAD for suspended thread creation, add KeInitializeMemoryTypes to reprogram MTRRs and install a canonical PAT for WB/WC/UC control, rework the display pipeline with a pitched present path and console output flush, bring back disk.vhd with mtools since vvfat fucking sucks, harden AHCI with serialized cache flush, USB mass storage with SCSI sense-data decoding, and xHCI with cleaner DMA teardown, fix the last stray for(;;) in HalStopProcessor to while(true), pile on smoke tests for audio, win32 sync primitives, and thread suspend, implement AHCI timeout, kill readahead since it was desperetaly trying to murder me, fix doom sound x2.

This commit is contained in:
maksw committed 2026-08-11 18:38:36 +02:00
1 parent 8b254f84f4
commit 4add6789ba
177 files changed
+22565 -3070

No files matched your search

+12 -5
View File
@@ -13,16 +13,23 @@ typedef struct MUTEX {
SPINLOCK Lock;
THREAD* Owner;
LIST_ENTRY WaitList;
LIST_ENTRY OwnerLink;
KE_SCHEDULING_CLASS DonationClass;
uint32_t DonationPriority;
uint8_t HasDonation;
uint8_t Abandoned;
} MUTEX;
// Tests whether a mutex acquisition transferred ownership to the caller.
#define KE_MUTEX_ACQUIRE_SUCCEEDED(status) \
((status) == NTLSTATUS_SUCCESS || (status) == NTLSTATUS_ABANDONED)
// Creates a mutex object.
__declspec(dllexport) KSTATUS KeMutexCreate(MUTEX** out);
// Acquires a mutex, blocking when necessary.
__declspec(dllexport) KSTATUS KeAcquireMutex(MUTEX* mutex);
// Attempts to acquire a mutex without blocking.
__declspec(dllexport) KSTATUS KeTryAcquireMutex(MUTEX* mutex);
// Acquires a mutex within the requested timeout and reports abandonment on transfer.
// Zero performs a nonblocking probe; KE_WAIT_INFINITE waits without a timeout.
__declspec(dllexport) KSTATUS KeAcquireMutex(MUTEX* mutex, uint64_t timeoutMilliseconds);
// Releases a mutex.
__declspec(dllexport) void KeReleaseMutex(MUTEX* mutex);