PVOID NTAPI HalpAcpiCopyBiosTable(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PDESCRIPTION_HEADER TableHeader) { ULONG Size; PFN_COUNT PageCount; PHYSICAL_ADDRESS PhysAddress; PACPI_CACHED_TABLE CachedTable; PDESCRIPTION_HEADER CopiedTable; /* Size we'll need for the cached table */ Size = TableHeader->Length + FIELD_OFFSET(ACPI_CACHED_TABLE, Header); if (LoaderBlock) { /* Phase 0: Convert to pages and use the HAL heap */ PageCount = BYTES_TO_PAGES(Size); PhysAddress.QuadPart = HalpAllocPhysicalMemory(LoaderBlock, 0x1000000, PageCount, FALSE); if (PhysAddress.QuadPart) { /* Map it */ CachedTable = HalpMapPhysicalMemory64(PhysAddress, PageCount); } else { /* No memory, so nothing to map */ CachedTable = NULL; } } else { /* Use Mm pool */ CachedTable = ExAllocatePoolWithTag(NonPagedPool, Size, ' laH'); } /* Do we have the cached table? */ if (CachedTable) { /* Copy the data */ CopiedTable = &CachedTable->Header; RtlCopyMemory(CopiedTable, TableHeader, TableHeader->Length); } else { /* Nothing to return */ CopiedTable = NULL; } /* Return the table */ return CopiedTable; }
VOID HalpInitMP ( IN ULONG Phase, IN PLOADER_PARAMETER_BLOCK LoaderBlock ) /*++ Routine Description: Allows MP initialization from HalInitSystem. Arguments: Same as HalInitSystem Return Value: None. --*/ { PKPCR pPCR; pPCR = KeGetPcr(); // // Increment a count of the number of processors // running NT, This could be different from the // number of enabled processors, if one or more // of the processor failed to start. // if (Phase == 1) HalpMpInfoTable.NtProcessors++; #ifdef DEBUGGING sprintf(Cbuf, "HalpInitMP: Number of Processors = 0x%x\n", HalpMpInfoTable.NtProcessors); HalpDisplayString(Cbuf); #endif if (Phase == 0) { #if defined(NT_UP) // // On UP build - done // return ; #endif // // Map the 1st Physical page of memory // Halp1stPhysicalPageVaddr = HalpMapPhysicalMemory (0, 1); // // Allocate some low memory for processor bootup stub // MpLowStubPhysicalAddress = (PVOID)HalpAllocPhysicalMemory (LoaderBlock, LOW_MEMORY, 1, FALSE); if (!MpLowStubPhysicalAddress) { // // Can't get memory // #if DBG DbgPrint("HAL: can't allocate memory to start processors\n"); #endif return; } MpLowStub = (PCHAR) HalpMapPhysicalMemory (MpLowStubPhysicalAddress, 1); } else { // // Phase 1 for another processor // if (pPCR->Prcb->Number != 0) { HalpIpiClock = 0xff; } } }