1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <cpu/x86/smm.h>
7 * Call the APMC SMI handler that resides in SMM. First, the command and sub-command are stored
8 * in eax, and the argument pointer is stored in ebx, then the command byte is written to the
9 * APMC IO port to trigger the SMI. The APMC SMI handler then reads the command from the APMC
10 * IO port and the contents of eax and ebx from the SMM state save area.
12 * static inline because the resulting assembly is often smaller than
13 * the call sequence due to constant folding.
15 static inline u32
call_smm(u8 cmd
, u8 subcmd
, void *arg
)
17 const uint16_t apmc_port
= pm_acpi_smi_cmd_port();
19 __asm__
__volatile__ (
22 : "a" ((subcmd
<< 8) | cmd
),