mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:43:04 +00:00
- Use MmAllocateMemoryWithType instead of deprecated MmAllocateMemory for the ARM Shared Heap allocation
- Use heap routines in i386 and powerpc branches for temporary memory svn path=/trunk/; revision=35017
This commit is contained in:
parent
f724943d40
commit
f81b3e63d2
4 changed files with 22 additions and 22 deletions
|
@ -1052,7 +1052,7 @@ ArmPrepareForReactOS(IN BOOLEAN Setup)
|
||||||
//
|
//
|
||||||
// Allocate the ARM Shared Heap
|
// Allocate the ARM Shared Heap
|
||||||
//
|
//
|
||||||
ArmSharedHeap = MmAllocateMemory(PAGE_SIZE);
|
ArmSharedHeap = MmAllocateMemoryWithType(PAGE_SIZE, LoaderOsloaderHeap);
|
||||||
ArmSharedHeapSize = 0;
|
ArmSharedHeapSize = 0;
|
||||||
if (!ArmSharedHeap) return;
|
if (!ArmSharedHeap) return;
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) +
|
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) +
|
||||||
2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->Size;
|
2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->Size;
|
||||||
PartialResourceList = MmAllocateMemory(Size);
|
PartialResourceList = MmHeapAlloc(Size);
|
||||||
if (PartialResourceList == NULL)
|
if (PartialResourceList == NULL)
|
||||||
{
|
{
|
||||||
DbgPrint((DPRINT_HWDETECT,
|
DbgPrint((DPRINT_HWDETECT,
|
||||||
|
@ -203,7 +203,7 @@ DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
|
||||||
|
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
FldrSetConfigurationData(TableKey, PartialResourceList, Size);
|
FldrSetConfigurationData(TableKey, PartialResourceList, Size);
|
||||||
MmFreeMemory(PartialResourceList);
|
MmHeapFree(PartialResourceList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST,
|
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST,
|
||||||
PartialDescriptors);
|
PartialDescriptors);
|
||||||
PartialResourceList = MmAllocateMemory(Size);
|
PartialResourceList = MmHeapAlloc(Size);
|
||||||
if (PartialResourceList == NULL)
|
if (PartialResourceList == NULL)
|
||||||
{
|
{
|
||||||
DbgPrint((DPRINT_HWDETECT,
|
DbgPrint((DPRINT_HWDETECT,
|
||||||
|
@ -259,7 +259,7 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
|
||||||
|
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
FldrSetConfigurationData(BiosKey, PartialResourceList, Size);
|
FldrSetConfigurationData(BiosKey, PartialResourceList, Size);
|
||||||
MmFreeMemory(PartialResourceList);
|
MmHeapFree(PartialResourceList);
|
||||||
|
|
||||||
DetectPciIrqRoutingTable(BiosKey);
|
DetectPciIrqRoutingTable(BiosKey);
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
|
||||||
PartialDescriptors) +
|
PartialDescriptors) +
|
||||||
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) +
|
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) +
|
||||||
sizeof(PCI_REGISTRY_INFO);
|
sizeof(PCI_REGISTRY_INFO);
|
||||||
PartialResourceList = MmAllocateMemory(Size);
|
PartialResourceList = MmHeapAlloc(Size);
|
||||||
if (!PartialResourceList)
|
if (!PartialResourceList)
|
||||||
{
|
{
|
||||||
DbgPrint((DPRINT_HWDETECT,
|
DbgPrint((DPRINT_HWDETECT,
|
||||||
|
@ -311,14 +311,14 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
|
||||||
|
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
|
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
|
||||||
MmFreeMemory(PartialResourceList);
|
MmHeapFree(PartialResourceList);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST,
|
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST,
|
||||||
PartialDescriptors);
|
PartialDescriptors);
|
||||||
PartialResourceList = MmAllocateMemory(Size);
|
PartialResourceList = MmHeapAlloc(Size);
|
||||||
if (!PartialResourceList)
|
if (!PartialResourceList)
|
||||||
{
|
{
|
||||||
DbgPrint((DPRINT_HWDETECT,
|
DbgPrint((DPRINT_HWDETECT,
|
||||||
|
@ -331,7 +331,7 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
|
||||||
|
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
|
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
|
||||||
MmFreeMemory(PartialResourceList);
|
MmHeapFree(PartialResourceList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Increment bus number */
|
/* Increment bus number */
|
||||||
|
|
|
@ -42,7 +42,7 @@ SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey,
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
|
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
|
||||||
sizeof(CM_DISK_GEOMETRY_DEVICE_DATA);
|
sizeof(CM_DISK_GEOMETRY_DEVICE_DATA);
|
||||||
PartialResourceList = MmAllocateMemory(Size);
|
PartialResourceList = MmHeapAlloc(Size);
|
||||||
if (PartialResourceList == NULL)
|
if (PartialResourceList == NULL)
|
||||||
{
|
{
|
||||||
DbgPrint((DPRINT_HWDETECT,
|
DbgPrint((DPRINT_HWDETECT,
|
||||||
|
@ -77,7 +77,7 @@ SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DbgPrint((DPRINT_HWDETECT, "Reading disk geometry failed\n"));
|
DbgPrint((DPRINT_HWDETECT, "Reading disk geometry failed\n"));
|
||||||
MmFreeMemory(PartialResourceList);
|
MmHeapFree(PartialResourceList);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DbgPrint((DPRINT_HWDETECT,
|
DbgPrint((DPRINT_HWDETECT,
|
||||||
|
@ -89,7 +89,7 @@ SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey,
|
||||||
DiskGeometry->BytesPerSector));
|
DiskGeometry->BytesPerSector));
|
||||||
|
|
||||||
FldrSetConfigurationData(DiskKey, PartialResourceList, Size);
|
FldrSetConfigurationData(DiskKey, PartialResourceList, Size);
|
||||||
MmFreeMemory(PartialResourceList);
|
MmHeapFree(PartialResourceList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
|
||||||
/* Allocate resource descriptor */
|
/* Allocate resource descriptor */
|
||||||
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
|
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
|
||||||
sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
|
sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
|
||||||
PartialResourceList = MmAllocateMemory(Size);
|
PartialResourceList = MmHeapAlloc(Size);
|
||||||
if (PartialResourceList == NULL)
|
if (PartialResourceList == NULL)
|
||||||
{
|
{
|
||||||
DbgPrint((DPRINT_HWDETECT,
|
DbgPrint((DPRINT_HWDETECT,
|
||||||
|
@ -268,7 +268,7 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
|
||||||
|
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
|
FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
|
||||||
MmFreeMemory(PartialResourceList);
|
MmHeapFree(PartialResourceList);
|
||||||
|
|
||||||
/* Create and fill subkey for each harddisk */
|
/* Create and fill subkey for each harddisk */
|
||||||
for (i = 0; i < DiskCount; i++)
|
for (i = 0; i < DiskCount; i++)
|
||||||
|
@ -323,7 +323,7 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
|
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
|
||||||
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
|
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
|
||||||
PartialResourceList = MmAllocateMemory(Size);
|
PartialResourceList = MmHeapAlloc(Size);
|
||||||
if (PartialResourceList == NULL)
|
if (PartialResourceList == NULL)
|
||||||
{
|
{
|
||||||
DbgPrint((DPRINT_HWDETECT,
|
DbgPrint((DPRINT_HWDETECT,
|
||||||
|
@ -339,7 +339,7 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
|
||||||
|
|
||||||
/* Set 'Configuration Data' value */
|
/* Set 'Configuration Data' value */
|
||||||
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
|
FldrSetConfigurationData(BusKey, PartialResourceList, Size);
|
||||||
MmFreeMemory(PartialResourceList);
|
MmHeapFree(PartialResourceList);
|
||||||
|
|
||||||
|
|
||||||
/* Detect ISA/BIOS devices */
|
/* Detect ISA/BIOS devices */
|
||||||
|
|
|
@ -459,7 +459,7 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern
|
||||||
phnum = ehdr.e_phnum;
|
phnum = ehdr.e_phnum;
|
||||||
shsize = ehdr.e_shentsize;
|
shsize = ehdr.e_shentsize;
|
||||||
shnum = ehdr.e_shnum;
|
shnum = ehdr.e_shnum;
|
||||||
sptr = (PCHAR)MmAllocateMemory(shnum * shsize);
|
sptr = (PCHAR)MmHeapAlloc(shnum * shsize);
|
||||||
|
|
||||||
/* Read section headers */
|
/* Read section headers */
|
||||||
FsSetFilePointer(KernelImage, ehdr.e_shoff);
|
FsSetFilePointer(KernelImage, ehdr.e_shoff);
|
||||||
|
@ -560,14 +560,14 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern
|
||||||
|
|
||||||
if (!ELF_SECTION(targetSection)->sh_addr) continue;
|
if (!ELF_SECTION(targetSection)->sh_addr) continue;
|
||||||
|
|
||||||
RelocSection = MmAllocateMemory(shdr->sh_size);
|
RelocSection = MmHeapAlloc(shdr->sh_size);
|
||||||
FsSetFilePointer(KernelImage, relstart);
|
FsSetFilePointer(KernelImage, relstart);
|
||||||
FsReadFile(KernelImage, shdr->sh_size, NULL, RelocSection);
|
FsReadFile(KernelImage, shdr->sh_size, NULL, RelocSection);
|
||||||
|
|
||||||
/* Get the symbol section */
|
/* Get the symbol section */
|
||||||
shdr = ELF_SECTION(shdr->sh_link);
|
shdr = ELF_SECTION(shdr->sh_link);
|
||||||
|
|
||||||
SymbolSection = MmAllocateMemory(shdr->sh_size);
|
SymbolSection = MmHeapAlloc(shdr->sh_size);
|
||||||
FsSetFilePointer(KernelImage, shdr->sh_offset);
|
FsSetFilePointer(KernelImage, shdr->sh_offset);
|
||||||
FsReadFile(KernelImage, shdr->sh_size, NULL, SymbolSection);
|
FsReadFile(KernelImage, shdr->sh_size, NULL, SymbolSection);
|
||||||
|
|
||||||
|
@ -642,11 +642,11 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MmFreeMemory(SymbolSection);
|
MmHeapFree(SymbolSection);
|
||||||
MmFreeMemory(RelocSection);
|
MmHeapFree(RelocSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
MmFreeMemory(sptr);
|
MmHeapFree(sptr);
|
||||||
|
|
||||||
ModuleData->ModStart = (ULONG)MemLoadAddr;
|
ModuleData->ModStart = (ULONG)MemLoadAddr;
|
||||||
/* Increase the next Load Base */
|
/* Increase the next Load Base */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue