Deleted Added
full compact
ia32_trap.c (151316) ia32_trap.c (155455)
1/*-
2 * Copyright (c) 2004 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/ia64/ia32/ia32_trap.c 151316 2005-10-14 12:43:47Z davidxu $");
28__FBSDID("$FreeBSD: head/sys/ia64/ia32/ia32_trap.c 155455 2006-02-08 08:09:17Z phk $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/ktr.h>
33#include <sys/sysproto.h>
34#include <sys/kernel.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

--- 163 unchanged lines hidden (view full) ---

200 */
201void
202ia32_trap(int vector, struct trapframe *tf)
203{
204 struct proc *p;
205 struct thread *td;
206 uint64_t ucode;
207 int sig;
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/ktr.h>
33#include <sys/sysproto.h>
34#include <sys/kernel.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

--- 163 unchanged lines hidden (view full) ---

200 */
201void
202ia32_trap(int vector, struct trapframe *tf)
203{
204 struct proc *p;
205 struct thread *td;
206 uint64_t ucode;
207 int sig;
208 u_int sticks;
209 ksiginfo_t ksi;
210
211 KASSERT(TRAPF_USERMODE(tf), ("%s: In kernel mode???", __func__));
212
213 ia64_set_fpsr(IA64_FPSR_DEFAULT);
214 PCPU_LAZY_INC(cnt.v_trap);
215
216 td = curthread;
217 td->td_frame = tf;
208 ksiginfo_t ksi;
209
210 KASSERT(TRAPF_USERMODE(tf), ("%s: In kernel mode???", __func__));
211
212 ia64_set_fpsr(IA64_FPSR_DEFAULT);
213 PCPU_LAZY_INC(cnt.v_trap);
214
215 td = curthread;
216 td->td_frame = tf;
218 sticks = td->td_sticks;
217 td->td_pticks = 0;
219 p = td->td_proc;
220 if (td->td_ucred != p->p_ucred)
221 cred_update_thread(td);
222 sig = 0;
223 ucode = 0;
224 switch (vector) {
225 case IA64_VEC_IA32_EXCEPTION:
226 switch ((tf->tf_special.isr >> 16) & 0xffff) {

--- 65 unchanged lines hidden (view full) ---

292
293 ksiginfo_init_trap(&ksi);
294 ksi.ksi_signo = sig;
295 ksi.ksi_code = (int)ucode; /* XXX */
296 /* ksi.ksi_addr */
297 trapsignal(td, &ksi);
298
299out:
218 p = td->td_proc;
219 if (td->td_ucred != p->p_ucred)
220 cred_update_thread(td);
221 sig = 0;
222 ucode = 0;
223 switch (vector) {
224 case IA64_VEC_IA32_EXCEPTION:
225 switch ((tf->tf_special.isr >> 16) & 0xffff) {

--- 65 unchanged lines hidden (view full) ---

291
292 ksiginfo_init_trap(&ksi);
293 ksi.ksi_signo = sig;
294 ksi.ksi_code = (int)ucode; /* XXX */
295 /* ksi.ksi_addr */
296 trapsignal(td, &ksi);
297
298out:
300 userret(td, tf, sticks);
299 userret(td, tf);
301 mtx_assert(&Giant, MA_NOTOWNED);
302 do_ast(tf);
303}
300 mtx_assert(&Giant, MA_NOTOWNED);
301 do_ast(tf);
302}