mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:42:57 +00:00
[FREELDR] Minor code formatting; constify some non-mutable data.
This commit is contained in:
parent
95564d5e30
commit
d272866550
11 changed files with 20 additions and 21 deletions
|
@ -38,7 +38,7 @@ typedef struct tagDISKCONTEXT
|
||||||
ULONGLONG SectorNumber;
|
ULONGLONG SectorNumber;
|
||||||
} DISKCONTEXT;
|
} DISKCONTEXT;
|
||||||
|
|
||||||
static CHAR Hex[] = "0123456789abcdef";
|
static const CHAR Hex[] = "0123456789abcdef";
|
||||||
|
|
||||||
/* Data cache for BIOS disks pre-enumeration */
|
/* Data cache for BIOS disks pre-enumeration */
|
||||||
UCHAR PcBiosDiskCount = 0;
|
UCHAR PcBiosDiskCount = 0;
|
||||||
|
|
|
@ -9,7 +9,7 @@ typedef struct _FRAME
|
||||||
void *Address;
|
void *Address;
|
||||||
} FRAME;
|
} FRAME;
|
||||||
|
|
||||||
char *i386ExceptionDescriptionText[] =
|
static const char *i386ExceptionDescriptionText[] =
|
||||||
{
|
{
|
||||||
"Exception 00: DIVIDE BY ZERO\n\n",
|
"Exception 00: DIVIDE BY ZERO\n\n",
|
||||||
"Exception 01: DEBUG EXCEPTION\n\n",
|
"Exception 01: DEBUG EXCEPTION\n\n",
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
extern void BootMain( LPSTR CmdLine );
|
extern void BootMain( LPSTR CmdLine );
|
||||||
extern PCHAR GetFreeLoaderVersionString();
|
extern const PCSTR GetFreeLoaderVersionString(VOID);
|
||||||
extern ULONG CacheSizeLimit;
|
extern ULONG CacheSizeLimit;
|
||||||
of_proxy ofproxy;
|
of_proxy ofproxy;
|
||||||
void *PageDirectoryStart, *PageDirectoryEnd;
|
void *PageDirectoryStart, *PageDirectoryEnd;
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#define IMAGE_FILE_HEADER_SIZE 20
|
#define IMAGE_FILE_HEADER_SIZE 20
|
||||||
#define IMAGE_OPTIONAL_HEADER_AddressOfEntryPoint 16
|
#define IMAGE_OPTIONAL_HEADER_AddressOfEntryPoint 16
|
||||||
|
|
||||||
|
|
||||||
.code16
|
.code16
|
||||||
|
|
||||||
/* fat helper code */
|
/* fat helper code */
|
||||||
|
@ -292,7 +291,7 @@ ExitToLongMode:
|
||||||
mov gs,ax
|
mov gs,ax
|
||||||
mov ss,ax
|
mov ss,ax
|
||||||
|
|
||||||
/* Safe current stack pointer */
|
/* Save current stack pointer */
|
||||||
mov word ptr ds:[stack16], sp
|
mov word ptr ds:[stack16], sp
|
||||||
|
|
||||||
/* Set PAE and PGE: 10100000b */
|
/* Set PAE and PGE: 10100000b */
|
||||||
|
|
|
@ -30,7 +30,7 @@ RealModeEntryPoint:
|
||||||
/* Enable A20 address line */
|
/* Enable A20 address line */
|
||||||
call EnableA20
|
call EnableA20
|
||||||
|
|
||||||
/* Safe real mode entry point in shared memory */
|
/* Save real mode entry point in shared memory */
|
||||||
mov dword ptr ds:[BSS_RealModeEntry], offset switch_to_real16
|
mov dword ptr ds:[BSS_RealModeEntry], offset switch_to_real16
|
||||||
|
|
||||||
/* Address the image with es segment */
|
/* Address the image with es segment */
|
||||||
|
@ -116,7 +116,7 @@ exit_to_protected:
|
||||||
|
|
||||||
cli
|
cli
|
||||||
|
|
||||||
/* Safe current stack pointer */
|
/* Save current stack pointer */
|
||||||
mov word ptr ds:[stack16], sp
|
mov word ptr ds:[stack16], sp
|
||||||
|
|
||||||
/* Load the GDT */
|
/* Load the GDT */
|
||||||
|
|
|
@ -29,9 +29,9 @@ VOID
|
||||||
(*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,
|
(*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,
|
||||||
IN USHORT OperatingSystemVersion);
|
IN USHORT OperatingSystemVersion);
|
||||||
|
|
||||||
struct
|
static const struct
|
||||||
{
|
{
|
||||||
CHAR BootType[80];
|
PCHAR BootType;
|
||||||
USHORT OperatingSystemVersion;
|
USHORT OperatingSystemVersion;
|
||||||
OS_LOADING_METHOD Load;
|
OS_LOADING_METHOD Load;
|
||||||
} OSLoadingMethods[] =
|
} OSLoadingMethods[] =
|
||||||
|
|
|
@ -51,13 +51,12 @@ VOID OptionMenuCustomBoot(VOID)
|
||||||
#endif
|
#endif
|
||||||
"ReactOS"
|
"ReactOS"
|
||||||
};
|
};
|
||||||
ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
|
|
||||||
ULONG SelectedMenuItem;
|
ULONG SelectedMenuItem;
|
||||||
|
|
||||||
if (!UiDisplayMenu("Please choose a boot method:", "",
|
if (!UiDisplayMenu("Please choose a boot method:", "",
|
||||||
FALSE,
|
FALSE,
|
||||||
CustomBootMenuList,
|
CustomBootMenuList,
|
||||||
CustomBootMenuCount,
|
sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]),
|
||||||
0, -1,
|
0, -1,
|
||||||
&SelectedMenuItem,
|
&SelectedMenuItem,
|
||||||
TRUE,
|
TRUE,
|
||||||
|
|
|
@ -36,4 +36,4 @@
|
||||||
#define FREELOADER_MINOR_VERSION 0
|
#define FREELOADER_MINOR_VERSION 0
|
||||||
#define FREELOADER_PATCH_VERSION 0
|
#define FREELOADER_PATCH_VERSION 0
|
||||||
|
|
||||||
PCHAR GetFreeLoaderVersionString(VOID);
|
const PCSTR GetFreeLoaderVersionString(VOID);
|
||||||
|
|
|
@ -17,7 +17,7 @@ DBG_DEFAULT_CHANNEL(WINDOWS);
|
||||||
|
|
||||||
extern ULONG LoaderPagesSpanned;
|
extern ULONG LoaderPagesSpanned;
|
||||||
|
|
||||||
PCHAR MemTypeDesc[] = {
|
static const PCSTR MemTypeDesc[] = {
|
||||||
"ExceptionBlock ", // ?
|
"ExceptionBlock ", // ?
|
||||||
"SystemBlock ", // ?
|
"SystemBlock ", // ?
|
||||||
"Free ",
|
"Free ",
|
||||||
|
|
|
@ -50,6 +50,7 @@ PCSTR OptionsMenuList[] =
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const
|
||||||
PCSTR FrldrDbgMsg = "Enable FreeLdr debug channels\n"
|
PCSTR FrldrDbgMsg = "Enable FreeLdr debug channels\n"
|
||||||
"Acceptable syntax: [level1]#channel1[,[level2]#channel2]\n"
|
"Acceptable syntax: [level1]#channel1[,[level2]#channel2]\n"
|
||||||
"level can be one of: trace,warn,fixme,err\n"
|
"level can be one of: trace,warn,fixme,err\n"
|
||||||
|
@ -78,8 +79,6 @@ enum BootOption
|
||||||
DIRECTORY_SERVICES_RESTORE_MODE,
|
DIRECTORY_SERVICES_RESTORE_MODE,
|
||||||
};
|
};
|
||||||
|
|
||||||
ULONG OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
|
|
||||||
|
|
||||||
static enum BootOption BootOptionChoice = NO_OPTION;
|
static enum BootOption BootOptionChoice = NO_OPTION;
|
||||||
static BOOLEAN BootLogging = FALSE;
|
static BOOLEAN BootLogging = FALSE;
|
||||||
static BOOLEAN VgaMode = FALSE;
|
static BOOLEAN VgaMode = FALSE;
|
||||||
|
@ -95,7 +94,7 @@ VOID DoOptionsMenu(VOID)
|
||||||
if (!UiDisplayMenu("Select an option:", "",
|
if (!UiDisplayMenu("Select an option:", "",
|
||||||
TRUE,
|
TRUE,
|
||||||
OptionsMenuList,
|
OptionsMenuList,
|
||||||
OptionsMenuItemCount,
|
sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]),
|
||||||
11, // Use "Start ReactOS normally" as default; see the switch below.
|
11, // Use "Start ReactOS normally" as default; see the switch below.
|
||||||
-1,
|
-1,
|
||||||
&SelectedMenuItem,
|
&SelectedMenuItem,
|
||||||
|
|
|
@ -19,15 +19,17 @@
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
|
|
||||||
CHAR FreeLoaderVersionString[80];
|
#define TOSTRING_(X) #X
|
||||||
|
#define TOSTRING(X) TOSTRING_(X)
|
||||||
|
|
||||||
PCHAR GetFreeLoaderVersionString(VOID)
|
static const PCSTR FreeLoaderVersionString =
|
||||||
{
|
|
||||||
#if (FREELOADER_PATCH_VERSION == 0)
|
#if (FREELOADER_PATCH_VERSION == 0)
|
||||||
sprintf(FreeLoaderVersionString, "FreeLoader v%d.%d", FREELOADER_MAJOR_VERSION, FREELOADER_MINOR_VERSION);
|
"FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION);
|
||||||
#else
|
#else
|
||||||
sprintf(FreeLoaderVersionString, "FreeLoader v%d.%d.%d", FREELOADER_MAJOR_VERSION, FREELOADER_MINOR_VERSION, FREELOADER_PATCH_VERSION);
|
"FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION) "." TOSTRING(FREELOADER_PATCH_VERSION);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const PCSTR GetFreeLoaderVersionString(VOID)
|
||||||
|
{
|
||||||
return FreeLoaderVersionString;
|
return FreeLoaderVersionString;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue