diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-05-16 05:19:16 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-05-16 05:19:16 +0000 |
commit | d0d00b82ac339b0d72ddf272b34d8f9d66dc0e46 (patch) | |
tree | 8a85ab1aba40b1770a1d57f01804c68867a5770a /sys | |
parent | 46395f39999cb5f2fcfda90bcd9e6f3ed6eb90c1 (diff) |
Switch vax to __HAVE_CPUINFO, based on an incomplete diff from art.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/vax/include/cpu.h | 18 | ||||
-rw-r--r-- | sys/arch/vax/include/intr.h | 3 | ||||
-rw-r--r-- | sys/arch/vax/vax/genassym.cf | 5 | ||||
-rw-r--r-- | sys/arch/vax/vax/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/vax/subr.s | 10 | ||||
-rw-r--r-- | sys/arch/vax/vax/trap.c | 4 |
6 files changed, 32 insertions, 12 deletions
diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h index 7227bf9c5e6..80b05d5d185 100644 --- a/sys/arch/vax/include/cpu.h +++ b/sys/arch/vax/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.24 2007/04/05 17:32:37 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.25 2007/05/16 05:19:13 miod Exp $ */ /* $NetBSD: cpu.h,v 1.41 1999/10/21 20:01:36 ragge Exp $ */ /* @@ -48,7 +48,21 @@ #include <machine/intr.h> #define cpu_wait(p) -#define cpu_number() 0 + +#include <sys/sched.h> +struct cpu_info { + struct proc *ci_curproc; + + struct schedstate_percpu ci_schedstate; /* scheduler state */ +}; + +extern struct cpu_info cpu_info_store; +#define curcpu() (&cpu_info_store) +#define cpu_number() 0 +#define CPU_IS_PRIMARY(ci) 1 +#define CPU_INFO_ITERATOR int +#define CPU_INFO_FOREACH(cii, ci) \ + for (cii = 0, ci = curcpu(); ci != NULL; ci = NULL) /* * All cpu-dependent info is kept in this struct. Pointer to the diff --git a/sys/arch/vax/include/intr.h b/sys/arch/vax/include/intr.h index 8cd3c6eb73e..13f53ac4a51 100644 --- a/sys/arch/vax/include/intr.h +++ b/sys/arch/vax/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.6 2007/04/05 17:31:47 miod Exp $ */ +/* $OpenBSD: intr.h,v 1.7 2007/05/16 05:19:13 miod Exp $ */ /* $NetBSD: intr.h,v 1.1 1998/08/18 23:55:00 matt Exp $ */ /* @@ -93,6 +93,7 @@ #define splclock() _splraise(IPL_CLOCK) #define splstatclock() _splraise(IPL_STATCLOCK) #define splhigh() _splset(IPL_HIGH) +#define splsched() splhigh() /* These are better to use when playing with VAX buses */ #define spl4() _splraise(0x14) diff --git a/sys/arch/vax/vax/genassym.cf b/sys/arch/vax/vax/genassym.cf index 8807309f637..76a50e81cd5 100644 --- a/sys/arch/vax/vax/genassym.cf +++ b/sys/arch/vax/vax/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.8 2005/06/08 07:06:02 miod Exp $ +# $OpenBSD: genassym.cf,v 1.9 2007/05/16 05:19:15 miod Exp $ # $NetBSD: genassym.cf,v 1.10 1999/11/19 22:09:55 ragge Exp $ # # Copyright (c) 1997 Ludd, University of Lule}, Sweden. @@ -62,6 +62,9 @@ struct cpu_dep member MCHK cpu_mchk member MEMERR cpu_memerr +struct cpu_info +member ci_curproc + export KERNBASE # mtpr register numbers diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index 5116593d07c..1f8210289d8 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.84 2006/07/20 19:15:35 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.85 2007/05/16 05:19:15 miod Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -386,7 +386,7 @@ void setstatclockrate(hzrate) int hzrate; { - panic("setstatclockrate"); + /* nothing to do */ } void diff --git a/sys/arch/vax/vax/subr.s b/sys/arch/vax/vax/subr.s index 3c3e9124974..6c669bd47af 100644 --- a/sys/arch/vax/vax/subr.s +++ b/sys/arch/vax/vax/subr.s @@ -1,4 +1,4 @@ -/* $OpenBSD: subr.s,v 1.25 2007/05/10 17:59:27 deraadt Exp $ */ +/* $OpenBSD: subr.s,v 1.26 2007/05/16 05:19:15 miod Exp $ */ /* $NetBSD: subr.s,v 1.32 1999/03/25 00:41:48 mrg Exp $ */ /* @@ -284,9 +284,11 @@ idle: mtpr $0,$PR_IPL # Enable all types of interrupts # cpu_switch, cpu_exit and the idle loop implemented in assembler # for efficiency. r0 contains pointer to last process. # - + +#define CURPROC _cpu_info_store + CI_CURPROC + JSBENTRY(Swtch) - clrl _curproc # Stop process accounting + clrl CURPROC # Stop process accounting #bpt mtpr $0x1f,$PR_IPL # block all interrupts ffs $0,$32,_whichqs,r3 # Search for bit set @@ -305,7 +307,7 @@ noque: .asciz "swtch" 2: clrl 4(r2) # clear proc backpointer clrl _want_resched # we are now changing process movb $SONPROC,P_STAT(r2) # p->p_stat = SONPROC - movl r2,_curproc # set new process running + movl r2,CURPROC # set new process running cmpl r0,r2 # Same process? bneq 1f # No, continue rsb diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c index 1bf96264d12..3ff3e3ea17a 100644 --- a/sys/arch/vax/vax/trap.c +++ b/sys/arch/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.38 2007/04/01 09:29:27 art Exp $ */ +/* $OpenBSD: trap.c,v 1.39 2007/05/16 05:19:15 miod Exp $ */ /* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -116,7 +116,7 @@ userret(struct proc *p) while ((sig = CURSIG(p)) !=0) postsig(sig); - curpriority = p->p_priority = p->p_usrpri; + p->p_cpu->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri; } void |