summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hp300/hp300/locore.s10
-rw-r--r--sys/arch/hp300/hp300/trap.c6
-rw-r--r--sys/arch/hp300/include/intr.h3
-rw-r--r--sys/arch/m68k/include/_types.h3
-rw-r--r--sys/arch/m68k/include/asm.h4
-rw-r--r--sys/arch/m68k/include/cpu.h24
-rw-r--r--sys/arch/m68k/include/param.h4
-rw-r--r--sys/arch/m68k/m68k/genassym.cf6
-rw-r--r--sys/arch/m68k/m68k/m68k_machdep.c4
-rw-r--r--sys/arch/mac68k/include/intr.h3
-rw-r--r--sys/arch/mac68k/mac68k/locore.s10
-rw-r--r--sys/arch/mac68k/mac68k/trap.c6
-rw-r--r--sys/arch/mvme68k/include/intr.h3
-rw-r--r--sys/arch/mvme68k/mvme68k/locore.s10
-rw-r--r--sys/arch/mvme68k/mvme68k/trap.c6
15 files changed, 68 insertions, 34 deletions
diff --git a/sys/arch/hp300/hp300/locore.s b/sys/arch/hp300/hp300/locore.s
index 7feb470f6b3..40a595f59c0 100644
--- a/sys/arch/hp300/hp300/locore.s
+++ b/sys/arch/hp300/hp300/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.59 2006/08/17 06:33:59 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.60 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: locore.s,v 1.91 1998/11/11 06:41:25 thorpej Exp $ */
/*
@@ -1036,7 +1036,7 @@ ENTRY_NOPROFILE(trap12)
movl d1,sp@- | push length
movl a1,sp@- | push addr
movl d0,sp@- | push command
- movl _C_LABEL(curproc),sp@- | push proc pointer
+ movl CURPROC,sp@- | push proc pointer
jbsr _C_LABEL(cachectl) | do it
lea sp@(16),sp | pop args
jra _ASM_LABEL(rei) | all done
@@ -1403,9 +1403,9 @@ ENTRY(cpu_switch)
movl _C_LABEL(curpcb),a0 | current pcb
movw sr,a0@(PCB_PS) | save sr before changing ipl
#ifdef notyet
- movl _C_LABEL(curproc),sp@- | remember last proc running
+ movl CURPROC,sp@- | remember last proc running
#endif
- clrl _C_LABEL(curproc)
+ clrl CURPROC
/*
* Find the highest-priority queue that isn't empty,
@@ -1437,7 +1437,7 @@ Lsw1:
bclr d0,d1 | no, clear bit
movl d1,_C_LABEL(whichqs)
Lsw2:
- movl a0,_C_LABEL(curproc)
+ movl a0,CURPROC
clrl _C_LABEL(want_resched)
#ifdef notyet
movl sp@+,a1
diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c
index 7c5f8cb7334..9338324224c 100644
--- a/sys/arch/hp300/hp300/trap.c
+++ b/sys/arch/hp300/hp300/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.51 2007/04/01 09:29:27 art Exp $ */
+/* $OpenBSD: trap.c,v 1.52 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: trap.c,v 1.57 1998/02/16 20:58:31 thorpej Exp $ */
/*
@@ -203,7 +203,7 @@ userret(struct proc *p)
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
- curpriority = p->p_priority = p->p_usrpri;
+ curcpu()->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri;
}
#ifdef M68040
@@ -239,7 +239,7 @@ wb_userret(struct proc *p, struct frame *fp)
p->p_priority = p->p_usrpri;
}
}
- curpriority = p->p_priority;
+ curcpu()->ci_schedstate.spc_curpriority = p->p_priority;
}
#endif
diff --git a/sys/arch/hp300/include/intr.h b/sys/arch/hp300/include/intr.h
index e2259669c5c..e6fc7fcbaa5 100644
--- a/sys/arch/hp300/include/intr.h
+++ b/sys/arch/hp300/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.18 2006/06/11 20:46:48 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.19 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: intr.h,v 1.2 1997/07/24 05:43:08 scottr Exp $ */
/*-
@@ -93,6 +93,7 @@ extern unsigned short hp300_vmipl;
#define splstatclock() _splraise(PSL_S | PSL_IPL6)
#define splvm() _splraise(hp300_vmipl)
#define splhigh() _spl(PSL_S | PSL_IPL7)
+#define splsched() splhigh()
/* watch out for side effects */
#define splx(s) ((s) & PSL_IPL ? _spl((s)) : spl0())
diff --git a/sys/arch/m68k/include/_types.h b/sys/arch/m68k/include/_types.h
index faa42a3a9a7..0a3fe095832 100644
--- a/sys/arch/m68k/include/_types.h
+++ b/sys/arch/m68k/include/_types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _types.h,v 1.3 2007/02/03 20:08:49 miod Exp $ */
+/* $OpenBSD: _types.h,v 1.4 2007/05/15 13:46:22 martin Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -116,5 +116,6 @@ typedef void * __wctype_t;
/* Feature test macros */
#define __HAVE_MUTEX
+#define __HAVE_CPUINFO
#endif /* _M68K__TYPES_H_ */
diff --git a/sys/arch/m68k/include/asm.h b/sys/arch/m68k/include/asm.h
index ecdda76e8b1..cf7762dc3a6 100644
--- a/sys/arch/m68k/include/asm.h
+++ b/sys/arch/m68k/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.6 2003/06/12 01:07:29 deraadt Exp $ */
+/* $OpenBSD: asm.h,v 1.7 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: asm.h,v 1.13 1997/04/24 22:49:39 thorpej Exp $ */
/*
@@ -165,6 +165,8 @@
#define VECTOR_UNUSED \
.long 0
+#define CURPROC _C_LABEL(cpu_info_store) + CI_CURPROC
+
#endif /* _KERNEL */
#endif /* _ASM_H_ */
diff --git a/sys/arch/m68k/include/cpu.h b/sys/arch/m68k/include/cpu.h
index c390a862c4f..88ae10d2472 100644
--- a/sys/arch/m68k/include/cpu.h
+++ b/sys/arch/m68k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.15 2007/01/28 16:38:47 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.16 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: cpu.h,v 1.3 1997/02/02 06:56:57 thorpej Exp $ */
/*
@@ -65,6 +65,28 @@
*/
#ifdef _KERNEL
+#ifndef _LOCORE
+#include <sys/sched.h>
+
+struct cpu_info {
+ struct proc *ci_curproc;
+
+ struct schedstate_percpu ci_schedstate;
+};
+
+extern struct cpu_info cpu_info_store;
+
+#define curcpu() (&cpu_info_store)
+
+#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)
+
+#define cpu_number() 0
+
+#endif /* !_LOCORE */
+
/*
* All m68k ports must provide these globals.
*/
diff --git a/sys/arch/m68k/include/param.h b/sys/arch/m68k/include/param.h
index 792b7a653e9..5c46893e921 100644
--- a/sys/arch/m68k/include/param.h
+++ b/sys/arch/m68k/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.20 2006/06/12 17:58:24 miod Exp $ */
+/* $OpenBSD: param.h,v 1.21 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: param.h,v 1.2 1997/06/10 18:21:23 veego Exp $ */
/*
@@ -159,6 +159,6 @@
((unsigned)(v) & ~HPMMMASK)
#endif /* COMPAT_HPUX */
-#include <machine/intr.h> /* splXXX() */
+#include <machine/cpu.h>
#endif /* !_M68K_PARAM_H_ */
diff --git a/sys/arch/m68k/m68k/genassym.cf b/sys/arch/m68k/m68k/genassym.cf
index 14c0a6d6a52..d608d7fa85b 100644
--- a/sys/arch/m68k/m68k/genassym.cf
+++ b/sys/arch/m68k/m68k/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.11 2004/07/02 17:33:43 miod Exp $
+# $OpenBSD: genassym.cf,v 1.12 2007/05/15 13:46:22 martin Exp $
#
# Copyright (c) 1995 Theo de Raadt
@@ -151,3 +151,7 @@ export IC_CLEAR
export DC_CLEAR
export IC60_CUBC
export IC60_CABC
+
+# cpuinfo
+struct cpu_info
+member ci_curproc
diff --git a/sys/arch/m68k/m68k/m68k_machdep.c b/sys/arch/m68k/m68k/m68k_machdep.c
index 13ab1ab21fb..5661dc5fcc8 100644
--- a/sys/arch/m68k/m68k/m68k_machdep.c
+++ b/sys/arch/m68k/m68k/m68k_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m68k_machdep.c,v 1.10 2007/02/26 21:30:17 miod Exp $ */
+/* $OpenBSD: m68k_machdep.c,v 1.11 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: m68k_machdep.c,v 1.3 1997/06/12 09:57:04 veego Exp $ */
/*-
@@ -49,6 +49,8 @@
#include <machine/frame.h>
#include <machine/reg.h>
+struct cpu_info cpu_info_store;
+
/*
* Set registers on exec.
*/
diff --git a/sys/arch/mac68k/include/intr.h b/sys/arch/mac68k/include/intr.h
index 0f3f4902e79..6e3d60745b4 100644
--- a/sys/arch/mac68k/include/intr.h
+++ b/sys/arch/mac68k/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.15 2006/06/11 20:46:50 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.16 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: intr.h,v 1.9 1998/08/12 06:58:42 scottr Exp $ */
/*
@@ -86,6 +86,7 @@ extern u_short mac68k_statclockipl;
#define splstatclock() _splraise(mac68k_statclockipl)
#define splserial() _splraise(PSL_S | PSL_IPL4)
#define splhigh() _spl(PSL_S | PSL_IPL7)
+#define splsched() splhigh()
/* These spl calls are _not_ to be used by machine-independent code. */
#define spladb() splhigh()
diff --git a/sys/arch/mac68k/mac68k/locore.s b/sys/arch/mac68k/mac68k/locore.s
index 6f671cc59e2..16809cabe7d 100644
--- a/sys/arch/mac68k/mac68k/locore.s
+++ b/sys/arch/mac68k/mac68k/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.57 2007/03/17 20:05:22 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.58 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: locore.s,v 1.103 1998/07/09 06:02:50 scottr Exp $ */
/*
@@ -662,7 +662,7 @@ ENTRY_NOPROFILE(trap12)
movl d1,sp@- | push length
movl a1,sp@- | push addr
movl d0,sp@- | push command
- movl _C_LABEL(curproc),sp@- | push proc pointer
+ movl CURPROC,sp@- | push proc pointer
jbsr _C_LABEL(cachectl) | do it
lea sp@(16),sp | pop args
jra _ASM_LABEL(rei) | all done
@@ -1013,9 +1013,9 @@ ENTRY(cpu_switch)
movl _C_LABEL(curpcb),a0 | current pcb
movw sr,a0@(PCB_PS) | save sr before changing ipl
#ifdef notyet
- movl _C_LABEL(curproc),sp@- | remember last proc running
+ movl CURPROC,sp@- | remember last proc running
#endif
- clrl _C_LABEL(curproc)
+ clrl CURPROC
/*
* Find the highest-priority queue that isn't empty,
@@ -1047,7 +1047,7 @@ Lsw1:
bclr d0,d1 | no, clear bit
movl d1,_C_LABEL(whichqs)
Lsw2:
- movl a0,_C_LABEL(curproc)
+ movl a0,CURPROC
clrl _C_LABEL(want_resched)
#ifdef notyet
movl sp@+,a1
diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c
index 434bbeb65aa..16be0b2528a 100644
--- a/sys/arch/mac68k/mac68k/trap.c
+++ b/sys/arch/mac68k/mac68k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.53 2007/04/01 09:29:27 art Exp $ */
+/* $OpenBSD: trap.c,v 1.54 2007/05/15 13:46:22 martin Exp $ */
/* $NetBSD: trap.c,v 1.68 1998/12/22 08:47:07 scottr Exp $ */
/*
@@ -162,7 +162,7 @@ userret(struct proc *p)
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
- curpriority = p->p_priority = p->p_usrpri;
+ curcpu()->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri;
}
#ifdef M68040
@@ -198,7 +198,7 @@ wb_userret(struct proc *p, struct frame *fp)
p->p_priority = p->p_usrpri;
}
}
- curpriority = p->p_priority;
+ curcpu()->ci_schedstate.spc_curpriority = p->p_priority;
}
#endif
diff --git a/sys/arch/mvme68k/include/intr.h b/sys/arch/mvme68k/include/intr.h
index 41c4a74312d..f59dcd6d086 100644
--- a/sys/arch/mvme68k/include/intr.h
+++ b/sys/arch/mvme68k/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.14 2006/06/11 20:46:50 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.15 2007/05/15 13:46:22 martin Exp $ */
/*
* Copyright (C) 2000 Steve Murphree, Jr.
* All rights reserved.
@@ -80,6 +80,7 @@ u_int8_t allocate_sir(void (*proc)(void *), void *arg);
#define splclock() _splraise(PSL_S | PSL_IPL5)
#define splstatclock() _splraise(PSL_S | PSL_IPL5)
#define splhigh() _spl(PSL_S | PSL_IPL7)
+#define splsched() splhigh()
/* watch out for side effects */
#define splx(s) ((s) & PSL_IPL ? _spl(s) : spl0())
diff --git a/sys/arch/mvme68k/mvme68k/locore.s b/sys/arch/mvme68k/mvme68k/locore.s
index 98107c903f4..38015370541 100644
--- a/sys/arch/mvme68k/mvme68k/locore.s
+++ b/sys/arch/mvme68k/mvme68k/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.53 2006/07/03 18:55:36 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.54 2007/05/15 13:46:22 martin Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -931,7 +931,7 @@ ENTRY_NOPROFILE(trap12)
movl d1,sp@- | push length
movl a1,sp@- | push addr
movl d0,sp@- | push command
- movl _C_LABEL(curproc),sp@- | push proc pointer
+ movl CURPROC,sp@- | push proc pointer
jbsr _C_LABEL(cachectl) | do it
lea sp@(16),sp | pop args
jra _ASM_LABEL(rei) | all done
@@ -1223,9 +1223,9 @@ ENTRY(cpu_switch)
movl _C_LABEL(curpcb),a0 | current pcb
movw sr,a0@(PCB_PS) | save sr before changing ipl
#ifdef notyet
- movl _C_LABEL(curproc),sp@- | remember last proc running
+ movl CURPROC,sp@- | remember last proc running
#endif
- clrl _C_LABEL(curproc)
+ clrl CURPROC
/*
* Find the highest-priority queue that isn't empty,
@@ -1257,7 +1257,7 @@ Lsw1:
bclr d0,d1 | no, clear bit
movl d1,_C_LABEL(whichqs)
Lsw2:
- movl a0,_C_LABEL(curproc)
+ movl a0,CURPROC
clrl _C_LABEL(want_resched)
#ifdef notyet
movl sp@+,a1
diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c
index 7a5bed1e38c..38fdc8d0811 100644
--- a/sys/arch/mvme68k/mvme68k/trap.c
+++ b/sys/arch/mvme68k/mvme68k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.66 2007/04/01 09:29:27 art Exp $ */
+/* $OpenBSD: trap.c,v 1.67 2007/05/15 13:46:22 martin Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -182,7 +182,7 @@ userret(struct proc *p)
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
- curpriority = p->p_priority = p->p_usrpri;
+ curcpu()->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri;
}
#ifdef M68040
@@ -218,7 +218,7 @@ wb_userret(struct proc *p, struct frame *fp)
p->p_priority = p->p_usrpri;
}
}
- curpriority = p->p_priority;
+ curcpu()->ci_schedstate.spc_curpriority = p->p_priority;
}
#endif