diff options
author | Martin Reindl <martin@cvs.openbsd.org> | 2007-04-12 14:38:37 +0000 |
---|---|---|
committer | Martin Reindl <martin@cvs.openbsd.org> | 2007-04-12 14:38:37 +0000 |
commit | 9503c81a3321b794f811dbe2280d39669517a6db (patch) | |
tree | 4add1a37db74671d3a67a926c81d84540087bc79 | |
parent | 9407dab3911388de6f96515d7c55e7c3d8a85d20 (diff) |
__HAVE_CPUINFO for alpha, with bits from netbsd
ok miod@
-rw-r--r-- | sys/arch/alpha/alpha/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/alpha/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/alpha/include/cpu.h | 11 | ||||
-rw-r--r-- | sys/arch/alpha/include/intr.h | 3 |
4 files changed, 16 insertions, 5 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index 36babce98c3..e04b558c7e8 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.53 2007/03/15 10:22:29 art Exp $ */ +/* $OpenBSD: trap.c,v 1.54 2007/04/12 14:38:36 martin Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -195,7 +195,7 @@ userret(struct proc *p) 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 DEBUG diff --git a/sys/arch/alpha/include/_types.h b/sys/arch/alpha/include/_types.h index a5cf64ba57e..eb1f22cd310 100644 --- a/sys/arch/alpha/include/_types.h +++ b/sys/arch/alpha/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.1 2006/01/06 18:50:08 millert Exp $ */ +/* $OpenBSD: _types.h,v 1.2 2007/04/12 14:38:36 martin Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -120,5 +120,6 @@ typedef void * __wctype_t; /* Feature test macros */ #define __HAVE_DEVICE_REGISTER +#define __HAVE_CPUINFO #endif /* _ALPHA__TYPES_H_ */ diff --git a/sys/arch/alpha/include/cpu.h b/sys/arch/alpha/include/cpu.h index 8f1dcfeeaca..4911e1e6cd5 100644 --- a/sys/arch/alpha/include/cpu.h +++ b/sys/arch/alpha/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.27 2007/03/15 10:22:29 art Exp $ */ +/* $OpenBSD: cpu.h,v 1.28 2007/04/12 14:38:36 martin Exp $ */ /* $NetBSD: cpu.h,v 1.45 2000/08/21 02:03:12 thorpej Exp $ */ /*- @@ -106,6 +106,7 @@ typedef union alpha_t_float { #include <machine/bus.h> #include <sys/device.h> +#include <sys/sched.h> struct pcb; struct proc; @@ -182,6 +183,7 @@ struct cpu_info { /* * Public members. */ + struct schedstate_percpu ci_schedstate; /* scheduler state */ #if defined(DIAGNOSTIC) || defined(LOCKDEBUG) u_long ci_spin_locks; /* # of spin locks held */ u_long ci_simple_locks; /* # of simple locks held */ @@ -189,6 +191,7 @@ struct cpu_info { struct proc *ci_curproc; /* current owner of the processor */ struct simplelock ci_slock; /* lock on this data structure */ cpuid_t ci_cpuid; /* our CPU ID */ + struct cpu_info *ci_next; /* * Private members. @@ -217,6 +220,11 @@ struct cpu_info { void fpusave_cpu(struct cpu_info *, int); void fpusave_proc(struct proc *, int); +#define CPU_INFO_UNIT(ci) ((ci)->ci_dev->dv_unit) +#define CPU_INFO_ITERATOR int +#define CPU_INFO_FOREACH(cii, ci) for (cii = 0, ci = curcpu(); \ + ci != NULL; ci = ci->ci_next) + #if defined(MULTIPROCESSOR) extern __volatile u_long cpus_running; extern __volatile u_long cpus_paused; @@ -233,6 +241,7 @@ void cpu_pause_resume_all(int); extern struct cpu_info cpu_info_store; #define curcpu() (&cpu_info_store) +#define CPU_IS_PRIMARY(ci) 1 #endif /* MULTIPROCESSOR */ #define curproc curcpu()->ci_curproc diff --git a/sys/arch/alpha/include/intr.h b/sys/arch/alpha/include/intr.h index 5fb16d23e34..6391372a4c8 100644 --- a/sys/arch/alpha/include/intr.h +++ b/sys/arch/alpha/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.23 2006/06/15 20:08:29 brad Exp $ */ +/* $OpenBSD: intr.h,v 1.24 2007/04/12 14:38:36 martin Exp $ */ /* $NetBSD: intr.h,v 1.26 2000/06/03 20:47:41 thorpej Exp $ */ /*- @@ -162,6 +162,7 @@ int _splraise(int); #define splhigh() _splraise(ALPHA_PSL_IPL_HIGH) #define spllpt() spltty() +#define splsched() splhigh() /* * Interprocessor interrupts. In order how we want them processed. |