coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
registers.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#ifndef __ARCH_REGISTERS_H
4
#define __ARCH_REGISTERS_H
5
6
#if !defined(__ASSEMBLER__)
7
#include <
stdint.h
>
8
9
#define LONG_DOWNTO8(A) \
10
union { \
11
struct { \
12
union { \
13
struct { \
14
uint8_t A##l; \
15
uint8_t A##h; \
16
} __packed; \
17
uint16_t A##x; \
18
} __packed; \
19
uint16_t h##A##x; \
20
} __packed; \
21
uint32_t e##A##x; \
22
} __packed;
23
24
#define LONG_DOWNTO16(A) \
25
union { \
26
struct { \
27
uint16_t A; \
28
uint16_t h##A; \
29
} __packed; \
30
uint32_t e##A; \
31
} __packed;
32
33
#define QUAD_DOWNTO8(A) \
34
union { \
35
LONG_DOWNTO8(A) \
36
uint64_t r##A##x; \
37
} __packed
38
39
#define QUAD_DOWNTO16(A) \
40
union {\
41
LONG_DOWNTO16(A) \
42
uint64_t r##A; \
43
} __packed
44
45
#if ENV_X86_64
46
struct
eregs
{
47
QUAD_DOWNTO8
(a);
48
QUAD_DOWNTO8
(
c
);
49
QUAD_DOWNTO8
(d);
50
QUAD_DOWNTO8
(b);
51
QUAD_DOWNTO16
(bp);
52
QUAD_DOWNTO16
(si);
53
QUAD_DOWNTO16
(di);
54
uint64_t
r8;
55
uint64_t
r9;
56
uint64_t
r10;
57
uint64_t
r11;
58
uint64_t
r12;
59
uint64_t
r13;
60
uint64_t
r14;
61
uint64_t
r15;
62
uint64_t
vector
;
63
uint64_t
error_code
;
64
uint64_t
rip;
65
uint64_t
cs
;
66
uint64_t
rflags;
67
QUAD_DOWNTO16
(sp);
68
uint64_t
ss;
69
};
70
#else
71
struct
eregs
{
72
LONG_DOWNTO8
(a);
73
LONG_DOWNTO8
(
c
);
74
LONG_DOWNTO8
(d);
75
LONG_DOWNTO8
(b);
76
LONG_DOWNTO16
(sp);
77
LONG_DOWNTO16
(bp);
78
LONG_DOWNTO16
(si);
79
LONG_DOWNTO16
(di);
80
uint32_t
vector
;
81
uint32_t
error_code
;
82
uint32_t
eip
;
83
uint32_t
cs
;
84
uint32_t
eflags
;
85
};
86
#endif
87
#endif
// !ASSEMBLER
88
89
#if CONFIG(COMPILER_LLVM_CLANG)
90
#define ADDR32(opcode) opcode
91
#else
92
#define ADDR32(opcode) addr32 opcode
93
#endif
94
95
#endif
QUAD_DOWNTO8
#define QUAD_DOWNTO8(A)
Definition:
registers.h:33
QUAD_DOWNTO16
#define QUAD_DOWNTO16(A)
Definition:
registers.h:39
stdint.h
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
uint64_t
unsigned long long uint64_t
Definition:
stdint.h:17
eregs
Definition:
registers.h:71
eregs::eflags
uint32_t eflags
Definition:
registers.h:84
eregs::eip
uint32_t eip
Definition:
registers.h:82
eregs::LONG_DOWNTO8
LONG_DOWNTO8(a)
eregs::vector
uint32_t vector
Definition:
registers.h:80
eregs::cs
uint32_t cs
Definition:
registers.h:83
eregs::LONG_DOWNTO16
LONG_DOWNTO16(sp)
eregs::LONG_DOWNTO16
LONG_DOWNTO16(si)
eregs::error_code
uint32_t error_code
Definition:
registers.h:81
eregs::LONG_DOWNTO8
LONG_DOWNTO8(b)
eregs::LONG_DOWNTO8
LONG_DOWNTO8(c)
eregs::LONG_DOWNTO16
LONG_DOWNTO16(di)
eregs::LONG_DOWNTO8
LONG_DOWNTO8(d)
eregs::LONG_DOWNTO16
LONG_DOWNTO16(bp)
c
#define c(value, pmcreg, dst_bits)
src
arch
x86
include
arch
registers.h
Generated by
1.9.1