Chameleon

Chameleon Commit Details

Date:2015-03-10 16:58:48 (9 years 4 months ago)
Author:ErmaC
Commit:2607
Parents: 2606
Message:Indent
Changes:
M/trunk/i386/libsaio/cpu.c
M/trunk/i386/modules/AcpiCodec/acpi_codec.c

File differences

trunk/i386/libsaio/cpu.c
2828
2929
3030
31
31
3232
33
33
3434
3535
3636
......
5151
5252
5353
54
54
5555
5656
5757
5858
59
59
6060
6161
6262
6363
6464
65
65
6666
6767
6868
......
316316
317317
318318
319
319320
320321
321322
322323
323324
324325
326
325327
326328
327329
......
460462
461463
462464
463
464
465
466
465467
466468
467469
static uint64_t timeRDTSC(void)
{
intattempts = 0;
uint64_t latchTime;
uint64_t latchTime;
uint64_tsaveTime,intermediate;
unsigned int timerValue, lastValue;
unsigned inttimerValue, lastValue;
//boolean_tint_enabled;
/*
* Table of correction factors to account for
ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-5))
};
//int_enabled = ml_set_interrupts_enabled(FALSE);
//int_enabled = ml_set_interrupts_enabled(false);
restart:
if (attempts >= 9) // increase to up to 9 attempts.
{
// This will flash-reboot. TODO: Use tscPanic instead.
// This will flash-reboot. TODO: Use tscPanic instead.
printf("Timestamp counter calibation failed with %d attempts\n", attempts);
}
attempts++;
enable_PIT2();// turn on PIT2
set_PIT2(0);// reset timer 2 to be zero
latchTime = rdtsc64();// get the time stamp to time
latchTime = rdtsc64();// get the time stamp to time
latchTime = get_PIT2(&timerValue) - latchTime; // time how long this takes
set_PIT2(SAMPLE_CLKS_INT);// set up the timer for (almost) 1/20th a second
saveTime = rdtsc64();// now time how long a 20th a second is...
{
do_cpuid(5, p->CPU.CPUID[CPUID_5]);
}
if (p->CPU.CPUID[CPUID_0][0] >= 6)// Thermal/Power
{
do_cpuid(6, p->CPU.CPUID[CPUID_6]);
}
do_cpuid(0x80000000, p->CPU.CPUID[CPUID_80]);
if ((p->CPU.CPUID[CPUID_80][0] & 0x0000000f) >= 8)
{
do_cpuid(0x80000008, p->CPU.CPUID[CPUID_88]);
// MSR is *NOT* available on the Intel Atom CPU
if ((p->CPU.Model == CPUID_MODEL_ATOM) && (strstr(p->CPU.BrandString, "270")))
{
p->CPU.NoCores= 1;
p->CPU.NoThreads= 2;
p->CPU.NoCores= 1;
p->CPU.NoThreads= 2;
}
/* setup features */
trunk/i386/modules/AcpiCodec/acpi_codec.c
12261226
12271227
12281228
1229
1229
12301230
12311231
12321232
12331233
12341234
12351235
1236
12361237
1238
12371239
1240
12381241
1239
1242
12401243
12411244
1245
12421246
12431247
1248
12441249
12451250
12461251
U32 index;
for (index=0; index < cpu->pkg_pstates.num_pstates; index ++)
{
PSTATE * pstate = &cpu->pkg_pstates.pstate[index];
PSTATE *pstate = &cpu->pkg_pstates.pstate[index];
// Set ratio
pstate->ratio = computePstateRatio(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, cpu->pkg_pstates.num_pstates, index);
// Compute frequency based on ratio
if ((index != 0) || (cpu->turbo_available == 0))
{
pstate->frequency = pstate->ratio * get_bclk();
}
else
{
pstate->frequency = ((pstate->ratio - 1) * get_bclk()) + 1;
}
// Compute power based on ratio and other data
if (pstate->ratio >= cpu->max_ratio_as_mfg)
{
// Use max power in mW
pstate->power = TDP * 1000;
}
else
{
pstate->power = compute_pstate_power(cpu, pstate->ratio, TDP);

Archive Download the corresponding diff file

Revision: 2607