coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
save_state.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __CPU_X86_SAVE_STATE_H__
4 #define __CPU_X86_SAVE_STATE_H__
5 
6 #include <stdint.h>
7 
8 enum cpu_reg {
9  RAX,
10  RBX,
11  RCX,
12  RDX
13 };
14 
15 #define SMM_REV_INVALID 0xffffffff
16 
19  /* Accessors for CPU registers in the SMM save state
20  Returns -1 on failure, 0 on success */
21  int (*get_reg)(const enum cpu_reg reg, const int node, void *out, const uint8_t length);
22  int (*set_reg)(const enum cpu_reg reg, const int node, void *in, const uint8_t length);
23  /* Returns -1 on failure, the node on which the 'cmd' was send on success */
24  int (*apmc_node)(u8 cmd);
25 };
26 
27 /* Return -1 on failure, otherwise returns which CPU node issued an APMC IO write */
28 int get_apmc_node(u8 cmd);
29 /* Return -1 on failure, 0 on success.
30  Accessors for the SMM save state CPU registers RAX, RBX, RCX and RDX */
31 int get_save_state_reg(const enum cpu_reg reg, const int node, void *out, const uint8_t length);
32 int set_save_state_reg(const enum cpu_reg reg, const int node, void *in, const uint8_t length);
33 
34 #endif /* __CPU_X86_SAVE_STATE_H__ */
uint64_t length
Definition: fw_cfg_if.h:1
cpu_reg
Definition: save_state.h:8
@ RDX
Definition: save_state.h:12
@ RBX
Definition: save_state.h:10
@ RCX
Definition: save_state.h:11
@ RAX
Definition: save_state.h:9
int get_save_state_reg(const enum cpu_reg reg, const int node, void *out, const uint8_t length)
Definition: save_state.c:57
int set_save_state_reg(const enum cpu_reg reg, const int node, void *in, const uint8_t length)
Definition: save_state.c:68
int get_apmc_node(u8 cmd)
Definition: save_state.c:49
unsigned int uint32_t
Definition: stdint.h:14
uint8_t u8
Definition: stdint.h:45
unsigned char uint8_t
Definition: stdint.h:8
Definition: jpeg.c:27
int(* set_reg)(const enum cpu_reg reg, const int node, void *in, const uint8_t length)
Definition: save_state.h:22
int(* get_reg)(const enum cpu_reg reg, const int node, void *out, const uint8_t length)
Definition: save_state.h:21
int(* apmc_node)(u8 cmd)
Definition: save_state.h:24
const uint32_t * revision_table
Definition: save_state.h:18