1414#define EFI_ST_EXECUTE 2
1515#define EFI_ST_TEARDOWN 4
1616
17- static const struct efi_system_table * systable ;
18- static const struct efi_boot_services * boottime ;
17+ const struct efi_system_table * st_systable ;
18+ const struct efi_boot_services * st_boottime ;
1919static const struct efi_runtime_services * runtime ;
2020static efi_handle_t handle ;
2121static u16 reset_message [] = u"Selftest completed" ;
@@ -41,7 +41,7 @@ void efi_st_exit_boot_services(void)
4141 /* Do not detach devices in ExitBootServices. We need the console. */
4242 efi_st_keep_devices = true;
4343
44- ret = boottime -> get_memory_map (& map_size , NULL , & map_key , & desc_size ,
44+ ret = st_boottime -> get_memory_map (& map_size , NULL , & map_key , & desc_size ,
4545 & desc_version );
4646 if (ret != EFI_BUFFER_TOO_SMALL ) {
4747 efi_st_error (
@@ -50,19 +50,19 @@ void efi_st_exit_boot_services(void)
5050 }
5151 /* Allocate extra space for newly allocated memory */
5252 map_size += sizeof (struct efi_mem_desc );
53- ret = boottime -> allocate_pool (EFI_BOOT_SERVICES_DATA , map_size ,
53+ ret = st_boottime -> allocate_pool (EFI_BOOT_SERVICES_DATA , map_size ,
5454 (void * * )& memory_map );
5555 if (ret != EFI_SUCCESS ) {
5656 efi_st_error ("AllocatePool did not return EFI_SUCCESS\n" );
5757 return ;
5858 }
59- ret = boottime -> get_memory_map (& map_size , memory_map , & map_key ,
59+ ret = st_boottime -> get_memory_map (& map_size , memory_map , & map_key ,
6060 & desc_size , & desc_version );
6161 if (ret != EFI_SUCCESS ) {
6262 efi_st_error ("GetMemoryMap did not return EFI_SUCCESS\n" );
6363 return ;
6464 }
65- ret = boottime -> exit_boot_services (handle , map_key );
65+ ret = st_boottime -> exit_boot_services (handle , map_key );
6666 if (ret != EFI_SUCCESS ) {
6767 efi_st_error ("ExitBootServices did not return EFI_SUCCESS\n" );
6868 return ;
@@ -84,7 +84,7 @@ static int setup(struct efi_unit_test *test, unsigned int *failures)
8484 if (!test -> setup )
8585 return EFI_ST_SUCCESS ;
8686 efi_st_printc (EFI_LIGHTBLUE , "\nSetting up '%s'\n" , test -> name );
87- ret = test -> setup (handle , systable );
87+ ret = test -> setup (handle , st_systable );
8888 if (ret != EFI_ST_SUCCESS ) {
8989 efi_st_error ("Setting up '%s' failed\n" , test -> name );
9090 ++ * failures ;
@@ -240,8 +240,8 @@ void efi_st_do_tests(const u16 *testname, unsigned int phase,
240240 * All tests use a driver model and are run in three phases:
241241 * setup, execute, teardown.
242242 *
243- * A test may be setup and executed at boottime ,
244- * it may be setup at boottime and executed at runtime,
243+ * A test may be setup and executed at st_boottime ,
244+ * it may be setup at st_boottime and executed at runtime,
245245 * or it may be setup and executed at runtime.
246246 *
247247 * After executing all tests the system is reset.
@@ -257,14 +257,14 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
257257 struct efi_loaded_image * loaded_image ;
258258 efi_status_t ret ;
259259
260- systable = systab ;
261- boottime = systable -> boottime ;
262- runtime = systable -> runtime ;
260+ st_systable = systab ;
261+ st_boottime = st_systable -> boottime ;
262+ runtime = st_systable -> runtime ;
263263 handle = image_handle ;
264- con_out = systable -> con_out ;
265- con_in = systable -> con_in ;
264+ con_out = st_systable -> con_out ;
265+ con_in = st_systable -> con_in ;
266266
267- ret = boottime -> handle_protocol (image_handle , & efi_guid_loaded_image ,
267+ ret = st_boottime -> handle_protocol (image_handle , & efi_guid_loaded_image ,
268268 (void * * )& loaded_image );
269269 if (ret != EFI_SUCCESS ) {
270270 efi_st_error ("Cannot open loaded image protocol\n" );
@@ -280,9 +280,9 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
280280 list_all_tests ();
281281 /*
282282 * TODO:
283- * Once the Exit boottime service is correctly
283+ * Once the Exit st_boottime service is correctly
284284 * implemented we should call
285- * boottime ->exit(image_handle, EFI_SUCCESS, 0, NULL);
285+ * st_boottime ->exit(image_handle, EFI_SUCCESS, 0, NULL);
286286 * here, cf.
287287 * https://lists.denx.de/pipermail/u-boot/2017-October/308720.html
288288 */
@@ -300,7 +300,7 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
300300 efi_unit_test ));
301301
302302 /* Allocate buffer for setup results */
303- ret = boottime -> allocate_pool (EFI_RUNTIME_SERVICES_DATA , sizeof (int ) *
303+ ret = st_boottime -> allocate_pool (EFI_RUNTIME_SERVICES_DATA , sizeof (int ) *
304304 ll_entry_count (struct efi_unit_test ,
305305 efi_unit_test ),
306306 (void * * )& setup_status );
@@ -309,7 +309,7 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
309309 return ret ;
310310 }
311311
312- /* Execute boottime tests */
312+ /* Execute st_boottime tests */
313313 efi_st_do_tests (testname , EFI_EXECUTE_BEFORE_BOOTTIME_EXIT ,
314314 EFI_ST_SETUP | EFI_ST_EXECUTE | EFI_ST_TEARDOWN ,
315315 & failures );
0 commit comments