mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 09:50:02 +00:00
- Add a runtime switch between using freeldr-embedded configuration tree heap, or using a real heap allocation (for NT-way).
- Use that in winldr. svn path=/trunk/; revision=31996
This commit is contained in:
parent
486430a6fa
commit
90c012403c
2 changed files with 20 additions and 7 deletions
|
@ -18,6 +18,8 @@ extern CHAR reactos_arc_hardware_data[];
|
||||||
ULONG FldrpHwHeapLocation;
|
ULONG FldrpHwHeapLocation;
|
||||||
PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot;
|
PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot;
|
||||||
|
|
||||||
|
BOOLEAN UseRealHeap = FALSE;
|
||||||
|
|
||||||
/* FUNCTIONS ******************************************************************/
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
PVOID
|
PVOID
|
||||||
|
@ -26,12 +28,20 @@ FldrpHwHeapAlloc(IN ULONG Size)
|
||||||
{
|
{
|
||||||
PVOID Buffer;
|
PVOID Buffer;
|
||||||
|
|
||||||
/* Return a block of memory from the ARC Hardware Heap */
|
if (UseRealHeap)
|
||||||
Buffer = &reactos_arc_hardware_data[FldrpHwHeapLocation];
|
{
|
||||||
|
/* Allocate memory from generic bootloader heap */
|
||||||
|
Buffer = MmHeapAlloc(Size);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Return a block of memory from the ARC Hardware Heap */
|
||||||
|
Buffer = &reactos_arc_hardware_data[FldrpHwHeapLocation];
|
||||||
|
|
||||||
/* Increment the heap location */
|
/* Increment the heap location */
|
||||||
FldrpHwHeapLocation += Size;
|
FldrpHwHeapLocation += Size;
|
||||||
if (FldrpHwHeapLocation > HW_MAX_ARC_HEAP_SIZE) Buffer = NULL;
|
if (FldrpHwHeapLocation > HW_MAX_ARC_HEAP_SIZE) Buffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Clear it */
|
/* Clear it */
|
||||||
if (Buffer)
|
if (Buffer)
|
||||||
|
|
|
@ -29,6 +29,8 @@ extern ULONG reactos_disk_count;
|
||||||
extern ARC_DISK_SIGNATURE reactos_arc_disk_info[];
|
extern ARC_DISK_SIGNATURE reactos_arc_disk_info[];
|
||||||
extern char reactos_arc_strings[32][256];
|
extern char reactos_arc_strings[32][256];
|
||||||
|
|
||||||
|
extern BOOLEAN UseRealHeap;
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
WinLdrCheckForLoadedDll(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock,
|
WinLdrCheckForLoadedDll(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock,
|
||||||
IN PCH DllName,
|
IN PCH DllName,
|
||||||
|
@ -429,6 +431,7 @@ LoadAndBootWindows(PCSTR OperatingSystemName, WORD OperatingSystemVersion)
|
||||||
AllocateAndInitLPB(&LoaderBlock);
|
AllocateAndInitLPB(&LoaderBlock);
|
||||||
|
|
||||||
/* Detect hardware */
|
/* Detect hardware */
|
||||||
|
UseRealHeap = TRUE;
|
||||||
LoaderBlock->ConfigurationRoot = MachHwDetect();
|
LoaderBlock->ConfigurationRoot = MachHwDetect();
|
||||||
|
|
||||||
/* Load kernel */
|
/* Load kernel */
|
||||||
|
|
Loading…
Reference in a new issue