Index: trunk/i386/libsaio/xml.c =================================================================== --- trunk/i386/libsaio/xml.c (revision 2857) +++ trunk/i386/libsaio/xml.c (revision 2858) @@ -22,15 +22,12 @@ * @APPLE_LICENSE_HEADER_END@ */ +#include "config.h" #include "bootstruct.h" #include "libsaio.h" #include "sl.h" #include "xml.h" -#ifndef DEBUG_XML - #define DEBUG_XML 0 -#endif - #if DEBUG_XML #define DBG(x...) printf(x) #else @@ -912,7 +909,7 @@ //========================================================================== // ParseTagData -static long ParseTagData( char *buffer, TagPtr *tag ) +static long ParseTagData( char *buffer, TagPtr *tag) { int actuallen = 0; long length = 0; Index: trunk/i386/libsaio/xml.h =================================================================== --- trunk/i386/libsaio/xml.h (revision 2857) +++ trunk/i386/libsaio/xml.h (revision 2858) @@ -115,5 +115,4 @@ // ParseTag* long ParseTagBoolean( char *buffer, TagPtr *tag, long type ); - #endif /* __LIBSAIO_XML_H */ Index: trunk/i386/libsaio/exfat.c =================================================================== --- trunk/i386/libsaio/exfat.c (revision 2857) +++ trunk/i386/libsaio/exfat.c (revision 2858) @@ -35,6 +35,7 @@ * from similar ntfs.c funcs as fallback (if not NTFS, maybe it's EXFAT). */ +#include "config.h" #include "libsaio.h" #include "sl.h" @@ -42,16 +43,13 @@ #pragma mark Preprocessor Definitions #pragma mark - -#ifndef DEBUG_EXFAT -#define DEBUG_EXFAT 0 -#endif #if DEBUG_EXFAT -#define DBG(x...) printf(x) -#define PAUSE() getchar() + #define DBG(x...) printf(x) + #define PAUSE() getchar() #else -#define DBG(x...) -#define PAUSE() + #define DBG(x...) + #define PAUSE() #endif #define EXFAT_BBID &gExfatID[0] Index: trunk/i386/libsaio/bootstruct.c =================================================================== --- trunk/i386/libsaio/bootstruct.c (revision 2857) +++ trunk/i386/libsaio/bootstruct.c (revision 2858) @@ -26,14 +26,11 @@ * All rights reserved. */ +#include "config.h" #include "libsaio.h" #include "boot.h" #include "bootstruct.h" -#ifndef DEBUG_BOOTSTRUCT - #define DEBUG_BOOTSTRUCT 0 -#endif - #if DEBUG_BOOTSTRUCT #define DBG(x...) printf(x) #else Index: trunk/i386/libsaio/bootstruct.h =================================================================== --- trunk/i386/libsaio/bootstruct.h (revision 2857) +++ trunk/i386/libsaio/bootstruct.h (revision 2858) @@ -135,8 +135,8 @@ config_file_t smbiosConfig; // smbios.plist config_file_t helperConfig; // boot helper partition's boot.plist config_file_t ramdiskConfig; // RAMDisk.plist - config_file_t kernelConfig; // kernel.plist + bool memDetect; } PrivateBootInfo_t; Index: trunk/i386/libsaio/acpi_patcher.c =================================================================== --- trunk/i386/libsaio/acpi_patcher.c (revision 2857) +++ trunk/i386/libsaio/acpi_patcher.c (revision 2858) @@ -3,6 +3,7 @@ * 2010 mojodojo, 2012 slice */ +#include "config.h" #include "libsaio.h" #include "boot.h" #include "bootstruct.h" @@ -15,10 +16,6 @@ #include "aml_generator.h" #include "state_generator.h" -#ifndef DEBUG_ACPI - #define DEBUG_ACPI 0 -#endif - #if DEBUG_ACPI==2 #define DBG(x...) {printf(x); sleep(1);} #elif DEBUG_ACPI==1 Index: trunk/i386/libsaio/bootargs.h =================================================================== --- trunk/i386/libsaio/bootargs.h (revision 2857) +++ trunk/i386/libsaio/bootargs.h (revision 2858) @@ -140,14 +140,14 @@ /* Rootless configuration flags */ // http://www.idelta.info/archives/kext-to-check-sip-rootless-status-on-el-capitan/ -#define CSR_ALLOW_UNTRUSTED_KEXTS (1 << 0) /* Allow untrusted kexts */ -#define CSR_ALLOW_UNRESTRICTED_FS (1 << 1) /* Allow unrestricted file system. */ -#define CSR_ALLOW_TASK_FOR_PID (1 << 2) /* Allow test_for_pid() */ -#define CSR_ALLOW_KERNEL_DEBUGGER (1 << 3) -#define CSR_ALLOW_APPLE_INTERNAL (1 << 4) -#define CSR_ALLOW_UNRESTRICTED_DTRACE (1 << 5) /* Allow unrestricted dtrace */ -#define CSR_ALLOW_UNRESTRICTED_NVRAM (1 << 6) /* Allow unrestricted NVRAM */ -#define CSR_ALLOW_DEVICE_CONFIGURATION (1 << 7) /* Allow device configuration */ +#define CSR_ALLOW_UNTRUSTED_KEXTS (1 << 0) /* Allow untrusted kexts */ +#define CSR_ALLOW_UNRESTRICTED_FS (1 << 1) /* Allow unrestricted file system. */ +#define CSR_ALLOW_TASK_FOR_PID (1 << 2) /* Allow test_for_pid() */ +#define CSR_ALLOW_KERNEL_DEBUGGER (1 << 3) +#define CSR_ALLOW_APPLE_INTERNAL (1 << 4) +#define CSR_ALLOW_UNRESTRICTED_DTRACE (1 << 5) /* Allow unrestricted dtrace */ +#define CSR_ALLOW_UNRESTRICTED_NVRAM (1 << 6) /* Allow unrestricted NVRAM */ +#define CSR_ALLOW_DEVICE_CONFIGURATION (1 << 7) /* Allow device configuration */ #define CSR_VALID_FLAGS (CSR_ALLOW_UNTRUSTED_KEXTS | \ CSR_ALLOW_UNRESTRICTED_FS | \ @@ -155,8 +155,8 @@ CSR_ALLOW_KERNEL_DEBUGGER | \ CSR_ALLOW_APPLE_INTERNAL | \ CSR_ALLOW_UNRESTRICTED_DTRACE | \ - CSR_ALLOW_UNRESTRICTED_NVRAM | \ - CSR_ALLOW_DEVICE_CONFIGURATION) + CSR_ALLOW_UNRESTRICTED_NVRAM | \ + CSR_ALLOW_DEVICE_CONFIGURATION) typedef struct boot_args { Index: trunk/i386/libsaio/spd.c =================================================================== --- trunk/i386/libsaio/spd.c (revision 2857) +++ trunk/i386/libsaio/spd.c (revision 2858) @@ -6,6 +6,7 @@ * System profiler fix and other fixes by Mozodojo. */ +#include "config.h" #include "libsaio.h" #include "pci.h" #include "platform.h" @@ -15,10 +16,6 @@ #include "bootstruct.h" #include "memvendors.h" -#ifndef DEBUG_SPD - #define DEBUG_SPD 0 -#endif - #if DEBUG_SPD #define DBG(x...) printf(x) #else Index: trunk/i386/libsaio/gma.c =================================================================== --- trunk/i386/libsaio/gma.c (revision 2857) +++ trunk/i386/libsaio/gma.c (revision 2858) @@ -33,6 +33,7 @@ - http://www.insanelymac.com/forum/topic/288241-intel-hd4000-inject-aaplig-platform-id/ */ +#include "config.h" #include "libsa.h" #include "saio_internal.h" #include "bootstruct.h" @@ -44,14 +45,6 @@ #include "vbe.h" #include "graphics.h" -#ifndef DEBUG_GMA - #define DEBUG_GMA 0 -#endif - -#ifndef REPLACE_DEVICE_ID - #define REPLACE_DEVICE_ID 0 -#endif - #if DEBUG_GMA #define DBG(x...) printf(x) #else @@ -443,7 +436,7 @@ {GMA_SKYLAKE_ULX_GT1, HD_GRAPHICS }, /* 190E */ {GMA_SKYLAKE_ULX_GT2, HD_GRAPHICS_515 }, /* 191E */ {GMA_SKYLAKE_DT_GT2, HD_GRAPHICS_530 }, /* 1912 */ - {GMA_SKYLAKE_1921, HD_GRAPHICS_520 }, /* 1921 */ + {GMA_SKYLAKE_1921, HD_GRAPHICS_520 }, /* 1921 */ {GMA_SKYLAKE_ULT_GT3_E, IRIS_540 }, /* 1926 */ {GMA_SKYLAKE_ULT_GT3, HD_GRAPHICS_535 }, /* 1923 */ {GMA_SKYLAKE_ULT_GT3_28W, HD_GRAPHICS_550 }, /* 1927 */ Index: trunk/i386/libsaio/pci_root.c =================================================================== --- trunk/i386/libsaio/pci_root.c (revision 2857) +++ trunk/i386/libsaio/pci_root.c (revision 2858) @@ -2,18 +2,15 @@ * Copyright 2009 netkas */ +#include "config.h" #include "libsaio.h" #include "boot.h" #include "bootstruct.h" -#ifndef DEBUG_PCIROOT -#define DEBUG_PCIROOT 1 -#endif - #if DEBUG_PCIROOT -#define DBG(x...) printf(x) + #define DBG(x...) printf(x) #else -#define DBG(x...) + #define DBG(x...) #endif static int rootuid = 10; //value means function wasnt ran yet Index: trunk/i386/libsaio/usb.c =================================================================== --- trunk/i386/libsaio/usb.c (revision 2857) +++ trunk/i386/libsaio/usb.c (revision 2858) @@ -7,15 +7,12 @@ * */ +#include "config.h" #include "libsaio.h" #include "boot.h" #include "bootstruct.h" #include "pci.h" -#ifndef DEBUG_USB - #define DEBUG_USB 0 -#endif - #if DEBUG_USB #define DBG(x...) printf(x) #else Index: trunk/i386/libsaio/device_inject.c =================================================================== --- trunk/i386/libsaio/device_inject.c (revision 2857) +++ trunk/i386/libsaio/device_inject.c (revision 2858) @@ -5,6 +5,7 @@ * Cleaned and merged by iNDi */ +#include "config.h" #include "libsaio.h" #include "boot.h" #include "bootstruct.h" @@ -13,10 +14,6 @@ #include "device_inject.h" #include "convert.h" -#ifndef DEBUG_INJECT - #define DEBUG_INJECT 0 -#endif - #if DEBUG_INJECT #define DBG(x...) printf(x) #else @@ -170,30 +167,30 @@ free(device); return NULL; } - + device->numentries = 0x00; - + device->acpi_dev_path.length = 0x0c; device->acpi_dev_path.type = 0x02; device->acpi_dev_path.subtype = 0x01; device->acpi_dev_path._HID = 0xd041030a; // 0x0a0341d0 - + device->num_pci_devpaths = numpaths; device->length = 24 + (6*numpaths); - + int i; - + for(i = 0; i < numpaths; i++) { device->pci_dev_path[i].length = 0x06; device->pci_dev_path[i].type = 0x01; device->pci_dev_path[i].subtype = 0x01; } - + device->path_end.length = 0x04; device->path_end.type = 0x7f; device->path_end.subtype = 0xff; - + device->string = string; device->data = NULL; Index: trunk/i386/libsaio/hda.c =================================================================== --- trunk/i386/libsaio/hda.c (revision 2857) +++ trunk/i386/libsaio/hda.c (revision 2858) @@ -60,6 +60,7 @@ * ******************************************************************************/ +#include "config.h" #include "boot.h" #include "bootstruct.h" #include "cpu.h" @@ -75,20 +76,12 @@ #define HEADER __FILE__ " [" TOSTRING(__LINE__) "]: " -#ifndef DEBUG_HDA - #define DEBUG_HDA 0 -#endif - #if DEBUG_HDA #define DBG(x...) verbose(x) #else #define DBG(x...) #endif -#ifndef DEBUG_CODEC - #define DEBUG_CODEC 0 -#endif - #if DEBUG_CODEC #define CDBG(x...) verbose(x) #else Index: trunk/i386/libsaio/dram_controllers.c =================================================================== --- trunk/i386/libsaio/dram_controllers.c (revision 2857) +++ trunk/i386/libsaio/dram_controllers.c (revision 2858) @@ -13,16 +13,13 @@ * http://www.canardpc.com - http://www.memtest.org */ +#include "config.h" #include "libsaio.h" #include "bootstruct.h" #include "pci.h" #include "platform.h" #include "dram_controllers.h" -#ifndef DEBUG_DRAM - #define DEBUG_DRAM 0 -#endif - #if DEBUG_DRAM #define DBG(x...) printf(x) #else Index: trunk/i386/libsaio/nvidia.c =================================================================== --- trunk/i386/libsaio/nvidia.c (revision 2857) +++ trunk/i386/libsaio/nvidia.c (revision 2858) @@ -47,6 +47,7 @@ * SOFTWARE. */ +#include "config.h" #include "boot.h" #include "bootstruct.h" #include "pci.h" @@ -56,10 +57,6 @@ #include "nvidia.h" #include "nvidia_helper.h" -#ifndef DEBUG_NVIDIA - #define DEBUG_NVIDIA 0 -#endif - #if DEBUG_NVIDIA #define DBG(x...) printf(x) #else @@ -172,7 +169,7 @@ }; static nvidia_pci_info_t nvidia_card_generic[] = { - // 0000 - 0040 + // 0000 - 0040 { 0x10DE0000, "Unknown" }, // 0040 - 004F /* Index: trunk/i386/libsaio/ati.c =================================================================== --- trunk/i386/libsaio/ati.c (revision 2857) +++ trunk/i386/libsaio/ati.c (revision 2858) @@ -5,10 +5,8 @@ * */ +#include "config.h" #include "ati.h" -#ifndef DEBUG_ATI - #define DEBUG_ATI 0 -#endif #if DEBUG_ATI #define DBG(x...) printf(x) Index: trunk/i386/libsaio/load.c =================================================================== --- trunk/i386/libsaio/load.c (revision 2857) +++ trunk/i386/libsaio/load.c (revision 2858) @@ -37,6 +37,7 @@ #define DBG(x...) msglog(x) #endif +// Private functions. static long DecodeSegment(long cmdBase, unsigned int*load_addr, unsigned int *load_size); static long DecodeUnixThread(long cmdBase, unsigned int *entry); static long DecodeSymbolTable(long cmdBase); Index: trunk/i386/libsaio/cpu.c =================================================================== --- trunk/i386/libsaio/cpu.c (revision 2857) +++ trunk/i386/libsaio/cpu.c (revision 2858) @@ -4,16 +4,13 @@ * Bronya: 2015 Improve AMD support, cleanup and bugfix */ +#include "config.h" #include "libsaio.h" #include "platform.h" #include "cpu.h" #include "bootstruct.h" #include "boot.h" -#ifndef DEBUG_CPU - #define DEBUG_CPU 0 -#endif - #if DEBUG_CPU #define DBG(x...) printf(x) #else @@ -284,7 +281,7 @@ * * -- zenith432, May 22nd, 2016 */ -void* memcpy_interruptible(void* dst, const void* src, size_t len) +void *memcpy_interruptible(void *dst, const void *src, size_t len) { uint64_t tscFreq, lastTsc; uint32_t eflags, threshold; @@ -408,11 +405,13 @@ * The BrandString 48 bytes (max), guaranteed to * be NULL terminated. */ - do_cpuid(0x80000002, reg); + do_cpuid(0x80000002, reg); // Processor Brand String memcpy(&str[0], (char *)reg, 16); - do_cpuid(0x80000003, reg); + + + do_cpuid(0x80000003, reg); // Processor Brand String memcpy(&str[16], (char *)reg, 16); - do_cpuid(0x80000004, reg); + do_cpuid(0x80000004, reg); // Processor Brand String memcpy(&str[32], (char *)reg, 16); for (s = str; *s != '\0'; s++) { @@ -469,6 +468,7 @@ break; } } + void scan_cpu(PlatformInfo_t *p) { verbose("[ CPU INFO ]\n"); Index: trunk/i386/libsaio/pci_setup.c =================================================================== --- trunk/i386/libsaio/pci_setup.c (revision 2857) +++ trunk/i386/libsaio/pci_setup.c (revision 2858) @@ -1,3 +1,4 @@ +#include "config.h" #include "libsaio.h" #include "boot.h" #include "bootstruct.h" @@ -4,10 +5,6 @@ #include "pci.h" #include "modules.h" -#ifndef DEBUG_PCI_SETUP - #define DEBUG_PCI_SETUP 0 -#endif - #if DEBUG_PCI_SETUP #define DBG(x...) printf(x) #else Index: trunk/i386/libsaio/smbios.c =================================================================== --- trunk/i386/libsaio/smbios.c (revision 2857) +++ trunk/i386/libsaio/smbios.c (revision 2858) @@ -5,21 +5,17 @@ * */ - +#include "config.h" #include "boot.h" #include "bootstruct.h" #include "smbios_getters.h" // Bungo #include "convert.h" -#ifndef DEBUG_SMBIOS -#define DEBUG_SMBIOS 0 -#endif - #if DEBUG_SMBIOS -#define DBG(x...) printf(x) + #define DBG(x...) printf(x) #else -#define DBG(x...) msglog(x) + #define DBG(x...) msglog(x) #endif #define SMBPlist &bootInfo->smbiosConfig Index: trunk/i386/libsaio/smbios_decode.c =================================================================== --- trunk/i386/libsaio/smbios_decode.c (revision 2857) +++ trunk/i386/libsaio/smbios_decode.c (revision 2858) @@ -5,20 +5,17 @@ * */ +#include "config.h" #include "libsaio.h" #include "smbios.h" // Bungo: #include "boot.h" #include "bootstruct.h" -#ifndef DEBUG_SMBIOS -#define DEBUG_SMBIOS 0 -#endif - #if DEBUG_SMBIOS -#define DBG(x...) printf(x) + #define DBG(x...) printf(x) #else -#define DBG(x...) msglog(x) + #define DBG(x...) msglog(x) #endif extern char *getSMBStringForField(SMBStructHeader *structHeader, uint8_t field); Index: trunk/i386/libsaio/hpet.c =================================================================== --- trunk/i386/libsaio/hpet.c (revision 2857) +++ trunk/i386/libsaio/hpet.c (revision 2858) @@ -6,14 +6,11 @@ * High Precision Event Timer (HPET) */ +#include "config.h" #include "libsaio.h" #include "pci.h" #include "hpet.h" -#ifndef DEBUG_HPET - #define DEBUG_HPET 0 -#endif - #if DEBUG_HPET #define DBG(x...) printf(x) #else Index: trunk/i386/libsaio/biosfn.c =================================================================== --- trunk/i386/libsaio/biosfn.c (revision 2857) +++ trunk/i386/libsaio/biosfn.c (revision 2858) @@ -40,14 +40,11 @@ - Added ebiosEjectMedia */ +#include "config.h" #include "bootstruct.h" #include "libsaio.h" -#ifndef MEMRANGE - #define MEMRANGE 0 -#endif - #if MEMRANGE #define DBG(x...) printf(x) #else Index: trunk/i386/libsaio/saio_types.h =================================================================== --- trunk/i386/libsaio/saio_types.h (revision 2857) +++ trunk/i386/libsaio/saio_types.h (revision 2858) @@ -60,7 +60,7 @@ typedef struct Tag { long type; - char *string; + char *string; long offset; struct Tag *tag; struct Tag *tagNext; Index: trunk/i386/libsaio/state_generator.c =================================================================== --- trunk/i386/libsaio/state_generator.c (revision 2857) +++ trunk/i386/libsaio/state_generator.c (revision 2858) @@ -9,6 +9,7 @@ * */ +#include "config.h" #include "libsaio.h" #include "boot.h" #include "bootstruct.h" @@ -21,16 +22,12 @@ #include "aml_generator.h" #include "state_generator.h" -#ifndef DEBUG_STATE -#define DEBUG_STATE 0 -#endif - #if DEBUG_STATE==2 #define DBG(x...) {printf(x); sleep(1);} #elif DEBUG_STATE==1 -#define DBG(x...) printf(x) + #define DBG(x...) printf(x) #else -#define DBG(x...) msglog(x) + #define DBG(x...) msglog(x) #endif uint8_t acpi_cpu_count = 0; Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 2857) +++ trunk/i386/libsaio/fake_efi.c (revision 2858) @@ -2,6 +2,8 @@ /* * Copyright 2007 David F. Elliott. All rights reserved. */ + +#include "config.h" #include "saio_types.h" #include "libsaio.h" #include "boot.h" @@ -19,14 +21,6 @@ #include "sl.h" #include "vers.h" -#ifndef DEBUG_EFI - #define DEBUG_EFI 0 -#endif - -#ifndef RANDOMSEED - #define RANDOMSEED 0 -#endif - #if DEBUG_EFI #define DBG(x...) printf(x) #else Index: trunk/i386/libsaio/smbios_getters.c =================================================================== --- trunk/i386/libsaio/smbios_getters.c (revision 2857) +++ trunk/i386/libsaio/smbios_getters.c (revision 2858) @@ -5,13 +5,10 @@ * */ +#include "config.h" #include "smbios_getters.h" #include "bootstruct.h" -#ifndef DEBUG_SMBIOS - #define DEBUG_SMBIOS 0 -#endif - #if DEBUG_SMBIOS #define DBG(x...) printf(x) #else Index: trunk/i386/boot2/config.h =================================================================== --- trunk/i386/boot2/config.h (revision 2857) +++ trunk/i386/boot2/config.h (revision 2858) @@ -9,4 +9,80 @@ #ifndef config_h #define config_h +////////////////////////////////// boot.c +#define DEBUG_BOOT2 0 +#define DEBUG_INTERRUPTS 0 + +////////////////////////////////// hpet.c +#define DEBUG_HPET 0 + +////////////////////////////////// modules.c +#define CONFIG_MODULE_DEBUG 0 + +////////////////////////////////// acpi_patcher.c 0 - 1 - 2 +#define DEBUG_ACPI 0 + +////////////////////////////////// ati.c +#define DEBUG_ATI 0 + +////////////////////////////////// nvidia.c +#define DEBUG_NVIDIA 0 + +////////////////////////////////// gma.c +#define DEBUG_GMA 0 +#define REPLACE_DEVICE_ID 0 + +////////////////////////////////// usb.c +#define DEBUG_USB 0 + +////////////////////////////////// gui.c +#define DEBUG_GUI 0 + +////////////////////////////////// pci_root.c +#define DEBUG_PCIROOT 1 + +////////////////////////////////// pci_setup.c +#define DEBUG_PCI_SETUP 0 + +////////////////////////////////// smbios.c +////////////////////////////////// smbios_decode.c +////////////////////////////////// smbios_getters.c +#define DEBUG_SMBIOS 0 + +////////////////////////////////// spd.c +#define DEBUG_SPD 0 + +////////////////////////////////// state_generator.c +#define DEBUG_STATE 0 + +////////////////////////////////// biosfn.c +#define MEMRANGE 1 + +////////////////////////////////// bootstruct.c +#define DEBUG_BOOTSTRUCT 0 + +////////////////////////////////// cpu.c +#define DEBUG_CPU 0 + +////////////////////////////////// device_inject.c +#define DEBUG_INJECT 0 + +////////////////////////////////// dram_controllers.c +#define DEBUG_DRAM 0 + +////////////////////////////////// exfat.c +#define DEBUG_EXFAT 0 + +////////////////////////////////// fake_efi.c +#define DEBUG_EFI 0 +#define RANDOMSEED 0 + +////////////////////////////////// hda.c +#define DEBUG_HDA 0 +#define DEBUG_CODEC 0 + +////////////////////////////////// xml.c +#define DEBUG_XML 0 + + #endif /* config_h */ Index: trunk/i386/boot2/drivers.c =================================================================== --- trunk/i386/boot2/drivers.c (revision 2857) +++ trunk/i386/boot2/drivers.c (revision 2858) @@ -46,8 +46,6 @@ #define DBG(x...) msglog(x) #endif -// extern char gMacOSVersion[8]; - struct Module { struct Module *nextModule; long willLoad; @@ -226,6 +224,7 @@ } } } + if(!gHaveKernelCache) { // Don't load main driver (from /System/Library/Extentions) if gHaveKernelCache is set. @@ -259,7 +258,7 @@ } else { - verbose("Attempting to loading drivers from standard repositories:\n"); + verbose("Attempting to load drivers from standard repositories:\n"); if ( (gMacOSVersion[3] == '9') || ((gMacOSVersion[3] == '1') && ((gMacOSVersion[4] == '0') || (gMacOSVersion[4] == '1') || (gMacOSVersion[4] == '2') ) )) // issue 352 { @@ -496,13 +495,13 @@ // LoadDriverPList long LoadDriverPList( char *dirSpec, char *name, long bundleType ) { - long length, executablePathLength, bundlePathLength; - ModulePtr module; - TagPtr personalities; - char * buffer = 0; - char * tmpExecutablePath = 0; - char * tmpBundlePath = 0; - long ret = -1; + long length, executablePathLength, bundlePathLength; + ModulePtr module; + TagPtr personalities; + char *buffer = 0; + char *tmpExecutablePath = 0; + char *tmpBundlePath = 0; + long ret = -1; do{ // Save the driver path. @@ -686,12 +685,6 @@ if ((length != -1) && executableAddr) { -// driverModuleAddr = (void *)kLoadAddr; -// if (length != 0) -// { -// ThinFatFile(&driverModuleAddr, &length); -// } - // Make make in the image area. execute_hook("LoadMatchedModules", module, &length, executableAddr, NULL); @@ -1138,7 +1131,7 @@ default:kernelOSVer = 0xA0A0500; break; //Last known kernel } break; - case 15: + case 15: /* El Capitan */ switch (gDarwinMinor) { case 0: kernelOSVer = 0xA0B0000; break; @@ -1151,7 +1144,7 @@ default:kernelOSVer = 0xA0B0600; break; //Last known kernel (add here updates) } break; - case 16: + case 16: /* Sierra */ switch (gDarwinMinor) { case 0: kernelOSVer = 0xA0C0000; break; @@ -1165,7 +1158,7 @@ break; default: kernelOSVer = 0xA0C0400; - break; + break; //Last known kernel is Sierra 10.12.4 } } else Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 2857) +++ trunk/i386/boot2/boot.c (revision 2858) @@ -45,6 +45,7 @@ * Reworked again by Curtis Galloway (galloway@NeXT.com) */ +#include "config.h" #include "boot.h" #include "bootstruct.h" #include "fake_efi.h" @@ -56,14 +57,7 @@ #include "modules.h" #include "device_tree.h" -#ifndef DEBUG_BOOT2 - #define DEBUG_BOOT2 0 -#endif -#ifndef DEBUG_INTERRUPTS - #define DEBUG_INTERRUPTS 0 -#endif - #if DEBUG_BOOT2 #define DBG(x...) printf(x) #else @@ -770,7 +764,9 @@ freeFilteredBVChain(bvChain); if (gEnableCDROMRescan) + { rescanBIOSDevice(gBIOSDev); + } bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount); setBootGlobals(bvChain); Index: trunk/i386/boot2/modules.c =================================================================== --- trunk/i386/boot2/modules.c (revision 2857) +++ trunk/i386/boot2/modules.c (revision 2858) @@ -2,6 +2,8 @@ * Copyright 2010-2015 Evan Lojewski. All rights reserved. * */ + +#include "config.h" #include "boot.h" #include "bootstruct.h" #include "modules.h" @@ -12,17 +14,13 @@ #include #ifdef CONFIG_MODULES -#ifndef CONFIG_MODULE_DEBUG -#define CONFIG_MODULE_DEBUG 0 -#endif - #if CONFIG_MODULE_DEBUG -#define DBG(x...) printf(x) -#define DBGPAUSE() getchar() + #define DBG(x...) printf(x) + #define DBGPAUSE() getchar() #else -#define DBG(x...) -#define DBGPAUSE() + #define DBG(x...) + #define DBGPAUSE() #endif static inline void rebase_location(UInt32 *location, char *base, int type); Index: trunk/i386/boot2/gui.c =================================================================== --- trunk/i386/boot2/gui.c (revision 2857) +++ trunk/i386/boot2/gui.c (revision 2858) @@ -8,15 +8,12 @@ * */ +#include "config.h" #include "gui.h" #include "term.h" #include "appleboot.h" #include "vers.h" -#ifndef DEBUG_GUI - #define DEBUG_GUI 0 -#endif - #if DEBUG_GUI #define DBG(x...) printf(x) #else Index: trunk/i386/boot2/appleboot.h =================================================================== --- trunk/i386/boot2/appleboot.h (revision 2857) +++ trunk/i386/boot2/appleboot.h (revision 2858) @@ -2,7 +2,7 @@ * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ - * + * * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights * Reserved. This file contains Original Code and/or Modifications of * Original Code as defined in and that are subject to the Apple Public @@ -10,7 +10,7 @@ * except in compliance with the License. Please obtain a copy of the * License at http://www.apple.com/publicsource and read it before using * this file. - * + * * The Original Code and all software distributed under the License are * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -18,7 +18,7 @@ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the * License for the specific language governing rights and limitations * under the License. - * + * * @APPLE_LICENSE_HEADER_END@ */ /* Index: trunk/i386/boot2/options.c =================================================================== --- trunk/i386/boot2/options.c (revision 2857) +++ trunk/i386/boot2/options.c (revision 2858) @@ -33,9 +33,9 @@ #include "modules.h" #if DEBUG -#define DBG(x...) printf(x) + #define DBG(x...) printf(x) #else -#define DBG(x...) msglog(x) + #define DBG(x...) msglog(x) #endif char gMacOSVersion[OSVERSTRLEN]; Index: trunk/i386/config/lxdialog/dialog.h =================================================================== --- trunk/i386/config/lxdialog/dialog.h (revision 2857) +++ trunk/i386/config/lxdialog/dialog.h (revision 2858) @@ -163,7 +163,7 @@ /* item list manipulation for lxdialog use */ #define MAXITEMSTR 200 struct dialog_item { - char str[MAXITEMSTR]; /* promtp displayed */ + char str[MAXITEMSTR]; /* prompt displayed */ char tag; void *data; /* pointer to menu item - used by menubox+checklist */ int selected; /* Set to 1 by dialog_*() function if selected. */ Index: trunk/i386/config/lxdialog/check-lxdialog.sh =================================================================== --- trunk/i386/config/lxdialog/check-lxdialog.sh (revision 2857) +++ trunk/i386/config/lxdialog/check-lxdialog.sh (revision 2858) @@ -38,7 +38,7 @@ # Check if we can link to ncurses check() { - $cc -xc - -o $tmp 2>/dev/null <<'EOF' + $cc -x c - -o $tmp 2>/dev/null <<'EOF' #include CURSES_LOC main() {} EOF Index: branches/ErmaC/Enoch/i386/libsaio/smbios_getters.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/smbios_getters.c (revision 2857) +++ branches/ErmaC/Enoch/i386/libsaio/smbios_getters.c (revision 2858) @@ -5,13 +5,10 @@ * */ +#include "config.h" #include "smbios_getters.h" #include "bootstruct.h" -#ifndef DEBUG_SMBIOS - #define DEBUG_SMBIOS 0 -#endif - #if DEBUG_SMBIOS #define DBG(x...) printf(x) #else Index: branches/ErmaC/Enoch/i386/boot2/config.h =================================================================== --- branches/ErmaC/Enoch/i386/boot2/config.h (revision 2857) +++ branches/ErmaC/Enoch/i386/boot2/config.h (revision 2858) @@ -46,6 +46,7 @@ ////////////////////////////////// smbios.c ////////////////////////////////// smbios_decode.c +////////////////////////////////// smbios_getters.c #define DEBUG_SMBIOS 0 ////////////////////////////////// spd.c