Sets the volatile and non-volatile variables used by OS X
| 199 | |
| 200 | /// Sets the volatile and non-volatile variables used by OS X |
| 201 | EFI_STATUS EFIAPI |
| 202 | SetVariablesForOSX(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 |
no test coverage detected