efi: Move noefi early param code out of x86 arch code
authorDave Young <dyoung@redhat.com>
Thu, 14 Aug 2014 09:15:26 +0000 (17:15 +0800)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 3 Oct 2014 17:40:58 +0000 (18:40 +0100)
noefi param can be used for arches other than X86 later, thus move it
out of x86 platform code.

Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Documentation/kernel-parameters.txt
arch/x86/platform/efi/efi.c
drivers/firmware/efi/efi.c
include/linux/efi.h

index 67d79597d9d6540310f545b27599982280a64f28..08df275eee2b9621e9f7940d7a4038f41205b66e 100644 (file)
@@ -2169,7 +2169,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
        nodsp           [SH] Disable hardware DSP at boot time.
 
-       noefi           [X86] Disable EFI runtime services support.
+       noefi           Disable EFI runtime services support.
 
        noexec          [IA-64]
 
index a1f745b0bf1df0b9a5f227caa8dc993d9f4dab08..c90d3cd2728ce17cb7f1f98407ee43bb69c1b50a 100644 (file)
@@ -70,14 +70,6 @@ static efi_config_table_type_t arch_tables[] __initdata = {
 
 u64 efi_setup;         /* efi setup_data physical address */
 
-static bool disable_runtime __initdata = false;
-static int __init setup_noefi(char *arg)
-{
-       disable_runtime = true;
-       return 0;
-}
-early_param("noefi", setup_noefi);
-
 int add_efi_memmap;
 EXPORT_SYMBOL(add_efi_memmap);
 
@@ -492,7 +484,7 @@ void __init efi_init(void)
        if (!efi_runtime_supported())
                pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n");
        else {
-               if (disable_runtime || efi_runtime_init())
+               if (efi_runtime_disabled() || efi_runtime_init())
                        return;
        }
        if (efi_memmap_init())
index 64ecbb501c5080df5e36b90dd73501b7dac881d4..c8f01a73edb5c90c035ba44f5490f992214fffb1 100644 (file)
@@ -41,6 +41,19 @@ struct efi __read_mostly efi = {
 };
 EXPORT_SYMBOL(efi);
 
+static bool disable_runtime;
+static int __init setup_noefi(char *arg)
+{
+       disable_runtime = true;
+       return 0;
+}
+early_param("noefi", setup_noefi);
+
+bool efi_runtime_disabled(void)
+{
+       return disable_runtime;
+}
+
 static struct kobject *efi_kobj;
 static struct kobject *efivars_kobj;
 
index 518779fb5e90fa38fdc3ee6dd01bdb4a4157c1d7..4812ed0b0374be02875245fbf9621ebc0aab0634 100644 (file)
@@ -1229,4 +1229,5 @@ efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg,
 
 efi_status_t efi_parse_options(char *cmdline);
 
+bool efi_runtime_disabled(void);
 #endif /* _LINUX_EFI_H */