[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.
This commit is contained in:
Justin Miller 2023-05-03 11:56:06 -07:00 committed by GitHub
parent a0bef1998e
commit f2a58733e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 71 additions and 164 deletions

View file

@ -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 <justinmiller100@gmail.com>
*/
#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,
...)
{
}

View file

@ -18,14 +18,3 @@ RealEntryPoint(VOID)
{ {
BootMain(""); BootMain("");
} }
VOID
FrLdrBugCheckWithMessage(
ULONG BugCode,
PCHAR File,
ULONG Line,
PSTR Format,
...)
{
}

View file

@ -18,7 +18,9 @@ ULONG gDiskReadBuffer, gFileSysBuffer;
BOOLEAN ArmHwDetectRan; BOOLEAN ArmHwDetectRan;
PCONFIGURATION_COMPONENT_DATA RootNode; PCONFIGURATION_COMPONENT_DATA RootNode;
#ifndef UEFIBOOT
BOOLEAN AcpiPresent = FALSE; BOOLEAN AcpiPresent = FALSE;
#endif
ULONG FirstLevelDcacheSize; ULONG FirstLevelDcacheSize;
ULONG FirstLevelDcacheFillSize; ULONG FirstLevelDcacheFillSize;
@ -174,6 +176,7 @@ ArmHwIdle(VOID)
/* UNIMPLEMENTED */ /* UNIMPLEMENTED */
} }
#ifndef UEFIBOOT
VOID VOID
MachInit(IN PCCH CommandLine) MachInit(IN PCCH CommandLine)
{ {
@ -229,3 +232,4 @@ MachInit(IN PCCH CommandLine)
MachVtbl.HwDetect = ArmHwDetect; MachVtbl.HwDetect = ArmHwDetect;
MachVtbl.HwIdle = ArmHwIdle; MachVtbl.HwIdle = ArmHwIdle;
} }
#endif

View file

@ -9,12 +9,14 @@
#include <debug.h> #include <debug.h>
#ifndef _M_ARM
/* TODO: Handle this with custom Disk / partition setup */ /* TODO: Handle this with custom Disk / partition setup */
UCHAR UCHAR
DriveMapGetBiosDriveNumber(PCSTR DeviceName) DriveMapGetBiosDriveNumber(PCSTR DeviceName)
{ {
return 0; return 0;
} }
#endif
VOID VOID
StallExecutionProcessor(ULONG Microseconds) StallExecutionProcessor(ULONG Microseconds)

View file

@ -31,7 +31,9 @@ EfiEntry(
return 0; return 0;
} }
#ifndef _M_ARM
VOID __cdecl Reboot(VOID) VOID __cdecl Reboot(VOID)
{ {
} }
#endif

View file

@ -38,7 +38,7 @@
#define DPRINT_HEAP 15 // messages in a bottle #define DPRINT_HEAP 15 // messages in a bottle
#define DBG_CHANNELS_COUNT 16 #define DBG_CHANNELS_COUNT 16
#if DBG && !defined(_M_ARM) #if DBG
VOID DebugInit(IN ULONG_PTR FrLdrSectionId); VOID DebugInit(IN ULONG_PTR FrLdrSectionId);
ULONG DbgPrint(const char *Format, ...); ULONG DbgPrint(const char *Format, ...);

View file

@ -20,7 +20,7 @@
#include <freeldr.h> #include <freeldr.h>
#include <debug.h> #include <debug.h>
#if DBG && !defined(_M_ARM) #if DBG
// #define DEBUG_ALL // #define DEBUG_ALL
// #define DEBUG_WARN // #define DEBUG_WARN
@ -54,6 +54,11 @@ ULONG PortIrq = 0; // Not used at the moment.
BOOLEAN DebugStartOfLine = TRUE; BOOLEAN DebugStartOfLine = TRUE;
#ifdef UEFIBOOT
VOID
ARMWriteToUART(UCHAR Data);
#endif
VOID DebugInit(IN ULONG_PTR FrLdrSectionId) VOID DebugInit(IN ULONG_PTR FrLdrSectionId)
{ {
PCHAR CommandLine, PortString, BaudString, IrqString; PCHAR CommandLine, PortString, BaudString, IrqString;

View file

@ -29,6 +29,9 @@ if(ARCH STREQUAL "i386")
elseif(ARCH STREQUAL "amd64") elseif(ARCH STREQUAL "amd64")
#TBD #TBD
elseif(ARCH STREQUAL "arm") elseif(ARCH STREQUAL "arm")
list(APPEND UEFILDR_ARC_SOURCE
arch/arm/macharm.c
arch/arm/debug.c)
#TBD #TBD
elseif(ARCH STREQUAL "arm64") elseif(ARCH STREQUAL "arm64")
#TBD #TBD
@ -86,7 +89,10 @@ set_target_properties(uefildr PROPERTIES SUFFIX ".efi")
target_compile_definitions(uefildr PRIVATE UEFIBOOT) target_compile_definitions(uefildr PRIVATE UEFIBOOT)
if(MSVC) 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 # We don't need hotpatching
remove_target_compile_option(uefildr "/hotpatch") remove_target_compile_option(uefildr "/hotpatch")
else() else()

View file

@ -6,8 +6,7 @@
* PROGRAMMERS: ReactOS Portable Systems Group * PROGRAMMERS: ReactOS Portable Systems Group
*/ */
#ifdef _M_ARM #if 0
#include <freeldr.h> #include <freeldr.h>
/* GLOBALS ********************************************************************/ /* GLOBALS ********************************************************************/

View file

@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef _M_ARM
#include <freeldr.h> #include <freeldr.h>
VOID GuiDrawBackdrop(VOID) VOID GuiDrawBackdrop(VOID)
@ -113,4 +112,3 @@ const UIVTBL GuiVtbl =
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL NULL
}; };
#endif

View file

@ -13,8 +13,6 @@
// #define NTLDR_PROGRESSBAR // #define NTLDR_PROGRESSBAR
// #define BTMGR_PROGRESSBAR /* Default style */ // #define BTMGR_PROGRESSBAR /* Default style */
#ifndef _M_ARM
BOOLEAN MiniTuiInitialize(VOID) BOOLEAN MiniTuiInitialize(VOID)
{ {
/* Initialize main TUI */ /* Initialize main TUI */
@ -71,8 +69,6 @@ VOID MiniTuiDrawStatusText(PCSTR StatusText)
/* Minimal UI doesn't have a status bar */ /* Minimal UI doesn't have a status bar */
} }
#endif // _M_ARM
/*static*/ VOID /*static*/ VOID
MiniTuiSetProgressBarText( MiniTuiSetProgressBarText(
_In_ PCSTR ProgressText) _In_ PCSTR ProgressText)
@ -143,10 +139,8 @@ MiniTuiTickProgressBar(
UiProgressBar.Right, UiProgressBar.Bottom, UiProgressBar.Right, UiProgressBar.Bottom,
' ', ATTR(UiTextColor, UiMenuBgColor)); ' ', ATTR(UiTextColor, UiMenuBgColor));
#ifndef _M_ARM
TuiUpdateDateTime(); TuiUpdateDateTime();
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
#endif
} }
VOID VOID
@ -191,10 +185,8 @@ MiniTuiDrawMenu(
{ {
ULONG i; ULONG i;
#ifndef _M_ARM
/* Draw the backdrop */ /* Draw the backdrop */
UiDrawBackdrop(); UiDrawBackdrop();
#endif
/* No GUI status bar text, just minimal text. Show the menu header. */ /* No GUI status bar text, just minimal text. Show the menu header. */
if (MenuInfo->MenuHeader) if (MenuInfo->MenuHeader)
@ -239,13 +231,9 @@ MiniTuiDrawMenu(
DisplayBootTimeOptions(); DisplayBootTimeOptions();
} }
#ifndef _M_ARM
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
#endif
} }
#ifndef _M_ARM
const UIVTBL MiniTuiVtbl = const UIVTBL MiniTuiVtbl =
{ {
MiniTuiInitialize, MiniTuiInitialize,
@ -274,4 +262,3 @@ const UIVTBL MiniTuiVtbl =
MiniTuiDrawMenu, MiniTuiDrawMenu,
}; };
#endif // _M_ARM

View file

@ -6,7 +6,6 @@
* PROGRAMMERS: Hervé Poussineau * PROGRAMMERS: Hervé Poussineau
*/ */
#ifndef _M_ARM
#include <freeldr.h> #include <freeldr.h>
BOOLEAN NoUiInitialize(VOID) BOOLEAN NoUiInitialize(VOID)
@ -183,5 +182,3 @@ NoUiDrawMenu(
_In_ PUI_MENU_INFO MenuInfo) _In_ PUI_MENU_INFO MenuInfo)
{ {
} }
#endif // _M_ARM

View file

@ -19,9 +19,7 @@
#include <freeldr.h> #include <freeldr.h>
#ifndef _M_ARM
PVOID TextVideoBuffer = NULL; PVOID TextVideoBuffer = NULL;
#endif
/* GENERIC TUI UTILS *********************************************************/ /* GENERIC TUI UTILS *********************************************************/
@ -93,9 +91,7 @@ TuiDrawText2(
_In_reads_or_z_(MaxNumChars) PCSTR Text, _In_reads_or_z_(MaxNumChars) PCSTR Text,
_In_ UCHAR Attr) _In_ UCHAR Attr)
{ {
#ifndef _M_ARM
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer; PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
#endif
ULONG i, j; ULONG i, j;
/* Don't display anything if we are out of the screen */ /* Don't display anything if we are out of the screen */
@ -105,13 +101,8 @@ TuiDrawText2(
/* Draw the text, not exceeding the width */ /* Draw the text, not exceeding the width */
for (i = X, j = 0; Text[j] && i < UiScreenWidth && (MaxNumChars > 0 ? j < MaxNumChars : TRUE); i++, j++) 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)] = (UCHAR)Text[j];
ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)+1] = Attr; 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 ************************************************************/ /* FULL TUI THEME ************************************************************/
#ifndef _M_ARM
#define TAG_TUI_SCREENBUFFER 'SiuT' #define TAG_TUI_SCREENBUFFER 'SiuT'
#define TAG_TUI_PALETTE 'PiuT' #define TAG_TUI_PALETTE 'PiuT'
@ -802,10 +791,8 @@ TuiTickProgressBar(
UiProgressBar.Right, UiProgressBar.Bottom, UiProgressBar.Right, UiProgressBar.Bottom,
'\xB2', ATTR(UiTextColor, UiMenuBgColor)); '\xB2', ATTR(UiTextColor, UiMenuBgColor));
#ifndef _M_ARM
TuiUpdateDateTime(); TuiUpdateDateTime();
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
#endif
} }
static VOID static VOID
@ -1241,5 +1228,3 @@ const UIVTBL TuiVtbl =
TuiDisplayMenu, TuiDisplayMenu,
TuiDrawMenu, TuiDrawMenu,
}; };
#endif // _M_ARM

View file

@ -91,11 +91,7 @@ TuiDisplayMenu(
TuiCalcMenuBoxSize(&MenuInformation); TuiCalcMenuBoxSize(&MenuInformation);
/* Draw the menu */ /* Draw the menu */
#ifdef _M_ARM
UiDrawMenu(&MenuInformation);
#else
UiVtbl.DrawMenu(&MenuInformation); UiVtbl.DrawMenu(&MenuInformation);
#endif
/* Get the current second of time */ /* Get the current second of time */
LastClockSecond = ArcGetTime()->Second; LastClockSecond = ArcGetTime()->Second;
@ -117,10 +113,9 @@ TuiDisplayMenu(
/* Update the time information */ /* Update the time information */
LastClockSecond = CurrentClockSecond; LastClockSecond = CurrentClockSecond;
#ifndef _M_ARM // FIXME: Theme-specific // FIXME: Theme-specific
/* Update the date & time */ /* Update the date & time */
TuiUpdateDateTime(); TuiUpdateDateTime();
#endif
/* If there is a countdown, update it */ /* If there is a countdown, update it */
if (MenuInformation.MenuTimeRemaining > 0) if (MenuInformation.MenuTimeRemaining > 0)
@ -131,19 +126,13 @@ TuiDisplayMenu(
else if (MenuInformation.MenuTimeRemaining == 0) else if (MenuInformation.MenuTimeRemaining == 0)
{ {
/* A timeout occurred, exit this loop and return selection */ /* A timeout occurred, exit this loop and return selection */
#ifndef _M_ARM
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
#endif
break; break;
} }
#ifndef _M_ARM
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
#endif
} }
#ifndef _M_ARM
MachHwIdle(); MachHwIdle();
#endif
} }
/* Return the selected item */ /* Return the selected item */
@ -178,7 +167,6 @@ TuiCalcMenuBoxSize(
/* Allow room for left & right borders, plus 8 spaces on each side */ /* Allow room for left & right borders, plus 8 spaces on each side */
Width += 18; Width += 18;
#ifndef _M_ARM
/* Check if we're drawing a centered menu */ /* Check if we're drawing a centered menu */
if (UiCenterMenu) if (UiCenterMenu)
{ {
@ -188,7 +176,6 @@ TuiCalcMenuBoxSize(
Height) / 2) + TUI_TITLE_BOX_CHAR_HEIGHT; Height) / 2) + TUI_TITLE_BOX_CHAR_HEIGHT;
} }
else else
#endif
{ {
/* Put the menu in the default left-corner position */ /* Put the menu in the default left-corner position */
MenuInfo->Left = -1; MenuInfo->Left = -1;
@ -206,21 +193,9 @@ TuiDrawMenu(
{ {
ULONG i; ULONG i;
#ifndef _M_ARM // FIXME: Theme-specific // FIXME: Theme-specific
/* Draw the backdrop */ /* Draw the backdrop */
UiDrawBackdrop(); 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 */ /* Draw the menu box */
TuiDrawMenuBox(MenuInfo); TuiDrawMenuBox(MenuInfo);
@ -231,43 +206,17 @@ TuiDrawMenu(
TuiDrawMenuItem(MenuInfo, i); TuiDrawMenuItem(MenuInfo, i);
} }
#ifndef _M_ARM // FIXME: Theme-specific // FIXME: Theme-specific
/* Update the status bar */ /* Update the status bar */
UiVtbl.DrawStatusText("Use \x18 and \x19 to select, then press ENTER."); 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 */ /* Display the boot options if needed */
if (MenuInfo->ShowBootOptions) if (MenuInfo->ShowBootOptions)
{ {
DisplayBootTimeOptions(); DisplayBootTimeOptions();
} }
#ifndef _M_ARM
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
#endif
} }
static VOID static VOID
@ -330,7 +279,6 @@ TuiDrawMenuTimeout(
* 1 1 Pad on the left with blanks + box bottom border. * 1 1 Pad on the left with blanks + box bottom border.
**/ **/
#ifndef _M_ARM
if (UiCenterMenu) if (UiCenterMenu)
{ {
/* In boxed menu mode, pad on the left with blanks and box border, /* In boxed menu mode, pad on the left with blanks and box border,
@ -368,7 +316,6 @@ TuiDrawMenuTimeout(
} }
} }
else else
#endif
{ {
if (Length > 0) if (Length > 0)
{ {
@ -385,13 +332,8 @@ TuiDrawMenuTimeout(
MenuInfo->Bottom + 4, MenuInfo->Bottom + 4,
Length ? (Length + 1) : (UiScreenWidth - 1), Length ? (Length + 1) : (UiScreenWidth - 1),
MenuInfo->Bottom + 4, MenuInfo->Bottom + 4,
#ifndef _M_ARM
UiBackdropFillStyle, UiBackdropFillStyle,
ATTR(UiBackdropFgColor, UiBackdropBgColor) ATTR(UiBackdropFgColor, UiBackdropBgColor)
#else
0, // ' '
ATTR(UiTextColor, COLOR_BLACK) // UiMenuBgColor
#endif
); );
} }
} }
@ -400,7 +342,7 @@ VOID
TuiDrawMenuBox( TuiDrawMenuBox(
_In_ PUI_MENU_INFO MenuInfo) _In_ PUI_MENU_INFO MenuInfo)
{ {
#ifndef _M_ARM // FIXME: Theme-specific // FIXME: Theme-specific
/* Draw the menu box if requested */ /* Draw the menu box if requested */
if (UiMenuBox) if (UiMenuBox)
{ {
@ -417,8 +359,6 @@ TuiDrawMenuBox(
/* Update the date & time */ /* Update the date & time */
TuiUpdateDateTime(); TuiUpdateDateTime();
#endif
TuiDrawMenuTimeout(MenuInfo); TuiDrawMenuTimeout(MenuInfo);
} }
@ -435,7 +375,7 @@ TuiDrawMenuItem(
/* If this is a separator */ /* If this is a separator */
if (MenuInfo->MenuItemList[MenuItemNumber] == NULL) if (MenuInfo->MenuItemList[MenuItemNumber] == NULL)
{ {
#ifndef _M_ARM // FIXME: Theme-specific // FIXME: Theme-specific
/* Draw its left box corner */ /* Draw its left box corner */
if (UiMenuBox) if (UiMenuBox)
{ {
@ -444,7 +384,6 @@ TuiDrawMenuItem(
"\xC7", "\xC7",
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
} }
#endif
/* Make it a separator line and use menu colors */ /* Make it a separator line and use menu colors */
RtlZeroMemory(MenuLineText, sizeof(MenuLineText)); RtlZeroMemory(MenuLineText, sizeof(MenuLineText));
@ -458,7 +397,7 @@ TuiDrawMenuItem(
MenuLineText, MenuLineText,
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
#ifndef _M_ARM // FIXME: Theme-specific // FIXME: Theme-specific
/* Draw its right box corner */ /* Draw its right box corner */
if (UiMenuBox) if (UiMenuBox)
{ {
@ -467,7 +406,6 @@ TuiDrawMenuItem(
"\xB6", "\xB6",
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
} }
#endif
/* We are done */ /* We are done */
return; return;
@ -476,7 +414,6 @@ TuiDrawMenuItem(
/* This is not a separator */ /* This is not a separator */
ASSERT(MenuInfo->MenuItemList[MenuItemNumber]); ASSERT(MenuInfo->MenuItemList[MenuItemNumber]);
#ifndef _M_ARM
/* Check if using centered menu */ /* Check if using centered menu */
if (UiCenterMenu) if (UiCenterMenu)
{ {
@ -491,7 +428,6 @@ TuiDrawMenuItem(
SpaceRight = (SpaceTotal - SpaceLeft) + 1; SpaceRight = (SpaceTotal - SpaceLeft) + 1;
} }
else else
#endif
{ {
/* Simply left-align it */ /* Simply left-align it */
SpaceLeft = 4; SpaceLeft = 4;
@ -556,11 +492,7 @@ TuiProcessMenuKeyboardEvent(
KeyPressFilter(KeyEvent, MenuInfo->SelectedMenuItem, MenuInfo->Context)) KeyPressFilter(KeyEvent, MenuInfo->SelectedMenuItem, MenuInfo->Context))
{ {
/* It processed the key character, so redraw and exit */ /* It processed the key character, so redraw and exit */
#ifdef _M_ARM
UiDrawMenu(MenuInfo);
#else
UiVtbl.DrawMenu(MenuInfo); UiVtbl.DrawMenu(MenuInfo);
#endif
return 0; return 0;
} }
@ -618,9 +550,7 @@ TuiProcessMenuKeyboardEvent(
/* Select new item and update video buffer */ /* Select new item and update video buffer */
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem); TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem);
#ifndef _M_ARM
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
#endif
} }
/* Return the pressed key */ /* Return the pressed key */

View file

@ -22,8 +22,6 @@
#include <debug.h> #include <debug.h>
DBG_DEFAULT_CHANNEL(UI); DBG_DEFAULT_CHANNEL(UI);
#ifndef _M_ARM
UCHAR UiStatusBarFgColor; // Status bar foreground color UCHAR UiStatusBarFgColor; // Status bar foreground color
UCHAR UiStatusBarBgColor; // Status bar background color UCHAR UiStatusBarBgColor; // Status bar background color
UCHAR UiBackdropFgColor; // Backdrop foreground color UCHAR UiBackdropFgColor; // Backdrop foreground color
@ -56,8 +54,6 @@ const PCSTR UiMonthNames[12] = { "January", "February", "March", "April", "May",
ULONG UiScreenWidth; // Screen Width ULONG UiScreenWidth; // Screen Width
ULONG UiScreenHeight; // Screen Height ULONG UiScreenHeight; // Screen Height
#endif // _M_ARM
/* /*
* Loading progress bar, based on the NTOS Inbv one. * Loading progress bar, based on the NTOS Inbv one.
* Supports progress within sub-ranges, used when loading * Supports progress within sub-ranges, used when loading
@ -65,8 +61,6 @@ ULONG UiScreenHeight; // Screen Height
*/ */
UI_PROGRESS_BAR UiProgressBar = {{0}}; UI_PROGRESS_BAR UiProgressBar = {{0}};
#ifndef _M_ARM
UIVTBL UiVtbl = UIVTBL UiVtbl =
{ {
NoUiInitialize, NoUiInitialize,
@ -386,8 +380,6 @@ UCHAR UiTextToFillStyle(PCSTR FillStyleText)
return UiVtbl.TextToFillStyle(FillStyleText); return UiVtbl.TextToFillStyle(FillStyleText);
} }
#endif // _M_ARM
VOID VOID
UiInitProgressBar( UiInitProgressBar(
_In_ ULONG Left, _In_ ULONG Left,
@ -413,13 +405,8 @@ UiInitProgressBar(
UiProgressBar.Show = TRUE; UiProgressBar.Show = TRUE;
/* Initial drawing: set the "Loading..." text and the original position */ /* Initial drawing: set the "Loading..." text and the original position */
#ifndef _M_ARM
UiVtbl.SetProgressBarText(ProgressText); UiVtbl.SetProgressBarText(ProgressText);
UiVtbl.TickProgressBar(0); UiVtbl.TickProgressBar(0);
#else
MiniTuiSetProgressBarText(ProgressText);
MiniTuiTickProgressBar(0);
#endif
} }
VOID VOID
@ -477,11 +464,7 @@ UiUpdateProgressBar(
TotalProgress = UiProgressBar.State.Floor + (Percentage * UiProgressBar.State.Bias); TotalProgress = UiProgressBar.State.Floor + (Percentage * UiProgressBar.State.Bias);
// TotalProgress /= (100 * 100); // TotalProgress /= (100 * 100);
#ifndef _M_ARM
UiVtbl.TickProgressBar(TotalProgress); UiVtbl.TickProgressBar(TotalProgress);
#else
MiniTuiTickProgressBar(TotalProgress);
#endif
} }
VOID VOID
@ -492,22 +475,14 @@ UiSetProgressBarText(
if (!UiProgressBar.Show) if (!UiProgressBar.Show)
return; return;
#ifndef _M_ARM
UiVtbl.SetProgressBarText(ProgressText); UiVtbl.SetProgressBarText(ProgressText);
#else
MiniTuiSetProgressBarText(ProgressText);
#endif
} }
VOID VOID
UiDrawProgressBarCenter( UiDrawProgressBarCenter(
_In_ PCSTR ProgressText) _In_ PCSTR ProgressText)
{ {
#ifndef _M_ARM
UiVtbl.DrawProgressBarCenter(ProgressText); UiVtbl.DrawProgressBarCenter(ProgressText);
#else
MiniTuiDrawProgressBarCenter(ProgressText);
#endif
} }
VOID VOID
@ -518,15 +493,9 @@ UiDrawProgressBar(
_In_ ULONG Bottom, _In_ ULONG Bottom,
_In_ PCSTR ProgressText) _In_ PCSTR ProgressText)
{ {
#ifndef _M_ARM
UiVtbl.DrawProgressBar(Left, Top, Right, Bottom, ProgressText); UiVtbl.DrawProgressBar(Left, Top, Right, Bottom, ProgressText);
#else
MiniTuiDrawProgressBar(Left, Top, Right, Bottom, ProgressText);
#endif
} }
#ifndef _M_ARM
static VOID static VOID
UiEscapeString(PCHAR String) UiEscapeString(PCHAR String)
{ {
@ -662,9 +631,3 @@ BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
return UiVtbl.EditBox(MessageText, EditTextBuffer, Length); return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
} }
#else
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
{
return FALSE;
}
#endif

View file

@ -5,7 +5,6 @@
* COPYRIGHT: Copyright 1998-2003 Brian Palmer <brianp@sginet.com> * COPYRIGHT: Copyright 1998-2003 Brian Palmer <brianp@sginet.com>
*/ */
#ifndef _M_ARM
#include <freeldr.h> #include <freeldr.h>
#define RGB_MAX 64 #define RGB_MAX 64
@ -173,4 +172,3 @@ VOID VideoFadeOut(ULONG ColorCount)
} }
} }
#endif

View file

@ -40,8 +40,15 @@ elseif(ARCH STREQUAL "arm")
float/arm/_fpreset.c float/arm/_fpreset.c
float/arm/_statusfp.c float/arm/_statusfp.c
) )
list(APPEND LIBCNTPR_FLOAT_SOURCE
float/arm/_controlfp.c
)
list(APPEND CRT_FLOAT_ASM_SOURCE list(APPEND CRT_FLOAT_ASM_SOURCE
float/arm/__getfp.s float/arm/__getfp.s
float/arm/__setfp.s float/arm/__setfp.s
) )
list(APPEND LIBCNTPR_FLOAT_ASM_SOURCE
float/arm/__getfp.s
float/arm/__setfp.s
)
endif() endif()