Loading...
--- xnu/xnu-4570.71.2/libsa/bootstrap.cpp
+++ xnu/xnu-3789.31.2/libsa/bootstrap.cpp
@@ -30,9 +30,6 @@
#include <libkern/kernel_mach_header.h>
#include <libkern/prelink.h>
-#if CONFIG_EMBEDDED
-extern uuid_t kernelcache_uuid;
-#endif
}
#include <libkern/version.h>
@@ -117,7 +114,7 @@
static int __whereIsAddr(vm_offset_t theAddr, unsigned long * segSizes, vm_offset_t *segAddrs, int segCount );
-#define PLK_SEGMENTS 12
+#define PLK_SEGMENTS 11
static const char * plk_segNames[] = {
"__TEXT",
@@ -129,7 +126,6 @@
"__PLK_TEXT_EXEC",
"__PRELINK_DATA",
"__PLK_DATA_CONST",
- "__PLK_LLVM_COV",
"__PLK_LINKEDIT",
"__PRELINK_INFO",
NULL
@@ -246,9 +242,6 @@
OSDictionary * prelinkInfoDict = NULL; // do not release
OSString * errorString = NULL; // must release
OSKext * theKernel = NULL; // must release
-#if CONFIG_EMBEDDED
- OSData * kernelcacheUUID = NULL; // do not release
-#endif
kernel_segment_command_t * prelinkTextSegment = NULL; // see code
kernel_segment_command_t * prelinkInfoSegment = NULL; // see code
@@ -374,19 +367,6 @@
ramDiskBoot = IORamDiskBSDRoot();
#endif /* NO_KEXTD */
-#if CONFIG_EMBEDDED
- /* Copy in the kernelcache UUID */
- kernelcacheUUID = OSDynamicCast(OSData,
- prelinkInfoDict->getObject(kPrelinkInfoKCIDKey));
- if (!kernelcacheUUID) {
- bzero(&kernelcache_uuid, sizeof(kernelcache_uuid));
- } else if (kernelcacheUUID->getLength() != sizeof(kernelcache_uuid)) {
- panic("kernelcacheUUID length is %d, expected %lu", kernelcacheUUID->getLength(),
- sizeof(kernelcache_uuid));
- } else {
- memcpy((void *)&kernelcache_uuid, (const void *)kernelcacheUUID->getBytesNoCopy(), kernelcacheUUID->getLength());
- }
-#endif /* CONFIG_EMBEDDED */
infoDictArray = OSDynamicCast(OSArray,
prelinkInfoDict->getObject(kPrelinkInfoDictionaryKey));
@@ -402,9 +382,7 @@
/* Create dictionary of excluded kexts
*/
-#ifndef CONFIG_EMBEDDED
OSKext::createExcludeListFromPrelinkInfo(infoDictArray);
-#endif
/* Create OSKext objects for each info dictionary.
*/
for (i = 0; i < infoDictArray->getCount(); ++i) {
@@ -453,13 +431,7 @@
OSNumber *lengthNum = OSDynamicCast(OSNumber,
infoDict->getObject(kPrelinkExecutableSizeKey));
if (addressNum && lengthNum) {
-#if __arm__ || __arm64__
- vm_offset_t data = (vm_offset_t) ((addressNum->unsigned64BitValue()) + vm_kernel_slide);
- vm_size_t length = (vm_size_t) (lengthNum->unsigned32BitValue());
- ml_static_mfree(data, length);
-#else
#error Pick the right way to free prelinked data on this arch
-#endif
}
infoDictArray->removeObject(i--);
@@ -481,8 +453,8 @@
int badSlideAddr = 0;
int badSlideTarget = 0;
- const kaslrPackedOffsets * myOffsets = NULL;
- myOffsets = (const kaslrPackedOffsets *) kaslrOffsets->getBytesNoCopy();
+ kaslrPackedOffsets * myOffsets = NULL;
+ myOffsets = (kaslrPackedOffsets *) kaslrOffsets->getBytesNoCopy();
for (uint32_t j = 0; j < myOffsets->count; j++) {
@@ -632,9 +604,7 @@
/* Create dictionary of excluded kexts
*/
-#ifndef CONFIG_EMBEDDED
OSKext::createExcludeListFromBooterData(propertyDict, keyIterator);
-#endif
keyIterator->reset();
while ( ( deviceTreeName =