Index: trunk/i386/libsaio/console.c =================================================================== --- trunk/i386/libsaio/console.c (revision 2489) +++ trunk/i386/libsaio/console.c (revision 2490) @@ -175,9 +175,12 @@ { va_list ap; va_start(ap, fmt); - if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + { prf(fmt, ap, putchar, 0); - } else { + } + else + { vprf(fmt, ap); } @@ -207,10 +210,14 @@ va_list ap; va_start(ap, fmt); - if (gVerboseMode) { - if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + if (gVerboseMode) + { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + { prf(fmt, ap, putchar, 0); - } else { + } + else + { vprf(fmt, ap); } } @@ -241,9 +248,12 @@ va_list ap; gErrors = true; va_start(ap, fmt); - if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + { prf(fmt, ap, putchar, 0); - } else { + } + else + { vprf(fmt, ap); } @@ -275,9 +285,12 @@ printf("\n"); va_start(ap, fmt); - if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + { prf(fmt, ap, putchar, 0); - } else { + } + else + { vprf(fmt, ap); } va_end(ap); Index: trunk/i386/libsaio/nvidia.c =================================================================== --- trunk/i386/libsaio/nvidia.c (revision 2489) +++ trunk/i386/libsaio/nvidia.c (revision 2490) @@ -1760,10 +1760,14 @@ default_NVCAP[8] = channel2; // patching HEADS - for (i = 0; i < num_outputs; i++) { - if (channel1 & (1 << i)) { + for (i = 0; i < num_outputs; i++) + { + if (channel1 & (1 << i)) + { *entries[i].heads = 1; - } else if(channel2 & (1 << i)) { + } + else if(channel2 & (1 << i)) + { *entries[i].heads = 2; } } @@ -1776,18 +1780,23 @@ // First check in the plist, (for e.g this can override any hardcoded devices) cardList_t * nvcard = FindCardWithIds(device_id, subsys_id); - if (nvcard) { - if (nvcard->model) { + if (nvcard) + { + if (nvcard->model) + { return nvcard->model; } } //ErmaC added selector for Chameleon "old" style in System Profiler - if (getBoolForKey(kNvidiaGeneric, &showGeneric, &bootInfo->chameleonConfig)) { + if (getBoolForKey(kNvidiaGeneric, &showGeneric, &bootInfo->chameleonConfig)) + { verbose("NvidiaGeneric = Yes\n"); - for (i = 1; i < (sizeof(nvidia_card_generic) / sizeof(nvidia_card_generic[0])); i++) { - if (nvidia_card_generic[i].device == device_id) { + for (i = 1; i < (sizeof(nvidia_card_generic) / sizeof(nvidia_card_generic[0])); i++) + { + if (nvidia_card_generic[i].device == device_id) + { return nvidia_card_generic[i].name; } } @@ -1795,20 +1804,28 @@ } // Then check the exceptions table - if (subsys_id) { - for (i = 0; i < (sizeof(nvidia_card_exceptions) / sizeof(nvidia_card_exceptions[0])); i++) { - if ((nvidia_card_exceptions[i].device == device_id) && (nvidia_card_exceptions[i].subdev == subsys_id)) { + if (subsys_id) + { + for (i = 0; i < (sizeof(nvidia_card_exceptions) / sizeof(nvidia_card_exceptions[0])); i++) + { + if ((nvidia_card_exceptions[i].device == device_id) && (nvidia_card_exceptions[i].subdev == subsys_id)) + { return nvidia_card_exceptions[i].name; } } } // At last try the generic names - for (i = 1; i < (sizeof(nvidia_card_generic) / sizeof(nvidia_card_generic[0])); i++) { - if (nvidia_card_generic[i].device == device_id) { - if (subsys_id) { - for (j = 0; j < (sizeof(nvidia_card_vendors) / sizeof(nvidia_card_vendors[0])); j++) { - if (nvidia_card_vendors[j].device == (subsys_id & 0xffff0000)) { + for (i = 1; i < (sizeof(nvidia_card_generic) / sizeof(nvidia_card_generic[0])); i++) + { + if (nvidia_card_generic[i].device == device_id) + { + if (subsys_id) + { + for (j = 0; j < (sizeof(nvidia_card_vendors) / sizeof(nvidia_card_vendors[0])); j++) + { + if (nvidia_card_vendors[j].device == (subsys_id & 0xffff0000)) + { snprintf(generic_name, 128, "%s %s", // sizeof(generic_name), "%s %s", nvidia_card_vendors[j].name, nvidia_card_generic[i].name); return &generic_name[0]; @@ -1826,13 +1843,15 @@ int fd; int size; - if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) { + if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) + { return 0; } size = file_size(fd); - if (size) { + if (size) + { *buf = malloc(size); size = read(fd, (char *)buf, size); } @@ -1849,23 +1868,48 @@ return 0; if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_0)) + { return 0; + } + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_0)) + { return 0; + } + if (!DP_ADD_TEMP_VAL(device, nvidia_name_0)) + { return 0; + } + if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_1)) + { return 0; + } + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_1)) + { return 0; + } + if (!DP_ADD_TEMP_VAL(device, nvidia_name_1)) + { return 0; - if (devices_number == 1) { + } + + if (devices_number == 1) + { if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_parent)) + { return 0; - } else { + } + } + else + { if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_child)) + { return 0; + } } // Rek : Dont use sprintf return, it does not WORK !! our custom sprintf() always return 0! @@ -1928,7 +1972,7 @@ // 10DE0F0014583544 2GB VRAM //if (((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) == 0x14583544 ) //{ - vram_size = -2147483648UL;//2147483648; + vram_size = -2147483648UL; // 2147483648; //} break; case 0x11C6: // GTX650TI 11C6 @@ -1945,15 +1989,21 @@ break; } - if (!vram_size) { // Finally, if vram_size still not set do the calculation with our own method - if (nvCardType < NV_ARCH_50) { + if (!vram_size) + { // Finally, if vram_size still not set do the calculation with our own method + if (nvCardType < NV_ARCH_50) + { vram_size = REG32(NV04_PFB_FIFO_DATA); vram_size &= NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK; - } else if (nvCardType < NV_ARCH_C0) { + } + else if (nvCardType < NV_ARCH_C0) + { vram_size = REG32(NV04_PFB_FIFO_DATA); vram_size |= (vram_size & 0xff) << 32; vram_size &= 0xffffffff00ll; - } else { // >= NV_ARCH_C0 + } + else + { // >= NV_ARCH_C0 vram_size = REG32(NVC0_MEM_CTRLR_RAM_AMOUNT) << 20; vram_size *= REG32(NVC0_MEM_CTRLR_COUNT); } @@ -2008,15 +2058,20 @@ verbose("Looking for nvidia video bios file %s\n", nvFilename); nvBiosOveride = load_nvidia_bios_file(nvFilename, &rom); - if (nvBiosOveride > 0) { + if (nvBiosOveride > 0) + { verbose("Using nVidia Video BIOS File %s (%d Bytes)\n", nvFilename, nvBiosOveride); DBG("%s Signature 0x%02x%02x %d bytes\n", nvFilename, rom[0], rom[1], nvBiosOveride); - } else { + } + else + { printf("ERROR: unable to open nVidia Video BIOS File %s\n", nvFilename); free(rom); return false; } - } else { + } + else + { uint8_t *nvRom; rom = malloc(NVIDIA_ROM_SIZE); // Otherwise read bios from card @@ -2029,10 +2084,13 @@ nvRom = (uint8_t*)®s[NV_PROM_OFFSET]; // Valid Signature ? - if (checkNvRomSig(nvRom)) { + if (checkNvRomSig(nvRom)) + { bcopy((uint8_t *)nvRom, rom, NVIDIA_ROM_SIZE); DBG("PROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); - } else { + } + else + { // disable PROM access (REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED; @@ -2040,25 +2098,32 @@ //PRAM next nvRom = (uint8_t*)®s[NV_PRAMIN_OFFSET]; - if(checkNvRomSig(nvRom)) { + if(checkNvRomSig(nvRom)) + { bcopy((uint32_t *)nvRom, rom, NVIDIA_ROM_SIZE); DBG("PRAM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); - } else { + } + else + { // 0xC0000 last bcopy((char *)0xc0000, rom, NVIDIA_ROM_SIZE); // Valid Signature ? - if (!checkNvRomSig(rom)) { + if (!checkNvRomSig(rom)) + { printf("ERROR: Unable to locate nVidia Video BIOS\n"); return false; - } else { + } + else + { DBG("ROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); } }//end PRAM check }//end PROM check }//end load rom from bios - if ((nvPatch = patch_nvidia_rom(rom)) == PATCH_ROM_FAILED) { + if ((nvPatch = patch_nvidia_rom(rom)) == PATCH_ROM_FAILED) + { printf("ERROR: nVidia ROM Patching Failed!\n"); free(rom); return false; @@ -2067,15 +2132,19 @@ rom_pci_header = (option_rom_pci_header_t*)(rom + *(uint16_t *)&rom[24]); // check for 'PCIR' sig - if (rom_pci_header->signature == 0x50434952) { - if (rom_pci_header->device_id != nvda_dev->device_id) { + if (rom_pci_header->signature == 0x50434952) + { + if (rom_pci_header->device_id != nvda_dev->device_id) + { // Get Model from the OpROM model = get_nvidia_model(((rom_pci_header->vendor_id << 16) | rom_pci_header->device_id), 0); // Get VRAM again videoRam = mem_detect(regs, nvCardType, nvda_dev, ((rom_pci_header->vendor_id << 16) | rom_pci_header->device_id), 0); - } else { + } + else + { printf("nVidia incorrect PCI ROM signature: 0x%x\n", rom_pci_header->signature); } } @@ -2086,18 +2155,21 @@ nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id, devicepath, devices_number); - if (!string) { + if (!string) + { string = devprop_create_string(); } device = devprop_add_device(string, devicepath); /* FIXME: for primary graphics card only */ boot_display = 1; - if (devices_number == 1) { - devprop_add_value(device, "@0,AAPL,boot-display", (uint8_t*)&boot_display, 4); + if (devices_number == 1) + { + devprop_add_value(device, "@0,AAPL,boot-display", (uint8_t *)&boot_display, 4); } - if (nvPatch == PATCH_ROM_SUCCESS_HAS_LVDS) { + if (nvPatch == PATCH_ROM_SUCCESS_HAS_LVDS) + { uint8_t built_in = 0x01; devprop_add_value(device, "@0,built-in", &built_in, 1); } @@ -2112,20 +2184,26 @@ int crlf_count = 0; // only search the first 384 bytes - for (i = 0; i < 0x180; i++) { - if (rom[i] == 0x0D && rom[i+1] == 0x0A) { + for (i = 0; i < 0x180; i++) + { + if (rom[i] == 0x0D && rom[i+1] == 0x0A) + { crlf_count++; // second 0x0D0A was found, extract bios version - if (crlf_count == 2) { + if (crlf_count == 2) + { if (rom[i-1] == 0x20) i--; // strip last " " - for (version_start = i; version_start > (i-MAX_BIOS_VERSION_LENGTH); version_start--) { + for (version_start = i; version_start > (i-MAX_BIOS_VERSION_LENGTH); version_start--) + { // find start - if (rom[version_start] == 0x00) { + if (rom[version_start] == 0x00) + { version_start++; // strip "Version " - if (strncmp((const char*)rom+version_start, "Version ", 8) == 0) { + if (strncmp((const char*)rom+version_start, "Version ", 8) == 0) + { version_start += 8; } @@ -2141,19 +2219,23 @@ snprintf(biosVersion, sizeof(biosVersion), "%s", (nvBiosOveride > 0) ? nvFilename : version_str); snprintf(kNVCAP, sizeof(kNVCAP), "NVCAP_%04x", nvda_dev->device_id); - if (getValueForKey(kNVCAP, &value, &len, &bootInfo->chameleonConfig) && len == NVCAP_LEN * 2) { + if (getValueForKey(kNVCAP, &value, &len, &bootInfo->chameleonConfig) && len == NVCAP_LEN * 2) + { uint8_t new_NVCAP[NVCAP_LEN]; - if (hex2bin(value, new_NVCAP, NVCAP_LEN) == 0) { + if (hex2bin(value, new_NVCAP, NVCAP_LEN) == 0) + { verbose("Using user supplied NVCAP for %s :: %s\n", model, devicepath); memcpy(default_NVCAP, new_NVCAP, NVCAP_LEN); } } - if (getValueForKey(kDcfg0, &value, &len, &bootInfo->chameleonConfig) && len == DCFG0_LEN * 2) { + if (getValueForKey(kDcfg0, &value, &len, &bootInfo->chameleonConfig) && len == DCFG0_LEN * 2) + { uint8_t new_dcfg0[DCFG0_LEN]; - if (hex2bin(value, new_dcfg0, DCFG0_LEN) == 0) { + if (hex2bin(value, new_dcfg0, DCFG0_LEN) == 0) + { memcpy(default_dcfg_0, new_dcfg0, DCFG0_LEN); verbose("Using user supplied @0,display-cfg\n"); @@ -2162,10 +2244,12 @@ } } - if (getValueForKey(kDcfg1, &value, &len, &bootInfo->chameleonConfig) && len == DCFG1_LEN * 2) { + if (getValueForKey(kDcfg1, &value, &len, &bootInfo->chameleonConfig) && len == DCFG1_LEN * 2) + { uint8_t new_dcfg1[DCFG1_LEN]; - if (hex2bin(value, new_dcfg1, DCFG1_LEN) == 0) { + if (hex2bin(value, new_dcfg1, DCFG1_LEN) == 0) + { memcpy(default_dcfg_1, new_dcfg1, DCFG1_LEN); verbose("Using user supplied @1,display-cfg\n"); @@ -2195,7 +2279,8 @@ /******************** Added Marchrius.**********************/ // For the AppleBacklightDisplay // /***********************************************************/ - if (getBoolForKey(kEnableBacklight, &doit, &bootInfo->chameleonConfig) && doit) { + if (getBoolForKey(kEnableBacklight, &doit, &bootInfo->chameleonConfig) && doit) + { uint8_t AAPL_value[] = {0x01, 0x00, 0x00, 0x00}; //Is the same for all devprop_add_value(device, "AAPL,HasPanel", AAPL_value, 4); devprop_add_value(device, "AAPL,Haslid", AAPL_value, 4); @@ -2207,7 +2292,8 @@ /***********************************************************/ // For the DualLink // /***********************************************************/ - if (getBoolForKey(kEnableDualLink, &doit, &bootInfo->chameleonConfig) && doit) { + if (getBoolForKey(kEnableDualLink, &doit, &bootInfo->chameleonConfig) && doit) + { uint8_t AAPL00_value[] = {0x01, 0x00, 0x00, 0x00}; devprop_add_value(device, "AAPL00,DualLink", AAPL00_value, 4); } @@ -2216,16 +2302,18 @@ /************************ HDMI Audio ***********************/ doit = false; //http://forge.voodooprojects.org/p/chameleon/issues/67/ - if(getBoolForKey(kEnableHDMIAudio, &doit, &bootInfo->chameleonConfig) && doit) { + if(getBoolForKey(kEnableHDMIAudio, &doit, &bootInfo->chameleonConfig) && doit) + { static uint8_t connector_type_1[]= {0x00, 0x08, 0x00, 0x00}; - devprop_add_value(device, "@0,connector-type",connector_type_1, 4); + //devprop_add_value(device, "@0,connector-type",connector_type_1, 4); devprop_add_value(device, "@1,connector-type",connector_type_1, 4); - devprop_add_value(device, "@2,connector-type",connector_type_1, 4); - devprop_add_value(device, "@3,connector-type",connector_type_1, 4); + //devprop_add_value(device, "@2,connector-type",connector_type_1, 4); + //devprop_add_value(device, "@3,connector-type",connector_type_1, 4); } /************************ End Audio *************************/ - if (getBoolForKey(kVBIOS, &doit, &bootInfo->chameleonConfig) && doit) { + if (getBoolForKey(kVBIOS, &doit, &bootInfo->chameleonConfig) && doit) + { devprop_add_value(device, "vbios", rom, (nvBiosOveride > 0) ? nvBiosOveride : (rom[2] * 512)); } Index: trunk/i386/libsaio/sys.c =================================================================== --- trunk/i386/libsaio/sys.c (revision 2489) +++ trunk/i386/libsaio/sys.c (revision 2490) @@ -961,7 +961,10 @@ { if (multiboot_skip_partition_set) { - if (bvr->part_no == multiboot_skip_partition) continue; + if (bvr->part_no == multiboot_skip_partition) + { + continue; + } } if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) { Index: trunk/i386/libsaio/msdos.c =================================================================== --- trunk/i386/libsaio/msdos.c (revision 2489) +++ trunk/i386/libsaio/msdos.c (revision 2490) @@ -666,9 +666,15 @@ struct direntry *dirp; uint16_t vfatname[WIN_MAXLEN+2*WIN_CHARS]; if (MSDOSInitPartition (ih)<0) + { return -1; + } + if (dirPath[0] == '/') + { dirPath++; + } + st = (struct msdosdirstate *)(long) *dirIndex; if (!st) { @@ -699,7 +705,10 @@ st->cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); st->vfatnumber = 0; if (msdosfatbits == 32) + { st->cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + } + } else initRoot (st); @@ -738,15 +747,20 @@ } for (i=7;i>=0;i--) if (dirp->deName[i]!=' ') + { break; + } + j=i+1; tmp[i+1]=0; for(;i>=0;i--) tmp[i]=(dirp->deName[i]>=128)?cp850[dirp->deName[i]-128][0]:tolower(dirp->deName[i]); for (i=2;i>=0;i--) if (dirp->deName[8+i]!=' ') + { break; - + } + if (i>=0) { tmp[j++]='.'; @@ -759,16 +773,23 @@ utf_encodestr(tmp, j, (uint8_t*)*name, 25, OSHostByteOrder() ); } + if (dirp->deAttributes & ATTR_DIRECTORY) + { *flags = kFileTypeDirectory; + } else + { *flags = kFileTypeFlat; - + } + // Calculate a fake timestamp using modification date and time values. *time = ((dirp->deMDate & 0x7FFF) << 16) + dirp->deMTime; if (infoValid) + { *infoValid = 1; + } return 0; } @@ -787,9 +808,14 @@ char devStr[12]; if (MSDOSInitPartition (ih)<0) + { return -1; + } + if (filePath[0] == '/') + { filePath++; + } buf = malloc(msdosclustersize); if (!buf) { @@ -804,7 +830,10 @@ } cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); if (msdosfatbits == 32) + { cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + } + size = (uint32_t)OSReadLittleInt32 ((dirp->deFileSize),0); if (size<=offset) { @@ -817,7 +846,10 @@ msdosreadcluster (ih, buf, msdosclustersize, &cluster); toread=length; if (length==0 || length>size-offset) + { toread=size-offset; + } + wastoread=toread; bcopy (buf+(offset%msdosclustersize),ptr,MIN((msdosclustersize-(offset%msdosclustersize)),(unsigned)toread)); ptr+=msdosclustersize-(offset%msdosclustersize); @@ -832,13 +864,16 @@ verbose("Read FAT%d file: [%s/%s] %d bytes.\n", msdosfatbits, devStr, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread); free (buf); if (toread<0) + { return wastoread; + } else + { return wastoread-toread; + } } -long -MSDOSGetFileBlock(CICell ih, char *filePath, unsigned long long *firstBlock) +long MSDOSGetFileBlock(CICell ih, char *filePath, unsigned long long *firstBlock) { uint8_t *buf; off_t cluster; @@ -898,8 +933,7 @@ } /* Fix up volume label. */ -static void -fixLabel(uint8_t *label, char *str, long strMaxLen) +static void fixLabel(uint8_t *label, char *str, long strMaxLen) { int i, len; uint16_t labelucs[13]; @@ -925,8 +959,7 @@ } -void -MSDOSGetDescription(CICell ih, char *str, long strMaxLen) +void MSDOSGetDescription(CICell ih, char *str, long strMaxLen) { struct direntry *dirp; uint8_t label[LABEL_LENGTH+1]; Index: trunk/i386/libsaio/smbios_getters.c =================================================================== --- trunk/i386/libsaio/smbios_getters.c (revision 2489) +++ trunk/i386/libsaio/smbios_getters.c (revision 2490) @@ -29,8 +29,8 @@ { switch (Platform.CPU.Model) { - // set external clock to 0 for SANDY - // removes FSB info from system profiler as on real mac's. + // set external clock to 0 for SANDY + // removes FSB info from system profiler as on real mac's. case CPUID_MODEL_SANDYBRIDGE: case CPUID_MODEL_JAKETOWN: case CPUID_MODEL_IVYBRIDGE_XEON: @@ -77,24 +77,24 @@ switch (Platform.CPU.Model) { case CPUID_MODEL_PENTIUM_M: - case CPUID_MODEL_DOTHAN: // Intel Pentium M - case CPUID_MODEL_YONAH: // Intel Mobile Core Solo, Duo - case CPUID_MODEL_MEROM: // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx - case CPUID_MODEL_PENRYN: // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx - case CPUID_MODEL_ATOM: // Intel Atom (45nm) + case CPUID_MODEL_DOTHAN: // Intel Pentium M + case CPUID_MODEL_YONAH: // Intel Mobile Core Solo, Duo + case CPUID_MODEL_MEROM: // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx + case CPUID_MODEL_PENRYN: // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx + case CPUID_MODEL_ATOM: // Intel Atom (45nm) return false; case 0x19: - case CPUID_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) - case CPUID_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPUID_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPUID_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) case CPUID_MODEL_DALES: - case CPUID_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) - case CPUID_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core - case CPUID_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x - case CPUID_MODEL_WESTMERE_EX: // Intel Xeon E7 - case CPUID_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) - case CPUID_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) - case CPUID_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPUID_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPUID_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPUID_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x + case CPUID_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPUID_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPUID_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + case CPUID_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) case CPUID_MODEL_IVYBRIDGE_XEON: case CPUID_MODEL_HASWELL: { @@ -180,7 +180,7 @@ switch (Platform.CPU.Model) { case CPUID_MODEL_PENTIUM_M: - case CPUID_MODEL_DOTHAN: // 0x0D - Intel Pentium M model D + case CPUID_MODEL_DOTHAN: // 0x0D - Intel Pentium M model D case CPUID_MODEL_PRESCOTT: case CPUID_MODEL_NOCONA: if (strstr(Platform.CPU.BrandString, "Xeon")) @@ -196,17 +196,19 @@ return true; case CPUID_MODEL_MEROM: // 0x0F - Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx - case CPUID_MODEL_XEON_MP: // 0x1D - Six-Core Xeon 7400, "Dunnington", 45nm - case CPUID_MODEL_PENRYN: // 0x17 - Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx + case CPUID_MODEL_XEON_MP: // 0x1D - Six-Core Xeon 7400, "Dunnington", 45nm + case CPUID_MODEL_PENRYN: // 0x17 - Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx if (strstr(Platform.CPU.BrandString, "Xeon")) { value->word = 0x402; // 1026 - Xeon - return true; + return true; } if (Platform.CPU.NoCores <= 2) { value->word = 0x301; // 769 - Core 2 Duo - } else { + } + else + { value->word = 0x402; // 1026 - Core 2 Quad as Xeon } return true; @@ -216,26 +218,31 @@ return true; case CPUID_MODEL_NEHALEM_EX: // 0x2E - Nehalem-ex, "Beckton", 45nm - case CPUID_MODEL_NEHALEM: // 0x1A - Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) - case CPUID_MODEL_FIELDS: // 0x1E - Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) - case CPUID_MODEL_DALES: // 0x1F - Intel Core i5, i7 LGA1156 (45nm) (Havendale, Auburndale) - if (strstr(Platform.CPU.BrandString, "Xeon")) { - value->word = 0x501; // 1281 - Lynnfiled Quad-Core Xeon + case CPUID_MODEL_NEHALEM: // 0x1A - Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPUID_MODEL_FIELDS: // 0x1E - Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPUID_MODEL_DALES: // 0x1F - Intel Core i5, i7 LGA1156 (45nm) (Havendale, Auburndale) + if (strstr(Platform.CPU.BrandString, "Xeon")) + { + value->word = 0x501; // 1281 - Lynnfiled Quad-Core Xeon return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) + { value->word = 0x901; // 2305 - Core i3 return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + { value->word = 0x601; // Core i5 return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) + { value->word = 0x701; // 1793 - Core i7 return true; } - if (Platform.CPU.NoCores <= 2) { + if (Platform.CPU.NoCores <= 2) + { value->word = 0x901; // - Core i3 } return true; @@ -243,68 +250,83 @@ case CPUID_MODEL_DALES_32NM: // 0x25 - Intel Core i3, i5 LGA1156 (32nm) (Clarkdale, Arrandale) case CPUID_MODEL_WESTMERE: // 0x2C - Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core case CPUID_MODEL_WESTMERE_EX: // 0x2F - Intel Xeon E7 - if (strstr(Platform.CPU.BrandString, "Xeon")) { + if (strstr(Platform.CPU.BrandString, "Xeon")) + { value->word = 0x501; // 1281 - Xeon return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) + { value->word = 0x901; // 2305 - Core i3 return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + { value->word = 0x602; // 1538 - Core i5 return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) + { value->word = 0x702; // 1794 -Core i7 return true; } - if (Platform.CPU.NoCores <= 2) { + if (Platform.CPU.NoCores <= 2) + { value->word = 0x901; // - Core i3 } return true; case CPUID_MODEL_JAKETOWN: // 0x2D - Intel Core i7, Xeon E5-xxxx LGA2011 (32nm) case CPUID_MODEL_SANDYBRIDGE: // 0x2A - Intel Core i3, i5, i7 LGA1155 (32nm) - if (strstr(Platform.CPU.BrandString, "Xeon")) { + if (strstr(Platform.CPU.BrandString, "Xeon")) + { value->word = 0x501; // 1281 - Xeon return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) + { value->word = 0x902; // 2306 -Core i3 return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + { value->word = 0x603; // 1539 - Core i5 return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) + { value->word = 0x703; // 1795 - Core i7 return true; } - if (Platform.CPU.NoCores <= 2) { + if (Platform.CPU.NoCores <= 2) + { value->word = 0x902; // - Core i5 } return true; case CPUID_MODEL_IVYBRIDGE: // 0x3A - Intel Core i3, i5, i7 LGA1155 (22nm) - if (strstr(Platform.CPU.BrandString, "Xeon")) { + if (strstr(Platform.CPU.BrandString, "Xeon")) + { value->word = 0xA01; // 2561 - Xeon return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) + { value->word = 0x903; // 2307 - Core i3 - Apple doesn't use it return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + { value->word = 0x604; // 1540 - Core i5 return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) + { value->word = 0x704; // 1796 - Core i7 return true; } - if (Platform.CPU.NoCores <= 2) { + if (Platform.CPU.NoCores <= 2) + { value->word = 0x903; // - Core i5 } return true; @@ -313,27 +335,32 @@ value->word = 0xA01; // 2561 - Xeon return true; - case CPUID_MODEL_HASWELL: // 0x3C - + case CPUID_MODEL_HASWELL: // 0x3C - case CPUID_MODEL_HASWELL_SVR: // 0x3F - case CPUID_MODEL_HASWELL_ULT: // 0x45 - case CPUID_MODEL_CRYSTALWELL: // 0x46 - if (strstr(Platform.CPU.BrandString, "Xeon")) { + if (strstr(Platform.CPU.BrandString, "Xeon")) + { value->word = 0xA01; // 2561 - Xeon return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) + { value->word = 0x904; // 2308 - Core i3 - Apple doesn't use it - but we yes:-) return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + { value->word = 0x605; // 1541 - Core i5 return true; } - if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) { + if (strstr(Platform.CPU.BrandString, "Core(TM) i7")) + { value->word = 0x705; // 1797 - Core i7 return true; } - if (Platform.CPU.NoCores <= 2) { + if (Platform.CPU.NoCores <= 2) + { value->word = 0x904; // - Core i3 } return true; @@ -347,7 +374,7 @@ value->word = 0x601; // 1537 - Core i5 return true; default: - break; //Unsupported CPU type + break; // Unsupported CPU type } } default: @@ -397,14 +424,17 @@ static int idx = -1; int map; - if (!bootInfo->memDetect) { + if (!bootInfo->memDetect) + { return false; } idx++; - if (idx < MAX_RAM_SLOTS) { + if (idx < MAX_RAM_SLOTS) + { map = Platform.DMI.DIMM[idx]; - if (Platform.RAM.DIMM[map].InUse && Platform.RAM.DIMM[map].Frequency != 0) { + if (Platform.RAM.DIMM[map].InUse && Platform.RAM.DIMM[map].Frequency != 0) + { DBG("RAM Detected Freq = %d Mhz\n", Platform.RAM.DIMM[map].Frequency); value->dword = Platform.RAM.DIMM[map].Frequency; return true; @@ -422,7 +452,8 @@ static int idx = -1; int map; - if (!bootInfo->memDetect) { + if (!bootInfo->memDetect) + { return false; } @@ -447,7 +478,8 @@ static int idx = -1; int map; - if (!bootInfo->memDetect) { + if (!bootInfo->memDetect) + { return false; } @@ -475,7 +507,8 @@ static int idx = -1; int map; - if (!bootInfo->memDetect) { + if (!bootInfo->memDetect) + { return false; } Index: trunk/i386/modules/AcpiCodec/acpi_codec.c =================================================================== --- trunk/i386/modules/AcpiCodec/acpi_codec.c (revision 2489) +++ trunk/i386/modules/AcpiCodec/acpi_codec.c (revision 2490) @@ -4757,7 +4757,7 @@ { sprintf(dirspec, "rd(0,0)/Extra/Acpi/"); acpidir_found = true; - + } else { @@ -4776,7 +4776,7 @@ { sprintf(dirspec, "bt(0,0)/Extra/Acpi/"); acpidir_found = true; - + } } } @@ -4784,17 +4784,18 @@ if (acpidir_found == true) { #if ACPISGN - if (checkOem == true) - { - MakeAcpiSgn(); - } + if (checkOem == true) + { + MakeAcpiSgn(); + } #endif - while (1) { - ret = GetDirEntry(dirspec, &index, &name, &flags, &time); - if (ret == -1) break; + while (1) + { + ret = GetDirEntry(dirspec, &index, &name, &flags, &time); + if (ret == -1) break; #if DEBUG_ACPI - printf("testing %s\n", name); + printf("testing %s\n", name); #endif // Make sure this is a directory. if ((flags & kFileTypeMask) == kFileTypeDirectory) continue; Index: trunk/CHANGES =================================================================== --- trunk/CHANGES (revision 2489) +++ trunk/CHANGES (revision 2490) @@ -24,7 +24,7 @@ Special thanks: Alex J, viv xix, zenith432 from http://forge.voodooprojects.org/p/chameleon/issues/375/ Testing and improvements: Pike R. Alpha, ErmaC, Bungo, blackosx, Micky1979, crazybirdy, oldnapalm, janek202, MinusZwei and Andy Vandijck. -- Pike R. Alpha : dinamic "random-seed" implementation ( http://www.insanelymac.com/forum/topic/301350-lets-make-random-seed-really-random/ ) +- Pike R. Alpha : dynamic "random-seed" implementation ( http://www.insanelymac.com/forum/topic/301350-lets-make-random-seed-really-random/ ) - ErmaC : getCPUTick() helper function ( http://www.insanelymac.com/forum/topic/301350-lets-make-random-seed-really-random/ ) - ErmaC : Add Yosemite Icons detection for chameleon UI - blackosx : Add chameleon UI Icons for Yosemite