Author: sginsberg
Date: Fri Aug 1 12:50:17 2008
New Revision: 35017
URL:
http://svn.reactos.org/svn/reactos?rev=35017&view=rev
Log:
- Use MmAllocateMemoryWithType instead of deprecated MmAllocateMemory for the ARM Shared
Heap allocation
- Use heap routines in i386 and powerpc branches for temporary memory
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c [iso-8859-1] Fri Aug 1 12:50:17
2008
@@ -1052,7 +1052,7 @@
//
// Allocate the ARM Shared Heap
//
- ArmSharedHeap = MmAllocateMemory(PAGE_SIZE);
+ ArmSharedHeap = MmAllocateMemoryWithType(PAGE_SIZE, LoaderOsloaderHeap);
ArmSharedHeapSize = 0;
if (!ArmSharedHeap) return;
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] Fri Aug 1 12:50:17
2008
@@ -173,7 +173,7 @@
/* Set 'Configuration Data' value */
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) +
2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->Size;
- PartialResourceList = MmAllocateMemory(Size);
+ PartialResourceList = MmHeapAlloc(Size);
if (PartialResourceList == NULL)
{
DbgPrint((DPRINT_HWDETECT,
@@ -203,7 +203,7 @@
/* Set 'Configuration Data' value */
FldrSetConfigurationData(TableKey, PartialResourceList, Size);
- MmFreeMemory(PartialResourceList);
+ MmHeapFree(PartialResourceList);
}
}
@@ -246,7 +246,7 @@
/* Set 'Configuration Data' value */
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST,
PartialDescriptors);
- PartialResourceList = MmAllocateMemory(Size);
+ PartialResourceList = MmHeapAlloc(Size);
if (PartialResourceList == NULL)
{
DbgPrint((DPRINT_HWDETECT,
@@ -259,7 +259,7 @@
/* Set 'Configuration Data' value */
FldrSetConfigurationData(BiosKey, PartialResourceList, Size);
- MmFreeMemory(PartialResourceList);
+ MmHeapFree(PartialResourceList);
DetectPciIrqRoutingTable(BiosKey);
@@ -288,7 +288,7 @@
PartialDescriptors) +
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) +
sizeof(PCI_REGISTRY_INFO);
- PartialResourceList = MmAllocateMemory(Size);
+ PartialResourceList = MmHeapAlloc(Size);
if (!PartialResourceList)
{
DbgPrint((DPRINT_HWDETECT,
@@ -311,14 +311,14 @@
/* Set 'Configuration Data' value */
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
- MmFreeMemory(PartialResourceList);
+ MmHeapFree(PartialResourceList);
}
else
{
/* Set 'Configuration Data' value */
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST,
PartialDescriptors);
- PartialResourceList = MmAllocateMemory(Size);
+ PartialResourceList = MmHeapAlloc(Size);
if (!PartialResourceList)
{
DbgPrint((DPRINT_HWDETECT,
@@ -331,7 +331,7 @@
/* Set 'Configuration Data' value */
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
- MmFreeMemory(PartialResourceList);
+ MmHeapFree(PartialResourceList);
}
/* Increment bus number */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c [iso-8859-1] Fri Aug 1 12:50:17
2008
@@ -42,7 +42,7 @@
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_DISK_GEOMETRY_DEVICE_DATA);
- PartialResourceList = MmAllocateMemory(Size);
+ PartialResourceList = MmHeapAlloc(Size);
if (PartialResourceList == NULL)
{
DbgPrint((DPRINT_HWDETECT,
@@ -77,7 +77,7 @@
else
{
DbgPrint((DPRINT_HWDETECT, "Reading disk geometry failed\n"));
- MmFreeMemory(PartialResourceList);
+ MmHeapFree(PartialResourceList);
return;
}
DbgPrint((DPRINT_HWDETECT,
@@ -89,7 +89,7 @@
DiskGeometry->BytesPerSector));
FldrSetConfigurationData(DiskKey, PartialResourceList, Size);
- MmFreeMemory(PartialResourceList);
+ MmHeapFree(PartialResourceList);
}
@@ -225,7 +225,7 @@
/* Allocate resource descriptor */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
- PartialResourceList = MmAllocateMemory(Size);
+ PartialResourceList = MmHeapAlloc(Size);
if (PartialResourceList == NULL)
{
DbgPrint((DPRINT_HWDETECT,
@@ -268,7 +268,7 @@
/* Set 'Configuration Data' value */
FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
- MmFreeMemory(PartialResourceList);
+ MmHeapFree(PartialResourceList);
/* Create and fill subkey for each harddisk */
for (i = 0; i < DiskCount; i++)
@@ -323,7 +323,7 @@
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
- PartialResourceList = MmAllocateMemory(Size);
+ PartialResourceList = MmHeapAlloc(Size);
if (PartialResourceList == NULL)
{
DbgPrint((DPRINT_HWDETECT,
@@ -339,7 +339,7 @@
/* Set 'Configuration Data' value */
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
- MmFreeMemory(PartialResourceList);
+ MmHeapFree(PartialResourceList);
/* Detect ISA/BIOS devices */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c [iso-8859-1] Fri Aug 1
12:50:17 2008
@@ -459,7 +459,7 @@
phnum = ehdr.e_phnum;
shsize = ehdr.e_shentsize;
shnum = ehdr.e_shnum;
- sptr = (PCHAR)MmAllocateMemory(shnum * shsize);
+ sptr = (PCHAR)MmHeapAlloc(shnum * shsize);
/* Read section headers */
FsSetFilePointer(KernelImage, ehdr.e_shoff);
@@ -560,14 +560,14 @@
if (!ELF_SECTION(targetSection)->sh_addr) continue;
- RelocSection = MmAllocateMemory(shdr->sh_size);
+ RelocSection = MmHeapAlloc(shdr->sh_size);
FsSetFilePointer(KernelImage, relstart);
FsReadFile(KernelImage, shdr->sh_size, NULL, RelocSection);
/* Get the symbol section */
shdr = ELF_SECTION(shdr->sh_link);
- SymbolSection = MmAllocateMemory(shdr->sh_size);
+ SymbolSection = MmHeapAlloc(shdr->sh_size);
FsSetFilePointer(KernelImage, shdr->sh_offset);
FsReadFile(KernelImage, shdr->sh_size, NULL, SymbolSection);
@@ -642,11 +642,11 @@
#endif
}
- MmFreeMemory(SymbolSection);
- MmFreeMemory(RelocSection);
- }
-
- MmFreeMemory(sptr);
+ MmHeapFree(SymbolSection);
+ MmHeapFree(RelocSection);
+ }
+
+ MmHeapFree(sptr);
ModuleData->ModStart = (ULONG)MemLoadAddr;
/* Increase the next Load Base */