diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2024-01-04 17:52:41 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-01-10 20:35:54 +0000 |
commit | 8dd5b9dd2ad444e9c1057e1ef67e790dbe343cc8 (patch) | |
tree | 2e5969d79d51168e965f0697f99b7f1b76742c0f | |
parent | b895d55748ee600eb59b40517f8ad815edcd9ca0 (diff) |
arch/x86/include/smm: use inline asm from drivers/smmstore/ramstage
The call_smm function is currently unused and the inline assembly code
for more or less the same functionality in drivers/smmstore/ramstage is
both a bit easier to understand since it uses the register names in the
'outb' instruction instead of positional arguments, and also tells the
compiler that this piece of code might change global memory. Having too
much in the clobber list might only have some performance impact, which
should however be negligible compared to the SMI handler being called,
while missing something in the clobber list might cause hard to debug
problems.
This is a preparation to make drivers/smmstore/ramstage use call_smm
instead of having its own inline assembly implementation for this.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I73837cab75429014897486b38a5c56f93a850f96
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79827
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
-rw-r--r-- | src/arch/x86/include/smm.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/arch/x86/include/smm.h b/src/arch/x86/include/smm.h index e6db9dcf04..c0d96c0182 100644 --- a/src/arch/x86/include/smm.h +++ b/src/arch/x86/include/smm.h @@ -13,8 +13,11 @@ static inline u32 call_smm(u8 cmd, u8 subcmd, void *arg) { u32 res = 0; __asm__ __volatile__ ( - "outb %b0, %3" + "outb %%al, %%dx" : "=a" (res) - : "a" ((subcmd << 8) | cmd), "b" (arg), "i" (APM_CNT)); + : "a" ((subcmd << 8) | cmd), + "b" (arg), + "d" (APM_CNT) + : "memory"); return res; } |