cpu_switch.S (d230622648ed9a4c08153a019f97d784d400775b) | cpu_switch.S (0e195446b70cdb3130378505b24603031c1f3ce0) |
---|---|
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.4 1994/01/31 10:26:59 davidg Exp $ | 36 * $Id: swtch.s,v 1.5 1994/04/02 07:00:30 davidg Exp $ |
37 */ 38 39#include "npx.h" /* for NNPX */ 40#include "assym.s" /* for preprocessor defines */ 41#include "errno.h" /* for error codes */ 42 43#include "machine/asmacros.h" /* for miscellaneous assembly macros */ 44#define LOCORE /* XXX inhibit C declarations */ --- 106 unchanged lines hidden (view full) --- 151 */ 152 movl $SWI_AST_MASK,_cpl 153 testl $~SWI_AST_MASK,_ipending 154 je idle_loop 155 call _splz 156 157 ALIGN_TEXT 158idle_loop: | 37 */ 38 39#include "npx.h" /* for NNPX */ 40#include "assym.s" /* for preprocessor defines */ 41#include "errno.h" /* for error codes */ 42 43#include "machine/asmacros.h" /* for miscellaneous assembly macros */ 44#define LOCORE /* XXX inhibit C declarations */ --- 106 unchanged lines hidden (view full) --- 151 */ 152 movl $SWI_AST_MASK,_cpl 153 testl $~SWI_AST_MASK,_ipending 154 je idle_loop 155 call _splz 156 157 ALIGN_TEXT 158idle_loop: |
159 cli |
|
159 cmpl $0,_whichqs | 160 cmpl $0,_whichqs |
160 jne sw1 | 161 jne sw1a 162 sti |
161 hlt /* wait for interrupt */ 162 jmp idle_loop 163 164badsw: 165 pushl $sw0 166 call _panic 167 /*NOTREACHED*/ 168 --- 40 unchanged lines hidden (view full) --- 209 movl $0,_curproc /* out of process */ 210 211# movw _cpl,%ax 212# movw %ax,PCB_IML(%ecx) /* save ipl */ 213 214 /* save is done, now choose a new process or idle */ 215sw1: 216 cli | 163 hlt /* wait for interrupt */ 164 jmp idle_loop 165 166badsw: 167 pushl $sw0 168 call _panic 169 /*NOTREACHED*/ 170 --- 40 unchanged lines hidden (view full) --- 211 movl $0,_curproc /* out of process */ 212 213# movw _cpl,%ax 214# movw %ax,PCB_IML(%ecx) /* save ipl */ 215 216 /* save is done, now choose a new process or idle */ 217sw1: 218 cli |
219sw1a: |
|
217 movl _whichqs,%edi 2182: 219 /* XXX - bsf is sloow */ 220 bsfl %edi,%eax /* find a full q */ 221 je _idle /* if none, idle */ 222 223 /* XX update whichqs? */ 224 btrl %eax,%edi /* clear q full status */ --- 231 unchanged lines hidden --- | 220 movl _whichqs,%edi 2212: 222 /* XXX - bsf is sloow */ 223 bsfl %edi,%eax /* find a full q */ 224 je _idle /* if none, idle */ 225 226 /* XX update whichqs? */ 227 btrl %eax,%edi /* clear q full status */ --- 231 unchanged lines hidden --- |