Tweak the "ffs" code in cpu_switch so we can ditch __HAVE_MD_RUNQUEUE.
This commit is contained in:
parent
8e4950499d
commit
4401a03fd4
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: types.h,v 1.3 2002/09/22 08:31:01 simonb Exp $ */
|
||||
/* $NetBSD: types.h,v 1.4 2002/10/09 20:27:35 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002 Wasabi Systems, Inc.
|
||||
@ -77,7 +77,6 @@ typedef struct label_t {
|
||||
#define __HAVE_DEVICE_REGISTER
|
||||
#define __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
#define __HAVE_SYSCALL_INTERN
|
||||
#define __HAVE_MD_RUNQUEUE
|
||||
|
||||
#ifdef notyet
|
||||
#define __HAVE_AST_PERPROC /* Not reqd. until we support SMP */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu_switch.S,v 1.11 2002/10/08 15:59:32 scw Exp $ */
|
||||
/* $NetBSD: cpu_switch.S,v 1.12 2002/10/09 20:27:35 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002 Wasabi Systems, Inc.
|
||||
@ -312,10 +312,11 @@ Lsw2:
|
||||
* Interrupts are blocked, sched_lock is held, and r0 contains
|
||||
* the contents of a non-zero sched_whichqs.
|
||||
*/
|
||||
addz.l r0, r63, r0 /* Correct for sign extension */
|
||||
nsb r0, r1 /* Count sign bits in r0 */
|
||||
addi r1, -31, r1 /* Correct for 64-bitness of "nsb" */
|
||||
xori r1, 31, r1 /* Convert to range 31-0 */
|
||||
addi r0, -1, r1 /* Slightly modified ffs(r0) */
|
||||
andc r0, r1, r1
|
||||
nsb r1, r1
|
||||
addi.l r1, -62, r1 /* We know r0 != 0, so this works */
|
||||
sub.l r63, r1, r1 /* Result in r1 */
|
||||
movi 1, r2
|
||||
shlld r2, r1, r2 /* Set appropriate bit in r2 */
|
||||
andc r0, r2, r5 /* Assume queue is empty, in r5 */
|
||||
@ -336,7 +337,7 @@ Lsw2:
|
||||
* Remove process from head of run queue
|
||||
*/
|
||||
LDPTR r3, PH_LINK, r2 /* r2 = victim process, p */
|
||||
beq/u r2, r63, tr0 /* Queue was empty! Panic stations! */
|
||||
beq/u r2, r3, tr0 /* Queue was empty! Panic stations! */
|
||||
LDPTR r2, P_FORW, r4 /* r4 = p->p_forw */
|
||||
STPTR r3, PH_LINK, r4 /* queue->ph_link = p->p_forw */
|
||||
STPTR r4, P_BACK, r3 /* p->p_forw->p_back = queue */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: process_machdep.c,v 1.5 2002/09/28 11:11:01 scw Exp $ */
|
||||
/* $NetBSD: process_machdep.c,v 1.6 2002/10/09 20:27:35 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002 Wasabi Systems, Inc.
|
||||
@ -111,41 +111,6 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack)
|
||||
&p->p_addr->u_pcb);
|
||||
}
|
||||
|
||||
void
|
||||
setrunqueue(struct proc *p)
|
||||
{
|
||||
int queue = p->p_priority >> 2;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (p->p_back != NULL)
|
||||
panic("setrunqueue");
|
||||
#endif
|
||||
|
||||
sched_whichqs |= (1 << queue);
|
||||
p->p_forw = (struct proc *)&sched_qs[queue];
|
||||
p->p_back = sched_qs[queue].ph_rlink;
|
||||
p->p_back->p_forw = p;
|
||||
sched_qs[queue].ph_rlink = p;
|
||||
}
|
||||
|
||||
void
|
||||
remrunqueue(struct proc *p)
|
||||
{
|
||||
int queue = p->p_priority >> 2;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if ((sched_whichqs & (1 << queue)) == 0)
|
||||
panic("remrunqueue");
|
||||
#endif
|
||||
|
||||
p->p_back->p_forw = p->p_forw;
|
||||
p->p_forw->p_back = p->p_back;
|
||||
p->p_back = NULL;
|
||||
|
||||
if ((struct proc *)&sched_qs[queue] == sched_qs[queue].ph_link)
|
||||
sched_whichqs &= ~(1 << queue);
|
||||
}
|
||||
|
||||
int
|
||||
process_read_regs(struct proc *p, struct reg *regs)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user