-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathefi.inc
140 lines (120 loc) · 2.35 KB
/
efi.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
;
; EFI.inc
; Based on: http://wiki.osdev.org/Uefi.inc
; 2015 Szymon Kłos
;
struc int8 {
. db ?
}
struc int16 {
align 2
. dw ?
}
struc int32 {
align 4
. dd ?
}
struc int64 {
align 8
. dq ?
}
struc intn {
align 4
. dd ?
}
struc dptr {
align 4
. dd ?
}
; symbols
EFI_SUCCESS equ 0
EFI_SYSTEM_TABLE_SIGNATURE equ 20494249h
EFI_SYSTEM_TABLE_SIGNATURE2 equ 54535953h
EFI_RUNTIME_SERVICES_SIGNATURE equ 544e5552h
EFI_RUNTIME_SERVICES_SIGNATURE2 equ 56524553h
; helper macro for definition of relative structure member offsets
macro struct name
{
virtual at 0
name name
end virtual
}
; structures
struc EFI_TABLE_HEADER {
.Signature int64
.Revision int32
.HeaderSize int32
.CRC32 int32
.Reserved int32
}
struct EFI_TABLE_HEADER
struc EFI_SYSTEM_TABLE {
.Hdr EFI_TABLE_HEADER
.FirmwareVendor dptr
.FirmwareRevision int32
.ConsoleInHandle dptr
.ConIn dptr
.ConsoleOutHandle dptr
.ConOut dptr
.StandardErrorHandle dptr
.StdErr dptr
.RuntimeServices dptr
.BootServices dptr
.NumberOfTableEntries intn
.ConfigurationTable dptr
}
struct EFI_SYSTEM_TABLE
struc SIMPLE_TEXT_OUTPUT_INTERFACE {
.Reset dptr
.OutputString dptr
.TestString dptr
.QueryMode dptr
.SetMode dptr
.SetAttribute dptr
.ClearScreen dptr
.SetCursorPosition dptr
.EnableCursor dptr
.Mode dptr
}
struct SIMPLE_TEXT_OUTPUT_INTERFACE
struc EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
.Reset dptr
.ReadKeyStroke dptr
.WaitForKey dptr
}
struct EFI_SIMPLE_TEXT_INPUT_PROTOCOL
struc EFI_INPUT_KEY {
.ScanCode int16
.UnicodeChar int16
}
struct EFI_INPUT_KEY
struc EFI_RUNTIME_SERVICES {
.Hdr EFI_TABLE_HEADER
.GetTime dptr
.SetTime dptr
.GetWakeUpTime dptr
.SetWakeUpTime dptr
.SetVirtualAddressMap dptr
.ConvertPointer dptr
.GetVariable dptr
.GetNextVariableName dptr
.SetVariable dptr
.GetNextHighMonotonicCount dptr
.ResetSystem dptr
}
struct EFI_RUNTIME_SERVICES
struc EFI_TIME {
.Year int16
.Month int8
.Day int8
.Hour int8
.Minute int8
.Second int8
.Pad1 int8
.Nanosecond int32
.TimeZone int16
.Daylight int8
.Pad2 int8
.sizeof rb 1
}
struct EFI_TIME