cpu_switch.S (41ed17bfec3d7948aca7ebee7aea16a5818488e8) cpu_switch.S (558226eae7e05c8594cec9615927b3c3530ca889)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $FreeBSD$
37 */
38
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $FreeBSD$
37 */
38
39#include "npx.h"
39#include "opt_npx.h"
40#include "opt_user_ldt.h"
41
42#include <sys/rtprio.h>
43
44#include <machine/asmacros.h>
45#include <machine/ipl.h>
46
47#ifdef SMP

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

135 /* save sched_lock recursion count */
136 movl _sched_lock+MTX_RECURSE,%eax
137 movl %eax,PCB_SCHEDNEST(%edx)
138
139#ifdef SMP
140 /* XXX FIXME: we should be saving the local APIC TPR */
141#endif /* SMP */
142
40#include "opt_user_ldt.h"
41
42#include <sys/rtprio.h>
43
44#include <machine/asmacros.h>
45#include <machine/ipl.h>
46
47#ifdef SMP

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

135 /* save sched_lock recursion count */
136 movl _sched_lock+MTX_RECURSE,%eax
137 movl %eax,PCB_SCHEDNEST(%edx)
138
139#ifdef SMP
140 /* XXX FIXME: we should be saving the local APIC TPR */
141#endif /* SMP */
142
143#if NNPX > 0
143#ifdef DEV_NPX
144 /* have we used fp, and need a save? */
145 cmpl %ecx,PCPU(NPXPROC)
146 jne 1f
147 addl $PCB_SAVEFPU,%edx /* h/w bugs make saving complicated */
148 pushl %edx
149 call _npxsave /* do it in a big C function */
150 popl %eax
1511:
144 /* have we used fp, and need a save? */
145 cmpl %ecx,PCPU(NPXPROC)
146 jne 1f
147 addl $PCB_SAVEFPU,%edx /* h/w bugs make saving complicated */
148 pushl %edx
149 call _npxsave /* do it in a big C function */
150 popl %eax
1511:
152#endif /* NNPX > 0 */
152#endif /* DEV_NPX */
153
154 /* save is done, now choose a new process */
155sw1:
156
157#ifdef SMP
158 /* Stop scheduling if smp_active goes zero and we are not BSP */
159 cmpl $0,_smp_active
160 jne 1f

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

353
354 movl %ebx,PCB_EBX(%ecx)
355 movl %esp,PCB_ESP(%ecx)
356 movl %ebp,PCB_EBP(%ecx)
357 movl %esi,PCB_ESI(%ecx)
358 movl %edi,PCB_EDI(%ecx)
359 movl %gs,PCB_GS(%ecx)
360
153
154 /* save is done, now choose a new process */
155sw1:
156
157#ifdef SMP
158 /* Stop scheduling if smp_active goes zero and we are not BSP */
159 cmpl $0,_smp_active
160 jne 1f

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

353
354 movl %ebx,PCB_EBX(%ecx)
355 movl %esp,PCB_ESP(%ecx)
356 movl %ebp,PCB_EBP(%ecx)
357 movl %esi,PCB_ESI(%ecx)
358 movl %edi,PCB_EDI(%ecx)
359 movl %gs,PCB_GS(%ecx)
360
361#if NNPX > 0
361#ifdef DEV_NPX
362 /*
363 * If npxproc == NULL, then the npx h/w state is irrelevant and the
364 * state had better already be in the pcb. This is true for forks
365 * but not for dumps (the old book-keeping with FP flags in the pcb
366 * always lost for dumps because the dump pcb has 0 flags).
367 *
368 * If npxproc != NULL, then we have to save the npx h/w state to
369 * npxproc's pcb and copy it to the requested pcb, or save to the

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

386 popl %ecx
387
388 pushl $PCB_SAVEFPU_SIZE
389 leal PCB_SAVEFPU(%ecx),%ecx
390 pushl %ecx
391 pushl %eax
392 call _bcopy
393 addl $12,%esp
362 /*
363 * If npxproc == NULL, then the npx h/w state is irrelevant and the
364 * state had better already be in the pcb. This is true for forks
365 * but not for dumps (the old book-keeping with FP flags in the pcb
366 * always lost for dumps because the dump pcb has 0 flags).
367 *
368 * If npxproc != NULL, then we have to save the npx h/w state to
369 * npxproc's pcb and copy it to the requested pcb, or save to the

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

386 popl %ecx
387
388 pushl $PCB_SAVEFPU_SIZE
389 leal PCB_SAVEFPU(%ecx),%ecx
390 pushl %ecx
391 pushl %eax
392 call _bcopy
393 addl $12,%esp
394#endif /* NNPX > 0 */
394#endif /* DEV_NPX */
395
3961:
397 ret
395
3961:
397 ret