vaseboot/include/VasEBoot/efi/sb.h

51 lines
1.6 KiB
C

/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2020 Free Software Foundation, Inc.
*
* VAS_EBOOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VAS_EBOOT_EFI_SB_H
#define VAS_EBOOT_EFI_SB_H 1
#include <VasEBoot/types.h>
#include <VasEBoot/dl.h>
#include <VasEBoot/efi/api.h>
#define VAS_EBOOT_EFI_SECUREBOOT_MODE_UNSET 0
#define VAS_EBOOT_EFI_SECUREBOOT_MODE_UNKNOWN 1
#define VAS_EBOOT_EFI_SECUREBOOT_MODE_DISABLED 2
#define VAS_EBOOT_EFI_SECUREBOOT_MODE_ENABLED 3
#ifdef VAS_EBOOT_MACHINE_EFI
extern VasEBoot_uint8_t
EXPORT_FUNC (VasEBoot_efi_get_secureboot) (void);
extern bool
EXPORT_FUNC (VasEBoot_is_using_legacy_shim_lock_protocol) (void);
extern VasEBoot_efi_handle_t
EXPORT_FUNC (VasEBoot_efi_get_last_verified_image_handle) (void);
extern void
VasEBoot_shim_lock_verifier_setup (void);
#else
static inline VasEBoot_uint8_t
VasEBoot_efi_get_secureboot (void)
{
return VAS_EBOOT_EFI_SECUREBOOT_MODE_UNSET;
}
#endif
#endif /* VAS_EBOOT_EFI_SB_H */