OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
CachelessInternal.h
Go to the documentation of this file.
1
16#ifndef CACHELESS_INTERNAL_H
17#define CACHELESS_INTERNAL_H
18
20#include <Library/OcStringLib.h>
21
22//
23// Names are of format OcXXXXXXXX.kext, where XXXXXXXX is a 32-bit hexadecimal number.
24//
25#define KEXT_BUNDLE_NAME L"OcXXXXXXXX.kext"
26#define KEXT_BUNDLE_NAME_SIZE (L_STR_SIZE (KEXT_BUNDLE_NAME))
27#define KEXT_BUNDLE_NAME_LEN (L_STR_LEN (KEXT_BUNDLE_NAME))
28#define KEXT_BUNDLE_INFO_SIZE (SIZE_OF_EFI_FILE_INFO + KEXT_BUNDLE_NAME_SIZE)
29
30enum {
34};
35
36//
37// Kext dependency.
38//
39typedef struct {
40 //
41 // Signature.
42 //
43 UINT32 Signature;
44 //
45 // Link for global list.
46 //
47 LIST_ENTRY Link;
48 //
49 // Bundle identifier.
50 //
51 CHAR8 *Identifier;
53
54//
55// Cacheless kext.
56//
57typedef struct {
58 //
59 // Signature.
60 //
61 UINT32 Signature;
62 //
63 // Link for global list (CACHELESS_CONTEXT -> InjectedKexts).
64 //
65 LIST_ENTRY Link;
66 //
67 // Bundle filename used during S/L/E overlay creation.
68 //
69 CHAR16 BundleFileName[KEXT_BUNDLE_NAME_LEN + 1];
70 //
71 // Plist data.
72 //
73 CHAR8 *PlistData;
74 //
75 // Plist data size.
76 //
78 //
79 // Binary data.
80 //
81 UINT8 *BinaryData;
82 //
83 // Binary data size.
84 //
86 //
87 // Binary file name.
88 //
91
92//
93// Kext patch.
94//
95typedef struct {
96 //
97 // Signature.
98 //
99 UINT32 Signature;
100 //
101 // Link for global list (PATCHED_BUILTIN_KEXT -> Patches).
102 //
103 LIST_ENTRY Link;
104 //
105 // Generic patch.
106 //
108 //
109 // Apply Quirk instead of Patch.
110 //
111 BOOLEAN ApplyQuirk;
112 //
113 // Kernel quirk to apply.
114 //
116} KEXT_PATCH;
117
118//
119// Built-in kext in SLE requiring patches.
120//
121typedef struct {
122 //
123 // Signature.
124 //
125 UINT32 Signature;
126 //
127 // Link for global list (CACHELESS_CONTEXT -> PatchedKexts).
128 //
129 LIST_ENTRY Link;
130 //
131 // Bundle identifier.
132 //
134 //
135 // List of patches to apply.
136 //
137 LIST_ENTRY Patches;
138 //
139 // Block kext.
140 //
141 BOOLEAN Block;
143
144//
145// Built-in kexts in SLE.
146//
147typedef struct {
148 //
149 // Signature.
150 //
151 UINT32 Signature;
152 //
153 // Link for global list (CACHELESS_CONTEXT -> BuiltInKexts).
154 //
155 LIST_ENTRY Link;
156 //
157 // Plist path.
158 //
159 CHAR16 *PlistPath;
160 //
161 // Bundle identifier.
162 //
164 //
165 // Binary file name.
166 //
168 //
169 // Binary file path.
170 //
171 CHAR16 *BinaryPath;
172 //
173 // Dependencies.
174 //
175 LIST_ENTRY Dependencies;
176 //
177 // OSBundleRequired is valid?
178 //
180 //
181 // Needs OSBundleRequired override for dependency injection?
182 //
184 //
185 // Needs patches or blocks?
186 //
187 BOOLEAN PatchKext;
189
190//
191// DEPEND_KEXT signature for list identification.
192//
193#define DEPEND_KEXT_SIGNATURE SIGNATURE_32 ('S', 'l', 'e', 'D')
194
200#define GET_DEPEND_KEXT_FROM_LINK(This) \
201 (CR ( \
202 (This), \
203 DEPEND_KEXT, \
204 Link, \
205 DEPEND_KEXT_SIGNATURE \
206 ))
207
208//
209// CACHELESS_KEXT signature for list identification.
210//
211#define CACHELESS_KEXT_SIGNATURE SIGNATURE_32 ('S', 'l', 'e', 'X')
212
218#define GET_CACHELESS_KEXT_FROM_LINK(This) \
219 (CR ( \
220 (This), \
221 CACHELESS_KEXT, \
222 Link, \
223 CACHELESS_KEXT_SIGNATURE \
224 ))
225
226//
227// KEXT_PATCH signature for list identification.
228//
229#define KEXT_PATCH_SIGNATURE SIGNATURE_32 ('K', 'x', 't', 'P')
230
236#define GET_KEXT_PATCH_FROM_LINK(This) \
237 (CR ( \
238 (This), \
239 KEXT_PATCH, \
240 Link, \
241 KEXT_PATCH_SIGNATURE \
242 ))
243
244//
245// PATCHED_KEXT signature for list identification.
246//
247#define PATCHED_KEXT_SIGNATURE SIGNATURE_32 ('S', 'l', 'e', 'P')
248
254#define GET_PATCHED_KEXT_FROM_LINK(This) \
255 (CR ( \
256 (This), \
257 PATCHED_KEXT, \
258 Link, \
259 PATCHED_KEXT_SIGNATURE \
260 ))
261
262//
263// BUILTIN_KEXT signature for list identification.
264//
265#define BUILTIN_KEXT_SIGNATURE SIGNATURE_32 ('S', 'l', 'e', 'B')
266
272#define GET_BUILTIN_KEXT_FROM_LINK(This) \
273 (CR ( \
274 (This), \
275 BUILTIN_KEXT, \
276 Link, \
277 BUILTIN_KEXT_SIGNATURE \
278 ))
279
280#endif
@ KEXT_OSBUNDLE_REQUIRED_VALID
@ KEXT_OSBUNDLE_REQUIRED_NONE
@ KEXT_OSBUNDLE_REQUIRED_INVALID
#define KEXT_BUNDLE_NAME_LEN
KERNEL_QUIRK_NAME
LIST_ENTRY Dependencies
BOOLEAN PatchValidOSBundleRequired
CHAR16 * BinaryFileName
LIST_ENTRY Link
PATCHER_GENERIC_PATCH Patch
LIST_ENTRY Link
KERNEL_QUIRK_NAME QuirkName