trap.c (179533) | trap.c (188860) |
---|---|
1/*- 2 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 3 * Copyright (C) 1995, 1996 TooLs GmbH. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * 31 * $NetBSD: trap.c,v 1.58 2002/03/04 04:07:35 dbj Exp $ 32 */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 3 * Copyright (C) 1995, 1996 TooLs GmbH. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * 31 * $NetBSD: trap.c,v 1.58 2002/03/04 04:07:35 dbj Exp $ 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/powerpc/aim/trap.c 179533 2008-06-04 07:32:49Z grehan $"); | 35__FBSDID("$FreeBSD: head/sys/powerpc/aim/trap.c 188860 2009-02-20 17:48:40Z nwhitehorn $"); |
36 37#include "opt_ktrace.h" 38 39#include <sys/param.h> 40#include <sys/kdb.h> 41#include <sys/proc.h> 42#include <sys/ktr.h> 43#include <sys/lock.h> --- 16 unchanged lines hidden (view full) --- 60#include <vm/vm.h> 61#include <vm/pmap.h> 62#include <vm/vm_extern.h> 63#include <vm/vm_param.h> 64#include <vm/vm_kern.h> 65#include <vm/vm_map.h> 66#include <vm/vm_page.h> 67 | 36 37#include "opt_ktrace.h" 38 39#include <sys/param.h> 40#include <sys/kdb.h> 41#include <sys/proc.h> 42#include <sys/ktr.h> 43#include <sys/lock.h> --- 16 unchanged lines hidden (view full) --- 60#include <vm/vm.h> 61#include <vm/pmap.h> 62#include <vm/vm_extern.h> 63#include <vm/vm_param.h> 64#include <vm/vm_kern.h> 65#include <vm/vm_map.h> 66#include <vm/vm_page.h> 67 |
68#include <machine/altivec.h> |
|
68#include <machine/cpu.h> 69#include <machine/db_machdep.h> 70#include <machine/fpu.h> 71#include <machine/frame.h> 72#include <machine/pcb.h> 73#include <machine/pmap.h> 74#include <machine/psl.h> 75#include <machine/trap.h> --- 107 unchanged lines hidden (view full) --- 183 break; 184 185 case EXC_FPU: 186 KASSERT((td->td_pcb->pcb_flags & PCB_FPU) != PCB_FPU, 187 ("FPU already enabled for thread")); 188 enable_fpu(td); 189 break; 190 | 69#include <machine/cpu.h> 70#include <machine/db_machdep.h> 71#include <machine/fpu.h> 72#include <machine/frame.h> 73#include <machine/pcb.h> 74#include <machine/pmap.h> 75#include <machine/psl.h> 76#include <machine/trap.h> --- 107 unchanged lines hidden (view full) --- 184 break; 185 186 case EXC_FPU: 187 KASSERT((td->td_pcb->pcb_flags & PCB_FPU) != PCB_FPU, 188 ("FPU already enabled for thread")); 189 enable_fpu(td); 190 break; 191 |
191#ifdef ALTIVEC | |
192 case EXC_VEC: | 192 case EXC_VEC: |
193 if ((vecthread = PCPU_GET(vecthread)) != NULL) { 194 KASSERT(vecthread != td, 195 ("altivec already enabled")); 196 save_vec(vecthread); 197 } 198 PCPU_SET(vecthread, td); 199 td->td_pcb->pcb_veccpu = PCPU_GET(cpuid); | 193 KASSERT((td->td_pcb->pcb_flags & PCB_VEC) != PCB_VEC, 194 ("Altivec already enabled for thread")); |
200 enable_vec(td); | 195 enable_vec(td); |
201 frame->srr1 |= PSL_VEC; | |
202 break; | 196 break; |
203#else 204 case EXC_VEC: | 197 |
205 case EXC_VECAST: | 198 case EXC_VECAST: |
199 printf("Vector assist exception!\n"); |
|
206 sig = SIGILL; 207 break; | 200 sig = SIGILL; 201 break; |
208#endif /* ALTIVEC */ | |
209 210 case EXC_ALI: 211 if (fix_unaligned(td, frame) != 0) 212 sig = SIGBUS; 213 else 214 frame->srr0 += 4; 215 break; 216 --- 461 unchanged lines hidden --- | 202 203 case EXC_ALI: 204 if (fix_unaligned(td, frame) != 0) 205 sig = SIGBUS; 206 else 207 frame->srr0 += 4; 208 break; 209 --- 461 unchanged lines hidden --- |