efi/reboot: Add generic wrapper around EfiResetSystem()
Implement efi_reboot(), which is really just a wrapper around the EfiResetSystem() EFI runtime service, but it does at least allow us to funnel all callers through a single location. It also simplifies the callsites since users no longer need to check to see whether EFI_RUNTIME_SERVICES are enabled. Cc: Tony Luck <tony.luck@intel.com> Tested-by: Mark Salter <msalter@redhat.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/pfn.h>
|
||||
#include <linux/pstore.h>
|
||||
#include <linux/reboot.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
|
||||
@@ -928,11 +929,14 @@ static inline bool efi_enabled(int feature)
|
||||
{
|
||||
return test_bit(feature, &efi.flags) != 0;
|
||||
}
|
||||
extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
|
||||
#else
|
||||
static inline bool efi_enabled(int feature)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline void
|
||||
efi_reboot(enum reboot_mode reboot_mode, const char *__unused) {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user