trap.c (163553) | trap.c (163709) |
---|---|
1/* $NetBSD: fault.c,v 1.45 2003/11/20 14:44:36 scw Exp $ */ 2 3/*- 4 * Copyright 2004 Olivier Houchard 5 * Copyright 2003 Wasabi Systems, Inc. 6 * All rights reserved. 7 * 8 * Written by Steve C. Woodford for Wasabi Systems, Inc. --- 68 unchanged lines hidden (view full) --- 77 * 78 * Created : 28/11/94 79 */ 80 81 82#include "opt_ktrace.h" 83 84#include <sys/cdefs.h> | 1/* $NetBSD: fault.c,v 1.45 2003/11/20 14:44:36 scw Exp $ */ 2 3/*- 4 * Copyright 2004 Olivier Houchard 5 * Copyright 2003 Wasabi Systems, Inc. 6 * All rights reserved. 7 * 8 * Written by Steve C. Woodford for Wasabi Systems, Inc. --- 68 unchanged lines hidden (view full) --- 77 * 78 * Created : 28/11/94 79 */ 80 81 82#include "opt_ktrace.h" 83 84#include <sys/cdefs.h> |
85__FBSDID("$FreeBSD: head/sys/arm/arm/trap.c 163553 2006-10-21 04:25:00Z kevlo $"); | 85__FBSDID("$FreeBSD: head/sys/arm/arm/trap.c 163709 2006-10-26 21:42:22Z jb $"); |
86 87#include <sys/param.h> 88#include <sys/systm.h> 89#include <sys/proc.h> 90#include <sys/kernel.h> 91#include <sys/lock.h> 92#include <sys/mutex.h> 93#include <sys/syscall.h> --- 164 unchanged lines hidden (view full) --- 258 /* Data abort came from user mode? */ 259 user = TRAP_USERMODE(tf); 260 261 if (user) { 262 td->td_pticks = 0; 263 td->td_frame = tf; 264 if (td->td_ucred != td->td_proc->p_ucred) 265 cred_update_thread(td); | 86 87#include <sys/param.h> 88#include <sys/systm.h> 89#include <sys/proc.h> 90#include <sys/kernel.h> 91#include <sys/lock.h> 92#include <sys/mutex.h> 93#include <sys/syscall.h> --- 164 unchanged lines hidden (view full) --- 258 /* Data abort came from user mode? */ 259 user = TRAP_USERMODE(tf); 260 261 if (user) { 262 td->td_pticks = 0; 263 td->td_frame = tf; 264 if (td->td_ucred != td->td_proc->p_ucred) 265 cred_update_thread(td); |
266#ifdef KSE |
|
266 if (td->td_pflags & TDP_SA) 267 thread_user_enter(td); | 267 if (td->td_pflags & TDP_SA) 268 thread_user_enter(td); |
269#endif |
|
268 269 } 270 /* Grab the current pcb */ 271 pcb = td->td_pcb; 272 /* Re-enable interrupts if they were enabled previously */ 273 if (td->td_md.md_spinlock_count == 0) { 274 if (__predict_true(tf->tf_spsr & I32_bit) == 0) 275 enable_interrupts(I32_bit); --- 449 unchanged lines hidden (view full) --- 725 td = curthread; 726 p = td->td_proc; 727 PCPU_LAZY_INC(cnt.v_trap); 728 729 if (TRAP_USERMODE(tf)) { 730 td->td_frame = tf; 731 if (td->td_ucred != td->td_proc->p_ucred) 732 cred_update_thread(td); | 270 271 } 272 /* Grab the current pcb */ 273 pcb = td->td_pcb; 274 /* Re-enable interrupts if they were enabled previously */ 275 if (td->td_md.md_spinlock_count == 0) { 276 if (__predict_true(tf->tf_spsr & I32_bit) == 0) 277 enable_interrupts(I32_bit); --- 449 unchanged lines hidden (view full) --- 727 td = curthread; 728 p = td->td_proc; 729 PCPU_LAZY_INC(cnt.v_trap); 730 731 if (TRAP_USERMODE(tf)) { 732 td->td_frame = tf; 733 if (td->td_ucred != td->td_proc->p_ucred) 734 cred_update_thread(td); |
735#ifdef KSE |
|
733 if (td->td_proc->p_flag & P_SA) 734 thread_user_enter(td); | 736 if (td->td_proc->p_flag & P_SA) 737 thread_user_enter(td); |
738#endif |
|
735 } 736 fault_pc = tf->tf_pc; 737 if (td->td_md.md_spinlock_count == 0) { 738 if (__predict_true(tf->tf_spsr & I32_bit) == 0) 739 enable_interrupts(I32_bit); 740 if (__predict_true(tf->tf_spsr & F32_bit) == 0) 741 enable_interrupts(F32_bit); 742 } --- 257 unchanged lines hidden (view full) --- 1000swi_handler(trapframe_t *frame) 1001{ 1002 struct thread *td = curthread; 1003 uint32_t insn; 1004 1005 td->td_frame = frame; 1006 1007 td->td_pticks = 0; | 739 } 740 fault_pc = tf->tf_pc; 741 if (td->td_md.md_spinlock_count == 0) { 742 if (__predict_true(tf->tf_spsr & I32_bit) == 0) 743 enable_interrupts(I32_bit); 744 if (__predict_true(tf->tf_spsr & F32_bit) == 0) 745 enable_interrupts(F32_bit); 746 } --- 257 unchanged lines hidden (view full) --- 1004swi_handler(trapframe_t *frame) 1005{ 1006 struct thread *td = curthread; 1007 uint32_t insn; 1008 1009 td->td_frame = frame; 1010 1011 td->td_pticks = 0; |
1012#ifdef KSE |
|
1008 if (td->td_proc->p_flag & P_SA) 1009 thread_user_enter(td); | 1013 if (td->td_proc->p_flag & P_SA) 1014 thread_user_enter(td); |
1015#endif |
|
1010 /* 1011 * Make sure the program counter is correctly aligned so we 1012 * don't take an alignment fault trying to read the opcode. 1013 */ 1014 if (__predict_false(((frame->tf_pc - INSN_SIZE) & 3) != 0)) { 1015 call_trapsignal(td, SIGILL, 0); 1016 userret(td, frame); 1017 return; --- 17 unchanged lines hidden --- | 1016 /* 1017 * Make sure the program counter is correctly aligned so we 1018 * don't take an alignment fault trying to read the opcode. 1019 */ 1020 if (__predict_false(((frame->tf_pc - INSN_SIZE) & 3) != 0)) { 1021 call_trapsignal(td, SIGILL, 0); 1022 userret(td, frame); 1023 return; --- 17 unchanged lines hidden --- |