63 lines
2.0 KiB
Diff
63 lines
2.0 KiB
Diff
From: Ben Hutchings <ben@decadent.org.uk>
|
|
Subject: [x86] efi: Avoid ABI change in 3.2.38
|
|
Date: Tue, 26 Feb 2013 13:56:01 +0000
|
|
Bug-Debian: http://bugs.debian.org/701690
|
|
|
|
"efi: Make 'efi_enabled' a function to query EFI facilities" (commit
|
|
83e68189745a upstream, backported into 3.2.38) obviously changes ABI,
|
|
but I thought this symbol wasn't used out-of-tree. Unfortunately
|
|
nvidia does use it, but its source is packaged up such that
|
|
codesearch.debian.net didn't show me that.
|
|
|
|
Restore the efi_enabled variable. Rename the efi_enabled() function
|
|
and make efi_enabled() a function-macro. This should keep both old
|
|
and new usage working.
|
|
|
|
--- a/arch/x86/platform/efi/efi.c
|
|
+++ b/arch/x86/platform/efi/efi.c
|
|
@@ -49,6 +49,9 @@
|
|
#define EFI_DEBUG 1
|
|
#define PFX "EFI: "
|
|
|
|
+int efi_enabled;
|
|
+EXPORT_SYMBOL(efi_enabled);
|
|
+
|
|
struct efi __read_mostly efi = {
|
|
.mps = EFI_INVALID_TABLE_ADDR,
|
|
.acpi = EFI_INVALID_TABLE_ADDR,
|
|
@@ -77,11 +80,11 @@ unsigned long x86_efi_facility;
|
|
/*
|
|
* Returns 1 if 'facility' is enabled, 0 otherwise.
|
|
*/
|
|
-int efi_enabled(int facility)
|
|
+int efi_enabled_facility(int facility)
|
|
{
|
|
return test_bit(facility, &x86_efi_facility) != 0;
|
|
}
|
|
-EXPORT_SYMBOL(efi_enabled);
|
|
+EXPORT_SYMBOL(efi_enabled_facility);
|
|
|
|
static bool disable_runtime = false;
|
|
static int __init setup_noefi(char *arg)
|
|
@@ -576,6 +579,7 @@ void __init efi_init(void)
|
|
efi.get_time = phys_efi_get_time;
|
|
|
|
set_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility);
|
|
+ efi_enabled = 1;
|
|
} else
|
|
printk(KERN_ERR "Could not map the EFI runtime service "
|
|
"table!\n");
|
|
--- a/include/linux/efi.h
|
|
+++ b/include/linux/efi.h
|
|
@@ -503,7 +503,9 @@ extern int __init efi_setup_pcdp_console
|
|
|
|
#ifdef CONFIG_EFI
|
|
# ifdef CONFIG_X86
|
|
-extern int efi_enabled(int facility);
|
|
+extern int efi_enabled; /* ABI compat; please use efi_enabled() instead */
|
|
+extern int efi_enabled_facility(int facility);
|
|
+#define efi_enabled(f) efi_enabled_facility(f)
|
|
# else
|
|
static inline int efi_enabled(int facility)
|
|
{
|