/SPARTAN/trunk/arch/mips/src/exception.c |
---|
42,9 → 42,9 |
epc = cp0_epc_read(); |
cp0_status_write(cp0_status_read() & ~ cp0_status_exl_exception_bit); |
if (the->thread) { |
the->thread->saved_pri = pri; |
the->thread->saved_epc = epc; |
if (THREAD) { |
THREAD->saved_pri = pri; |
THREAD->saved_epc = epc; |
} |
/* decode exception number and process the exception */ |
switch(excno = (cp0_cause_read()>>2)&0x1f) { |
54,9 → 54,9 |
default: panic(PANIC "unhandled exception %d\n", excno); break; |
} |
if (the->thread) { |
pri = the->thread->saved_pri; |
epc = the->thread->saved_epc; |
if (THREAD) { |
pri = THREAD->saved_pri; |
epc = THREAD->saved_epc; |
} |
cp0_epc_write(epc); |
/SPARTAN/trunk/arch/mips/src/cpu/cpu.c |
---|
83,8 → 83,8 |
void cpu_identify(void) |
{ |
the->cpu->arch.rev_num = cp0_prid_read() & 0xff; |
the->cpu->arch.imp_num = (cp0_prid_read() >> 8) & 0xff; |
CPU->arch.rev_num = cp0_prid_read() & 0xff; |
CPU->arch.imp_num = (cp0_prid_read() >> 8) & 0xff; |
} |
void cpu_print_report(cpu_t *m) |
/SPARTAN/trunk/arch/mips/src/mm/tlb.c |
---|
46,7 → 46,7 |
void tlb_invalid(void) |
{ |
panic(PANIC "%X: TLB exception at %X", cp0_badvaddr_read(), the->thread ? the->thread->saved_epc : 0); |
panic(PANIC "%X: TLB exception at %X", cp0_badvaddr_read(), THREAD ? THREAD->saved_epc : 0); |
} |
void tlb_invalidate(int asid) |
/SPARTAN/trunk/arch/ia32/src/smp/apic.c |
---|
114,7 → 114,7 |
void apic_spurious(__u8 n, __u32 stack[]) |
{ |
printf("cpu%d: APIC spurious interrupt\n", the->cpu->id); |
printf("cpu%d: APIC spurious interrupt\n", CPU->id); |
} |
int apic_poll_errors(void) |
142,7 → 142,7 |
} |
/* |
* Send all CPUs excluding the->cpu IPI vector. |
* Send all CPUs excluding CPU IPI vector. |
*/ |
int l_apic_broadcast_custom_ipi(__u8 vector) |
{ |
232,7 → 232,7 |
l_apic[TPR] &= TPRClear; |
if (the->cpu->arch.family >= 6) |
if (CPU->arch.family >= 6) |
enable_l_apic_in_msr(); |
tmp = l_apic[ICRlo] & ICRloClear; |
270,7 → 270,7 |
#ifdef LAPIC_VERBOSE |
int i, lint; |
printf("LVT on cpu%d, LAPIC ID: %d\n", the->cpu->id, (l_apic[L_APIC_ID] >> 24)&0xf); |
printf("LVT on cpu%d, LAPIC ID: %d\n", CPU->id, (l_apic[L_APIC_ID] >> 24)&0xf); |
printf("LVT_Tm: "); |
if (l_apic[LVT_Tm] & (1<<17)) printf("periodic"); else printf("one-shot"); putchar(','); |
304,7 → 304,7 |
/* |
* This register is supported only on P6 and higher. |
*/ |
if (the->cpu->family > 5) { |
if (CPU->family > 5) { |
printf("LVT_PCINT: "); |
if (l_apic[LVT_PCINT] & (1<<16)) printf("masked"); else printf("not masked"); putchar(','); |
if (l_apic[LVT_PCINT] & (1<<12)) printf("send pending"); else printf("idle"); putchar(','); |
/SPARTAN/trunk/arch/ia32/src/cpu/cpu.c |
---|
61,7 → 61,7 |
void cpu_arch_init(void) |
{ |
the->cpu->arch.tss = tss_p; |
CPU->arch.tss = tss_p; |
} |
70,7 → 70,7 |
cpu_info_t info; |
int i; |
the->cpu->arch.vendor = VendorUnknown; |
CPU->arch.vendor = VendorUnknown; |
if (has_cpuid()) { |
cpuid(0, &info); |
81,7 → 81,7 |
info.cpuid_ecx==AMD_CPUID_ECX && |
info.cpuid_edx==AMD_CPUID_EDX) { |
the->cpu->arch.vendor = VendorAMD; |
CPU->arch.vendor = VendorAMD; |
} |
/* |
91,14 → 91,14 |
info.cpuid_ecx==INTEL_CPUID_ECX && |
info.cpuid_edx==INTEL_CPUID_EDX) { |
the->cpu->arch.vendor = VendorIntel; |
CPU->arch.vendor = VendorIntel; |
} |
cpuid(1, &info); |
the->cpu->arch.family = (info.cpuid_eax>>8)&0xf; |
the->cpu->arch.model = (info.cpuid_eax>>4)&0xf; |
the->cpu->arch.stepping = (info.cpuid_eax>>0)&0xf; |
CPU->arch.family = (info.cpuid_eax>>8)&0xf; |
CPU->arch.model = (info.cpuid_eax>>4)&0xf; |
CPU->arch.stepping = (info.cpuid_eax>>0)&0xf; |
} |
} |
/SPARTAN/trunk/arch/ia32/src/userspace.c |
---|
42,8 → 42,8 |
/* |
* Prepare TSS stack selector and pointers for next syscall. |
*/ |
the->cpu->arch.tss->esp0 = (__address) &the->thread->kstack[THREAD_STACK_SIZE-8]; |
the->cpu->arch.tss->ss0 = selector(KDATA_DES); |
CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-8]; |
CPU->arch.tss->ss0 = selector(KDATA_DES); |
__asm__ volatile ("" |
"pushl %0\n" |
/SPARTAN/trunk/arch/ia32/src/drivers/i8259.c |
---|
116,5 → 116,5 |
void pic_spurious(__u8 n, __u32 stack[]) |
{ |
printf("cpu%d: PIC spurious interrupt\n", the->cpu->id); |
printf("cpu%d: PIC spurious interrupt\n", CPU->id); |
} |
/SPARTAN/trunk/arch/ia32/src/drivers/i8042.c |
---|
54,5 → 54,5 |
trap_virtual_eoi(); |
x = inb(0x60); |
printf("%d", the->cpu->id);; |
printf("%d", CPU->id);; |
} |
/SPARTAN/trunk/arch/ia32/src/drivers/i8254.c |
---|
110,7 → 110,7 |
o2 |= inb(CLK_PORT1) << 8; |
the->cpu->delay_loop_const = ((MAGIC_NUMBER*LOOPS)/1000) / ((t1-t2)-(o1-o2)) + |
CPU->delay_loop_const = ((MAGIC_NUMBER*LOOPS)/1000) / ((t1-t2)-(o1-o2)) + |
(((MAGIC_NUMBER*LOOPS)/1000) % ((t1-t2)-(o1-o2)) ? 1 : 0); |
118,7 → 118,7 |
delay(1<<SHIFT); |
clk2 = rdtsc(); |
the->cpu->frequency_mhz = (clk2-clk1)>>SHIFT; |
CPU->frequency_mhz = (clk2-clk1)>>SHIFT; |
return; |
} |