summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-05-14 07:07:10 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-05-14 07:07:10 +0000
commitce42057a347aafb909c296a4ade029e26fd8ad6a (patch)
treeefe368b7354d4e2222bdbc799c1bbe49ba0699b9
parent150a39c85f36cf1ddb9293785762f056bcde0d12 (diff)
Switch arm to __HAVE_CPUINFO. Least effort.
deraadt@ ok
-rw-r--r--sys/arch/arm/arm/ast.c4
-rw-r--r--sys/arch/arm/arm/cpuswitch.S20
-rw-r--r--sys/arch/arm/arm/genassym.cf8
-rw-r--r--sys/arch/arm/include/_types.h4
-rw-r--r--sys/arch/arm/include/cpu.h12
5 files changed, 22 insertions, 26 deletions
diff --git a/sys/arch/arm/arm/ast.c b/sys/arch/arm/arm/ast.c
index 8bc5c0394bc..762c440e125 100644
--- a/sys/arch/arm/arm/ast.c
+++ b/sys/arch/arm/arm/ast.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ast.c,v 1.7 2007/03/15 10:22:29 art Exp $ */
+/* $OpenBSD: ast.c,v 1.8 2007/05/14 07:07:09 art Exp $ */
/* $NetBSD: ast.c,v 1.6 2003/10/31 16:44:34 cl Exp $ */
/*
@@ -80,7 +80,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;
}
diff --git a/sys/arch/arm/arm/cpuswitch.S b/sys/arch/arm/arm/cpuswitch.S
index 5b80ec6ed3c..d94219d88c0 100644
--- a/sys/arch/arm/arm/cpuswitch.S
+++ b/sys/arch/arm/arm/cpuswitch.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpuswitch.S,v 1.6 2005/09/22 04:14:44 drahn Exp $ */
+/* $OpenBSD: cpuswitch.S,v 1.7 2007/05/14 07:07:09 art Exp $ */
/* $NetBSD: cpuswitch.S,v 1.41 2003/11/15 08:44:18 scw Exp $ */
/*
@@ -253,22 +253,11 @@ ENTRY(remrunqueue)
* This function has several entry points
*/
-#ifdef MULTIPROCESSOR
.Lcpu_info_store:
.word _C_LABEL(cpu_info_store)
.Lcurproc:
- /* FIXME: This is bogus in the general case. */
- .word _C_LABEL(cpu_info_store) + CI_CURLWP
-
-.Lcurpcb:
- .word _C_LABEL(cpu_info_store) + CI_CURPCB
-#else
-.Lcurproc:
- .word _C_LABEL(curproc)
+ .word _C_LABEL(cpu_info_store) + CI_CURPROC
-.Lcurpcb:
- .word _C_LABEL(curpcb)
-#endif
.Lwant_resched:
.word _C_LABEL(want_resched)
@@ -277,11 +266,16 @@ ENTRY(remrunqueue)
.word _C_LABEL(cpufuncs)
#ifndef MULTIPROCESSOR
+.Lcurpcb:
+ .word _C_LABEL(curpcb)
.data
.global _C_LABEL(curpcb)
_C_LABEL(curpcb):
.word 0x00000000
.text
+#else
+.Lcurpcb:
+ .word _C_LABEL(cpu_info_store) + CI_CURPCB
#endif
.Lcpu_do_powersave:
diff --git a/sys/arch/arm/arm/genassym.cf b/sys/arch/arm/arm/genassym.cf
index 46cc2f4b7f1..63839e12196 100644
--- a/sys/arch/arm/arm/genassym.cf
+++ b/sys/arch/arm/arm/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.6 2006/03/07 20:20:28 miod Exp $
+# $OpenBSD: genassym.cf,v 1.7 2007/05/14 07:07:09 art Exp $
# $NetBSD: genassym.cf,v 1.27 2003/11/04 10:33:16 dsl Exp$
# Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -162,10 +162,8 @@ member cf_control
struct cpu_info
#member CI_CURPRIORITY ci_schedstate.spc_curpriority
-ifdef MULTIPROCESSOR
-member ci_curlwp
-member ci_curpcb
-endif
+member ci_curproc
+#member ci_curpcb
# Constants required for in_cksum() and friends.
define M_LEN offsetof(struct mbuf, m_len)
diff --git a/sys/arch/arm/include/_types.h b/sys/arch/arm/include/_types.h
index ddd9db693f9..db38d11fbd2 100644
--- a/sys/arch/arm/include/_types.h
+++ b/sys/arch/arm/include/_types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _types.h,v 1.3 2006/02/14 18:12:58 miod Exp $ */
+/* $OpenBSD: _types.h,v 1.4 2007/05/14 07:07:09 art Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -119,4 +119,6 @@ typedef void * __wctype_t;
#define __PROG32 /* indicate 32-bit mode */
#endif
+#define __HAVE_CPUINFO
+
#endif /* _ARM__TYPES_H_ */
diff --git a/sys/arch/arm/include/cpu.h b/sys/arch/arm/include/cpu.h
index faa66b3cbdb..db0450d3b52 100644
--- a/sys/arch/arm/include/cpu.h
+++ b/sys/arch/arm/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.15 2007/03/15 10:22:29 art Exp $ */
+/* $OpenBSD: cpu.h,v 1.16 2007/05/14 07:07:09 art Exp $ */
/* $NetBSD: cpu.h,v 1.34 2003/06/23 11:01:08 martin Exp $ */
/*
@@ -199,13 +199,11 @@ void arm32_vector_init(vaddr_t, int);
*/
#include <sys/device.h>
-/*
#include <sys/sched.h>
-*/
struct cpu_info {
-#if 0
+ struct proc *ci_curproc;
+
struct schedstate_percpu ci_schedstate; /* scheduler state */
-#endif
#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
u_long ci_spin_locks; /* # of spin locks held */
u_long ci_simple_locks; /* # of simple locks held */
@@ -224,6 +222,10 @@ struct cpu_info {
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)
#endif
#ifdef __PROG32