replace nob with ms' build, move disk creation to build.bat, major comment cleanup, remove old and stupid tests, overhaul interrupt management with per-CPU vector allocation, affinity migration and safe teardown, add proper IOAPIC routing and PCI MSI/MSI-X/INTx support, migrate drivers to the new interrupt API, integrate ACPICA with a proper OS services layer, move ACPI firmware events, power button handling and S5 shutdown into acpi.sys, add parallel driver startup and atomic publication, replace PnP arrays with dynamic lists, redesign service startup again to be asynchronous, add delayed startup mode for services, allow omitting keys in services.ini, fix acpi ec deferred work handling, fix kernel threads having garbage exit code.

This commit is contained in:
maksw committed 2026-10-28 15:18:43 +01:00
1 parent d36f19509c
commit 36eef8f58d
696 files changed
+147281 -7530

No files matched your search

+9 -10
View File
@@ -136,7 +136,6 @@ void KeFinalizeThreadExit(THREAD* thread) {
}
}
// Implements the thread Destroy operation.
static void KiThreadDestroy(OBJECT* obj) {
THREAD* thread = CONTAINING_RECORD(obj, THREAD, Header);
@@ -450,7 +449,6 @@ bool KeThreadExitInProgress(const THREAD* thread) {
return thread && NtlAtomicLoad32(&thread->ExitInProgress) != 0;
}
// Implements the exit Thread operation.
__declspec(dllexport) void KeExitThread(THREAD* thread, int32_t code) {
(void)code;
if (!thread) return;
@@ -601,6 +599,15 @@ static KSTATUS KiCreateKernelThread(uintptr_t fn, uintptr_t arg,
ctx->Rip = (uint64_t)KeKernelThreadEntry;
thread->SavedContext = ctx;
// Publish thread completion before the new kernel thread can run.
EVENT* exitEvent = (EVENT*)0;
KSTATUS eventStatus = KeEventCreate(EventManualReset, false, &exitEvent);
if (!KSUCCESS(eventStatus)) {
ObDereferenceObject(&thread->Header);
return eventStatus;
}
thread->ExitEvent = exitEvent;
// Register with the owning process.
ObReferenceObject(&owner->Header);
thread->Owner = owner;
@@ -716,7 +723,6 @@ void KeRundownThreadWait(THREAD* thread, KSTATUS status) {
routine(thread, context, status);
}
// Implements the commit Block Thread operation.
KSTATUS KeCommitBlockThread(THREAD* thread, uint8_t alertable) {
KeAssertIrql(PASSIVE_LEVEL);
if (!thread) return NTLSTATUS_INVALID_PARAMETER;
@@ -766,13 +772,11 @@ KSTATUS KeCommitBlockThread(THREAD* thread, uint8_t alertable) {
return thread->WaitStatus;
}
// Implements the block Thread operation.
KSTATUS KeBlockThread(THREAD* thread, OBJECT* waitObject, uint8_t alertable) {
KePrepareBlockThread(thread, waitObject, alertable);
return KeCommitBlockThread(thread, alertable);
}
// Implements the unblock Thread With Status operation.
void KeUnblockThreadWithStatus(THREAD* thread, KSTATUS status) {
if (!thread) return;
KiSchedulerWakeThread(thread, status);
@@ -864,12 +868,10 @@ bool KeAbortThreadWait(THREAD* thread, KSTATUS status) {
return true;
}
// Implements the unblock Thread operation.
void KeUnblockThread(THREAD* thread) {
KeUnblockThreadWithStatus(thread, NTLSTATUS_SUCCESS);
}
// Implements the alert Thread With Status operation.
static KSTATUS KiAlertThreadWithStatus(THREAD* thread, KSTATUS status) {
if (!thread) return NTLSTATUS_INVALID_PARAMETER;
@@ -881,17 +883,14 @@ static KSTATUS KiAlertThreadWithStatus(THREAD* thread, KSTATUS status) {
: NTLSTATUS_PENDING;
}
// Implements the alert Thread operation.
KSTATUS KeAlertThread(THREAD* thread) {
return KiAlertThreadWithStatus(thread, NTLSTATUS_ALERTED);
}
// Implements the wake Thread For Kernel Apc operation.
void KiWakeThreadForKernelApc(THREAD* thread) {
(void)KiAlertThreadWithStatus(thread, NTLSTATUS_KERNEL_APC);
}
// Implements the wake Thread For User Apc operation.
void KiWakeThreadForUserApc(THREAD* thread) {
(void)KiAlertThreadWithStatus(thread, NTLSTATUS_USER_APC);
}