mb/google/skyrim: Enable Chrome EC
[coreboot.git] / src / arch / x86 / include / smm.h
blob739b7158630d6e63512eba44c2810bdc072e8478
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <stddef.h>
4 #include <stdint.h>
5 #include <cpu/x86/smm.h>
7 /*
8 * calls into SMM with the given cmd and subcmd in eax, and arg in ebx
10 * static inline because the resulting assembly is often smaller than
11 * the call sequence due to constant folding.
13 static inline u32 call_smm(u8 cmd, u8 subcmd, void *arg)
15 u32 res = 0;
16 __asm__ __volatile__ (
17 "outb %b0, %3"
18 : "=a" (res)
19 : "a" ((subcmd << 8) | cmd), "b" (arg), "i" (APM_CNT));
20 return res;