summaryrefslogtreecommitdiffstats
path: root/include/efi/efi-mode.h
blob: a917c038a1b03ce071e7579d9e6190247c313b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef __EFI_MODE_H
#define __EFI_MODE_H

#include <linux/stddef.h>
#include <linux/types.h>

struct efi_boot_services;
extern struct efi_boot_services *BS;

static inline bool efi_is_payload(void)
{
	return IS_ENABLED(CONFIG_EFI_PAYLOAD) && BS;
}

static inline bool efi_is_loader(void)
{
	return false;
}

static inline struct efi_boot_services *efi_get_boot_services(void)
{
	if (efi_is_payload())
		return BS;

	return NULL;
}

#endif