mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
[FREELDR]
Add FREELDR_MEMORY_DESCRIPTOR structure using TYPE_OF_MEMORY instead of MEMORY_TYPE. Use it in place of MEMORY_DESCRIPTOR. Undo r53837 changes. svn path=/trunk/; revision=53841
This commit is contained in:
parent
4ab9552831
commit
7253e6bc9d
|
@ -143,9 +143,9 @@ ArmHwDetect(VOID)
|
||||||
return RootNode;
|
return RootNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
MEMORY_DESCRIPTOR ArmMemoryMap[32];
|
FREELDR_MEMORY_DESCRIPTOR ArmMemoryMap[32];
|
||||||
|
|
||||||
PMEMORY_DESCRIPTOR
|
PFREELDR_MEMORY_DESCRIPTOR
|
||||||
ArmMemGetMemoryMap(OUT ULONG *MemoryMapSize)
|
ArmMemGetMemoryMap(OUT ULONG *MemoryMapSize)
|
||||||
{
|
{
|
||||||
ASSERT(ArmBoardBlock->MemoryMapEntryCount <= 32);
|
ASSERT(ArmBoardBlock->MemoryMapEntryCount <= 32);
|
||||||
|
|
|
@ -271,6 +271,7 @@ static BOOLEAN PcDiskReadLogicalSectorsCHS(UCHAR DriveNumber, ULONGLONG SectorNu
|
||||||
|
|
||||||
BOOLEAN PcDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
|
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);
|
TRACE("PcDiskReadLogicalSectors() DriveNumber: 0x%x SectorNumber: %I64d SectorCount: %d Buffer: 0x%x\n", DriveNumber, SectorNumber, SectorCount, Buffer);
|
||||||
|
|
||||||
|
@ -279,9 +280,11 @@ BOOLEAN PcDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULON
|
||||||
// If so then check to see if Int13 extensions work
|
// If so then check to see if Int13 extensions work
|
||||||
// If they do then use them, otherwise default back to BIOS calls
|
// 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
|
// LBA is easy, nothing to calculate
|
||||||
|
|
|
@ -44,7 +44,7 @@ DBG_DEFAULT_CHANNEL(MEMORY);
|
||||||
BIOS_MEMORY_MAP PcBiosMemoryMap[MAX_BIOS_DESCRIPTORS];
|
BIOS_MEMORY_MAP PcBiosMemoryMap[MAX_BIOS_DESCRIPTORS];
|
||||||
ULONG PcBiosMapCount;
|
ULONG PcBiosMapCount;
|
||||||
|
|
||||||
MEMORY_DESCRIPTOR PcMemoryMap[MAX_BIOS_DESCRIPTORS + 1] =
|
FREELDR_MEMORY_DESCRIPTOR PcMemoryMap[MAX_BIOS_DESCRIPTORS + 1] =
|
||||||
{
|
{
|
||||||
{ LoaderFirmwarePermanent, 0x00, 1 }, // realmode int vectors
|
{ LoaderFirmwarePermanent, 0x00, 1 }, // realmode int vectors
|
||||||
{ LoaderFirmwareTemporary, 0x01, FREELDR_BASE_PAGE - 1 }, // freeldr stack + cmdline
|
{ LoaderFirmwareTemporary, 0x01, FREELDR_BASE_PAGE - 1 }, // freeldr stack + cmdline
|
||||||
|
@ -60,7 +60,7 @@ MEMORY_DESCRIPTOR PcMemoryMap[MAX_BIOS_DESCRIPTORS + 1] =
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
AddMemoryDescriptor(
|
AddMemoryDescriptor(
|
||||||
IN OUT PMEMORY_DESCRIPTOR List,
|
IN OUT PFREELDR_MEMORY_DESCRIPTOR List,
|
||||||
IN ULONG MaxCount,
|
IN ULONG MaxCount,
|
||||||
IN PFN_NUMBER BasePage,
|
IN PFN_NUMBER BasePage,
|
||||||
IN PFN_NUMBER PageCount,
|
IN PFN_NUMBER PageCount,
|
||||||
|
@ -189,7 +189,7 @@ PcMemGetConventionalMemorySize(VOID)
|
||||||
|
|
||||||
static
|
static
|
||||||
ULONG
|
ULONG
|
||||||
PcMemGetBiosMemoryMap(PMEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSize)
|
PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSize)
|
||||||
{
|
{
|
||||||
REGS Regs;
|
REGS Regs;
|
||||||
ULONG MapCount = 0;
|
ULONG MapCount = 0;
|
||||||
|
@ -292,7 +292,7 @@ PcMemGetBiosMemoryMap(PMEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PMEMORY_DESCRIPTOR
|
PFREELDR_MEMORY_DESCRIPTOR
|
||||||
PcMemGetMemoryMap(ULONG *MemoryMapSize)
|
PcMemGetMemoryMap(ULONG *MemoryMapSize)
|
||||||
{
|
{
|
||||||
ULONG i, EntryCount;
|
ULONG i, EntryCount;
|
||||||
|
|
|
@ -75,9 +75,9 @@ XboxMemInit(VOID)
|
||||||
AvailableMemoryMb = InstalledMemoryMb;
|
AvailableMemoryMb = InstalledMemoryMb;
|
||||||
}
|
}
|
||||||
|
|
||||||
MEMORY_DESCRIPTOR BiosMemoryMap[2];
|
FREELDR_MEMORY_DESCRIPTOR BiosMemoryMap[2];
|
||||||
|
|
||||||
PMEMORY_DESCRIPTOR
|
PFREELDR_MEMORY_DESCRIPTOR
|
||||||
XboxMemGetMemoryMap(ULONG *MemoryMapSize)
|
XboxMemGetMemoryMap(ULONG *MemoryMapSize)
|
||||||
{
|
{
|
||||||
/* Synthesize memory map */
|
/* Synthesize memory map */
|
||||||
|
|
|
@ -34,10 +34,6 @@ ArcGetConfigurationData(
|
||||||
VOID* ConfigurationData,
|
VOID* ConfigurationData,
|
||||||
CONFIGURATION_COMPONENT* Component);
|
CONFIGURATION_COMPONENT* Component);
|
||||||
|
|
||||||
/* mm.c */
|
|
||||||
const MEMORY_DESCRIPTOR*
|
|
||||||
ArcGetMemoryDescriptor(const MEMORY_DESCRIPTOR* Current);
|
|
||||||
|
|
||||||
/* time.c */
|
/* time.c */
|
||||||
TIMEINFO* ArcGetTime(VOID);
|
TIMEINFO* ArcGetTime(VOID);
|
||||||
ULONG ArcGetRelativeTime(VOID);
|
ULONG ArcGetRelativeTime(VOID);
|
||||||
|
|
|
@ -49,7 +49,7 @@ VOID XboxPrepareForReactOS(IN BOOLEAN Setup);
|
||||||
|
|
||||||
VOID XboxMemInit(VOID);
|
VOID XboxMemInit(VOID);
|
||||||
PVOID XboxMemReserveMemory(ULONG MbToReserve);
|
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 XboxDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
|
||||||
BOOLEAN XboxDiskGetPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry);
|
BOOLEAN XboxDiskGetPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry);
|
||||||
|
|
|
@ -46,7 +46,7 @@ VOID PcVideoSync(VOID);
|
||||||
VOID PcVideoPrepareForReactOS(IN BOOLEAN Setup);
|
VOID PcVideoPrepareForReactOS(IN BOOLEAN Setup);
|
||||||
VOID PcPrepareForReactOS(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 PcDiskGetBootPath(char *BootPath, unsigned Size);
|
||||||
BOOLEAN PcDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
|
BOOLEAN PcDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
|
||||||
|
|
|
@ -57,8 +57,8 @@ typedef struct tagMACHVTBL
|
||||||
VOID (*Beep)(VOID);
|
VOID (*Beep)(VOID);
|
||||||
VOID (*PrepareForReactOS)(IN BOOLEAN Setup);
|
VOID (*PrepareForReactOS)(IN BOOLEAN Setup);
|
||||||
|
|
||||||
MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(MEMORY_DESCRIPTOR* Current);
|
FREELDR_MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(FREELDR_MEMORY_DESCRIPTOR* Current);
|
||||||
PMEMORY_DESCRIPTOR (*GetMemoryMap)(PULONG MaxMemoryMapSize);
|
PFREELDR_MEMORY_DESCRIPTOR (*GetMemoryMap)(PULONG MaxMemoryMapSize);
|
||||||
|
|
||||||
BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size);
|
BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size);
|
||||||
BOOLEAN (*DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
|
BOOLEAN (*DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
|
||||||
|
|
|
@ -27,6 +27,13 @@ typedef enum
|
||||||
BiosMemoryAcpiNvs
|
BiosMemoryAcpiNvs
|
||||||
} BIOS_MEMORY_TYPE;
|
} 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>
|
#include <pshpack1.h>
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ ULONG LastFreePageHint = 0;
|
||||||
ULONG MmLowestPhysicalPage = 0xFFFFFFFF;
|
ULONG MmLowestPhysicalPage = 0xFFFFFFFF;
|
||||||
ULONG MmHighestPhysicalPage = 0;
|
ULONG MmHighestPhysicalPage = 0;
|
||||||
|
|
||||||
PMEMORY_DESCRIPTOR BiosMemoryMap;
|
PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap;
|
||||||
ULONG BiosMemoryMapEntryCount;
|
ULONG BiosMemoryMapEntryCount;
|
||||||
|
|
||||||
extern ULONG_PTR MmHeapPointer;
|
extern ULONG_PTR MmHeapPointer;
|
||||||
|
@ -67,11 +67,11 @@ extern ULONG_PTR MmHeapStart;
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
AddMemoryDescriptor(
|
AddMemoryDescriptor(
|
||||||
IN OUT PMEMORY_DESCRIPTOR List,
|
IN OUT PFREELDR_MEMORY_DESCRIPTOR List,
|
||||||
IN ULONG MaxCount,
|
IN ULONG MaxCount,
|
||||||
IN PFN_NUMBER BasePage,
|
IN PFN_NUMBER BasePage,
|
||||||
IN PFN_NUMBER PageCount,
|
IN PFN_NUMBER PageCount,
|
||||||
IN MEMORY_TYPE MemoryType)
|
IN TYPE_OF_MEMORY MemoryType)
|
||||||
{
|
{
|
||||||
ULONG i, c;
|
ULONG i, c;
|
||||||
PFN_NUMBER NextBase;
|
PFN_NUMBER NextBase;
|
||||||
|
@ -147,8 +147,8 @@ AddMemoryDescriptor(
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MEMORY_DESCRIPTOR*
|
const FREELDR_MEMORY_DESCRIPTOR*
|
||||||
ArcGetMemoryDescriptor(const MEMORY_DESCRIPTOR* Current)
|
ArcGetMemoryDescriptor(const FREELDR_MEMORY_DESCRIPTOR* Current)
|
||||||
{
|
{
|
||||||
if (Current == NULL)
|
if (Current == NULL)
|
||||||
{
|
{
|
||||||
|
@ -166,7 +166,7 @@ ArcGetMemoryDescriptor(const MEMORY_DESCRIPTOR* Current)
|
||||||
BOOLEAN MmInitializeMemoryManager(VOID)
|
BOOLEAN MmInitializeMemoryManager(VOID)
|
||||||
{
|
{
|
||||||
#if DBG
|
#if DBG
|
||||||
const MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
|
const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TRACE("Initializing Memory Manager.\n");
|
TRACE("Initializing Memory Manager.\n");
|
||||||
|
@ -239,7 +239,7 @@ ULONG MmGetPageNumberFromAddress(PVOID Address)
|
||||||
|
|
||||||
ULONG MmGetAddressablePageCountIncludingHoles(VOID)
|
ULONG MmGetAddressablePageCountIncludingHoles(VOID)
|
||||||
{
|
{
|
||||||
const MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
|
const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
|
||||||
ULONG PageCount;
|
ULONG PageCount;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -255,7 +255,7 @@ ULONG MmGetAddressablePageCountIncludingHoles(VOID)
|
||||||
//
|
//
|
||||||
// Yes, remember it if this is real memory
|
// Yes, remember it if this is real memory
|
||||||
//
|
//
|
||||||
if (MemoryDescriptor->MemoryType == MemoryFree)
|
if (MemoryDescriptor->MemoryType == LoaderFree)
|
||||||
MmHighestPhysicalPage = MemoryDescriptor->BasePage + MemoryDescriptor->PageCount;
|
MmHighestPhysicalPage = MemoryDescriptor->BasePage + MemoryDescriptor->PageCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ ULONG MmGetAddressablePageCountIncludingHoles(VOID)
|
||||||
|
|
||||||
PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount)
|
PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount)
|
||||||
{
|
{
|
||||||
const MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
|
const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
|
||||||
ULONG PageLookupTableSize;
|
ULONG PageLookupTableSize;
|
||||||
ULONG PageLookupTablePages;
|
ULONG PageLookupTablePages;
|
||||||
ULONG PageLookupTableStartPage = 0;
|
ULONG PageLookupTableStartPage = 0;
|
||||||
|
@ -293,7 +293,7 @@ PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount)
|
||||||
while ((MemoryDescriptor = ArcGetMemoryDescriptor(MemoryDescriptor)) != NULL)
|
while ((MemoryDescriptor = ArcGetMemoryDescriptor(MemoryDescriptor)) != NULL)
|
||||||
{
|
{
|
||||||
// Continue, if memory is not free
|
// Continue, if memory is not free
|
||||||
if (MemoryDescriptor->MemoryType != MemoryFree) continue;
|
if (MemoryDescriptor->MemoryType != LoaderFree) continue;
|
||||||
|
|
||||||
// Continue, if the block is not big enough?
|
// Continue, if the block is not big enough?
|
||||||
if (MemoryDescriptor->PageCount < PageLookupTablePages) continue;
|
if (MemoryDescriptor->PageCount < PageLookupTablePages) continue;
|
||||||
|
@ -318,7 +318,7 @@ PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount)
|
||||||
|
|
||||||
VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount)
|
VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount)
|
||||||
{
|
{
|
||||||
const MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
|
const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
|
||||||
TYPE_OF_MEMORY MemoryMapPageAllocated;
|
TYPE_OF_MEMORY MemoryMapPageAllocated;
|
||||||
ULONG PageLookupTableStartPage;
|
ULONG PageLookupTableStartPage;
|
||||||
ULONG PageLookupTablePageCount;
|
ULONG PageLookupTablePageCount;
|
||||||
|
|
Loading…
Reference in a new issue