Chameleon

Chameleon Commit Details

Date:2014-11-19 20:25:40 (9 years 5 months ago)
Author:ErmaC
Commit:2488
Parents: 2487
Message:typo and sync with trunk
Changes:
M/branches/ErmaC/Enoch/i386/libsaio/stringTable.c
M/branches/ErmaC/Enoch/i386/boot2/drivers.c
M/branches/ErmaC/Enoch/i386/libsaio/msdos.c
M/branches/ErmaC/Enoch/i386/libsaio/cpu.c
M/branches/ErmaC/Enoch/i386/libsaio/disk.c
M/branches/ErmaC/Enoch/i386/boot2/boot.h

File differences

branches/ErmaC/Enoch/i386/libsaio/cpu.c
9797
9898
9999
100
100
101101
102102
103103
......
159159
160160
161161
162
162
163163
164164
165
165
166166
167167
168168
......
247247
248248
249249
250
250251
251252
252253
254
253255
254256
255257
......
257259
258260
259261
260
261262
262263
263264
......
327328
328329
329330
330
331
332
331333
332334
333335
......
363365
364366
365367
366
367
368
369
370
368
369
370
371
372
371373
372374
373375
374
376
377
378
375379
376380
377
381
382
383
378384
379385
380386
......
387393
388394
389395
390
396
391397
392398
393399
......
469475
470476
471477
472
478
479
480
473481
474482
475483
476484
477485
478486
479
487
488
480489
481
490
491
482492
483
493
494
484495
485496
486497
......
611622
612623
613624
625
626
627
628
629
614630
615631
616632
......
753769
754770
755771
756
772
757773
758774
759775
* It pauses until the value is latched in the counter
* and then reads the time stamp counter to return to the caller.
*/
uint64_t timeRDTSC(void)
static uint64_t timeRDTSC(void)
{
intattempts = 0;
uint64_t latchTime;
intermediate *= scale[timerValue];// rescale measured time spent
intermediate /= SAMPLE_NSECS;// so its exactly 1/20 a second
intermediate += latchTime;// add on our save fudge
set_PIT2(0);// reset timer 2 to be zero
disable_PIT2();// turn off PIT 2
//ml_set_interrupts_enabled(int_enabled);
return intermediate;
}
uint64_tcpuFrequency = 0;
uint64_tmsr = 0;
uint64_tflex_ratio = 0;
uint32_tmax_ratio = 0;
uint32_tmin_ratio = 0;
uint8_tbus_ratio_max = 0;
uint8_tbus_ratio_min = 0;
uint8_tcurrdiv = 0;
uint8_tcurrcoef = 0;
uint8_tmaxdiv = 0;
const char*newratio;
intlen = 0;
intmyfsb = 0;
uint8_tbus_ratio_min = 0;
/* get cpuid values */
do_cpuid(0x00000000, p->CPU.CPUID[CPUID_0]);
p->CPU.Family == 0x06 &&
p->CPU.Model >= CPUID_MODEL_NEHALEM &&
p->CPU.Model != CPUID_MODEL_ATOM// MSR is *NOT* available on the Intel Atom CPU
) {
)
{
/*
* Find the number of enabled cores and threads
* (which determines whether SMT/Hyperthreading is active).
p->CPU.NoCores = bitfield(p->CPU.CPUID[CPUID_1][1], 23, 16);
p->CPU.NoThreads = (uint8_t)(p->CPU.LogicalPerPackage & 0xff);
//workaround for N270. I don't know why it detected wrong
if ((p->CPU.Model == CPUID_MODEL_ATOM) &&
(p->CPU.Stepping == 2)) {
p->CPU.NoCores = 1;
}
break;
if ((p->CPU.Model == CPUID_MODEL_ATOM) && (p->CPU.Stepping == 2))
{
p->CPU.NoCores = 1;
}
break;
} // end switch
} else if (p->CPU.Vendor == CPUID_VENDOR_AMD) {
}
else if (p->CPU.Vendor == CPUID_VENDOR_AMD)
{
p->CPU.NoThreads= bitfield(p->CPU.CPUID[CPUID_1][1], 23, 16);
p->CPU.NoCores= bitfield(p->CPU.CPUID[CPUID_88][2], 7, 0) + 1;
} else {
}
else
{
// Use previous method for Cores and Threads
p->CPU.NoThreads= bitfield(p->CPU.CPUID[CPUID_1][1], 23, 16);
p->CPU.NoCores= bitfield(p->CPU.CPUID[CPUID_4][0], 31, 26) + 1;
uint32_treg[4];
charstr[128], *s;
/*
* The brand string 48 bytes (max), guaranteed to
* The BrandString 48 bytes (max), guaranteed to
* be NULL terminated.
*/
do_cpuid(0x80000002, reg);
{
tscFrequency = timeRDTSC() * 20;//measure_tsc_frequency();
// DBG("cpu freq timeRDTSC = 0x%016llx\n", tscFrequency);
} else {
}
else
{
// DBG("cpu freq timeRDTSC = 0x%016llxn", timeRDTSC() * 20);
}
fsbFrequency = 0;
cpuFrequency = 0;
if ((p->CPU.Vendor == CPUID_VENDOR_INTEL) && ((p->CPU.Family == 0x06) || (p->CPU.Family == 0x0f))) {
if ((p->CPU.Vendor == CPUID_VENDOR_INTEL) && ((p->CPU.Family == 0x06) || (p->CPU.Family == 0x0f)))
{
int intelCPU = p->CPU.Model;
if ((p->CPU.Family == 0x06 && p->CPU.Model >= 0x0c) || (p->CPU.Family == 0x0f && p->CPU.Model >= 0x03)){
if ((p->CPU.Family == 0x06 && p->CPU.Model >= 0x0c) || (p->CPU.Family == 0x0f && p->CPU.Model >= 0x03))
{
/* Nehalem CPU model */
switch (p->CPU.Model) {
switch (p->CPU.Model)
{
case CPUID_MODEL_NEHALEM:
case CPUID_MODEL_FIELDS:
case CPUID_MODEL_DALES:
maxcoef = currcoef;
}
if (!currcoef)
{
currcoef = maxcoef;
}
if (maxcoef)
{
if (maxdiv)
// keep formatted with spaces instead of tabs
DBG("\n---------------------------------------------\n");
DBG("--------------- CPU INFO ---------------\n");
DBG("------------------ CPU INFO -----------------\n");
DBG("---------------------------------------------\n");
DBG("Brand String: %s\n",p->CPU.BrandString); // Processor name (BIOS)
DBG("Vendor: 0x%x\n",p->CPU.Vendor); // Vendor ex: GenuineIntel
branches/ErmaC/Enoch/i386/libsaio/disk.c
15811581
15821582
15831583
1584
15841585
15851586
15861587
......
15911592
15921593
15931594
1595
15941596
15951597
15961598
......
16001602
16011603
16021604
1605
16031606
16041607
16051608
config_file_t systemVersion;
char dirSpec[512];
// OS X Recovery
sprintf(dirSpec, "hd(%d,%d)/com.apple.recovery.boot/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
if (!valid)
{
// OS X Standard
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
}
else
{
// OS X Server
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
branches/ErmaC/Enoch/i386/libsaio/stringTable.c
614614
615615
616616
617
618
619
620
621
617
618
619
620
621
622622
623623
624624
int loadSystemConfig(config_file_t *config)
{
char *dirspec[] = {
"/Mac OS X Install Data/com.apple.Boot.plist",
"/OS X Install Data/com.apple.Boot.plist",
"/.IABootFiles/com.apple.Boot.plist", // OS X Installer
"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
"/com.apple.recovery.boot/com.apple.Boot.plist" // OS X Recovery
"/Mac OS X Install Data/com.apple.Boot.plist",// OS X Installer (Lion 10.7)
"/OS X Install Data/com.apple.Boot.plist",// OS X Installer (10.8+)
"/.IABootFiles/com.apple.Boot.plist",// OS X Installer
"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",// com.boot.Apple.plist
"/com.apple.recovery.boot/com.apple.Boot.plist"// OS X Recovery
};
int i, fd, count, ret=-1;
branches/ErmaC/Enoch/i386/libsaio/msdos.c
830830
831831
832832
833
834
833
835834
836835
837836
getDeviceDescription(ih, devStr);
/*
verbose("Read FAT%d file: [%s/%s] %d bytes.\n",
msdosfatbits, devStr, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread);
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)
branches/ErmaC/Enoch/i386/boot2/drivers.c
907907
908908
909909
910
911
912
913
914
915
916
917
918
919
920
921
922
910923
911924
912925
error("ERROR: kernel compression is bad!\n");
return -1;
}
if (kernel_header->compress_type == OSSwapBigToHostConstInt32('lzss'))
{
verbose ("Decompressing Kernel Using lzss\n");
}
else
{
if (kernel_header->compress_type == OSSwapBigToHostConstInt32('lzvn'))
{
verbose ("Decompressing Kernel Using lzvn\n");
}
}
#if NOTDEF
if (kernel_header->platform_name[0] && strcmp(gPlatformName, kernel_header->platform_name))
{
branches/ErmaC/Enoch/i386/boot2/boot.h
161161
162162
163163
164
165
164166
165167
166168
#define kEnableC2State"EnableC2State"/* acpi_patcher.c */
#define kEnableC3State"EnableC3State"/* acpi_patcher.c */
#define kEnableC4State"EnableC4State"/* acpi_patcher.c */
#define kEnableC6State"EnableC6State"/* acpi_patcher.c */
#define kEnableC7State"EnableC7State"/* acpi_patcher.c */
/* valv: added these keys */
#define kbusratio"busratio"/* cpu.c */

Archive Download the corresponding diff file

Revision: 2488