Page MenuHomeFreeBSD

LinuxKPI: Implement efi_enabled(EFI_BOOT)
ClosedPublic

Authored by wulf on Dec 6 2021, 11:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 31, 8:12 PM
Unknown Object (File)
Jan 12 2024, 7:46 AM
Unknown Object (File)
Dec 26 2023, 2:25 PM
Unknown Object (File)
Dec 24 2023, 10:47 AM
Unknown Object (File)
Dec 20 2023, 5:17 AM
Unknown Object (File)
Oct 3 2023, 3:58 AM
Unknown Object (File)
Sep 10 2023, 8:54 PM
Unknown Object (File)
Sep 9 2023, 7:49 AM

Details

Summary

efi_enabled(EFI_BOOT) returns true if machine was booted from EFI
Used by drm-kmod and some unported drm drivers like hyperv

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wulf requested review of this revision.Dec 6 2021, 11:59 AM
sys/compat/linuxkpi/common/include/linux/efi.h
59

Is it possible to catch this compile time with a static assert, CTASSERT() or _Static_assert() ?

Add _Static_assert wrapper for compile-time argument checking

This revision is now accepted and ready to land.Dec 6 2021, 12:55 PM
sys/compat/linuxkpi/common/include/linux/efi.h
56

I thought we had a more direct EFI enabled variable these days....

bool efi_boot;

in machdep.c. Is there some reason that wasn't used? We use the above to search it out early in boot, why not use the cached result?

bz added inline comments.
sys/compat/linuxkpi/common/include/linux/efi.h
30

_BSD_LKPI_ is a new one to me; can that be _LINUXKPI_ ?

sys/compat/linuxkpi/common/include/linux/efi.h
30

It must be _LINUX_EFI_H_. I will fix it.

56

efi_boot is defined on amd64 only while MODINFOMD_EFI_MAP exists on every platform which is able to boot from EFI

Use cached efi_boot value on amd64

This revision now requires review to proceed.Dec 6 2021, 10:48 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 10 2022, 7:51 PM
This revision was automatically updated to reflect the committed changes.