Do not use static linked list
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 25s
Builds / ExectOS (i686) (push) Successful in 26s

This commit is contained in:
Rafal Kupiec 2023-12-11 17:41:34 +01:00
parent 9aa2efe17f
commit a079423174
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 12 additions and 6 deletions

View File

@ -114,12 +114,12 @@ EFI_STATUS
BlpLoadConfiguration() BlpLoadConfiguration()
{ {
PLIST_ENTRY SectionListEntry; PLIST_ENTRY SectionListEntry;
STATIC LIST_ENTRY Configuration; // STATIC LIST_ENTRY BlpConfiguration;
EFI_STATUS Status; EFI_STATUS Status;
PCHAR ConfigData; PCHAR ConfigData;
/* Initialize configuration pointer */ /* Initialize configuration pointer */
RtlInitializeListHead(&Configuration); RtlInitializeListHead(&BlpConfiguration);
/* Read data from configuration file */ /* Read data from configuration file */
Status = BlpReadConfigFile(L"\\EFI\\BOOT\\", L"XTLDR.INI", &ConfigData); Status = BlpReadConfigFile(L"\\EFI\\BOOT\\", L"XTLDR.INI", &ConfigData);
@ -131,7 +131,7 @@ BlpLoadConfiguration()
} }
/* Parse configuration data */ /* Parse configuration data */
Status = BlpParseConfigFile(ConfigData, &Configuration); Status = BlpParseConfigFile(ConfigData, &BlpConfiguration);
if(Status != STATUS_EFI_SUCCESS) if(Status != STATUS_EFI_SUCCESS)
{ {
/* Failed to parse configuration */ /* Failed to parse configuration */
@ -140,8 +140,8 @@ BlpLoadConfiguration()
} }
/* Iterate through config sections */ /* Iterate through config sections */
SectionListEntry = Configuration.Flink; SectionListEntry = BlpConfiguration.Flink;
while(SectionListEntry != &Configuration) while(SectionListEntry != &BlpConfiguration)
{ {
/* Get config section */ /* Get config section */
PXTBL_CONFIG_SECTION Section = CONTAIN_RECORD(SectionListEntry, XTBL_CONFIG_SECTION, Flink); PXTBL_CONFIG_SECTION Section = CONTAIN_RECORD(SectionListEntry, XTBL_CONFIG_SECTION, Flink);
@ -162,7 +162,7 @@ BlpLoadConfiguration()
} }
/* Update boot menu OS list */ /* Update boot menu OS list */
BlpMenuList = &Configuration; BlpMenuList = &BlpConfiguration;
/* Return success */ /* Return success */
return STATUS_EFI_SUCCESS; return STATUS_EFI_SUCCESS;

View File

@ -12,6 +12,9 @@
/* XT Boot Loader configuration list */ /* XT Boot Loader configuration list */
PLIST_ENTRY BlpConfig = NULL; PLIST_ENTRY BlpConfig = NULL;
/* XT Boot Loader loaded configuration */
LIST_ENTRY BlpConfiguration;
/* XT Boot Loader debug port configuration */ /* XT Boot Loader debug port configuration */
ULONG BlpDebugPort = 0; ULONG BlpDebugPort = 0;

View File

@ -15,6 +15,9 @@
/* XT Boot Loader configuration list */ /* XT Boot Loader configuration list */
EXTERN PLIST_ENTRY BlpConfig; EXTERN PLIST_ENTRY BlpConfig;
/* XT Boot Loader loaded configuration */
EXTERN LIST_ENTRY BlpConfiguration;
/* XT Boot Loader debug port configuration */ /* XT Boot Loader debug port configuration */
EXTERN ULONG BlpDebugPort; EXTERN ULONG BlpDebugPort;