summaryrefslogtreecommitdiff
path: root/sys/arch/m68k
diff options
context:
space:
mode:
authorMartin Reindl <martin@cvs.openbsd.org>2007-05-15 13:46:23 +0000
committerMartin Reindl <martin@cvs.openbsd.org>2007-05-15 13:46:23 +0000
commit7d95296f228e0b8befa23f15833ca056cfeeec16 (patch)
tree49ef36eadd161e34934d3d07506c88486a20d736 /sys/arch/m68k
parent91ab665a68b179b0f98b8b1f7f700357ff7a711b (diff)
switch m68k to __HAVE_CPUINFO
help miod@, art@ ok deraadt@
Diffstat (limited to 'sys/arch/m68k')
-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
6 files changed, 38 insertions, 7 deletions
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.
*/