Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/aim/aim_machdep.c
Show First 20 Lines • Show All 500 Lines • ▼ Show 20 Lines | |||||
cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t sz) | cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t sz) | ||||
{ | { | ||||
#ifdef __powerpc64__ | #ifdef __powerpc64__ | ||||
/* Copy the SLB contents from the current CPU */ | /* Copy the SLB contents from the current CPU */ | ||||
memcpy(pcpu->pc_aim.slb, PCPU_GET(aim.slb), sizeof(pcpu->pc_aim.slb)); | memcpy(pcpu->pc_aim.slb, PCPU_GET(aim.slb), sizeof(pcpu->pc_aim.slb)); | ||||
#endif | #endif | ||||
} | } | ||||
/* Return 0 on handled success, otherwise signal number. */ | |||||
int | |||||
cpu_machine_check(struct thread *td, struct trapframe *frame, int *ucode) | |||||
{ | |||||
/* Check if the important information is in DSISR */ | |||||
if ((frame->srr1 & SRR1_MCHK_DATA) != 0) { | |||||
printf("Machine check, DSISR: %016lx\n", frame->cpu.aim.dsisr); | |||||
/* SLB multi-hit is recoverable. */ | |||||
if ((frame->cpu.aim.dsisr & DSISR_MC_SLB_MULTIHIT) != 0) | |||||
return (0); | |||||
if ((frame->cpu.aim.dsisr & DSISR_MC_TLB_MULTIHIT) != 0) { | |||||
__asm __volatile("tlbiel %0" :: "r"(frame->dar)); | |||||
bdragon: Should this have a : "memory"? | |||||
jhibbitsAuthorUnsubmitted Done Inline ActionsMaybe. This is an obviously incomplete flush, anyway. The correct thing to do here is to flush the full TLB, not just the one entry. jhibbits: Maybe. This is an obviously incomplete flush, anyway. The correct thing to do here is to… | |||||
return (0); | |||||
} | |||||
} else { | |||||
if ((frame->srr1 & SRR1_MCHK_IFETCH_M) == SRR1_MCHK_IFETCH_SLBMH) | |||||
return (0); | |||||
} | |||||
*ucode = BUS_OBJERR; | |||||
return (SIGBUS); | |||||
} | |||||
#ifndef __powerpc64__ | #ifndef __powerpc64__ | ||||
uint64_t | uint64_t | ||||
va_to_vsid(pmap_t pm, vm_offset_t va) | va_to_vsid(pmap_t pm, vm_offset_t va) | ||||
{ | { | ||||
return ((pm->pm_sr[(uintptr_t)va >> ADDR_SR_SHFT]) & SR_VSID_MASK); | return ((pm->pm_sr[(uintptr_t)va >> ADDR_SR_SHFT]) & SR_VSID_MASK); | ||||
} | } | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |
Should this have a : "memory"?