cpu_switch.S (26309) | cpu_switch.S (26494) |
---|---|
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 --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 * | 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 --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 * $Id: swtch.s,v 1.50 1997/05/29 05:11:11 peter Exp $ | 36 * $Id: swtch.s,v 1.51 1997/05/31 09:27:29 peter Exp $ |
37 */ 38 39#include "npx.h" 40#include "opt_user_ldt.h" 41#include "opt_smp_privpages.h" 42 43#include <sys/rtprio.h> 44 --- 286 unchanged lines hidden (view full) --- 331 332 movl (%esp),%eax /* Hardware registers */ 333 movl %eax,PCB_EIP(%ecx) 334 movl %ebx,PCB_EBX(%ecx) 335 movl %esp,PCB_ESP(%ecx) 336 movl %ebp,PCB_EBP(%ecx) 337 movl %esi,PCB_ESI(%ecx) 338 movl %edi,PCB_EDI(%ecx) | 37 */ 38 39#include "npx.h" 40#include "opt_user_ldt.h" 41#include "opt_smp_privpages.h" 42 43#include <sys/rtprio.h> 44 --- 286 unchanged lines hidden (view full) --- 331 332 movl (%esp),%eax /* Hardware registers */ 333 movl %eax,PCB_EIP(%ecx) 334 movl %ebx,PCB_EBX(%ecx) 335 movl %esp,PCB_ESP(%ecx) 336 movl %ebp,PCB_EBP(%ecx) 337 movl %esi,PCB_ESI(%ecx) 338 movl %edi,PCB_EDI(%ecx) |
339 movl %fs,PCB_FS(%ecx) 340 movl %gs,PCB_GS(%ecx) |
|
339 340#ifdef SMP 341 movl _mp_lock, %eax 342 cmpl $0xffffffff, %eax /* is it free? */ 343 je badsw /* yes, bad medicine! */ 344 andl $0x00ffffff, %eax /* clear CPU portion */ 345 movl %eax,PCB_MPNEST(%ecx) /* store it */ 346#endif /* SMP */ --- 210 unchanged lines hidden (view full) --- 557 movl %eax,_currentldt 558 jmp 2f 5591: pushl %edx 560 call _set_user_ldt 561 popl %edx 5622: 563#endif 564 | 341 342#ifdef SMP 343 movl _mp_lock, %eax 344 cmpl $0xffffffff, %eax /* is it free? */ 345 je badsw /* yes, bad medicine! */ 346 andl $0x00ffffff, %eax /* clear CPU portion */ 347 movl %eax,PCB_MPNEST(%ecx) /* store it */ 348#endif /* SMP */ --- 210 unchanged lines hidden (view full) --- 559 movl %eax,_currentldt 560 jmp 2f 5611: pushl %edx 562 call _set_user_ldt 563 popl %edx 5642: 565#endif 566 |
567 /* This must be done after loading the user LDT. */ 568 .globl cpu_switch_load_fs 569cpu_switch_load_fs: 570 movl PCB_FS(%edx),%fs 571 .globl cpu_switch_load_gs 572cpu_switch_load_gs: 573 movl PCB_GS(%edx),%gs 574 |
|
565 sti 566 ret 567 568CROSSJUMPTARGET(idqr) 569CROSSJUMPTARGET(nortqr) 570CROSSJUMPTARGET(sw1a) 571 572badsw: --- 14 unchanged lines hidden (view full) --- 587 movl (%esp),%eax 588 movl %eax,PCB_EIP(%ecx) 589 590 movl %ebx,PCB_EBX(%ecx) 591 movl %esp,PCB_ESP(%ecx) 592 movl %ebp,PCB_EBP(%ecx) 593 movl %esi,PCB_ESI(%ecx) 594 movl %edi,PCB_EDI(%ecx) | 575 sti 576 ret 577 578CROSSJUMPTARGET(idqr) 579CROSSJUMPTARGET(nortqr) 580CROSSJUMPTARGET(sw1a) 581 582badsw: --- 14 unchanged lines hidden (view full) --- 597 movl (%esp),%eax 598 movl %eax,PCB_EIP(%ecx) 599 600 movl %ebx,PCB_EBX(%ecx) 601 movl %esp,PCB_ESP(%ecx) 602 movl %ebp,PCB_EBP(%ecx) 603 movl %esi,PCB_ESI(%ecx) 604 movl %edi,PCB_EDI(%ecx) |
605 movl %fs,PCB_FS(%ecx) 606 movl %gs,PCB_GS(%ecx) |
|
595 596#if NNPX > 0 597 /* 598 * If npxproc == NULL, then the npx h/w state is irrelevant and the 599 * state had better already be in the pcb. This is true for forks 600 * but not for dumps (the old book-keeping with FP flags in the pcb 601 * always lost for dumps because the dump pcb has 0 flags). 602 * --- 30 unchanged lines hidden --- | 607 608#if NNPX > 0 609 /* 610 * If npxproc == NULL, then the npx h/w state is irrelevant and the 611 * state had better already be in the pcb. This is true for forks 612 * but not for dumps (the old book-keeping with FP flags in the pcb 613 * always lost for dumps because the dump pcb has 0 flags). 614 * --- 30 unchanged lines hidden --- |