BOOLEAN ExpInitSystemPhase0( VOID ) /*++ Routine Description: This function performs Phase 0 initialization of the executive component of the NT system. Arguments: None. Return Value: A value of TRUE is returned if the initialization is success. Otherwise a value of FALSE is returned. --*/ { ULONG Index; BOOLEAN Initialized = TRUE; PGENERAL_LOOKASIDE Lookaside; // // Initialize Resource objects, currently required during SE // Phase 0 initialization. // if (ExpResourceInitialization() == FALSE) { Initialized = FALSE; KdPrint(("Executive: Resource initialization failed\n")); } // // Initialize query/set environment variable synchronization fast // mutex. // ExInitializeFastMutex(&ExpEnvironmentLock); // // Initialize the paged and nonpaged small pool lookaside structures. // InitializeListHead(&ExPoolLookasideListHead); for (Index = 0; Index < POOL_SMALL_LISTS; Index += 1) { Lookaside = &ExpSmallNPagedPoolLookasideLists[Index]; ExInitializeSystemLookasideList(Lookaside, NonPagedPool, (Index + 1) * sizeof(POOL_BLOCK), 'looP', 256, &ExPoolLookasideListHead); /*Lookaside->SListHead.Next.Next = NULL; Lookaside->SListHead.Depth = 0; Lookaside->SListHead.Sequence = 0; Lookaside->Depth = 2; Lookaside->MaximumDepth = 256; Lookaside->TotalAllocates = 0; Lookaside->AllocateHits = 0; Lookaside->TotalFrees = 0; Lookaside->FreeHits = 0; Lookaside->LastTotalAllocates = 0; Lookaside->LastAllocateHits = 0; KeInitializeSpinLock(&Lookaside->Lock);*/ #if !defined(_PPC_) Lookaside = &ExpSmallPagedPoolLookasideLists[Index]; ExInitializeSystemLookasideList(Lookaside, PagedPool, (Index + 1) * sizeof(POOL_BLOCK), 'looP', 256, &ExPoolLookasideListHead); /*Lookaside->SListHead.Next.Next = NULL; Lookaside->SListHead.Depth = 0; Lookaside->SListHead.Sequence = 0; Lookaside->Depth = 2; Lookaside->MaximumDepth = 256; Lookaside->TotalAllocates = 0; Lookaside->AllocateHits = 0; Lookaside->TotalFrees = 0; Lookaside->FreeHits = 0; Lookaside->LastTotalAllocates = 0; Lookaside->LastAllocateHits = 0; Lookaside->Lock = 0;*/ #endif } // // Set the maximum depth of small nonpaged and paged lookaside structures // which get a larger maximum than the default. // ExpSmallNPagedPoolLookasideLists[0].L.MaximumDepth = 512; ExpSmallNPagedPoolLookasideLists[1].L.MaximumDepth = 512; #if !defined(_PPC_) ExpSmallPagedPoolLookasideLists[0].L.MaximumDepth = 512; ExpSmallPagedPoolLookasideLists[1].L.MaximumDepth = 512; #endif // // Initialize the nonpaged and paged system lookaside lists. // InitializeListHead(&ExNPagedLookasideListHead); KeInitializeSpinLock(&ExNPagedLookasideLock); InitializeListHead(&ExPagedLookasideListHead); KeInitializeSpinLock(&ExPagedLookasideLock); return Initialized; }
BOOLEAN ExpInitSystemPhase0 ( VOID ) /*++ Routine Description: This function performs Phase 0 initialization of the executive component of the NT system. Arguments: None. Return Value: A value of TRUE is returned if the initialization is success. Otherwise a value of FALSE is returned. --*/ { ULONG Index; BOOLEAN Initialized = TRUE; PGENERAL_LOOKASIDE Lookaside; // // Initialize Resource objects, currently required during SE // Phase 0 initialization. // if (ExpResourceInitialization() == FALSE) { Initialized = FALSE; KdPrint(("Executive: Resource initialization failed\n")); } // // Initialize query/set environment variable synchronization fast // mutex. // ExInitializeFastMutex(&ExpEnvironmentLock); // // Initialize the key manipulation resource. // ExInitializeResourceLite(&ExpKeyManipLock); // // Initialize the paged and nonpaged small pool lookaside structures, // InitializeListHead(&ExPoolLookasideListHead); for (Index = 0; Index < POOL_SMALL_LISTS; Index += 1) { Lookaside = &ExpSmallNPagedPoolLookasideLists[Index]; ExInitializeSystemLookasideList(Lookaside, NonPagedPool, (Index + 1) * sizeof (POOL_BLOCK), 'looP', 256, &ExPoolLookasideListHead); Lookaside = &ExpSmallPagedPoolLookasideLists[Index]; ExInitializeSystemLookasideList(Lookaside, PagedPool, (Index + 1) * sizeof (POOL_BLOCK), 'looP', 256, &ExPoolLookasideListHead); } // // Initialize the nonpaged and paged system lookaside lists. // InitializeListHead(&ExNPagedLookasideListHead); KeInitializeSpinLock(&ExNPagedLookasideLock); InitializeListHead(&ExPagedLookasideListHead); KeInitializeSpinLock(&ExPagedLookasideLock); // // Initialize the system paged and nonpaged lookaside list. // InitializeListHead(&ExSystemLookasideListHead); // // Initialize the Firmware table provider list // InitializeListHead(&ExpFirmwareTableProviderListHead); // // Initialize the FirmwareTableProvider resource // ExInitializeResourceLite(&ExpFirmwareTableResource); return ExpSystemOK(2, Initialized); }