return RootNode;
}
-MEMORY_DESCRIPTOR ArmMemoryMap[32];
+FREELDR_MEMORY_DESCRIPTOR ArmMemoryMap[32];
-PMEMORY_DESCRIPTOR
+PFREELDR_MEMORY_DESCRIPTOR
ArmMemGetMemoryMap(OUT ULONG *MemoryMapSize)
{
ASSERT(ArmBoardBlock->MemoryMapEntryCount <= 32);
BOOLEAN PcDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
{
+ BOOLEAN ExtensionsSupported;
TRACE("PcDiskReadLogicalSectors() DriveNumber: 0x%x SectorNumber: %I64d SectorCount: %d Buffer: 0x%x\n", DriveNumber, SectorNumber, SectorCount, Buffer);
// If so then check to see if Int13 extensions work
// If they do then use them, otherwise default back to BIOS calls
//
- if ((DriveNumber >= 0x80) && DiskInt13ExtensionsSupported(DriveNumber))
+ ExtensionsSupported = DiskInt13ExtensionsSupported(DriveNumber);
+
+ if ((DriveNumber >= 0x80) && ExtensionsSupported)
{
- TRACE("Using Int 13 Extensions for read. DiskInt13ExtensionsSupported(%d) = %s\n", DriveNumber, DiskInt13ExtensionsSupported(DriveNumber) ? "TRUE" : "FALSE");
+ TRACE("Using Int 13 Extensions for read. DiskInt13ExtensionsSupported(%d) = %s\n", DriveNumber, ExtensionsSupported ? "TRUE" : "FALSE");
//
// LBA is easy, nothing to calculate
BIOS_MEMORY_MAP PcBiosMemoryMap[MAX_BIOS_DESCRIPTORS];
ULONG PcBiosMapCount;
-MEMORY_DESCRIPTOR PcMemoryMap[MAX_BIOS_DESCRIPTORS + 1] =
+FREELDR_MEMORY_DESCRIPTOR PcMemoryMap[MAX_BIOS_DESCRIPTORS + 1] =
{
{ LoaderFirmwarePermanent, 0x00, 1 }, // realmode int vectors
{ LoaderFirmwareTemporary, 0x01, FREELDR_BASE_PAGE - 1 }, // freeldr stack + cmdline
ULONG
AddMemoryDescriptor(
- IN OUT PMEMORY_DESCRIPTOR List,
+ IN OUT PFREELDR_MEMORY_DESCRIPTOR List,
IN ULONG MaxCount,
IN PFN_NUMBER BasePage,
IN PFN_NUMBER PageCount,
static
ULONG
-PcMemGetBiosMemoryMap(PMEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSize)
+PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSize)
{
REGS Regs;
ULONG MapCount = 0;
}
-PMEMORY_DESCRIPTOR
+PFREELDR_MEMORY_DESCRIPTOR
PcMemGetMemoryMap(ULONG *MemoryMapSize)
{
ULONG i, EntryCount;
AvailableMemoryMb = InstalledMemoryMb;
}
-MEMORY_DESCRIPTOR BiosMemoryMap[2];
+FREELDR_MEMORY_DESCRIPTOR BiosMemoryMap[2];
-PMEMORY_DESCRIPTOR
+PFREELDR_MEMORY_DESCRIPTOR
XboxMemGetMemoryMap(ULONG *MemoryMapSize)
{
/* Synthesize memory map */
VOID* ConfigurationData,
CONFIGURATION_COMPONENT* Component);
-/* mm.c */
-const MEMORY_DESCRIPTOR*
-ArcGetMemoryDescriptor(const MEMORY_DESCRIPTOR* Current);
-
/* time.c */
TIMEINFO* ArcGetTime(VOID);
ULONG ArcGetRelativeTime(VOID);
VOID XboxMemInit(VOID);
PVOID XboxMemReserveMemory(ULONG MbToReserve);
-PMEMORY_DESCRIPTOR XboxMemGetMemoryMap(ULONG *MemoryMapSize);
+PFREELDR_MEMORY_DESCRIPTOR XboxMemGetMemoryMap(ULONG *MemoryMapSize);
BOOLEAN XboxDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
BOOLEAN XboxDiskGetPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry);
VOID PcVideoPrepareForReactOS(IN BOOLEAN Setup);
VOID PcPrepareForReactOS(IN BOOLEAN Setup);
-PMEMORY_DESCRIPTOR PcMemGetMemoryMap(ULONG *MemoryMapSize);
+PFREELDR_MEMORY_DESCRIPTOR PcMemGetMemoryMap(ULONG *MemoryMapSize);
BOOLEAN PcDiskGetBootPath(char *BootPath, unsigned Size);
BOOLEAN PcDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
VOID (*Beep)(VOID);
VOID (*PrepareForReactOS)(IN BOOLEAN Setup);
- MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(MEMORY_DESCRIPTOR* Current);
- PMEMORY_DESCRIPTOR (*GetMemoryMap)(PULONG MaxMemoryMapSize);
+ FREELDR_MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(FREELDR_MEMORY_DESCRIPTOR* Current);
+ PFREELDR_MEMORY_DESCRIPTOR (*GetMemoryMap)(PULONG MaxMemoryMapSize);
BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size);
BOOLEAN (*DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
BiosMemoryAcpiNvs
} BIOS_MEMORY_TYPE;
+typedef struct _FREELDR_MEMORY_DESCRIPTOR
+{
+ TYPE_OF_MEMORY MemoryType;
+ PFN_NUMBER BasePage;
+ PFN_NUMBER PageCount;
+} FREELDR_MEMORY_DESCRIPTOR, *PFREELDR_MEMORY_DESCRIPTOR;
+
#include <pshpack1.h>
typedef struct
{
ULONG MmLowestPhysicalPage = 0xFFFFFFFF;
ULONG MmHighestPhysicalPage = 0;
-PMEMORY_DESCRIPTOR BiosMemoryMap;
+PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap;
ULONG BiosMemoryMapEntryCount;
extern ULONG_PTR MmHeapPointer;
ULONG
AddMemoryDescriptor(
- IN OUT PMEMORY_DESCRIPTOR List,
+ IN OUT PFREELDR_MEMORY_DESCRIPTOR List,
IN ULONG MaxCount,
IN PFN_NUMBER BasePage,
IN PFN_NUMBER PageCount,
- IN MEMORY_TYPE MemoryType)
+ IN TYPE_OF_MEMORY MemoryType)
{
ULONG i, c;
PFN_NUMBER NextBase;
return c;
}
-const MEMORY_DESCRIPTOR*
-ArcGetMemoryDescriptor(const MEMORY_DESCRIPTOR* Current)
+const FREELDR_MEMORY_DESCRIPTOR*
+ArcGetMemoryDescriptor(const FREELDR_MEMORY_DESCRIPTOR* Current)
{
if (Current == NULL)
{
BOOLEAN MmInitializeMemoryManager(VOID)
{
#if DBG
- const MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
+ const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
#endif
TRACE("Initializing Memory Manager.\n");
ULONG MmGetAddressablePageCountIncludingHoles(VOID)
{
- const MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
+ const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
ULONG PageCount;
//
//
// Yes, remember it if this is real memory
//
- if (MemoryDescriptor->MemoryType == MemoryFree)
+ if (MemoryDescriptor->MemoryType == LoaderFree)
MmHighestPhysicalPage = MemoryDescriptor->BasePage + MemoryDescriptor->PageCount;
}
PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount)
{
- const MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
+ const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
ULONG PageLookupTableSize;
ULONG PageLookupTablePages;
ULONG PageLookupTableStartPage = 0;
while ((MemoryDescriptor = ArcGetMemoryDescriptor(MemoryDescriptor)) != NULL)
{
// Continue, if memory is not free
- if (MemoryDescriptor->MemoryType != MemoryFree) continue;
+ if (MemoryDescriptor->MemoryType != LoaderFree) continue;
// Continue, if the block is not big enough?
if (MemoryDescriptor->PageCount < PageLookupTablePages) continue;
VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount)
{
- const MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
+ const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
TYPE_OF_MEMORY MemoryMapPageAllocated;
ULONG PageLookupTableStartPage;
ULONG PageLookupTablePageCount;