summaryrefslogtreecommitdiffstats
path: root/src/cpu/x86/smm/smihandler.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2020-08-09 14:58:05 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-09-21 08:11:54 +0000
commit342d0a8365bc0a61936bfd1deba69dc0d4f68d05 (patch)
treed6aaf21446aa3b3f8812c29c5d4cecf700c648f9 /src/cpu/x86/smm/smihandler.c
parentd579a502d04c67ea9ead07c0035a18fa7a70dc30 (diff)
downloadcoreboot-342d0a8365bc0a61936bfd1deba69dc0d4f68d05.tar.gz
coreboot-342d0a8365bc0a61936bfd1deba69dc0d4f68d05.tar.bz2
coreboot-342d0a8365bc0a61936bfd1deba69dc0d4f68d05.zip
cpu/x86/smm.h: Add function to return the SMM save state revision
Change-Id: I3e4450088adbb654050e7420956cf58ee1170a98 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44318 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/cpu/x86/smm/smihandler.c')
-rw-r--r--src/cpu/x86/smm/smihandler.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cpu/x86/smm/smihandler.c b/src/cpu/x86/smm/smihandler.c
index 8fd95bb563a8..8f7ebfbf66fe 100644
--- a/src/cpu/x86/smm/smihandler.c
+++ b/src/cpu/x86/smm/smihandler.c
@@ -120,6 +120,14 @@ static inline void *smm_save_state(uintptr_t base, int arch_offset, int node)
return (void *)base;
}
+/* This returns the SMM revision from the savestate of CPU0,
+ which is assumed to be the same for all CPU's. See the memory
+ map in smmhandler.S */
+uint32_t smm_revision(void)
+{
+ return *(uint32_t *)(SMM_BASE + SMM_ENTRY_OFFSET * 2 - SMM_REVISION_OFFSET_FROM_TOP);
+}
+
bool smm_region_overlaps_handler(const struct region *r)
{
const struct region r_smm = {SMM_BASE, SMM_DEFAULT_SIZE};