+
+// Base System Analogue
+
+IOMemoryDescriptor*
+IOGetBaseSystemARVManifestData(void)
+{
+ // Check if someone got the base system manifest before us
+ if (!OSCompareAndSwap(0, 1, &bsARVManifestFetched)) {
+ return NULL;
+ }
+
+ boot_args* args = (boot_args*)PE_state.bootArgs;
+
+ DEBG("%s: data at address %llu size %llu\n", __func__, args->bsARVManifestStart, args->bsARVManifestSize);
+ if (args->bsARVManifestStart == 0) {
+ return NULL;
+ }
+
+ // We have the manifest in the boot_args, create IOMemoryDescriptor for the blob
+ IOAddressRange ranges;
+ ranges.address = args->bsARVManifestStart;
+ ranges.length = args->bsARVManifestSize;
+
+ const IOOptionBits options = kIODirectionInOut | kIOMemoryTypePhysical64 | kIOMemoryMapperNone;
+
+ IOMemoryDescriptor* memoryDescriptor = IOMemoryDescriptor::withOptions(&ranges, 1, 0, NULL, options);
+ DEBG("%s: memory descriptor %p\n", __func__, memoryDescriptor);
+ return memoryDescriptor;
+}