/* GLOBALS ********************************************************************/
-extern CHAR reactos_arc_hardware_data[];
-SIZE_T FldrpHwHeapLocation;
PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot;
-BOOLEAN UseRealHeap = FALSE;
-
-VOID
-NTAPI
-FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
- IN PCM_PARTIAL_RESOURCE_LIST ResourceList,
- IN ULONG Size);
-
/* FUNCTIONS ******************************************************************/
PVOID
{
PVOID Buffer;
- if (UseRealHeap)
- {
- /* 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 */
- FldrpHwHeapLocation += Size;
- if (FldrpHwHeapLocation > HW_MAX_ARC_HEAP_SIZE) Buffer = NULL;
- }
-
- /* Clear it */
- if (Buffer)
- RtlZeroMemory(Buffer, Size);
-
- /* Return the buffer */
+ /* Allocate memory from generic bootloader heap */
+ Buffer = MmHeapAlloc(Size);
return Buffer;
}
SIZE_T IdentifierLength;
PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry;
PCHAR Identifier;
-
+
/* Allocate memory for the identifier */
IdentifierLength = strlen(IdentifierString) + 1;
- Identifier = FldrpHwHeapAlloc(IdentifierLength);
+ Identifier = MmHeapAlloc(IdentifierLength);
if (!Identifier) return;
/* Copy the identifier */
FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
{
PCONFIGURATION_COMPONENT Component;
-
+
/* Allocate the root */
- FldrArcHwTreeRoot = FldrpHwHeapAlloc(sizeof(CONFIGURATION_COMPONENT_DATA));
+ FldrArcHwTreeRoot = MmHeapAlloc(sizeof(CONFIGURATION_COMPONENT_DATA));
if (!FldrArcHwTreeRoot) return;
-
+
/* Set it up */
Component = &FldrArcHwTreeRoot->ComponentEntry;
Component->Class = SystemClass;
Component->Revision = 0;
Component->Key = 0;
Component->AffinityMask = 0xFFFFFFFF;
-
+
/* Return the node */
*SystemNode = FldrArcHwTreeRoot;
}
/* This is now the parent */
Parent = Sibling;
} while ((Sibling = Sibling->Sibling));
-
+
/* Found the lowest sibling; mark us as its sibling too */
Parent->Sibling = Child;
}
PCONFIGURATION_COMPONENT Component;
/* Allocate the node for this component */
- ComponentData = FldrpHwHeapAlloc(sizeof(CONFIGURATION_COMPONENT_DATA));
+ ComponentData = MmHeapAlloc(sizeof(CONFIGURATION_COMPONENT_DATA));
if (!ComponentData) return;
-
+
/* Now save our parent */
ComponentData->Parent = SystemNode;
-
+
/* Link us to the parent */
if (SystemNode)
FldrLinkToParent(SystemNode, ComponentData);
-
+
/* Set us up */
Component = &ComponentData->ComponentEntry;
Component->Class = Class;
Component->Flags = Flags;
Component->Key = Key;
Component->AffinityMask = Affinity;
-
+
/* Set identifier */
if (IdentifierString)
FldrSetIdentifier(ComponentData, IdentifierString);
-
+
/* Set configuration data */
if (ResourceList)
- FldrSetConfigurationData(ComponentData, ResourceList, Size);
-
+ {
+ ComponentData->ConfigurationData = ResourceList;
+ ComponentData->ComponentEntry.ConfigurationDataLength = Size;
+ }
+
/* Return the child */
- *ComponentKey = ComponentData;
+ *ComponentKey = ComponentData;
}
-VOID
-NTAPI
-FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
- IN PCM_PARTIAL_RESOURCE_LIST ResourceList,
- IN ULONG Size)
-{
- PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry;
- PVOID ConfigurationData;
-
- /* Allocate a buffer from the hardware heap */
- ConfigurationData = FldrpHwHeapAlloc(Size);
- if (!ConfigurationData) return;
-
- /* Copy component information */
- RtlCopyMemory(ConfigurationData, ResourceList, Size);
-
- /* Set component information */
- ComponentData->ConfigurationData = ConfigurationData;
- Component->ConfigurationDataLength = Size;
-}