MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / SetVariablesForOSX

Function SetVariablesForOSX

rEFIt_UEFI/Platform/DataHubCpu.cpp:201–418  ·  view source on GitHub ↗

Sets the volatile and non-volatile variables used by OS X

Source from the content-addressed store, hash-verified

199
200/// Sets the volatile and non-volatile variables used by OS X
201EFI_STATUS EFIAPI
202SetVariablesForOSX(LOADER_ENTRY *Entry)
203{
204 // The variable names used should be made global constants to prevent them being allocated multiple times
205
206 UINT32 Attributes;
207 UINT32 Color;
208 CONST CHAR8 *None;
209 CONST CHAR8 *NvidiaWebValue;
210
211 CONST CHAR16 *KbdPrevLang;
212 UINTN LangLen;
213 VOID *OldData;
214 UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion);
215 CHAR8 *PlatformLang;
216
217 //
218 // firmware Variables
219 //
220 if (BlockRtVariableArray.size() > 0) {
221 OvrRuntimeServices(gRT);
222 }
223
224 // As found on a real Mac, the system-id variable solely has the BS flag
225 SetNvramVariable(L"system-id",
226 &gEfiAppleNvramGuid,
227 EFI_VARIABLE_BOOTSERVICE_ACCESS,
228 sizeof(gUuid),
229 &gUuid);
230
231 Attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
232
233 if (gSettings.RtMLB.notEmpty()) {
234 if ( gSettings.RtMLB.length() != 17 ) {
235 DBG("** Warning: Your MLB is not suitable for iMessage(must be 17 chars long) !\n");
236 }
237
238 SetNvramXString8(L"MLB",
239 &gEfiAppleNvramGuid,
240 Attributes,
241 gSettings.RtMLB);
242 }
243
244 if (gSettings.RtROM != NULL) {
245 SetNvramVariable(L"ROM",
246 &gEfiAppleNvramGuid,
247 Attributes,
248 gSettings.RtROMLen,
249 gSettings.RtROM);
250 }
251
252 SetNvramVariable(L"FirmwareFeatures",
253 &gEfiAppleNvramGuid,
254 Attributes,
255 sizeof(gFwFeatures),
256 &gFwFeatures);
257
258 // Download-Fritz: Should be added to SMBIOS or at least to some other config section

Callers 1

StartLoaderMethod · 0.85

Calls 13

SetNvramVariableFunction · 0.85
SetNvramXString8Function · 0.85
AddNvramVariableFunction · 0.85
AddNvramXString8Function · 0.85
GetNvramVariableFunction · 0.85
DeleteNvramVariableFunction · 0.85
trimMethod · 0.80
OvrRuntimeServicesFunction · 0.70
FreePoolFunction · 0.50
GetDevicePathSizeFunction · 0.50
sizeMethod · 0.45
notEmptyMethod · 0.45

Tested by

no test coverage detected