Skip to contentSkip to conversation

efi: Make 'efi_enabled' a function to

RFC PATCH Guo Chao 2 participants 2 messages Jan 5, 2013 – Jan 8, 2013 EFI

lore
Share & tools
lore

Guo Chao

author
#0 lore raw

query EFI facilities
Reply-To: <1357219085-4312-2-git-send-email-matt-HNK1S37rvNbeXh+fF434Mdi2O/[email protected]>
In-Reply-To: <1357219085-4312-2-git-send-email-matt-HNK1S37rvNbeXh+fF434Mdi2O/[email protected]>

Quoted 14 lines
init/main.c +1 -1
index e33e09d..e71d924 100644
@@ -604,7 +604,7 @@ asmlinkage void __init start_kernel(void)
 	pidmap_init();
 	anon_vma_init();
 #ifdef CONFIG_X86
-	if (efi_enabled)
+	if (efi_enabled(EFI_RUNTIME_SERVICES))
 		efi_enter_virtual_mode();
 #endif
 	thread_info_cache_init();

init/main.c asmlinkage void __init start_kernel(void) · line 638

Quoted 8 lines
init/main.c +1 -1
@@ -632,7 +632,7 @@ asmlinkage void __init start_kernel(void)
 	acpi_early_init(); /* before LAPIC and SMP init */
 	sfi_init_late();
 
-	if (efi_enabled) {
+	if (efi_enabled(EFI_RUNTIME_SERVICES)) {
 		efi_late_init();
 		efi_free_boot_services();
 	}

I just wonder why we compile efi code away explicitly by CONFIG_X86 in one place and implicitly by if (0) in another place, in the same function.

Thanks,
Guo Chao

#1 lore raw
Quoted 21 lines · Guo Chao

query EFI facilities
Reply-To: <1357219085-4312-2-git-send-email-matt-HNK1S37rvNbeXh+fF434Mdi2O/[email protected]>
In-Reply-To: <1357219085-4312-2-git-send-email-matt-HNK1S37rvNbeXh+fF434Mdi2O/[email protected]>

Quoted 17 lines
init/main.c +1 -1
index e33e09d..e71d924 100644
@@ -604,7 +604,7 @@ asmlinkage void __init start_kernel(void)
 	pidmap_init();
 	anon_vma_init();
 #ifdef CONFIG_X86
-	if (efi_enabled)
+	if (efi_enabled(EFI_RUNTIME_SERVICES))
 		efi_enter_virtual_mode();
 #endif
 	thread_info_cache_init();
@@ -632,7 +632,7 @@ asmlinkage void __init start_kernel(void)
 	acpi_early_init(); /* before LAPIC and SMP init */
 	sfi_init_late();
 
Quoted 9 lines

init/main.c asmlinkage void __init start_kernel(void) · line 638

Quoted 5 lines
init/main.c +1 -1
-	if (efi_enabled) {
+	if (efi_enabled(EFI_RUNTIME_SERVICES)) {
 		efi_late_init();
 		efi_free_boot_services();
 	}

I just wonder why we compile efi code away explicitly by CONFIG_X86 in one place and implicitly by if (0) in another place, in the same function.

Because ia64 also has an efi_enter_virtual_mode() implementation, but that's called internally by arch/ia64.

The setup we've got at the moment isn't ideal, as there's a couple of oddities like this dotted around the kernel. I have plans to try and unify the EFI code a bit more based on a patch that Matthew Garrett wrote, which should allow us to do away with things like the above.

Signature · 1 line
Matt Fleming, Intel Open Source Technology Center