Deleted Added
full compact
exception.S (69431) exception.S (69971)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
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 * 1. Redistributions of source code must retain the above copyright

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

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
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 * 1. Redistributions of source code must retain the above copyright

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

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/sys/amd64/amd64/exception.S 69431 2000-12-01 02:09:45Z jake $
33 * $FreeBSD: head/sys/amd64/amd64/exception.S 69971 2000-12-13 09:23:53Z jake $
34 */
35
36#include "npx.h"
37
38#include <machine/asmacros.h>
39#include <sys/ipl.h>
40#include <machine/lock.h>
41#include <machine/mutex.h>

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

179 MPLOCKED incl _cnt+V_TRAP
180 pushl $0 /* dummy unit to finish intr frame */
181
182 call __mtx_enter_giant_def
183 call _npx_intr
184 call __mtx_exit_giant_def
185
186 addl $4,%esp
34 */
35
36#include "npx.h"
37
38#include <machine/asmacros.h>
39#include <sys/ipl.h>
40#include <machine/lock.h>
41#include <machine/mutex.h>

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

179 MPLOCKED incl _cnt+V_TRAP
180 pushl $0 /* dummy unit to finish intr frame */
181
182 call __mtx_enter_giant_def
183 call _npx_intr
184 call __mtx_exit_giant_def
185
186 addl $4,%esp
187 incb _intr_nesting_level
187 incb PCPU(INTR_NESTING_LEVEL)
188 MEXITCOUNT
189 jmp _doreti
190#else /* NNPX > 0 */
191 pushl $0; TRAP(T_ARITHTRAP)
192#endif /* NNPX > 0 */
193
194IDTVEC(align)
195 TRAP(T_ALIGNFLT)

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

218 FAKE_MCOUNT(13*4(%esp))
219calltrap:
220 FAKE_MCOUNT(_btrap) /* init "from" _btrap -> calltrap */
221 call _trap
222
223 /*
224 * Return via _doreti to handle ASTs.
225 */
188 MEXITCOUNT
189 jmp _doreti
190#else /* NNPX > 0 */
191 pushl $0; TRAP(T_ARITHTRAP)
192#endif /* NNPX > 0 */
193
194IDTVEC(align)
195 TRAP(T_ALIGNFLT)

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

218 FAKE_MCOUNT(13*4(%esp))
219calltrap:
220 FAKE_MCOUNT(_btrap) /* init "from" _btrap -> calltrap */
221 call _trap
222
223 /*
224 * Return via _doreti to handle ASTs.
225 */
226 incb _intr_nesting_level
226 incb PCPU(INTR_NESTING_LEVEL)
227 MEXITCOUNT
228 jmp _doreti
229
230/*
231 * SYSCALL CALL GATE (old entry point for a.out binaries)
232 *
233 * The intersegment call has been set up to specify one dummy parameter.
234 *

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

257 mov %ax,%fs
258 movl TF_ERR(%esp),%eax /* copy saved eflags to final spot */
259 movl %eax,TF_EFLAGS(%esp)
260 movl $7,TF_ERR(%esp) /* sizeof "lcall 7,0" */
261 FAKE_MCOUNT(13*4(%esp))
262 call _syscall2
263 MEXITCOUNT
264 cli /* atomic astpending access */
227 MEXITCOUNT
228 jmp _doreti
229
230/*
231 * SYSCALL CALL GATE (old entry point for a.out binaries)
232 *
233 * The intersegment call has been set up to specify one dummy parameter.
234 *

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

257 mov %ax,%fs
258 movl TF_ERR(%esp),%eax /* copy saved eflags to final spot */
259 movl %eax,TF_EFLAGS(%esp)
260 movl $7,TF_ERR(%esp) /* sizeof "lcall 7,0" */
261 FAKE_MCOUNT(13*4(%esp))
262 call _syscall2
263 MEXITCOUNT
264 cli /* atomic astpending access */
265 cmpl $0,_astpending /* AST pending? */
265 cmpl $0,PCPU(ASTPENDING) /* AST pending? */
266 je doreti_syscall_ret /* no, get out of here */
266 je doreti_syscall_ret /* no, get out of here */
267 movb $1,_intr_nesting_level
267 movb $1,PCPU(INTR_NESTING_LEVEL)
268 jmp _doreti
269
270/*
271 * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80)
272 *
273 * Even though the name says 'int0x80', this is actually a TGT (trap gate)
274 * rather then an IGT (interrupt gate). Thus interrupts are enabled on
275 * entry just as they are for a normal syscall.

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

289 mov %ax,%es
290 MOVL_KPSEL_EAX
291 mov %ax,%fs
292 movl $2,TF_ERR(%esp) /* sizeof "int 0x80" */
293 FAKE_MCOUNT(13*4(%esp))
294 call _syscall2
295 MEXITCOUNT
296 cli /* atomic astpending access */
268 jmp _doreti
269
270/*
271 * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80)
272 *
273 * Even though the name says 'int0x80', this is actually a TGT (trap gate)
274 * rather then an IGT (interrupt gate). Thus interrupts are enabled on
275 * entry just as they are for a normal syscall.

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

289 mov %ax,%es
290 MOVL_KPSEL_EAX
291 mov %ax,%fs
292 movl $2,TF_ERR(%esp) /* sizeof "int 0x80" */
293 FAKE_MCOUNT(13*4(%esp))
294 call _syscall2
295 MEXITCOUNT
296 cli /* atomic astpending access */
297 cmpl $0,_astpending /* AST pending? */
297 cmpl $0,PCPU(ASTPENDING) /* AST pending? */
298 je doreti_syscall_ret /* no, get out of here */
298 je doreti_syscall_ret /* no, get out of here */
299 movb $1,_intr_nesting_level
299 movb $1,PCPU(INTR_NESTING_LEVEL)
300 jmp _doreti
301
302ENTRY(fork_trampoline)
303 MTX_EXIT(_sched_lock, %ecx)
304 sti /* XXX: we need this for kernel threads
305 created very early before interrupts
306 are enabled */
307
308#ifdef SMP
300 jmp _doreti
301
302ENTRY(fork_trampoline)
303 MTX_EXIT(_sched_lock, %ecx)
304 sti /* XXX: we need this for kernel threads
305 created very early before interrupts
306 are enabled */
307
308#ifdef SMP
309 cmpl $0,_switchtime
309 cmpl $0,PCPU(SWITCHTIME)
310 jne 1f
310 jne 1f
311 movl $gd_switchtime,%eax
311 movl $GD_SWITCHTIME,%eax
312 addl %fs:0,%eax
313 pushl %eax
314 call _microuptime
315 popl %edx
316 movl _ticks,%eax
312 addl %fs:0,%eax
313 pushl %eax
314 call _microuptime
315 popl %edx
316 movl _ticks,%eax
317 movl %eax,_switchticks
317 movl %eax,PCPU(SWITCHTICKS)
3181:
319#endif
320
321 /*
322 * cpu_set_fork_handler intercepts this function call to
323 * have this call a non-return function to stay in kernel mode.
324 * initproc has its own fork handler, but it does return.
325 */
326 pushl %ebx /* arg1 */
327 call *%esi /* function */
328 addl $4,%esp
329 /* cut from syscall */
330
331 /*
332 * Return via _doreti to handle ASTs.
333 */
3181:
319#endif
320
321 /*
322 * cpu_set_fork_handler intercepts this function call to
323 * have this call a non-return function to stay in kernel mode.
324 * initproc has its own fork handler, but it does return.
325 */
326 pushl %ebx /* arg1 */
327 call *%esi /* function */
328 addl $4,%esp
329 /* cut from syscall */
330
331 /*
332 * Return via _doreti to handle ASTs.
333 */
334 movb $1,_intr_nesting_level
334 movb $1,PCPU(INTR_NESTING_LEVEL)
335 MEXITCOUNT
336 jmp _doreti
337
338
339/*
340 * Include vm86 call routines, which want to call _doreti.
341 */
342#include "i386/i386/vm86bios.s"

--- 20 unchanged lines hidden ---
335 MEXITCOUNT
336 jmp _doreti
337
338
339/*
340 * Include vm86 call routines, which want to call _doreti.
341 */
342#include "i386/i386/vm86bios.s"

--- 20 unchanged lines hidden ---