Chameleon

Chameleon Commit Details

Date:2012-07-20 04:30:50 (11 years 9 months ago)
Author:ErmaC
Commit:2026
Parents: 2025
Message:Small DBG edits (better log for CPU in bdmesg???)
Changes:
M/branches/ErmaC/Trunk/i386/libsaio/spd.c
M/branches/ErmaC/Trunk/i386/libsaio/cpu.c
M/branches/ErmaC/Trunk/i386/libsaio/disk.c
M/branches/ErmaC/Trunk/i386/libsaio/acpi_patcher.c

File differences

branches/ErmaC/Trunk/i386/libsaio/acpi_patcher.c
2929
3030
3131
32
33
32
33
34
35
3436
3537
3638
......
174176
175177
176178
179
180
181
182
183
177184
178185
179186
......
189196
190197
191198
192
193
194
195
196
197
199
200
201
202
203
204
205
206
207
198208
199209
200210
201
211
212
202213
203214
204215
boolean_t tableSign(char *table, const char *sgn)
{
int i;
for (i=0; i<4; i++) {
if ((table[i] &~0x20) != (sgn[i] &~0x20)) {
for (i=0; i<4; i++)
{
if ((table[i] &~0x20) != (sgn[i] &~0x20))
{
return false;
}
}
for (j=0; j<4; j++)
{
char c = dsdt[offset+j];
if( c == '\\')
{
offset = i + 8 + (dsdt[i+7] >> 6);
c = dsdt[offset+j];
}
if (!aml_isvalidchar(c))
{
memcpy(acpi_cpu_name[acpi_cpu_count], dsdt+offset, 4);
i = offset + 5;
if (acpi_cpu_count == 0)
acpi_cpu_p_blk = dsdt[i] | (dsdt[i+1] << 8);
verbose("Found ACPI CPU: %c%c%c%c\n", acpi_cpu_name[acpi_cpu_count][0], acpi_cpu_name[acpi_cpu_count][1], acpi_cpu_name[acpi_cpu_count][2], acpi_cpu_name[acpi_cpu_count][3]);
if (++acpi_cpu_count == 32) return;
if (acpi_cpu_count == 0)
{
verbose("Found ACPI CPU: %c%c%c%c\n", acpi_cpu_name[acpi_cpu_count]);
} else {
verbose("And %c%c%c%c\n", acpi_cpu_name[acpi_cpu_count]);
}
if (++acpi_cpu_count == 32)
break;
}
}
}
// DBG("end finding cpu names: cpu names found: %d\n", acpi_cpu_count);
DBG("end finding cpu names: cpu names found: %d\n", acpi_cpu_count);
return;
}
struct acpi_2_ssdt *generate_cst_ssdt(struct acpi_2_fadt* fadt)
branches/ErmaC/Trunk/i386/libsaio/spd.c
278278
279279
280280
281
281
282282
283283
284284
for (i = 0; i < MAX_RAM_SLOTS; i++){
slot = &Platform.RAM.DIMM[i];
spd_size = smb_read_byte_intel(base, 0x50 + i, 0);
DBG("SPD[0] (size): %d @0x%x\n", spd_size, 0x50 + i);
DBG("SPD[0] (size): 0x%02x @0x%x\n", spd_size, 0x50 + i);
// Check spd is present
if (spd_size && (spd_size != 0xff))
{
branches/ErmaC/Trunk/i386/libsaio/cpu.c
464464
465465
466466
467
468
469
470
471
467
468
469
470
471
472
473
472474
473
474
475
476
475
476
477
478
479
477480
478481
479482
480483
481484
482485
483
486
487
484488
485489
486490
......
559563
560564
561565
562
566
567
563568
564569
565570
......
578583
579584
580585
581
582
583
584
585
586
587
588
589
590
586
587
588
589
590
591
592
593
594
595
596
597
598
591599
592600
593601
maxcoef = currcoef;
}
if (maxcoef) {
if (maxdiv) {
fsbFrequency = ((tscFrequency * 2) / ((maxcoef * 2) + 1));
} else {
fsbFrequency = (tscFrequency / maxcoef);
if (maxcoef)
{
if (maxdiv)
{
fsbFrequency = ((tscFrequency * 2) / ((maxcoef * 2) + 1));
} else {
fsbFrequency = (tscFrequency / maxcoef);
}
if (currdiv) {
cpuFrequency = (fsbFrequency * ((currcoef * 2) + 1) / 2);
} else {
cpuFrequency = (fsbFrequency * currcoef);
if (currdiv)
{
cpuFrequency = (fsbFrequency * ((currcoef * 2) + 1) / 2);
} else {
cpuFrequency = (fsbFrequency * currcoef);
}
DBG("max: %d%s current: %d%s\n", maxcoef, maxdiv ? ".5" : "",currcoef, currdiv ? ".5" : "");
}
}
}
/* Mobile CPU */
if (rdmsr64(MSR_IA32_PLATFORM_ID) & (1<<28)) {
if (rdmsr64(MSR_IA32_PLATFORM_ID) & (1<<28))
{
p->CPU.Features |= CPU_FEATURE_MOBILE;
}
}
}
#if 0
if (!fsbFrequency) {
if (!fsbFrequency)
{
fsbFrequency = (DEFAULT_FSB * 1000);
cpuFrequency = tscFrequency;
DBG("0 ! using the default value for FSB !\n");
p->CPU.CPUFrequency = cpuFrequency;
// keep formatted with spaces instead of tabs
DBG("CPU: Brand String: %s\n", p->CPU.BrandString);
DBG("CPU: Vendor/Family/ExtFamily: 0x%x/0x%x/0x%x\n", p->CPU.Vendor, p->CPU.Family, p->CPU.ExtFamily);
DBG("CPU: Model/ExtModel/Stepping: 0x%x/0x%x/0x%x\n", p->CPU.Model, p->CPU.ExtModel, p->CPU.Stepping);
DBG("CPU: MaxCoef/CurrCoef: 0x%x/0x%x\n", p->CPU.MaxCoef, p->CPU.CurrCoef);
DBG("CPU: MaxDiv/CurrDiv: 0x%x/0x%x\n", p->CPU.MaxDiv, p->CPU.CurrDiv);
DBG("CPU: TSCFreq: %dMHz\n", p->CPU.TSCFrequency / 1000000);
DBG("CPU: FSBFreq: %dMHz\n", (p->CPU.FSBFrequency + 500000) / 1000000);
DBG("CPU: CPUFreq: %dMHz\n", p->CPU.CPUFrequency / 1000000);
DBG("CPU: NoCores/NoThreads: %d/%d\n", p->CPU.NoCores, p->CPU.NoThreads);
DBG("CPU: Features: 0x%08x\n", p->CPU.Features);
DBG("\n---------------------------------------------\n");
DBG("CPU: Brand String:\t\t\t\t %s\n", p->CPU.BrandString);
DBG("CPU: Vendor/Family/ExtFamily:\t 0x%x/0x%x/0x%x\n", p->CPU.Vendor, p->CPU.Family, p->CPU.ExtFamily);
DBG("CPU: Model/ExtModel/Stepping:\t 0x%x/0x%x/0x%x\n", p->CPU.Model, p->CPU.ExtModel, p->CPU.Stepping);
DBG("CPU: MaxCoef/CurrCoef:\t\t\t 0x%x/0x%x\n", p->CPU.MaxCoef, p->CPU.CurrCoef);
DBG("CPU: MaxDiv/CurrDiv:\t\t\t 0x%x/0x%x\n", p->CPU.MaxDiv, p->CPU.CurrDiv);
DBG("CPU: TSCFreq:\t\t\t\t %dMHz\n", p->CPU.TSCFrequency / 1000000);
DBG("CPU: FSBFreq:\t\t\t\t\t %dMHz\n", (p->CPU.FSBFrequency + 500000) / 1000000);
DBG("CPU: CPUFreq:\t\t\t\t %dMHz\n", p->CPU.CPUFrequency / 1000000);
DBG("CPU: Number of CPU Cores:\t\t %d\n", p->CPU.NoCores);
DBG("CPU: Number of CPU Threads:\t %d\n", p->CPU.NoThreads);
DBG("CPU: Features:\t\t\t\t\t 0x%08x\n", p->CPU.Features);
DBG("---------------------------------------------\n");
#if DEBUG_CPU
pause();
#endif
branches/ErmaC/Trunk/i386/libsaio/disk.c
14901490
14911491
14921492
1493
1493
14941494
14951495
14961496
14971497
14981498
14991499
1500
1500
15011501
1502
15021503
1503
1504
15041505
15051506
15061507
bool valid = false;
config_file_t systemVersion;
char dirSpec[512];
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
valid = true;
}
else
else
{
/* Mac OS X Server */
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
bvr->OSisServer = true;

Archive Download the corresponding diff file

Revision: 2026