diff options
Diffstat (limited to 'src/include/cpu/x86')
-rw-r--r-- | src/include/cpu/x86/smm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index 75c19a5cd5..ca834743b5 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -4,6 +4,7 @@ #define CPU_X86_SMM_H #include <arch/cpu.h> +#include <commonlib/region.h> #include <types.h> #define SMM_DEFAULT_BASE 0x30000 @@ -93,6 +94,17 @@ asmlinkage void smm_handler_start(void *params); * account CPUs which are configured to not save their state to RAM. */ void *smm_get_save_state(int cpu); +/* Returns true if the region overlaps with the SMM */ +bool smm_region_overlaps_handler(const struct region *r); + +/* Returns true if the memory pointed to overlaps with SMM reserved memory. */ +static inline bool smm_points_to_smram(const void *ptr, const size_t len) +{ + const struct region r = {(uintptr_t)ptr, len}; + + return smm_region_overlaps_handler(&r); +} + /* SMM Module Loading API */ /* The smm_loader_params structure provides direction to the SMM loader: |