From 7cdb047ce714378a644b7aa2c1f40a2e1a8d5750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 8 Aug 2019 11:16:06 +0300 Subject: cpu/x86/smm: Promote smm_memory_map() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I909e9b5fead317928d3513a677cfab25e3c42f64 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/34792 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/cpu/x86/smm/tseg_region.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/cpu/x86') diff --git a/src/cpu/x86/smm/tseg_region.c b/src/cpu/x86/smm/tseg_region.c index df9dea5c0f..07789f4ac1 100644 --- a/src/cpu/x86/smm/tseg_region.c +++ b/src/cpu/x86/smm/tseg_region.c @@ -84,3 +84,23 @@ void __weak stage_cache_external_region(void **base, size_t *size) *size = 0; } } + +void smm_list_regions(void) +{ + uintptr_t base; + size_t size; + int i; + + smm_region(&base, &size); + if (!size) + return; + + printk(BIOS_DEBUG, "SMM Memory Map\n"); + printk(BIOS_DEBUG, "SMRAM : 0x%zx 0x%zx\n", base, size); + + for (i = 0; i < SMM_SUBREGION_NUM; i++) { + if (smm_subregion(i, &base, &size)) + continue; + printk(BIOS_DEBUG, " Subregion %d: 0x%zx 0x%zx\n", i, base, size); + } +} -- cgit v1.2.3