mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 06:45:24 +00:00
[freeldr] Remove MachDiskGetPartitionEntry, and directly use the correct one
Remove PpcDiskNormalizeSystemPath(), it was the same as DiskNormalizeSystemPath() svn path=/trunk/; revision=43271
This commit is contained in:
parent
94b78efb6a
commit
b150069433
8 changed files with 5 additions and 63 deletions
|
@ -203,7 +203,6 @@ MachInit(IN PCCH CommandLine)
|
|||
//
|
||||
MachVtbl.DiskGetBootPath = DiskGetBootPath;
|
||||
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
|
||||
MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry;
|
||||
|
||||
//
|
||||
// We can now print to the console
|
||||
|
|
|
@ -440,7 +440,7 @@ static LONG DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
|
|||
SectorSize = (DrivePartition == 0xff ? 2048 : 512);
|
||||
if (DrivePartition != 0xff && DrivePartition != 0)
|
||||
{
|
||||
if (!MachDiskGetPartitionEntry(DriveNumber, DrivePartition, &PartitionTableEntry))
|
||||
if (!DiskGetPartitionEntry(DriveNumber, DrivePartition, &PartitionTableEntry))
|
||||
return EINVAL;
|
||||
SectorOffset = PartitionTableEntry.SectorCountBeforePartition;
|
||||
SectorCount = PartitionTableEntry.PartitionSectorCount;
|
||||
|
@ -565,7 +565,7 @@ GetHarddiskIdentifier(PCHAR Identifier,
|
|||
/* Add partitions */
|
||||
i = 1;
|
||||
DiskReportError(FALSE);
|
||||
while (MachDiskGetPartitionEntry(DriveNumber, i, &PartitionTableEntry))
|
||||
while (DiskGetPartitionEntry(DriveNumber, i, &PartitionTableEntry))
|
||||
{
|
||||
if (PartitionTableEntry.SystemIndicator != PARTITION_ENTRY_UNUSED)
|
||||
{
|
||||
|
|
|
@ -47,7 +47,6 @@ PcMachInit(const char *CmdLine)
|
|||
MachVtbl.DiskGetBootPath = DiskGetBootPath;
|
||||
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
|
||||
MachVtbl.DiskReadLogicalSectors = PcDiskReadLogicalSectors;
|
||||
MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry;
|
||||
MachVtbl.DiskGetDriveGeometry = PcDiskGetDriveGeometry;
|
||||
MachVtbl.DiskGetCacheableBlockCount = PcDiskGetCacheableBlockCount;
|
||||
MachVtbl.GetTime = PcGetTime;
|
||||
|
|
|
@ -50,7 +50,6 @@ XboxMachInit(const char *CmdLine)
|
|||
MachVtbl.DiskGetBootPath = DiskGetBootPath;
|
||||
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
|
||||
MachVtbl.DiskReadLogicalSectors = XboxDiskReadLogicalSectors;
|
||||
MachVtbl.DiskGetPartitionEntry = XboxDiskGetPartitionEntry;
|
||||
MachVtbl.DiskGetDriveGeometry = XboxDiskGetDriveGeometry;
|
||||
MachVtbl.DiskGetCacheableBlockCount = XboxDiskGetCacheableBlockCount;
|
||||
MachVtbl.GetTime = XboxGetTime;
|
||||
|
|
|
@ -141,7 +141,7 @@ static LONG DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
|
|||
SectorSize = (DrivePartition == 0xff ? 2048 : 512);
|
||||
if (DrivePartition != 0xff && DrivePartition != 0)
|
||||
{
|
||||
if (!MachDiskGetPartitionEntry(DriveNumber, DrivePartition, &PartitionTableEntry))
|
||||
if (!XboxDiskGetPartitionEntry(DriveNumber, DrivePartition, &PartitionTableEntry))
|
||||
return EINVAL;
|
||||
SectorOffset = PartitionTableEntry.SectorCountBeforePartition;
|
||||
SectorCount = PartitionTableEntry.PartitionSectorCount;
|
||||
|
@ -266,7 +266,7 @@ GetHarddiskIdentifier(PCHAR Identifier,
|
|||
/* Add partitions */
|
||||
i = 1;
|
||||
DiskReportError(FALSE);
|
||||
while (MachDiskGetPartitionEntry(DriveNumber, i, &PartitionTableEntry))
|
||||
while (XboxDiskGetPartitionEntry(DriveNumber, i, &PartitionTableEntry))
|
||||
{
|
||||
if (PartitionTableEntry.SystemIndicator != PARTITION_ENTRY_UNUSED)
|
||||
{
|
||||
|
|
|
@ -281,12 +281,6 @@ BOOLEAN PpcDiskReadLogicalSectors( ULONG DriveNumber, ULONGLONG SectorNumber,
|
|||
return rlen > 0;
|
||||
}
|
||||
|
||||
BOOLEAN PpcDiskGetPartitionEntry( ULONG DriveNumber, ULONG PartitionNumber,
|
||||
PPARTITION_TABLE_ENTRY PartitionTableEntry ) {
|
||||
printf("GetPartitionEntry(%d,%d)\n", DriveNumber, PartitionNumber);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN PpcDiskGetDriveGeometry( ULONG DriveNumber, PGEOMETRY DriveGeometry ) {
|
||||
printf("GetGeometry(%d)\n", DriveNumber);
|
||||
DriveGeometry->BytesPerSector = 512;
|
||||
|
@ -420,44 +414,6 @@ PCONFIGURATION_COMPONENT_DATA PpcHwDetect() {
|
|||
return RootKey;
|
||||
}
|
||||
|
||||
BOOLEAN PpcDiskNormalizeSystemPath(char *SystemPath, unsigned Size) {
|
||||
CHAR BootPath[256];
|
||||
ULONG PartitionNumber;
|
||||
ULONG DriveNumber;
|
||||
PARTITION_TABLE_ENTRY PartEntry;
|
||||
char *p;
|
||||
|
||||
if (!DissectArcPath(SystemPath, BootPath, &DriveNumber, &PartitionNumber))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (0 != PartitionNumber)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (! DiskGetActivePartitionEntry(DriveNumber,
|
||||
&PartEntry,
|
||||
&PartitionNumber) ||
|
||||
PartitionNumber < 1 || 9 < PartitionNumber)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
p = SystemPath;
|
||||
while ('\0' != *p && 0 != _strnicmp(p, "partition(", 10)) {
|
||||
p++;
|
||||
}
|
||||
p = strchr(p, ')');
|
||||
if (NULL == p || '0' != *(p - 1)) {
|
||||
return FALSE;
|
||||
}
|
||||
*(p - 1) = '0' + PartitionNumber;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Compatibility functions that don't do much */
|
||||
VOID PpcVideoPrepareForReactOS(BOOLEAN Setup) {
|
||||
}
|
||||
|
@ -484,10 +440,9 @@ void PpcDefaultMachVtbl()
|
|||
|
||||
MachVtbl.GetMemoryMap = PpcGetMemoryMap;
|
||||
|
||||
MachVtbl.DiskNormalizeSystemPath = PpcDiskNormalizeSystemPath;
|
||||
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
|
||||
MachVtbl.DiskGetBootPath = PpcDiskGetBootPath;
|
||||
MachVtbl.DiskReadLogicalSectors = PpcDiskReadLogicalSectors;
|
||||
MachVtbl.DiskGetPartitionEntry = PpcDiskGetPartitionEntry;
|
||||
MachVtbl.DiskGetDriveGeometry = PpcDiskGetDriveGeometry;
|
||||
MachVtbl.DiskGetCacheableBlockCount = PpcDiskGetCacheableBlockCount;
|
||||
|
||||
|
|
|
@ -65,7 +65,6 @@ typedef struct tagMACHVTBL
|
|||
BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size);
|
||||
BOOLEAN (*DiskNormalizeSystemPath)(char *SystemPath, unsigned Size);
|
||||
BOOLEAN (*DiskReadLogicalSectors)(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
|
||||
BOOLEAN (*DiskGetPartitionEntry)(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry);
|
||||
BOOLEAN (*DiskGetDriveGeometry)(ULONG DriveNumber, PGEOMETRY DriveGeometry);
|
||||
ULONG (*DiskGetCacheableBlockCount)(ULONG DriveNumber);
|
||||
|
||||
|
@ -99,7 +98,6 @@ MEMORY_DESCRIPTOR* ArcGetMemoryDescriptor(MEMORY_DESCRIPTOR* Current);
|
|||
BOOLEAN MachDiskGetBootPath(char *BootPath, unsigned Size);
|
||||
BOOLEAN MachDiskNormalizeSystemPath(char *SystemPath, unsigned Size);
|
||||
BOOLEAN MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
|
||||
BOOLEAN MachDiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry);
|
||||
BOOLEAN MachDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry);
|
||||
ULONG MachDiskGetCacheableBlockCount(ULONG DriveNumber);
|
||||
TIMEINFO* ArcGetTime(VOID);
|
||||
|
@ -127,7 +125,6 @@ VOID MachPrepareForReactOS(IN BOOLEAN Setup);
|
|||
#define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size))
|
||||
#define MachDiskNormalizeSystemPath(Path, Size) MachVtbl.DiskNormalizeSystemPath((Path), (Size))
|
||||
#define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
|
||||
#define MachDiskGetPartitionEntry(Drive, Part, Entry) MachVtbl.DiskGetPartitionEntry((Drive), (Part), (Entry))
|
||||
#define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
|
||||
#define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
|
||||
#define MachHwDetect() MachVtbl.HwDetect()
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#undef MachDiskGetBootPath
|
||||
#undef MachDiskNormalizeSystemPath
|
||||
#undef MachDiskReadLogicalSectors
|
||||
#undef MachDiskGetPartitionEntry
|
||||
#undef MachDiskGetDriveGeometry
|
||||
#undef MachDiskGetCacheableBlockCount
|
||||
#undef MachHwDetect
|
||||
|
@ -166,12 +165,6 @@ MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG Sect
|
|||
return MachVtbl.DiskReadLogicalSectors(DriveNumber, SectorNumber, SectorCount, Buffer);
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
MachDiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
||||
{
|
||||
return MachVtbl.DiskGetPartitionEntry(DriveNumber, PartitionNumber, PartitionTableEntry);
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
MachDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue