https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f2a58733e85158a8325e657e9cdfc32f35d516ba

commit f2a58733e85158a8325e657e9cdfc32f35d516ba
Author:     Justin Miller <[email protected]>
AuthorDate: Wed May 3 11:56:06 2023 -0700
Commit:     GitHub <[email protected]>
CommitDate: Wed May 3 20:56:06 2023 +0200

    [FREELDR][SDK] Build UEFI bootloader for ARM32 (#5196)
    
    CORE-17604
    
    - Disable some functions for ARM32;
    - Remove some link options not used on ARM;
    - Add get _controlfp() to LIBCNTPR to link properly on ARM;
    - Unify Freeldr UI Drawing on ARM;
    - Add qemu UART debugging for ARM32/ARM64.
---
 boot/freeldr/freeldr/arch/arm/debug.c    | 35 ++++++++++++++
 boot/freeldr/freeldr/arch/arm/entry.c    | 11 -----
 boot/freeldr/freeldr/arch/arm/macharm.c  |  4 ++
 boot/freeldr/freeldr/arch/uefi/stubs.c   |  2 +
 boot/freeldr/freeldr/arch/uefi/uefildr.c |  2 +
 boot/freeldr/freeldr/include/debug.h     |  2 +-
 boot/freeldr/freeldr/lib/debug.c         |  7 ++-
 boot/freeldr/freeldr/uefi.cmake          |  8 +++-
 boot/freeldr/freeldr/ui/directui.c       |  3 +-
 boot/freeldr/freeldr/ui/gui.c            |  2 -
 boot/freeldr/freeldr/ui/minitui.c        | 13 -----
 boot/freeldr/freeldr/ui/noui.c           |  3 --
 boot/freeldr/freeldr/ui/tui.c            | 15 ------
 boot/freeldr/freeldr/ui/tuimenu.c        | 82 +++-----------------------------
 boot/freeldr/freeldr/ui/ui.c             | 37 --------------
 boot/freeldr/freeldr/ui/video.c          |  2 -
 sdk/lib/crt/float/float.cmake            |  7 +++
 17 files changed, 71 insertions(+), 164 deletions(-)

diff --git a/boot/freeldr/freeldr/arch/arm/debug.c 
b/boot/freeldr/freeldr/arch/arm/debug.c
new file mode 100644
index 00000000000..f7d65d2bfc5
--- /dev/null
+++ b/boot/freeldr/freeldr/arch/arm/debug.c
@@ -0,0 +1,35 @@
+/*
+ * PROJECT:     Freeldr ARM32
+ * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE:     Arch specific debug
+ * COPYRIGHT:   Copyright 2022 Justin Miller <[email protected]>
+ */
+
+#include <freeldr.h>
+#include <debug.h>
+
+#define QEMUUART 0x09000000
+volatile unsigned int * UART0DR = (unsigned int *) QEMUUART;
+
+BOOLEAN
+Rs232PortInitialize(IN ULONG ComPort,
+                    IN ULONG BaudRate)
+{
+    return TRUE;
+}
+
+VOID
+Rs232PortPutByte(UCHAR ByteToSend)
+{
+    *UART0DR = ByteToSend;
+}
+
+VOID
+FrLdrBugCheckWithMessage(
+    ULONG BugCode,
+    PCHAR File,
+    ULONG Line,
+    PSTR Format,
+    ...)
+{
+}
diff --git a/boot/freeldr/freeldr/arch/arm/entry.c 
b/boot/freeldr/freeldr/arch/arm/entry.c
index 4f5a015e4f8..6dbbb2be4df 100644
--- a/boot/freeldr/freeldr/arch/arm/entry.c
+++ b/boot/freeldr/freeldr/arch/arm/entry.c
@@ -18,14 +18,3 @@ RealEntryPoint(VOID)
 {
     BootMain("");
 }
-
-VOID
-FrLdrBugCheckWithMessage(
-    ULONG BugCode,
-    PCHAR File,
-    ULONG Line,
-    PSTR Format,
-    ...)
-{
-
-}
diff --git a/boot/freeldr/freeldr/arch/arm/macharm.c 
b/boot/freeldr/freeldr/arch/arm/macharm.c
index cfca3b17169..b62ba474df5 100644
--- a/boot/freeldr/freeldr/arch/arm/macharm.c
+++ b/boot/freeldr/freeldr/arch/arm/macharm.c
@@ -18,7 +18,9 @@ ULONG gDiskReadBuffer, gFileSysBuffer;
 BOOLEAN ArmHwDetectRan;
 PCONFIGURATION_COMPONENT_DATA RootNode;
 
+#ifndef UEFIBOOT
 BOOLEAN AcpiPresent = FALSE;
+#endif
 
 ULONG FirstLevelDcacheSize;
 ULONG FirstLevelDcacheFillSize;
@@ -174,6 +176,7 @@ ArmHwIdle(VOID)
     /* UNIMPLEMENTED */
 }
 
+#ifndef UEFIBOOT
 VOID
 MachInit(IN PCCH CommandLine)
 {
@@ -229,3 +232,4 @@ MachInit(IN PCCH CommandLine)
     MachVtbl.HwDetect = ArmHwDetect;
     MachVtbl.HwIdle = ArmHwIdle;
 }
+#endif
diff --git a/boot/freeldr/freeldr/arch/uefi/stubs.c 
b/boot/freeldr/freeldr/arch/uefi/stubs.c
index 28f11b7795b..513f9f8f85d 100644
--- a/boot/freeldr/freeldr/arch/uefi/stubs.c
+++ b/boot/freeldr/freeldr/arch/uefi/stubs.c
@@ -9,12 +9,14 @@
 
 #include <debug.h>
 
+#ifndef _M_ARM
 /* TODO: Handle this with custom Disk / partition setup */
 UCHAR
 DriveMapGetBiosDriveNumber(PCSTR DeviceName)
 {
     return 0;
 }
+#endif
 
 VOID
 StallExecutionProcessor(ULONG Microseconds)
diff --git a/boot/freeldr/freeldr/arch/uefi/uefildr.c 
b/boot/freeldr/freeldr/arch/uefi/uefildr.c
index ded8e405f69..ef0dd85cba3 100644
--- a/boot/freeldr/freeldr/arch/uefi/uefildr.c
+++ b/boot/freeldr/freeldr/arch/uefi/uefildr.c
@@ -31,7 +31,9 @@ EfiEntry(
     return 0;
 }
 
+#ifndef _M_ARM
 VOID __cdecl Reboot(VOID)
 {
 
 }
+#endif
diff --git a/boot/freeldr/freeldr/include/debug.h 
b/boot/freeldr/freeldr/include/debug.h
index feed051d013..3c9d741dac6 100644
--- a/boot/freeldr/freeldr/include/debug.h
+++ b/boot/freeldr/freeldr/include/debug.h
@@ -38,7 +38,7 @@
 #define DPRINT_HEAP         15  // messages in a bottle
 #define DBG_CHANNELS_COUNT  16
 
-#if DBG && !defined(_M_ARM)
+#if DBG
 
     VOID    DebugInit(IN ULONG_PTR FrLdrSectionId);
     ULONG   DbgPrint(const char *Format, ...);
diff --git a/boot/freeldr/freeldr/lib/debug.c b/boot/freeldr/freeldr/lib/debug.c
index b7a37977696..4edb35e4bae 100644
--- a/boot/freeldr/freeldr/lib/debug.c
+++ b/boot/freeldr/freeldr/lib/debug.c
@@ -20,7 +20,7 @@
 #include <freeldr.h>
 #include <debug.h>
 
-#if DBG && !defined(_M_ARM)
+#if DBG
 
 // #define DEBUG_ALL
 // #define DEBUG_WARN
@@ -54,6 +54,11 @@ ULONG PortIrq  = 0; // Not used at the moment.
 
 BOOLEAN DebugStartOfLine = TRUE;
 
+#ifdef UEFIBOOT
+VOID
+ARMWriteToUART(UCHAR Data);
+#endif
+
 VOID DebugInit(IN ULONG_PTR FrLdrSectionId)
 {
     PCHAR CommandLine, PortString, BaudString, IrqString;
diff --git a/boot/freeldr/freeldr/uefi.cmake b/boot/freeldr/freeldr/uefi.cmake
index 0adb0a25f4b..76483f0529e 100644
--- a/boot/freeldr/freeldr/uefi.cmake
+++ b/boot/freeldr/freeldr/uefi.cmake
@@ -29,6 +29,9 @@ if(ARCH STREQUAL "i386")
 elseif(ARCH STREQUAL "amd64")
     #TBD
 elseif(ARCH STREQUAL "arm")
+    list(APPEND UEFILDR_ARC_SOURCE
+        arch/arm/macharm.c
+        arch/arm/debug.c)
     #TBD
 elseif(ARCH STREQUAL "arm64")
     #TBD
@@ -86,7 +89,10 @@ set_target_properties(uefildr PROPERTIES SUFFIX ".efi")
 target_compile_definitions(uefildr PRIVATE UEFIBOOT)
 
 if(MSVC)
-    target_link_options(uefildr PRIVATE /DYNAMICBASE:NO /NXCOMPAT:NO 
/ignore:4078 /ignore:4254 /DRIVER)
+if(NOT ARCH STREQUAL "arm")
+    target_link_options(uefildr PRIVATE /DYNAMICBASE:NO)
+endif()
+    target_link_options(uefildr PRIVATE /NXCOMPAT:NO /ignore:4078 /ignore:4254 
/DRIVER)
     # We don't need hotpatching
     remove_target_compile_option(uefildr "/hotpatch")
 else()
diff --git a/boot/freeldr/freeldr/ui/directui.c 
b/boot/freeldr/freeldr/ui/directui.c
index f34f1dc2158..8bd47b2be0e 100644
--- a/boot/freeldr/freeldr/ui/directui.c
+++ b/boot/freeldr/freeldr/ui/directui.c
@@ -6,8 +6,7 @@
  * PROGRAMMERS:     ReactOS Portable Systems Group
  */
 
-#ifdef _M_ARM
-
+#if 0
 #include <freeldr.h>
 
 /* GLOBALS 
********************************************************************/
diff --git a/boot/freeldr/freeldr/ui/gui.c b/boot/freeldr/freeldr/ui/gui.c
index 3c631902e2f..d3160199ac9 100644
--- a/boot/freeldr/freeldr/ui/gui.c
+++ b/boot/freeldr/freeldr/ui/gui.c
@@ -17,7 +17,6 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifndef _M_ARM
 #include <freeldr.h>
 
 VOID GuiDrawBackdrop(VOID)
@@ -113,4 +112,3 @@ const UIVTBL GuiVtbl =
     NULL, NULL, NULL, NULL, NULL, NULL, NULL,
     NULL
 };
-#endif
diff --git a/boot/freeldr/freeldr/ui/minitui.c 
b/boot/freeldr/freeldr/ui/minitui.c
index 872b9aac6ed..d44aef6bc67 100644
--- a/boot/freeldr/freeldr/ui/minitui.c
+++ b/boot/freeldr/freeldr/ui/minitui.c
@@ -13,8 +13,6 @@
 // #define NTLDR_PROGRESSBAR
 // #define BTMGR_PROGRESSBAR /* Default style */
 
-#ifndef _M_ARM
-
 BOOLEAN MiniTuiInitialize(VOID)
 {
     /* Initialize main TUI */
@@ -71,8 +69,6 @@ VOID MiniTuiDrawStatusText(PCSTR StatusText)
     /* Minimal UI doesn't have a status bar */
 }
 
-#endif // _M_ARM
-
 /*static*/ VOID
 MiniTuiSetProgressBarText(
     _In_ PCSTR ProgressText)
@@ -143,10 +139,8 @@ MiniTuiTickProgressBar(
                 UiProgressBar.Right, UiProgressBar.Bottom,
                 ' ', ATTR(UiTextColor, UiMenuBgColor));
 
-#ifndef _M_ARM
     TuiUpdateDateTime();
     VideoCopyOffScreenBufferToVRAM();
-#endif
 }
 
 VOID
@@ -191,10 +185,8 @@ MiniTuiDrawMenu(
 {
     ULONG i;
 
-#ifndef _M_ARM
     /* Draw the backdrop */
     UiDrawBackdrop();
-#endif
 
     /* No GUI status bar text, just minimal text. Show the menu header. */
     if (MenuInfo->MenuHeader)
@@ -239,13 +231,9 @@ MiniTuiDrawMenu(
         DisplayBootTimeOptions();
     }
 
-#ifndef _M_ARM
     VideoCopyOffScreenBufferToVRAM();
-#endif
 }
 
-#ifndef _M_ARM
-
 const UIVTBL MiniTuiVtbl =
 {
     MiniTuiInitialize,
@@ -274,4 +262,3 @@ const UIVTBL MiniTuiVtbl =
     MiniTuiDrawMenu,
 };
 
-#endif // _M_ARM
diff --git a/boot/freeldr/freeldr/ui/noui.c b/boot/freeldr/freeldr/ui/noui.c
index 5bc33d70e69..1e7c21d1554 100644
--- a/boot/freeldr/freeldr/ui/noui.c
+++ b/boot/freeldr/freeldr/ui/noui.c
@@ -6,7 +6,6 @@
  * PROGRAMMERS:     Hervé Poussineau
  */
 
-#ifndef _M_ARM
 #include <freeldr.h>
 
 BOOLEAN NoUiInitialize(VOID)
@@ -183,5 +182,3 @@ NoUiDrawMenu(
     _In_ PUI_MENU_INFO MenuInfo)
 {
 }
-
-#endif // _M_ARM
diff --git a/boot/freeldr/freeldr/ui/tui.c b/boot/freeldr/freeldr/ui/tui.c
index be9cb22567d..bb5646aa917 100644
--- a/boot/freeldr/freeldr/ui/tui.c
+++ b/boot/freeldr/freeldr/ui/tui.c
@@ -19,9 +19,7 @@
 
 #include <freeldr.h>
 
-#ifndef _M_ARM
 PVOID TextVideoBuffer = NULL;
-#endif
 
 /* GENERIC TUI UTILS *********************************************************/
 
@@ -93,9 +91,7 @@ TuiDrawText2(
     _In_reads_or_z_(MaxNumChars) PCSTR Text,
     _In_ UCHAR Attr)
 {
-#ifndef _M_ARM
     PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
-#endif
     ULONG i, j;
 
     /* Don't display anything if we are out of the screen */
@@ -105,13 +101,8 @@ TuiDrawText2(
     /* Draw the text, not exceeding the width */
     for (i = X, j = 0; Text[j] && i < UiScreenWidth && (MaxNumChars > 0 ? j < 
MaxNumChars : TRUE); i++, j++)
     {
-#ifndef _M_ARM
         ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)]   = (UCHAR)Text[j];
         ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)+1] = Attr;
-#else
-        /* Write the character */
-        MachVideoPutChar(Text[j], Attr, i, Y);
-#endif
     }
 }
 
@@ -196,8 +187,6 @@ TuiDrawCenteredText(
 
 /* FULL TUI THEME ************************************************************/
 
-#ifndef _M_ARM
-
 #define TAG_TUI_SCREENBUFFER 'SiuT'
 #define TAG_TUI_PALETTE      'PiuT'
 
@@ -802,10 +791,8 @@ TuiTickProgressBar(
                 UiProgressBar.Right, UiProgressBar.Bottom,
                 '\xB2', ATTR(UiTextColor, UiMenuBgColor));
 
-#ifndef _M_ARM
     TuiUpdateDateTime();
     VideoCopyOffScreenBufferToVRAM();
-#endif
 }
 
 static VOID
@@ -1241,5 +1228,3 @@ const UIVTBL TuiVtbl =
     TuiDisplayMenu,
     TuiDrawMenu,
 };
-
-#endif // _M_ARM
diff --git a/boot/freeldr/freeldr/ui/tuimenu.c 
b/boot/freeldr/freeldr/ui/tuimenu.c
index 548d209e42b..e65b642f367 100644
--- a/boot/freeldr/freeldr/ui/tuimenu.c
+++ b/boot/freeldr/freeldr/ui/tuimenu.c
@@ -91,11 +91,7 @@ TuiDisplayMenu(
     TuiCalcMenuBoxSize(&MenuInformation);
 
     /* Draw the menu */
-#ifdef _M_ARM
-    UiDrawMenu(&MenuInformation);
-#else
     UiVtbl.DrawMenu(&MenuInformation);
-#endif
 
     /* Get the current second of time */
     LastClockSecond = ArcGetTime()->Second;
@@ -117,10 +113,9 @@ TuiDisplayMenu(
             /* Update the time information */
             LastClockSecond = CurrentClockSecond;
 
-#ifndef _M_ARM // FIXME: Theme-specific
+            // FIXME: Theme-specific
             /* Update the date & time */
             TuiUpdateDateTime();
-#endif
 
             /* If there is a countdown, update it */
             if (MenuInformation.MenuTimeRemaining > 0)
@@ -131,19 +126,13 @@ TuiDisplayMenu(
             else if (MenuInformation.MenuTimeRemaining == 0)
             {
                 /* A timeout occurred, exit this loop and return selection */
-#ifndef _M_ARM
                 VideoCopyOffScreenBufferToVRAM();
-#endif
                 break;
             }
-#ifndef _M_ARM
             VideoCopyOffScreenBufferToVRAM();
-#endif
         }
 
-#ifndef _M_ARM
         MachHwIdle();
-#endif
     }
 
     /* Return the selected item */
@@ -178,7 +167,6 @@ TuiCalcMenuBoxSize(
     /* Allow room for left & right borders, plus 8 spaces on each side */
     Width += 18;
 
-#ifndef _M_ARM
     /* Check if we're drawing a centered menu */
     if (UiCenterMenu)
     {
@@ -188,7 +176,6 @@ TuiCalcMenuBoxSize(
                           Height) / 2) + TUI_TITLE_BOX_CHAR_HEIGHT;
     }
     else
-#endif
     {
         /* Put the menu in the default left-corner position */
         MenuInfo->Left = -1;
@@ -206,21 +193,9 @@ TuiDrawMenu(
 {
     ULONG i;
 
-#ifndef _M_ARM // FIXME: Theme-specific
+    // FIXME: Theme-specific
     /* Draw the backdrop */
     UiDrawBackdrop();
-#else
-
-    /* No GUI status bar text, just minimal text. Show the menu header. */
-    if (MenuInfo->MenuHeader)
-    {
-        UiDrawText(0,
-                   MenuInfo->Top - 2,
-                   MenuInfo->MenuHeader,
-                   ATTR(UiMenuFgColor, UiMenuBgColor));
-    }
-
-#endif
 
     /* Draw the menu box */
     TuiDrawMenuBox(MenuInfo);
@@ -231,43 +206,17 @@ TuiDrawMenu(
         TuiDrawMenuItem(MenuInfo, i);
     }
 
-#ifndef _M_ARM // FIXME: Theme-specific
-
+    // FIXME: Theme-specific
     /* Update the status bar */
     UiVtbl.DrawStatusText("Use \x18 and \x19 to select, then press ENTER.");
 
-#else
-
-    /* Now tell the user how to choose */
-    UiDrawText(0,
-               MenuInfo->Bottom + 1,
-               "Use \x18 and \x19 to move the highlight to your choice.",
-               ATTR(UiMenuFgColor, UiMenuBgColor));
-    UiDrawText(0,
-               MenuInfo->Bottom + 2,
-               "Press ENTER to choose.",
-               ATTR(UiMenuFgColor, UiMenuBgColor));
-
-    /* And show the menu footer */
-    if (MenuInfo->MenuFooter)
-    {
-        UiDrawText(0,
-                   UiScreenHeight - 4,
-                   MenuInfo->MenuFooter,
-                   ATTR(UiMenuFgColor, UiMenuBgColor));
-    }
-
-#endif
-
     /* Display the boot options if needed */
     if (MenuInfo->ShowBootOptions)
     {
         DisplayBootTimeOptions();
     }
 
-#ifndef _M_ARM
     VideoCopyOffScreenBufferToVRAM();
-#endif
 }
 
 static VOID
@@ -330,7 +279,6 @@ TuiDrawMenuTimeout(
      *  1       1       Pad on the left with blanks + box bottom border.
      **/
 
-#ifndef _M_ARM
     if (UiCenterMenu)
     {
         /* In boxed menu mode, pad on the left with blanks and box border,
@@ -368,7 +316,6 @@ TuiDrawMenuTimeout(
         }
     }
     else
-#endif
     {
         if (Length > 0)
         {
@@ -385,13 +332,8 @@ TuiDrawMenuTimeout(
                     MenuInfo->Bottom + 4,
                     Length ? (Length + 1) : (UiScreenWidth - 1),
                     MenuInfo->Bottom + 4,
-#ifndef _M_ARM
                     UiBackdropFillStyle,
                     ATTR(UiBackdropFgColor, UiBackdropBgColor)
-#else
-                    0, // ' '
-                    ATTR(UiTextColor, COLOR_BLACK) // UiMenuBgColor
-#endif
                     );
     }
 }
@@ -400,7 +342,7 @@ VOID
 TuiDrawMenuBox(
     _In_ PUI_MENU_INFO MenuInfo)
 {
-#ifndef _M_ARM // FIXME: Theme-specific
+    // FIXME: Theme-specific
     /* Draw the menu box if requested */
     if (UiMenuBox)
     {
@@ -417,8 +359,6 @@ TuiDrawMenuBox(
 
     /* Update the date & time */
     TuiUpdateDateTime();
-#endif
-
     TuiDrawMenuTimeout(MenuInfo);
 }
 
@@ -435,7 +375,7 @@ TuiDrawMenuItem(
     /* If this is a separator */
     if (MenuInfo->MenuItemList[MenuItemNumber] == NULL)
     {
-#ifndef _M_ARM // FIXME: Theme-specific
+        // FIXME: Theme-specific
         /* Draw its left box corner */
         if (UiMenuBox)
         {
@@ -444,7 +384,6 @@ TuiDrawMenuItem(
                        "\xC7",
                        ATTR(UiMenuFgColor, UiMenuBgColor));
         }
-#endif
 
         /* Make it a separator line and use menu colors */
         RtlZeroMemory(MenuLineText, sizeof(MenuLineText));
@@ -458,7 +397,7 @@ TuiDrawMenuItem(
                    MenuLineText,
                    ATTR(UiMenuFgColor, UiMenuBgColor));
 
-#ifndef _M_ARM // FIXME: Theme-specific
+        // FIXME: Theme-specific
         /* Draw its right box corner */
         if (UiMenuBox)
         {
@@ -467,7 +406,6 @@ TuiDrawMenuItem(
                        "\xB6",
                        ATTR(UiMenuFgColor, UiMenuBgColor));
         }
-#endif
 
         /* We are done */
         return;
@@ -476,7 +414,6 @@ TuiDrawMenuItem(
     /* This is not a separator */
     ASSERT(MenuInfo->MenuItemList[MenuItemNumber]);
 
-#ifndef _M_ARM
     /* Check if using centered menu */
     if (UiCenterMenu)
     {
@@ -491,7 +428,6 @@ TuiDrawMenuItem(
         SpaceRight = (SpaceTotal - SpaceLeft) + 1;
     }
     else
-#endif
     {
         /* Simply left-align it */
         SpaceLeft  = 4;
@@ -556,11 +492,7 @@ TuiProcessMenuKeyboardEvent(
         KeyPressFilter(KeyEvent, MenuInfo->SelectedMenuItem, 
MenuInfo->Context))
     {
         /* It processed the key character, so redraw and exit */
-#ifdef _M_ARM
-        UiDrawMenu(MenuInfo);
-#else
         UiVtbl.DrawMenu(MenuInfo);
-#endif
         return 0;
     }
 
@@ -618,9 +550,7 @@ TuiProcessMenuKeyboardEvent(
 
         /* Select new item and update video buffer */
         TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem);
-#ifndef _M_ARM
         VideoCopyOffScreenBufferToVRAM();
-#endif
     }
 
     /* Return the pressed key */
diff --git a/boot/freeldr/freeldr/ui/ui.c b/boot/freeldr/freeldr/ui/ui.c
index 78ea2f16dd1..7d1b379d3e0 100644
--- a/boot/freeldr/freeldr/ui/ui.c
+++ b/boot/freeldr/freeldr/ui/ui.c
@@ -22,8 +22,6 @@
 #include <debug.h>
 DBG_DEFAULT_CHANNEL(UI);
 
-#ifndef _M_ARM
-
 UCHAR UiStatusBarFgColor;       // Status bar foreground color
 UCHAR UiStatusBarBgColor;       // Status bar background color
 UCHAR UiBackdropFgColor;        // Backdrop foreground color
@@ -56,8 +54,6 @@ const PCSTR UiMonthNames[12] = { "January", "February", 
"March", "April", "May",
 ULONG UiScreenWidth;    // Screen Width
 ULONG UiScreenHeight;   // Screen Height
 
-#endif // _M_ARM
-
 /*
  * Loading progress bar, based on the NTOS Inbv one.
  * Supports progress within sub-ranges, used when loading
@@ -65,8 +61,6 @@ ULONG UiScreenHeight;   // Screen Height
  */
 UI_PROGRESS_BAR UiProgressBar = {{0}};
 
-#ifndef _M_ARM
-
 UIVTBL UiVtbl =
 {
     NoUiInitialize,
@@ -386,8 +380,6 @@ UCHAR UiTextToFillStyle(PCSTR FillStyleText)
     return UiVtbl.TextToFillStyle(FillStyleText);
 }
 
-#endif // _M_ARM
-
 VOID
 UiInitProgressBar(
     _In_ ULONG Left,
@@ -413,13 +405,8 @@ UiInitProgressBar(
     UiProgressBar.Show = TRUE;
 
     /* Initial drawing: set the "Loading..." text and the original position */
-#ifndef _M_ARM
     UiVtbl.SetProgressBarText(ProgressText);
     UiVtbl.TickProgressBar(0);
-#else
-    MiniTuiSetProgressBarText(ProgressText);
-    MiniTuiTickProgressBar(0);
-#endif
 }
 
 VOID
@@ -477,11 +464,7 @@ UiUpdateProgressBar(
     TotalProgress = UiProgressBar.State.Floor + (Percentage * 
UiProgressBar.State.Bias);
     // TotalProgress /= (100 * 100);
 
-#ifndef _M_ARM
     UiVtbl.TickProgressBar(TotalProgress);
-#else
-    MiniTuiTickProgressBar(TotalProgress);
-#endif
 }
 
 VOID
@@ -492,22 +475,14 @@ UiSetProgressBarText(
     if (!UiProgressBar.Show)
         return;
 
-#ifndef _M_ARM
     UiVtbl.SetProgressBarText(ProgressText);
-#else
-    MiniTuiSetProgressBarText(ProgressText);
-#endif
 }
 
 VOID
 UiDrawProgressBarCenter(
     _In_ PCSTR ProgressText)
 {
-#ifndef _M_ARM
     UiVtbl.DrawProgressBarCenter(ProgressText);
-#else
-    MiniTuiDrawProgressBarCenter(ProgressText);
-#endif
 }
 
 VOID
@@ -518,15 +493,9 @@ UiDrawProgressBar(
     _In_ ULONG Bottom,
     _In_ PCSTR ProgressText)
 {
-#ifndef _M_ARM
     UiVtbl.DrawProgressBar(Left, Top, Right, Bottom, ProgressText);
-#else
-    MiniTuiDrawProgressBar(Left, Top, Right, Bottom, ProgressText);
-#endif
 }
 
-#ifndef _M_ARM
-
 static VOID
 UiEscapeString(PCHAR String)
 {
@@ -662,9 +631,3 @@ BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, 
ULONG Length)
     return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
 }
 
-#else
-BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
-{
-    return FALSE;
-}
-#endif
diff --git a/boot/freeldr/freeldr/ui/video.c b/boot/freeldr/freeldr/ui/video.c
index ab77d694a3c..a07ff083f6c 100644
--- a/boot/freeldr/freeldr/ui/video.c
+++ b/boot/freeldr/freeldr/ui/video.c
@@ -5,7 +5,6 @@
  * COPYRIGHT:   Copyright 1998-2003 Brian Palmer <[email protected]>
  */
 
-#ifndef _M_ARM
 #include <freeldr.h>
 
 #define RGB_MAX                 64
@@ -173,4 +172,3 @@ VOID VideoFadeOut(ULONG ColorCount)
     }
 }
 
-#endif
diff --git a/sdk/lib/crt/float/float.cmake b/sdk/lib/crt/float/float.cmake
index 24fe327fbd5..d3ca0e6a9c6 100644
--- a/sdk/lib/crt/float/float.cmake
+++ b/sdk/lib/crt/float/float.cmake
@@ -40,8 +40,15 @@ elseif(ARCH STREQUAL "arm")
         float/arm/_fpreset.c
         float/arm/_statusfp.c
     )
+    list(APPEND LIBCNTPR_FLOAT_SOURCE
+        float/arm/_controlfp.c
+    )
     list(APPEND CRT_FLOAT_ASM_SOURCE
         float/arm/__getfp.s
         float/arm/__setfp.s
     )
+    list(APPEND LIBCNTPR_FLOAT_ASM_SOURCE
+        float/arm/__getfp.s
+        float/arm/__setfp.s
+    )
 endif()

Reply via email to