Use <m68k/m68k/proc_subr.s>

This commit is contained in:
thorpej 1997-04-09 20:43:52 +00:00
parent 7b5647f03a
commit 4fb277fd75
1 changed files with 3 additions and 83 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.48 1997/03/17 19:03:19 gwr Exp $ */
/* $NetBSD: locore.s,v 1.49 1997/04/09 20:43:52 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -740,94 +740,14 @@ _esigcode:
*/
#include <m68k/m68k/support.s>
/*
* The following primitives manipulate the run queues.
* _whichqs tells which of the 32 queues _qs have processes in them.
* Setrunqueue puts processes into queues, Remrunqueue removes them
* from queues. The running process is on no queue, other processes
* are on a queue related to p->p_priority, divided by 4 actually to
* shrink the 0-127 range of priorities into the 32 available queues.
*/
.globl _whichqs,_qs,_cnt,_panic
.globl _curproc
.comm _want_resched,4
/*
* setrunqueue(p)
*
* Call should be made at splclock(), and p->p_stat should be SRUN
* Use common m68k process manipulation routines.
*/
ENTRY(setrunqueue)
movl sp@(4),a0
#ifdef DIAGNOSTIC
tstl a0@(P_BACK)
jne Lset1
tstl a0@(P_WCHAN)
jne Lset1
cmpb #SRUN,a0@(P_STAT)
jne Lset1
#endif
clrl d0
movb a0@(P_PRIORITY),d0
lsrb #2,d0
movl _whichqs,d1
bset d0,d1
movl d1,_whichqs
lslb #3,d0
addl #_qs,d0
movl d0,a0@(P_FORW)
movl d0,a1
movl a1@(P_BACK),a0@(P_BACK)
movl a0,a1@(P_BACK)
movl a0@(P_BACK),a1
movl a0,a1@(P_FORW)
rts
#ifdef DIAGNOSTIC
Lset1:
movl #Lset2,sp@-
jbsr _panic
Lset2:
.asciz "setrunqueue"
.even
#endif
/*
* remrunqueue(p)
*
* Call should be made at splclock().
*/
ENTRY(remrunqueue)
movl sp@(4),a0 | proc *p
clrl d0
movb a0@(P_PRIORITY),d0
lsrb #2,d0
movl _whichqs,d1
bclr d0,d1 | if ((d1 & (1 << d0)) == 0)
jeq Lrem2 | panic (empty queue)
movl d1,_whichqs
movl a0@(P_FORW),a1
movl a0@(P_BACK),a1@(P_BACK)
movl a0@(P_BACK),a1
movl a0@(P_FORW),a1@(P_FORW)
movl #_qs,a1
movl d0,d1
lslb #3,d1
addl d1,a1
cmpl a1@(P_FORW),a1
jeq Lrem1
movl _whichqs,d1
bset d0,d1
movl d1,_whichqs
Lrem1:
clrl a0@(P_BACK)
rts
Lrem2:
movl #Lrem3,sp@-
jbsr _panic
Lrem3:
.asciz "remrunqueue"
.even
#include <m68k/m68k/proc_subr.s>
| Message for Lbadsw panic
Lsw0: