Apply consistent coding style
This commit is contained in:
@@ -28,7 +28,7 @@ KE::KernelInit::InitializeKernel(VOID)
|
||||
{
|
||||
/* Hardware layer initialization failed, kernel panic */
|
||||
DebugPrint(L"Failed to initialize hardware layer subsystem!\n");
|
||||
Crash::Panic(0);
|
||||
KE::Crash::Panic(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ KE::KernelInit::StartKernel(VOID)
|
||||
PKTHREAD CurrentThread;
|
||||
|
||||
/* Get processor control block and current thread */
|
||||
Prcb = Processor::GetCurrentProcessorControlBlock();
|
||||
CurrentThread = Processor::GetCurrentThread();
|
||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||
CurrentThread = KE::Processor::GetCurrentThread();
|
||||
|
||||
/* Get current process */
|
||||
CurrentProcess = CurrentThread->ApcState.Process;
|
||||
@@ -84,14 +84,14 @@ KE::KernelInit::StartKernel(VOID)
|
||||
PO::Idle::InitializeProcessorIdleState(Prcb);
|
||||
|
||||
/* Save processor state */
|
||||
Processor::SaveProcessorState(&Prcb->ProcessorState);
|
||||
KE::Processor::SaveProcessorState(&Prcb->ProcessorState);
|
||||
|
||||
/* Initialize spin locks */
|
||||
SpinLock::InitializeAllLocks();
|
||||
SpinLock::InitializeLockQueues();
|
||||
KE::SpinLock::InitializeAllLocks();
|
||||
KE::SpinLock::InitializeLockQueues();
|
||||
|
||||
/* Lower to APC runlevel */
|
||||
RunLevel::LowerRunLevel(APC_LEVEL);
|
||||
KE::RunLevel::LowerRunLevel(APC_LEVEL);
|
||||
|
||||
/* Initialize XTOS kernel */
|
||||
InitializeKernel();
|
||||
@@ -99,12 +99,12 @@ KE::KernelInit::StartKernel(VOID)
|
||||
/* Initialize Idle process */
|
||||
PageDirectory[0] = 0;
|
||||
PageDirectory[1] = 0;
|
||||
KProcess::InitializeProcess(CurrentProcess, 0, MAXULONG_PTR, PageDirectory, FALSE);
|
||||
KE::KProcess::InitializeProcess(CurrentProcess, 0, MAXULONG_PTR, PageDirectory, FALSE);
|
||||
CurrentProcess->Quantum = MAXCHAR;
|
||||
|
||||
/* Initialize Idle thread */
|
||||
KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
||||
NULLPTR, NULLPTR, AR::ProcSup::GetBootStack(), TRUE);
|
||||
KE::KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
||||
NULLPTR, NULLPTR, AR::ProcSup::GetBootStack(), TRUE);
|
||||
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
||||
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
||||
CurrentThread->State = Running;
|
||||
@@ -117,7 +117,7 @@ KE::KernelInit::StartKernel(VOID)
|
||||
|
||||
/* Enter infinite loop */
|
||||
DebugPrint(L"KernelInit::StartKernel() finished. Entering infinite loop.\n");
|
||||
Crash::HaltSystem();
|
||||
KE::Crash::HaltSystem();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,7 +138,7 @@ KE::KernelInit::SwitchBootStack(VOID)
|
||||
Stack = ((ULONG_PTR)AR::ProcSup::GetBootStack() + KERNEL_STACK_SIZE) & ~(STACK_ALIGNMENT - 1);
|
||||
|
||||
/* Get address of KernelInit::StartKernel() */
|
||||
StartKernel = (PVOID)KernelInit::StartKernel;
|
||||
StartKernel = (PVOID)KE::KernelInit::StartKernel;
|
||||
|
||||
/* Discard old stack frame, switch stack and jump to KernelInit::StartKernel() */
|
||||
__asm__ volatile("mov %0, %%rdx\n"
|
||||
|
||||
@@ -28,7 +28,7 @@ KE::KernelInit::InitializeKernel(VOID)
|
||||
{
|
||||
/* Hardware layer initialization failed, kernel panic */
|
||||
DebugPrint(L"Failed to initialize hardware layer subsystem!\n");
|
||||
Crash::Panic(0);
|
||||
KE::Crash::Panic(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ KE::KernelInit::StartKernel(VOID)
|
||||
PKTHREAD CurrentThread;
|
||||
|
||||
/* Get processor control block and current thread */
|
||||
Prcb = Processor::GetCurrentProcessorControlBlock();
|
||||
CurrentThread = Processor::GetCurrentThread();
|
||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||
CurrentThread = KE::Processor::GetCurrentThread();
|
||||
|
||||
/* Get current process */
|
||||
CurrentProcess = CurrentThread->ApcState.Process;
|
||||
@@ -84,14 +84,14 @@ KE::KernelInit::StartKernel(VOID)
|
||||
PO::Idle::InitializeProcessorIdleState(Prcb);
|
||||
|
||||
/* Save processor state */
|
||||
Processor::SaveProcessorState(&Prcb->ProcessorState);
|
||||
KE::Processor::SaveProcessorState(&Prcb->ProcessorState);
|
||||
|
||||
/* Initialize spin locks */
|
||||
SpinLock::InitializeAllLocks();
|
||||
SpinLock::InitializeLockQueues();
|
||||
KE::SpinLock::InitializeAllLocks();
|
||||
KE::SpinLock::InitializeLockQueues();
|
||||
|
||||
/* Lower to APC runlevel */
|
||||
RunLevel::LowerRunLevel(APC_LEVEL);
|
||||
KE::RunLevel::LowerRunLevel(APC_LEVEL);
|
||||
|
||||
/* Initialize XTOS kernel */
|
||||
InitializeKernel();
|
||||
@@ -99,12 +99,12 @@ KE::KernelInit::StartKernel(VOID)
|
||||
/* Initialize Idle process */
|
||||
PageDirectory[0] = 0;
|
||||
PageDirectory[1] = 0;
|
||||
KProcess::InitializeProcess(CurrentProcess, 0, MAXULONG_PTR, PageDirectory, FALSE);
|
||||
KE::KProcess::InitializeProcess(CurrentProcess, 0, MAXULONG_PTR, PageDirectory, FALSE);
|
||||
CurrentProcess->Quantum = MAXCHAR;
|
||||
|
||||
/* Initialize Idle thread */
|
||||
KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
||||
NULLPTR, NULLPTR, AR::ProcSup::GetBootStack(), TRUE);
|
||||
KE::KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
||||
NULLPTR, NULLPTR, AR::ProcSup::GetBootStack(), TRUE);
|
||||
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
||||
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
||||
CurrentThread->State = Running;
|
||||
@@ -117,7 +117,7 @@ KE::KernelInit::StartKernel(VOID)
|
||||
|
||||
/* Enter infinite loop */
|
||||
DebugPrint(L"KernelInit::StartKernel() finished. Entering infinite loop.\n");
|
||||
Crash::HaltSystem();
|
||||
KE::Crash::HaltSystem();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,7 +138,7 @@ KE::KernelInit::SwitchBootStack(VOID)
|
||||
Stack = ((ULONG_PTR)AR::ProcSup::GetBootStack() + KERNEL_STACK_SIZE) & ~(STACK_ALIGNMENT - 1);
|
||||
|
||||
/* Get address of KernelInit::StartKernel() */
|
||||
StartKernel = (PVOID)KernelInit::StartKernel;
|
||||
StartKernel = (PVOID)KE::KernelInit::StartKernel;
|
||||
|
||||
/* Discard old stack frame, switch stack, make space for NPX and jump to KernelInit::StartKernel() */
|
||||
__asm__ volatile("mov %0, %%edx\n"
|
||||
|
||||
@@ -32,17 +32,17 @@ KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters)
|
||||
Parameters->ProtocolVersion != BOOT_PROTOCOL_VERSION)
|
||||
{
|
||||
/* Kernel and boot loader version mismatch */
|
||||
Crash::HaltSystem();
|
||||
KE::Crash::HaltSystem();
|
||||
}
|
||||
|
||||
/* Save the kernel initialization block */
|
||||
BootInformation::InitializeInitializationBlock(Parameters);
|
||||
KE::BootInformation::InitializeInitializationBlock(Parameters);
|
||||
|
||||
/* Check if debugging enabled and if boot loader provided routine for debug printing */
|
||||
if(DEBUG && BootInformation::GetDebugPrint())
|
||||
if(DEBUG && KE::BootInformation::GetDebugPrint())
|
||||
{
|
||||
/* Use loader's provided DbgPrint() routine for early printing to serial console */
|
||||
KD::DebugIo::SetPrintRoutine(BootInformation::GetDebugPrint());
|
||||
KD::DebugIo::SetPrintRoutine(KE::BootInformation::GetDebugPrint());
|
||||
DebugPrint(L"Initializing ExectOS v%d.%d for %s\n", XTOS_VERSION_MAJOR, XTOS_VERSION_MINOR, _ARCH_NAME);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters)
|
||||
AR::Traps::SetUnhandledInterruptRoutine(HL::Irq::HandleUnexpectedInterrupt);
|
||||
|
||||
/* Initialize system resources */
|
||||
SystemResources::InitializeResources();
|
||||
KE::SystemResources::InitializeResources();
|
||||
|
||||
/* Check if debugging enabled */
|
||||
if(DEBUG)
|
||||
@@ -67,11 +67,11 @@ KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters)
|
||||
XTOS_COMPILER_NAME, XTOS_COMPILER_VERSION);
|
||||
|
||||
/* Architecture specific kernel initialization */
|
||||
KernelInit::InitializeMachine();
|
||||
KE::KernelInit::InitializeMachine();
|
||||
|
||||
/* Raise to HIGH runlevel */
|
||||
RunLevel::RaiseRunLevel(HIGH_LEVEL);
|
||||
KE::RunLevel::RaiseRunLevel(HIGH_LEVEL);
|
||||
|
||||
/* Switch the boot stack and transfer control to the KepStartKernel() routine */
|
||||
KernelInit::SwitchBootStack();
|
||||
KE::KernelInit::SwitchBootStack();
|
||||
}
|
||||
|
||||
@@ -92,10 +92,10 @@ KE::KThread::InitializeThread(IN PKPROCESS Process,
|
||||
Thread->Header.SignalState = 0;
|
||||
|
||||
/* Initialize thread wait list */
|
||||
RtlInitializeListHead(&Thread->Header.WaitListHead);
|
||||
RTL::LinkedList::InitializeListHead(&Thread->Header.WaitListHead);
|
||||
|
||||
/* Initialize thread mutant list head */
|
||||
RtlInitializeListHead(&Thread->MutantListHead);
|
||||
RTL::LinkedList::InitializeListHead(&Thread->MutantListHead);
|
||||
|
||||
/* Initialize the builtin wait blocks */
|
||||
for(Index = 0; Index <= KTHREAD_WAIT_BLOCK; Index++)
|
||||
@@ -113,7 +113,7 @@ KE::KThread::InitializeThread(IN PKPROCESS Process,
|
||||
Thread->AdjustReason = AdjustNone;
|
||||
|
||||
/* Initialize thread lock */
|
||||
SpinLock::InitializeSpinLock(&Thread->ThreadLock);
|
||||
KE::SpinLock::InitializeSpinLock(&Thread->ThreadLock);
|
||||
|
||||
/* Initialize thread APC */
|
||||
Thread->ApcStatePointer[0] = &Thread->ApcState;
|
||||
@@ -123,21 +123,21 @@ KE::KThread::InitializeThread(IN PKPROCESS Process,
|
||||
Thread->Process = Process;
|
||||
|
||||
/* Initialize APC list heads */
|
||||
RtlInitializeListHead(&Thread->ApcState.ApcListHead[KernelMode]);
|
||||
RtlInitializeListHead(&Thread->ApcState.ApcListHead[UserMode]);
|
||||
RTL::LinkedList::InitializeListHead(&Thread->ApcState.ApcListHead[KernelMode]);
|
||||
RTL::LinkedList::InitializeListHead(&Thread->ApcState.ApcListHead[UserMode]);
|
||||
|
||||
/* Initialize APC queue lock */
|
||||
SpinLock::InitializeSpinLock(&Thread->ApcQueueLock);
|
||||
KE::SpinLock::InitializeSpinLock(&Thread->ApcQueueLock);
|
||||
|
||||
/* Initialize kernel-mode suspend APC */
|
||||
Apc::InitializeApc(&Thread->SuspendApc, Thread, OriginalApcEnvironment, SuspendNop,
|
||||
SuspendRundown, SuspendThread, KernelMode, NULLPTR);
|
||||
KE::Apc::InitializeApc(&Thread->SuspendApc, Thread, OriginalApcEnvironment, SuspendNop,
|
||||
SuspendRundown, SuspendThread, KernelMode, NULLPTR);
|
||||
|
||||
/* Initialize suspend semaphore */
|
||||
Semaphore::InitializeSemaphore(&Thread->SuspendSemaphore, 0, 2);
|
||||
KE::Semaphore::InitializeSemaphore(&Thread->SuspendSemaphore, 0, 2);
|
||||
|
||||
/* Initialize the builtin timer */
|
||||
Timer::InitializeTimer(&Thread->Timer, NotificationTimer);
|
||||
KE::Timer::InitializeTimer(&Thread->Timer, NotificationTimer);
|
||||
TimerWaitBlock = &Thread->WaitBlock[KTIMER_WAIT_BLOCK];
|
||||
TimerWaitBlock->Object = &Thread->Timer;
|
||||
TimerWaitBlock->WaitKey = STATUS_TIMEOUT;
|
||||
|
||||
@@ -66,7 +66,7 @@ KE::SystemResources::GetSystemResource(IN SYSTEM_RESOURCE_TYPE ResourceType,
|
||||
|
||||
/* Disable interrupts and acquire a spinlock */
|
||||
AR::CpuFunc::ClearInterruptFlag();
|
||||
SpinLock::AcquireSpinLock(&ResourcesLock);
|
||||
KE::SpinLock::AcquireSpinLock(&ResourcesLock);
|
||||
|
||||
/* Iterate through system resources list */
|
||||
ListEntry = ResourcesListHead.Flink;
|
||||
@@ -110,7 +110,7 @@ KE::SystemResources::GetSystemResource(IN SYSTEM_RESOURCE_TYPE ResourceType,
|
||||
}
|
||||
|
||||
/* Release spinlock and re-enable interrupts if necessary */
|
||||
SpinLock::ReleaseSpinLock(&ResourcesLock);
|
||||
KE::SpinLock::ReleaseSpinLock(&ResourcesLock);
|
||||
if(Interrupts)
|
||||
{
|
||||
/* Re-enable interrupts */
|
||||
@@ -160,15 +160,15 @@ KE::SystemResources::InitializeResources(VOID)
|
||||
ULONG ResourceSize;
|
||||
|
||||
/* Initialize system resources spin lock and resource list */
|
||||
SpinLock::InitializeSpinLock(&ResourcesLock);
|
||||
KE::SpinLock::InitializeSpinLock(&ResourcesLock);
|
||||
RTL::LinkedList::InitializeListHead(&ResourcesListHead);
|
||||
|
||||
/* Make sure there are some system resources available */
|
||||
if(!RTL::LinkedList::ListEmpty(BootInformation::GetSystemResources()))
|
||||
if(!RTL::LinkedList::ListEmpty(KE::BootInformation::GetSystemResources()))
|
||||
{
|
||||
/* Iterate through system resources list */
|
||||
ListEntry = BootInformation::GetSystemResources()->Flink;
|
||||
while(ListEntry != BootInformation::GetSystemResources())
|
||||
ListEntry = KE::BootInformation::GetSystemResources()->Flink;
|
||||
while(ListEntry != KE::BootInformation::GetSystemResources())
|
||||
{
|
||||
/* Get resource header and next list entry */
|
||||
ResourceHeader = CONTAIN_RECORD(ListEntry, SYSTEM_RESOURCE_HEADER, ListEntry);
|
||||
@@ -221,12 +221,12 @@ KE::SystemResources::ReleaseResource(IN PSYSTEM_RESOURCE_HEADER ResourceHeader)
|
||||
{
|
||||
/* Disable interrupts and acquire a spinlock */
|
||||
AR::CpuFunc::ClearInterruptFlag();
|
||||
SpinLock::AcquireSpinLock(&ResourcesLock);
|
||||
KE::SpinLock::AcquireSpinLock(&ResourcesLock);
|
||||
|
||||
/* Release resource lock */
|
||||
ResourceHeader->ResourceLocked = FALSE;
|
||||
|
||||
/* Release spinlock and enable interrupts */
|
||||
SpinLock::ReleaseSpinLock(&ResourcesLock);
|
||||
KE::SpinLock::ReleaseSpinLock(&ResourcesLock);
|
||||
AR::CpuFunc::SetInterruptFlag();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ KE::Timer::CancelTimer(IN PKTIMER Timer)
|
||||
|
||||
/* Raise run level and acquire dispatcher lock */
|
||||
RunLevel = KE::RunLevel::RaiseRunLevel(SYNC_LEVEL);
|
||||
SpinLock::AcquireQueuedSpinLock(DispatcherLock);
|
||||
KE::SpinLock::AcquireQueuedSpinLock(DispatcherLock);
|
||||
|
||||
/* Check timer status */
|
||||
if(Timer->Header.Inserted)
|
||||
@@ -42,8 +42,8 @@ KE::Timer::CancelTimer(IN PKTIMER Timer)
|
||||
}
|
||||
|
||||
/* Release dispatcher lock and process the deferred ready list */
|
||||
SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
|
||||
KThread::ExitDispatcher(RunLevel);
|
||||
KE::SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
|
||||
KE::KThread::ExitDispatcher(RunLevel);
|
||||
|
||||
/* Return result */
|
||||
return Result;
|
||||
@@ -139,7 +139,7 @@ KE::Timer::QueryTimer(IN PKTIMER Timer)
|
||||
|
||||
/* Raise run level and acquire dispatcher lock */
|
||||
RunLevel = KE::RunLevel::RaiseRunLevel(SYNC_LEVEL);
|
||||
SpinLock::AcquireQueuedSpinLock(DispatcherLock);
|
||||
KE::SpinLock::AcquireQueuedSpinLock(DispatcherLock);
|
||||
|
||||
/* Check timer status */
|
||||
if(Timer->Header.Inserted)
|
||||
@@ -149,8 +149,8 @@ KE::Timer::QueryTimer(IN PKTIMER Timer)
|
||||
}
|
||||
|
||||
/* Release dispatcher lock and process the deferred ready list */
|
||||
SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
|
||||
KThread::ExitDispatcher(RunLevel);
|
||||
KE::SpinLock::ReleaseQueuedSpinLock(DispatcherLock);
|
||||
KE::KThread::ExitDispatcher(RunLevel);
|
||||
|
||||
/* Return timer's due time */
|
||||
return DueTime;
|
||||
|
||||
Reference in New Issue
Block a user