Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

initkr.c File Reference

#include "ki.h"

Go to the source code of this file.

Defines

#define NumBats   3
#define RoundDownTo8MB(x)   ((x) & ~(0x7fffff))
#define VirtBase   0xb0000000
#define EightMeg(x)   ((x) << 23)

Functions

VOID KiPhase0SyncIoMap (VOID)
VOID KiSetDbatInvalid (IN ULONG Number)
VOID KiSetDbat (IN ULONG Number, IN ULONG PhysicalAddress, IN ULONG VirtualAddress, IN ULONG Length, IN ULONG Coherence)
ULONG KiInitExceptionFilter (IN PEXCEPTION_POINTERS ExceptionPointers)
VOID KiInitializeKernel (IN PKPROCESS Process, IN PKTHREAD Thread, IN PVOID IdleStack, IN PKPRCB Prcb, IN CCHAR Number, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
PVOID KePhase0MapIo (IN PVOID PhysicalAddress, IN ULONG Length)
VOID KePhase0DeleteIoMap (IN PVOID PhysicalAddress, IN ULONG Length)

Variables

struct {
   ULONG   PhysBase
   ULONG   RefCount
AllocatedBats [NumBats]


Define Documentation

#define EightMeg  )     ((x) << 23)
 

Definition at line 557 of file ppc/initkr.c.

Referenced by KePhase0MapIo(), and KiPhase0SyncIoMap().

#define NumBats   3
 

Definition at line 554 of file ppc/initkr.c.

Referenced by KePhase0DeleteIoMap(), KePhase0MapIo(), and KiPhase0SyncIoMap().

#define RoundDownTo8MB  )     ((x) & ~(0x7fffff))
 

Definition at line 555 of file ppc/initkr.c.

Referenced by KePhase0DeleteIoMap(), and KePhase0MapIo().

#define VirtBase   0xb0000000
 

Definition at line 556 of file ppc/initkr.c.

Referenced by KePhase0MapIo(), and KiPhase0SyncIoMap().


Function Documentation

VOID KePhase0DeleteIoMap IN PVOID  PhysicalAddress,
IN ULONG  Length
 

Definition at line 653 of file ppc/initkr.c.

References AllocatedBats, KeBugCheck(), KiSetDbatInvalid(), NumBats, and RoundDownTo8MB.

00660 : 00661 00662 Removes a Virtual to Physical address translation that was 00663 established with KePhase0MapIo. 00664 00665 Arguments: 00666 00667 PhysicalAddress - Address to which the HAL needs access. 00668 00669 Length - Number of bytes. (Ignored) 00670 00671 Return Value: 00672 00673 None. 00674 00675 --*/ 00676 00677 { 00678 ULONG Base; 00679 LONG i; 00680 00681 Base = RoundDownTo8MB((ULONG)PhysicalAddress); 00682 00683 for ( i = 0 ; i < NumBats ; i++ ) { 00684 if ( AllocatedBats[i].RefCount ) { 00685 if ( Base == AllocatedBats[i].PhysBase ) { 00686 // We have a match, detach from this bat 00687 if ( --AllocatedBats[i].RefCount == 0 ) { 00688 KiSetDbatInvalid(i+1); 00689 } 00690 return; 00691 } 00692 } 00693 } 00694 00695 // if we get here we were called to detach from memory 00696 // we don't have. This is insane. 00697 00698 KeBugCheck(MEMORY_MANAGEMENT); 00699 }

PVOID KePhase0MapIo IN PVOID  PhysicalAddress,
IN ULONG  Length
 

Definition at line 566 of file ppc/initkr.c.

References AllocatedBats, EightMeg, KiSetDbat(), NumBats, Offset, RoundDownTo8MB, and VirtBase.

00573 : 00574 00575 Assign a Virtual to Physical address translation using PowerPC 00576 Block Address Translation registers for use by the HAL prior to 00577 being able to achieve the same thing using MmMapIo. 00578 00579 Up to three BATs can be used for this function. This routine is 00580 extremely simplistic. It will attempt to assign the required 00581 address range within an existing BAT register if possible. In 00582 deference to the 601, the maximum range covered by a BAT is 00583 limited to 8MB. On processors that support seperate Instruction 00584 and Data BATs, only the Data BAT will be set. Caching in the 00585 region is disabled. 00586 00587 In the first pass at this, a full 8MB will be allocated. 00588 00589 The HAL should call KePhase0DeleteIoMap with the same parameters 00590 to release the BAT when it is able to aquire the same physical 00591 memory using MM. 00592 00593 WARNING: This code is NOT applicable for an MP solution. Further 00594 study of this problem is required, specifically, a way of ensuring 00595 a change to BATs on one processor is reflected on other processors. 00596 00597 00598 Arguments: 00599 00600 PhysicalAddress - Address to which the HAL needs access. 00601 00602 Length - Number of bytes. 00603 00604 Return Value: 00605 00606 Virtual address corresponding to the requested physical address or 0 00607 if unable to allocate. 00608 00609 --*/ 00610 00611 { 00612 ULONG Base, Offset; 00613 LONG i, FreeBat = -1; 00614 00615 // The maximum allocation we allow is 8MB starting at an 8MB 00616 // boundary. 00617 00618 Base = RoundDownTo8MB((ULONG)PhysicalAddress); 00619 Offset = (ULONG)PhysicalAddress - Base; 00620 00621 // Chack length is acceptable 00622 00623 if ( (Offset + Length) > 0x800000 ) { 00624 return (PVOID)0; 00625 } 00626 00627 for ( i = 0 ; i < NumBats ; i++ ) { 00628 if ( AllocatedBats[i].RefCount ) { 00629 if ( Base == AllocatedBats[i].PhysBase ) { 00630 // We have a match, reuse this bat 00631 AllocatedBats[i].RefCount++; 00632 return (PVOID)(VirtBase + EightMeg(i) + Offset); 00633 } 00634 } else { 00635 // This index is not allocated, remember. 00636 FreeBat = i; 00637 } 00638 } 00639 00640 // No match, we need to allocate another bat (if one is available). 00641 00642 if ( FreeBat == -1 ) { 00643 return (PVOID)0; 00644 } 00645 00646 AllocatedBats[FreeBat].PhysBase = Base; 00647 AllocatedBats[FreeBat].RefCount = 1; 00648 KiSetDbat(FreeBat + 1, Base, VirtBase + EightMeg(FreeBat), 0x800000, 6); 00649 return (PVOID)(VirtBase + EightMeg(FreeBat) + Offset); 00650 }

ULONG KiInitExceptionFilter IN PEXCEPTION_POINTERS  ExceptionPointers  ) 
 

Definition at line 62 of file ppc/initkr.c.

References DbgPrint, and EXCEPTION_EXECUTE_HANDLER.

Referenced by KiInitializeKernel().

00065 { 00066 #if DBG 00067 DbgPrint("KE: Phase0 Exception Pointers = %x\n",ExceptionPointers); 00068 DbgPrint("Code %x Addr %lx Info0 %x Info1 %x Info2 %x Info3 %x\n", 00069 ExceptionPointers->ExceptionRecord->ExceptionCode, 00070 (ULONG)ExceptionPointers->ExceptionRecord->ExceptionAddress, 00071 ExceptionPointers->ExceptionRecord->ExceptionInformation[0], 00072 ExceptionPointers->ExceptionRecord->ExceptionInformation[1], 00073 ExceptionPointers->ExceptionRecord->ExceptionInformation[2], 00074 ExceptionPointers->ExceptionRecord->ExceptionInformation[3] 00075 ); 00076 DbgBreakPoint(); 00077 #endif 00078 return EXCEPTION_EXECUTE_HANDLER; 00079 }

VOID KiInitializeKernel IN PKPROCESS  Process,
IN PKTHREAD  Thread,
IN PVOID  IdleStack,
IN PKPRCB  Prcb,
IN CCHAR  Number,
IN PLOADER_PARAMETER_BLOCK  LoaderBlock
 

Definition at line 82 of file ppc/initkr.c.

References APC_LEVEL, _BOOT_STATUS::BootFinished, _RESTART_BLOCK::BootStatus, CcMasterSpinLock, CcVacbSpinLock, DBG_STATUS_CONTROL_C, DbgPrint, DISPATCH_LEVEL, DMA_READ_DCACHE_INVALIDATE, DMA_WRITE_DCACHE_SNOOP, EXCEPTION_EXECUTE_HANDLER, ExpInitializeExecutive(), FALSE, HalInitializeProcessor(), HIGH_LEVEL, Index, KdInitSystem(), KdPollBreakIn(), KeActiveProcessors, KeBugCheck(), KeBugCheckEx(), KeFeatureBits, KeFlushCurrentTb(), KeInitializeDpc(), KeInitializeProcess(), KeInitializeSpinLock(), KeInitializeThread(), KeLoaderBlock, KeMaximumIncrement, KeNumberProcessors, KeProcessorArchitecture, KeProcessorLevel, KeProcessorRevision, KeRaiseIrql(), KeSetPriorityThread(), KiAdjustDpcThreshold, KiApcInterrupt(), KiComputeReciprocal(), KiContextSwapLock, KiDisableAlignmentExceptions, KiDispatcherLock, KiDispatchInterrupt(), KiDmaIoCoherency, KiGetFeatureBits(), KiIdleSummary, KiInitExceptionFilter(), KiInitSystem(), KiMaximumDpcQueueDepth, KiMinimumDpcRate, KiPassiveRelease(), KiPhase0SyncIoMap(), KiProcessorBlock, KiQuantumEnd, KiTimeIncrementReciprocal, KiTimeIncrementShiftCount, KiUnexpectedInterrupt(), LockQueueContextSwapLock, LockQueueDispatcherLock, LockQueueMasterLock, LockQueuePfnLock, LockQueueSystemSpaceLock, LockQueueVacbLock, MAXIMUM_PROCESSORS, MmPfnLock, MmSystemSpaceLock, NIL, NULL, PAGE_SHIFT, PAGE_SIZE, PASSIVE_LEVEL, PDI_SHIFT, PKDEFERRED_ROUTINE, PKSTART_ROUTINE, PKSYSTEM_ROUTINE, PoInitializePrcb(), PRCB_MAJOR_VERSION, PRCB_MINOR_VERSION, Running, SetMember, TRUE, and USHORT.

00093 : 00094 00095 This function gains control after the system has been bootstrapped and 00096 before the system has been initialized. Its function is to initialize 00097 the kernel data structures, initialize the idle thread and process objects, 00098 initialize the processor control block, call the executive initialization 00099 routine, and then return to the system startup routine. This routine is 00100 also called to initialize the processor specific structures when a new 00101 processor is brought on line. 00102 00103 Arguments: 00104 00105 Process - Supplies a pointer to a control object of type process for 00106 the specified processor. 00107 00108 Thread - Supplies a pointer to a dispatcher object of type thread for 00109 the specified processor. 00110 00111 IdleStack - Supplies a pointer the base of the real kernel stack for 00112 idle thread on the specified processor. 00113 00114 Prcb - Supplies a pointer to a processor control block for the specified 00115 processor. 00116 00117 Number - Supplies the number of the processor that is being 00118 initialized. 00119 00120 LoaderBlock - Supplies a pointer to the loader parameter block. 00121 00122 Return Value: 00123 00124 None. 00125 00126 --*/ 00127 00128 { 00129 00130 LONG Index; 00131 KIRQL OldIrql; 00132 PRESTART_BLOCK RestartBlock; 00133 KPCR *Pcr; 00134 00135 // 00136 // Before the hashed page table is set up, the PCR must be referred 00137 // to by its SPRG.1 address, not by its 0xffffd000 address. 00138 // 00139 00140 Pcr = (PKPCR)PCRsprg1; 00141 00142 #if !defined(NT_UP) 00143 00144 if (Number != 0) { 00145 KiPhase0SyncIoMap(); 00146 } 00147 00148 #endif 00149 00150 // 00151 // Set processor version and revision in PCR 00152 // 00153 00154 Pcr->ProcessorRevision = KeGetPvr() & 0xFFFF; 00155 Pcr->ProcessorVersion = (KeGetPvr() >> 16); 00156 00157 // 00158 // Set global processor architecture, level and revision. The 00159 // latter two are the least common denominator on an MP system. 00160 // 00161 00162 KeProcessorArchitecture = PROCESSOR_ARCHITECTURE_PPC; 00163 KeFeatureBits = 0; 00164 if (KeProcessorLevel == 0 || 00165 KeProcessorLevel > (USHORT)Pcr->ProcessorVersion 00166 ) { 00167 KeProcessorLevel = (USHORT)Pcr->ProcessorVersion; 00168 } 00169 if (KeProcessorRevision == 0 || 00170 KeProcessorRevision > (USHORT)Pcr->ProcessorRevision 00171 ) { 00172 KeProcessorRevision = (USHORT)Pcr->ProcessorRevision; 00173 } 00174 00175 // 00176 // Perform platform dependent processor initialization. 00177 // 00178 00179 HalInitializeProcessor(Number); 00180 HalSweepIcache(); 00181 00182 // 00183 // Save the address of the loader parameter block. 00184 // 00185 00186 KeLoaderBlock = LoaderBlock; 00187 00188 // 00189 // Initialize the processor block. 00190 // 00191 00192 Prcb->MinorVersion = PRCB_MINOR_VERSION; 00193 Prcb->MajorVersion = PRCB_MAJOR_VERSION; 00194 Prcb->BuildType = 0; 00195 00196 #if DBG 00197 00198 Prcb->BuildType |= PRCB_BUILD_DEBUG; 00199 00200 #endif 00201 00202 #if defined(NT_UP) 00203 00204 Prcb->BuildType |= PRCB_BUILD_UNIPROCESSOR; 00205 00206 #endif 00207 00208 Prcb->CurrentThread = Thread; 00209 Prcb->NextThread = (PKTHREAD)NULL; 00210 Prcb->IdleThread = Thread; 00211 Prcb->SetMember = 1 << Number; 00212 Prcb->PcrPage = LoaderBlock->u.Ppc.PcrPage; 00213 Prcb->ProcessorState.SpecialRegisters.Sprg0 = 00214 LoaderBlock->u.Ppc.PcrPage << PAGE_SHIFT; 00215 Prcb->ProcessorState.SpecialRegisters.Sprg1 = (ULONG)Pcr; 00216 00217 #if !defined(NT_UP) 00218 00219 Prcb->TargetSet = 0; 00220 Prcb->WorkerRoutine = NULL; 00221 Prcb->RequestSummary = 0; 00222 Prcb->IpiFrozen = 0; 00223 00224 #if NT_INST 00225 00226 Prcb->IpiCounts = &KiIpiCounts[Number]; 00227 00228 #endif 00229 00230 #endif 00231 00232 Prcb->MaximumDpcQueueDepth = KiMaximumDpcQueueDepth; 00233 Prcb->MinimumDpcRate = KiMinimumDpcRate; 00234 Prcb->AdjustDpcThreshold = KiAdjustDpcThreshold; 00235 00236 // 00237 // Initialize DPC listhead and lock. 00238 // 00239 00240 InitializeListHead(&Prcb->DpcListHead); 00241 KeInitializeSpinLock(&Prcb->DpcLock); 00242 00243 // 00244 // Set address of processor block. 00245 // 00246 00247 KiProcessorBlock[Number] = Prcb; 00248 00249 // 00250 // Initialize the idle thread initial kernel stack value. 00251 // 00252 00253 Pcr->InitialStack = IdleStack; 00254 Pcr->StackLimit = (PVOID)((ULONG)IdleStack - KERNEL_STACK_SIZE); 00255 00256 // 00257 // Initialize all interrupt vectors to transfer control to the unexpected 00258 // interrupt routine. 00259 // 00260 // N.B. This interrupt object is never actually "connected" to an interrupt 00261 // vector via KeConnectInterrupt. It is initialized and then connected 00262 // by simply storing the address of the dispatch code in the interrupt 00263 // vector. 00264 // 00265 00266 if (Number == 0) { 00267 00268 // 00269 // Initial the address of the interrupt dispatch routine. 00270 // 00271 00272 KxUnexpectedInterrupt.DispatchAddress = KiUnexpectedInterrupt; 00273 00274 // 00275 // Copy the interrupt dispatch function descriptor into the interrupt 00276 // object. 00277 // 00278 00279 KxUnexpectedInterrupt.DispatchCode[0] = 00280 *(PULONG)(KxUnexpectedInterrupt.DispatchAddress); 00281 KxUnexpectedInterrupt.DispatchCode[1] = 00282 *(((PULONG)(KxUnexpectedInterrupt.DispatchAddress))+1); 00283 00284 // 00285 // Initialize the context swap spinlock. 00286 // 00287 00288 KeInitializeSpinLock(&KiContextSwapLock); 00289 00290 // 00291 // Set the default DMA I/O coherency attributes. PowerPC 00292 // architecture dictates that the D-Cache is fully coherent 00293 // but the I-Cache doesn't snoop. 00294 // 00295 00296 KiDmaIoCoherency = DMA_READ_DCACHE_INVALIDATE | DMA_WRITE_DCACHE_SNOOP; 00297 } 00298 00299 for (Index = 0; Index < MAXIMUM_VECTOR; Index += 1) { 00300 Pcr->InterruptRoutine[Index] = 00301 (PKINTERRUPT_ROUTINE)(&KxUnexpectedInterrupt.DispatchCode); 00302 } 00303 00304 // 00305 // Initialize the profile count and interval. 00306 // 00307 00308 Pcr->ProfileCount = 0; 00309 Pcr->ProfileInterval = 0x200000; 00310 00311 // 00312 // Initialize the passive release, APC, and DPC interrupt vectors. 00313 // 00314 00315 Pcr->InterruptRoutine[0] = KiUnexpectedInterrupt; 00316 // Pcr->InterruptRoutine[APC_LEVEL] = KiApcInterrupt; 00317 // Pcr->InterruptRoutine[DISPATCH_LEVEL] = KiDispatchInterrupt; 00318 00319 // on PowerPC APC and Dispatch Level interrupts are handled explicitly 00320 // so handle calls thru the dispatch table as no-ops. 00321 00322 Pcr->InterruptRoutine[APC_LEVEL] = KiUnexpectedInterrupt; 00323 Pcr->InterruptRoutine[DISPATCH_LEVEL] = KiUnexpectedInterrupt; 00324 00325 Pcr->ReservedVectors = (1 << PASSIVE_LEVEL) | 00326 (1 << APC_LEVEL) | 00327 (1 << DISPATCH_LEVEL); 00328 00329 // 00330 // Initialize the set member for the current processor, set IRQL to 00331 // APC_LEVEL, and set the processor number. 00332 // 00333 00334 Pcr->CurrentIrql = APC_LEVEL; 00335 Pcr->SetMember = 1 << Number; 00336 Pcr->NotMember = ~Pcr->SetMember; 00337 Pcr->Number = Number; 00338 00339 // 00340 // Set the initial stall execution scale factor. This value will be 00341 // recomputed later by the HAL. 00342 // 00343 00344 Pcr->StallScaleFactor = 50; 00345 00346 // 00347 // Set address of process object in thread object. 00348 // 00349 00350 Thread->ApcState.Process = Process; 00351 00352 // 00353 // Set the appropriate member in the active processors set. 00354 // 00355 00356 SetMember(Number, KeActiveProcessors); 00357 00358 // 00359 // Set the number of processors based on the maximum of the current 00360 // number of processors and the current processor number. 00361 // 00362 00363 if ((Number + 1) > KeNumberProcessors) { 00364 KeNumberProcessors = Number + 1; 00365 } 00366 00367 // 00368 // If the initial processor is being initialized, then initialize the 00369 // per system data structures. 00370 // 00371 00372 if (Number == 0) { 00373 00374 // 00375 // Initialize the kernel debugger. 00376 // 00377 00378 if (KdInitSystem(LoaderBlock, FALSE) == FALSE) { 00379 KeBugCheck(PHASE0_INITIALIZATION_FAILED); 00380 } 00381 00382 // 00383 // Sweep both the D and the I caches. 00384 // 00385 00386 HalSweepDcache(); 00387 HalSweepIcache(); 00388 00389 // 00390 // Ensure there are NO stale entries in the TLB by 00391 // flushing the HPT/TLB even though the HPT is fresh. 00392 // 00393 00394 KeFlushCurrentTb(); 00395 00396 #if DBG 00397 if ((PCR->IcacheMode) || (PCR->DcacheMode)) 00398 { 00399 DbgPrint("****** Dynamic Cache Mode Kernel Invocation\n"); 00400 if (PCR->IcacheMode) 00401 DbgPrint("****** Icache is OFF\n"); 00402 if (PCR->DcacheMode) 00403 DbgPrint("****** Dcache is OFF\n"); 00404 } 00405 #endif 00406 00407 // 00408 // Initialize the address of the restart block for the boot master. 00409 // 00410 00411 Prcb->RestartBlock = SYSTEM_BLOCK->RestartBlock; 00412 00413 // 00414 // Initialize processor block array. 00415 // 00416 00417 for (Index = 1; Index < MAXIMUM_PROCESSORS; Index += 1) { 00418 KiProcessorBlock[Index] = (PKPRCB)NULL; 00419 } 00420 00421 // 00422 // Perform architecture independent initialization. 00423 // 00424 00425 KiInitSystem(); 00426 00427 // 00428 // Initialize idle thread process object and then set: 00429 // 00430 // 1. all the quantum values to the maximum possible. 00431 // 2. the process in the balance set. 00432 // 3. the active processor mask to the specified processor. 00433 // 00434 00435 KeInitializeProcess(Process, 00436 (KPRIORITY)0, 00437 (KAFFINITY)(0xffffffff), 00438 (PULONG)(PDE_BASE + ((PDE_BASE >> PDI_SHIFT - 2) & 0xffc)), 00439 FALSE); 00440 00441 Process->ThreadQuantum = MAXCHAR; 00442 00443 } 00444 00445 // 00446 // Initialize idle thread object and then set: 00447 // 00448 // 1. the initial kernel stack to the specified idle stack. 00449 // 2. the next processor number to the specified processor. 00450 // 3. the thread priority to the highest possible value. 00451 // 4. the state of the thread to running. 00452 // 5. the thread affinity to the specified processor. 00453 // 6. the specified processor member in the process active processors 00454 // set. 00455 // 00456 00457 KeInitializeThread(Thread, (PVOID)((ULONG)IdleStack - PAGE_SIZE), 00458 (PKSYSTEM_ROUTINE)KeBugCheck, 00459 (PKSTART_ROUTINE)NULL, 00460 (PVOID)NULL, (PCONTEXT)NULL, (PVOID)NULL, Process); 00461 00462 Thread->InitialStack = IdleStack; 00463 Thread->StackBase = IdleStack; 00464 Thread->StackLimit = (PVOID)((ULONG)IdleStack - KERNEL_STACK_SIZE); 00465 Thread->NextProcessor = Number; 00466 Thread->Priority = HIGH_PRIORITY; 00467 Thread->State = Running; 00468 Thread->Affinity = (KAFFINITY)(1 << Number); 00469 Thread->WaitIrql = DISPATCH_LEVEL; 00470 00471 // 00472 // If the current processor is 0, then set the appropriate bit in the 00473 // active summary of the idle process. 00474 // 00475 00476 if (Number == 0) { 00477 SetMember(Number, Process->ActiveProcessors); 00478 } 00479 00480 // 00481 // Execute the executive initialization. 00482 // 00483 00484 try { 00485 ExpInitializeExecutive(Number, LoaderBlock); 00486 00487 } except (KiInitExceptionFilter(GetExceptionInformation())) { 00488 KeBugCheck (PHASE0_EXCEPTION); 00489 } 00490 00491 // 00492 // If the initial processor is being initialized, then compute the 00493 // timer table reciprocal value and reset the PRCB values for the 00494 // controllable DPC behavior in order to reflect any registry 00495 // overrides. 00496 // 00497 00498 if (Number == 0) { 00499 KiTimeIncrementReciprocal = KiComputeReciprocal((LONG)KeMaximumIncrement, 00500 &KiTimeIncrementShiftCount); 00501 Prcb->MaximumDpcQueueDepth = KiMaximumDpcQueueDepth; 00502 Prcb->MinimumDpcRate = KiMinimumDpcRate; 00503 Prcb->AdjustDpcThreshold = KiAdjustDpcThreshold; 00504 } 00505 00506 // 00507 // Raise IRQL to dispatch level and set the priority of the idle thread 00508 // to zero. This will have the effect of immediately causing the phase 00509 // one initialization thread to get scheduled for execution. The idle 00510 // thread priority is then set to the lowest realtime priority. This is 00511 // necessary so that mutexes aquired at DPC level do not cause the active 00512 // matrix to get corrupted. 00513 // 00514 00515 KeRaiseIrqlToDpcLevel(&OldIrql); 00516 KeSetPriorityThread(Thread, (KPRIORITY)0); 00517 Thread->Priority = LOW_REALTIME_PRIORITY; 00518 00519 // 00520 // Raise IRQL to the highest level. 00521 // 00522 00523 KeRaiseIrql(HIGH_LEVEL, &OldIrql); 00524 00525 // 00526 // If a restart block exists for the current process, then set boot 00527 // completed. 00528 // 00529 // N.B. Firmware on uniprocessor machines configured for MP operation 00530 // can have a restart block address of NULL. 00531 // 00532 00533 #if !defined(NT_UP) 00534 00535 RestartBlock = Prcb->RestartBlock; 00536 if (RestartBlock != NULL) { 00537 RestartBlock->BootStatus.BootFinished = 1; 00538 } 00539 00540 // 00541 // If the current processor is not 0, then set the appropriate bit in 00542 // idle summary. 00543 // 00544 00545 if (Number != 0) { 00546 SetMember(Number, KiIdleSummary); 00547 } 00548 00549 #endif 00550 00551 return; 00552 }

VOID KiPhase0SyncIoMap VOID   ) 
 

Definition at line 705 of file ppc/initkr.c.

References AllocatedBats, EightMeg, KiSetDbat(), NumBats, PhysBase, and VirtBase.

Referenced by KiInitializeKernel().

00711 : 00712 00713 This routine runs on all processors other than zero to 00714 ensure that all processors have the same Block Address 00715 Translations (BATs) established during phase 0. 00716 00717 Arguments: 00718 00719 None. 00720 00721 Return Value: 00722 00723 None. 00724 00725 --*/ 00726 00727 { 00728 LONG i; 00729 00730 for ( i = 0 ; i < NumBats ; i++ ) { 00731 if ( AllocatedBats[i].RefCount ) { 00732 KiSetDbat(i + 1, 00733 AllocatedBats[i].PhysBase, 00734 VirtBase + EightMeg(i), 00735 0x800000, 00736 6); 00737 } 00738 } 00739 }

VOID KiSetDbat IN ULONG  Number,
IN ULONG  PhysicalAddress,
IN ULONG  VirtualAddress,
IN ULONG  Length,
IN ULONG  Coherence
 

Referenced by KePhase0MapIo(), and KiPhase0SyncIoMap().

VOID KiSetDbatInvalid IN ULONG  Number  ) 
 

Referenced by KePhase0DeleteIoMap().


Variable Documentation

struct { ... } AllocatedBats[NumBats] [static]
 

Referenced by KePhase0DeleteIoMap(), KePhase0MapIo(), and KiPhase0SyncIoMap().

ULONG PhysBase
 

Definition at line 561 of file ppc/initkr.c.

Referenced by KiPhase0SyncIoMap().

ULONG RefCount
 

Definition at line 562 of file ppc/initkr.c.

Referenced by NtCreateSuperSection(), NtWaitForMultipleObjects(), and RtlCreateTimer().


Generated on Sat May 15 19:44:12 2004 for test by doxygen 1.3.7