[FREELDR] Limit the usage of DiskStopFloppyMotor() in hardware/platform-specific...
[reactos.git] / boot / freeldr / freeldr / arch / arm / macharm.c
index c45bd0f..348d304 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:         ReactOS Boot Loader
  * LICENSE:         BSD - See COPYING.ARM in the top level directory
- * FILE:            boot/freeldr/arch/arm/marcharm.c
+ * FILE:            boot/freeldr/freeldr/arch/arm/macharm.c
  * PURPOSE:         Provides abstraction between the ARM Boot Loader and FreeLDR
  * PROGRAMMERS:     ReactOS Portable Systems Group
  */
@@ -29,8 +29,7 @@ ULONG SecondLevelDcacheFillSize;
 ULONG SecondLevelIcacheSize;
 ULONG SecondLevelIcacheFillSize;
 
-ARC_DISK_SIGNATURE reactos_arc_disk_info;
-ULONG reactos_disk_count;
+extern ULONG reactos_disk_count;
 
 ULONG SizeBits[] =
 {
@@ -60,6 +59,12 @@ ULONG LenBits[] =
 
 /* FUNCTIONS ******************************************************************/
 
+VOID
+FrLdrCheckCpuCompatibility(VOID)
+{
+    /* Nothing for now */
+}
+
 VOID
 ArmInit(IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
 {
@@ -81,32 +86,11 @@ ArmInit(IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
 }
 
 VOID
-ArmPrepareForReactOS(IN BOOLEAN Setup)
+ArmPrepareForReactOS(VOID)
 {
     return;
 }
 
-BOOLEAN
-ArmDiskGetBootPath(OUT PCHAR BootPath,
-                   IN unsigned Size)
-{
-    PCCH Path = "ramdisk(0)";
-
-    /* Make sure enough space exists */
-    if (Size < sizeof(Path)) return FALSE;
-
-    /* On ARM platforms, the loader is always in RAM */
-    strcpy(BootPath, Path);
-    return TRUE;
-}
-
-BOOLEAN
-ArmInitializeBootDevices(VOID)
-{
-    /* Emulate old behavior */
-    return (ArmHwDetect() != NULL);
-}
-
 PCONFIGURATION_COMPONENT_DATA
 ArmHwDetect(VOID)
 {
@@ -140,20 +124,31 @@ ArmHwDetect(VOID)
     RamDiskInitialize();
 
     /* Fill out the ARC disk block */
-    reactos_arc_disk_info.Signature = 0xBADAB00F;
-    reactos_arc_disk_info.CheckSum = 0xDEADBABE;
-    reactos_arc_disk_info.ArcName = "ramdisk(0)";
-    reactos_disk_count = 1;
+    AddReactOSArcDiskInfo("ramdisk(0)", 0xBADAB00F, 0xDEADBABE, TRUE);
+    ASSERT(reactos_disk_count == 1);
 
     /* Return the root node */
     return RootNode;
 }
 
+BOOLEAN
+ArmInitializeBootDevices(VOID)
+{
+    /* Emulate old behavior */
+    if (ArmHwDetect() == NULL)
+        return FALSE;
+
+    /* On ARM platforms, the loader is always in RAM */
+    strcpy(FrldrBootPath, "ramdisk(0)");
+    return TRUE;
+}
+
 FREELDR_MEMORY_DESCRIPTOR ArmMemoryMap[32];
 
 PFREELDR_MEMORY_DESCRIPTOR
 ArmMemGetMemoryMap(OUT ULONG *MemoryMapSize)
 {
+    ULONG i;
     ASSERT(ArmBoardBlock->MemoryMapEntryCount <= 32);
 
     /* Return whatever the board returned to us (CS0 Base + Size and FLASH0) */
@@ -167,7 +162,10 @@ ArmMemGetMemoryMap(OUT ULONG *MemoryMapSize)
             ArmMemoryMap[i].MemoryType = MemoryFirmwarePermanent;
     }
 
-    return ArmBoardBlock->MemoryMapEntryCount;
+    *MemoryMapSize = ArmBoardBlock->MemoryMapEntryCount;
+
+    // FIXME
+    return NULL;
 }
 
 VOID
@@ -229,6 +227,5 @@ MachInit(IN PCCH CommandLine)
     MachVtbl.GetMemoryMap = ArmMemGetMemoryMap;
     MachVtbl.InitializeBootDevices = ArmInitializeBootDevices;
     MachVtbl.HwDetect = ArmHwDetect;
-    MachVtbl.DiskGetBootPath = ArmDiskGetBootPath;
     MachVtbl.HwIdle = ArmHwIdle;
 }