mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
arm64: Add in_vhe() to find if the kernel is in VHE
Add a function to support devices that may need to know if the kernel has enabled the Armv8.1 Virtulization Host Extensions (FEAT_VHE). Some devices, e.g. the generic timer, will need to know, e.g. use a different interrupt. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43973
This commit is contained in:
parent
37563d39ef
commit
353b6a5bcb
|
@ -215,6 +215,14 @@ has_hyp(void)
|
|||
return (boot_el == 2 && (hcr_el2 & HCR_E2H) == 0);
|
||||
}
|
||||
|
||||
bool
|
||||
in_vhe(void)
|
||||
{
|
||||
/* If we are currently in EL2 then must be in VHE */
|
||||
return ((READ_SPECIALREG(CurrentEL) & CURRENTEL_EL_MASK) ==
|
||||
CURRENTEL_EL_EL2);
|
||||
}
|
||||
|
||||
static void
|
||||
cpu_startup(void *dummy)
|
||||
{
|
||||
|
|
|
@ -48,6 +48,7 @@ extern enum arm64_bus arm64_bus_method;
|
|||
|
||||
void dbg_init(void);
|
||||
bool has_hyp(void);
|
||||
bool in_vhe(void);
|
||||
void initarm(struct arm64_bootparams *);
|
||||
vm_offset_t parse_boot_param(struct arm64_bootparams *abp);
|
||||
#ifdef FDT
|
||||
|
|
Loading…
Reference in a new issue