From 2e0cbe66a38d5565e2d4778f430a7a663e3af5d7 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 7 May 2007 18:42:14 +0000 Subject: Move sgo to __HAVE_CPUINFO. ok miod@ --- sys/arch/mips64/include/_types.h | 3 ++- sys/arch/mips64/include/cpu.h | 22 +++++++++++++++++++++- sys/arch/mips64/mips64/context.S | 4 +++- sys/arch/mips64/mips64/cpu.c | 4 +++- sys/arch/mips64/mips64/interrupt.c | 4 ++-- sys/arch/mips64/mips64/lcore_float.S | 4 +++- sys/arch/mips64/mips64/trap.c | 4 ++-- 7 files changed, 36 insertions(+), 9 deletions(-) (limited to 'sys/arch/mips64') diff --git a/sys/arch/mips64/include/_types.h b/sys/arch/mips64/include/_types.h index 3d9ca5f2aab..765e071bd88 100644 --- a/sys/arch/mips64/include/_types.h +++ b/sys/arch/mips64/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.2 2006/01/13 17:50:06 millert Exp $ */ +/* $OpenBSD: _types.h,v 1.3 2007/05/07 18:42:12 kettenis Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -132,6 +132,7 @@ typedef struct label_t { #define __SWAP_BROKEN /* Feature test macros */ +#define __HAVE_CPUINFO #define __HAVE_TIMECOUNTER #endif /* _MIPS64__TYPES_H_ */ diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h index d75a77876b3..99b41598cd0 100644 --- a/sys/arch/mips64/include/cpu.h +++ b/sys/arch/mips64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.17 2007/05/03 19:34:00 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.18 2007/05/07 18:42:12 kettenis Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -330,6 +330,26 @@ #define cpu_wait(p) /* nothing */ #ifndef _LOCORE + +#include + +struct cpu_info { + struct schedstate_percpu ci_schedstate; + + struct proc *ci_curproc; +}; + +extern struct cpu_info cpu_info_primary; + +#define curcpu() (&cpu_info_primary) + +#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 + #include /* * Arguments to hardclock and gatherstats encapsulate the previous diff --git a/sys/arch/mips64/mips64/context.S b/sys/arch/mips64/mips64/context.S index 0e51e44efb9..795c3ae46a2 100644 --- a/sys/arch/mips64/mips64/context.S +++ b/sys/arch/mips64/mips64/context.S @@ -1,4 +1,4 @@ -/* $OpenBSD: context.S,v 1.9 2005/12/20 07:06:26 miod Exp $ */ +/* $OpenBSD: context.S,v 1.10 2007/05/07 18:42:13 kettenis Exp $ */ /* * Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -38,6 +38,8 @@ #include "assym.h" +#define curproc (cpu_info_primary + CI_CURPROC) + .set mips3 .set noreorder # Noreorder is default style! diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c index eedf4851f45..bdb54f76fec 100644 --- a/sys/arch/mips64/mips64/cpu.c +++ b/sys/arch/mips64/mips64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.9 2004/09/21 05:51:15 miod Exp $ */ +/* $OpenBSD: cpu.c,v 1.10 2007/05/07 18:42:13 kettenis Exp $ */ /* * Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se) @@ -39,6 +39,8 @@ int cpumatch(struct device *, void *, void *); void cpuattach(struct device *, struct device *, void *); +struct cpu_info cpu_info_primary; + u_int CpuPrimaryInstCacheSize; u_int CpuPrimaryInstCacheLSize; u_int CpuPrimaryInstSetSize; diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c index 61ceccf200c..3dd6ecc4154 100644 --- a/sys/arch/mips64/mips64/interrupt.c +++ b/sys/arch/mips64/mips64/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.24 2007/03/23 21:07:38 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.25 2007/05/07 18:42:13 kettenis Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -277,7 +277,7 @@ softintr() while ((sig = CURSIG(p)) != 0) /* take pending signals */ 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/mips64/mips64/lcore_float.S b/sys/arch/mips64/mips64/lcore_float.S index 3d727e0d309..54c0a619a02 100644 --- a/sys/arch/mips64/mips64/lcore_float.S +++ b/sys/arch/mips64/mips64/lcore_float.S @@ -1,4 +1,4 @@ -/* $OpenBSD: lcore_float.S,v 1.12 2007/04/26 17:04:32 miod Exp $ */ +/* $OpenBSD: lcore_float.S,v 1.13 2007/05/07 18:42:13 kettenis Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -38,6 +38,8 @@ #include "assym.h" +#define curproc (cpu_info_primary + CI_CURPROC) + .set noreorder # Noreorder is default style! .set mips3 diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index c96e5b81df7..9cd0126dbc3 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.33 2007/05/03 19:34:00 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.34 2007/05/07 18:42:13 kettenis Exp $ */ /* tracked to 1.23 */ /* @@ -166,7 +166,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; } /* -- cgit v1.2.3