Similarly to the existing efi_get_boot_services() helper that replaces hardcoded BS use to allow code to be usable from both payload and upcoming loader support, efi_get_runtime_services() can replace RT use.
Signed-off-by: Ahmad Fatoum <[email protected]> --- include/efi/efi-mode.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/efi/efi-mode.h b/include/efi/efi-mode.h index a917c038a1b0..696ab78acd50 100644 --- a/include/efi/efi-mode.h +++ b/include/efi/efi-mode.h @@ -7,7 +7,9 @@ #include <linux/types.h> struct efi_boot_services; +struct efi_runtime_services; extern struct efi_boot_services *BS; +extern struct efi_runtime_services *RT; static inline bool efi_is_payload(void) { @@ -27,4 +29,12 @@ static inline struct efi_boot_services *efi_get_boot_services(void) return NULL; } +static inline struct efi_runtime_services *efi_get_runtime_services(void) +{ + if (efi_is_payload()) + return RT; + + return NULL; +} + #endif -- 2.47.3
