-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathefi.inc
181 lines (167 loc) · 3.91 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
;for 32/64 portability and automatic natural align in structure definitions
struc int8 {
. db ?
}
struc int16 {
align 2
. dw ?
}
struc int32 {
align 4
. dd ?
}
struc int64 {
align 8
. dq ?
}
struc intn {
align 8
. dq ?
}
struc dptr {
align 8
. dq ?
}
;symbols
;EFIERR = 0x8000000000000000
EFIERR = 0x0
EFI_SUCCESS = 0
EFI_LOAD_ERROR = EFIERR or 1
EFI_INVALID_PARAMETER = EFIERR or 2
EFI_UNSUPPORTED = EFIERR or 3
EFI_BAD_BUFFER_SIZE = EFIERR or 4
EFI_BUFFER_TOO_SMALL = EFIERR or 5
EFI_NOT_READY = EFIERR or 6
EFI_DEVICE_ERROR = EFIERR or 7
EFI_WRITE_PROTECTED = EFIERR or 8
EFI_OUT_OF_RESOURCES = EFIERR or 9
EFI_VOLUME_CORRUPTED = EFIERR or 10
EFI_VOLUME_FULL = EFIERR or 11
EFI_NO_MEDIA = EFIERR or 12
EFI_MEDIA_CHANGED = EFIERR or 13
EFI_NOT_FOUND = EFIERR or 14
EFI_ACCESS_DENIED = EFIERR or 15
EFI_NO_RESPONSE = EFIERR or 16
EFI_NO_MAPPING = EFIERR or 17
EFI_TIMEOUT = EFIERR or 18
EFI_NOT_STARTED = EFIERR or 19
EFI_ALREADY_STARTED = EFIERR or 20
EFI_ABORTED = EFIERR or 21
EFI_ICMP_ERROR = EFIERR or 22
EFI_TFTP_ERROR = EFIERR or 23
EFI_PROTOCOL_ERROR = EFIERR or 24
;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_BOOT_SERVICES_TABLE {
.Hdr EFI_TABLE_HEADER
.RaisePriority dptr
.RestorePriority dptr
.AllocatePages dptr
.FreePages dptr
.GetMemoryMap dptr
.AllocatePool dptr
.FreePool dptr
.CreateEvent dptr
.SetTimer dptr
.WaitForEvent dptr
.SignalEvent dptr
.CloseEvent dptr
.CheckEvent dptr
.InstallProtocolInterface dptr
.ReInstallProtocolInterface dptr
.UnInstallProtocolInterface dptr
.HandleProtocol dptr
.Void dptr
.RegisterProtocolNotify dptr
.LocateHandle dptr
.LocateDevicePath dptr
.InstallConfigurationTable dptr
.ImageLoad dptr
.ImageStart dptr
.Exit dptr
.ImageUnLoad dptr
.ExitBootServices dptr
.GetNextMonotonicCount dptr
.Stall dptr
.SetWatchdogTimer dptr
.ConnectController dptr
.DisConnectController dptr
.OpenProtocol dptr
.CloseProtocol dptr
.OpenProtocolInformation dptr
.ProtocolsPerHandle dptr
.LocateHandleBuffer dptr
.LocateProtocol dptr
.InstallMultipleProtocolInterfaces dptr
.UnInstallMultipleProtocolInterfaces dptr
.CalculateCrc32 dptr
.CopyMem dptr
.SetMem dptr
}
struct EFI_BOOT_SERVICES_TABLE
EFI_MP_SERVICES_PROTOCOL_GUID equ 0x05, 0xa6, 0xdd, 0x3f, 0x6e, 0xa7, 0x46, 0x4F, 0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08
struc EFI_MP_SERVICES_PROTOCOL {
.GetNumberOfProcessors dptr
.GetProcessorInfo dptr
.StartupAllAPs dptr
.StartupThisAP dptr
.SwitchBSP dptr
.EnableDisableAP dptr
.WhoAmI dptr
}
struct EFI_MP_SERVICES_PROTOCOL
FRAMEWORK_EFI_MP_SERVICES_PROTOCOL_GUID equ 0xe7, 0x61, 0x32, 0xf3, 0xcb, 0x23, 0xd5, 0x11, 0xbd, 0x5c, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81
struc FRAMEWORK_EFI_MP_SERVICES_PROTOCOL {
.GetGeneralMPInfo dptr
.GetProcessorContext dptr
.StartupAllAPs dptr
.StartupThisAP dptr
.SwitchBSP dptr
.SendIPI dptr
.EnableDisableAP dptr
.WhoAmI dptr
}
struct FRAMEWORK_EFI_MP_SERVICES_PROTOCOL