diff options
author | Martin Reindl <martin@cvs.openbsd.org> | 2007-05-14 19:54:22 +0000 |
---|---|---|
committer | Martin Reindl <martin@cvs.openbsd.org> | 2007-05-14 19:54:22 +0000 |
commit | d5917096feb9ef17299adc90d0ba61fe531ea007 (patch) | |
tree | a782fb663fbdf24f5ef1539bcabf65a3c4ca9965 /sys | |
parent | 94f5c5f3b4032aa9030bf85e8b12faa4afdb5bbb (diff) |
move hppa to __HAVE_CPUINFO
input from miod@, ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/genassym.cf | 5 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/locore.S | 5 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/machdep.c | 3 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/hppa/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/hppa/include/cpu.h | 21 | ||||
-rw-r--r-- | sys/arch/hppa/include/intr.h | 3 | ||||
-rw-r--r-- | sys/lib/libkern/arch/hppa/bcopy.m4 | 6 |
8 files changed, 41 insertions, 9 deletions
diff --git a/sys/arch/hppa/hppa/genassym.cf b/sys/arch/hppa/hppa/genassym.cf index 2aab0926aef..8f4351a2877 100644 --- a/sys/arch/hppa/hppa/genassym.cf +++ b/sys/arch/hppa/hppa/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.29 2006/01/10 01:17:28 martin Exp $ +# $OpenBSD: genassym.cf,v 1.30 2007/05/14 19:54:21 martin Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -159,6 +159,9 @@ member page_idle_zero struct uvmexp member fpswtch +struct cpu_info +member ci_curproc + # system calls export SYSCALLGATE export SYS_exit diff --git a/sys/arch/hppa/hppa/locore.S b/sys/arch/hppa/hppa/locore.S index 64d50e2f208..27dba434bcd 100644 --- a/sys/arch/hppa/hppa/locore.S +++ b/sys/arch/hppa/hppa/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.152 2006/01/10 01:17:28 martin Exp $ */ +/* $OpenBSD: locore.S,v 1.153 2007/05/14 19:54:21 martin Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -93,6 +93,7 @@ .import bootdev, data .import esym, data .import curproc, data + .import cpu_info_primary, data .import want_resched, data .import virtual_avail, data .import proc0, data @@ -100,6 +101,8 @@ .import kpsw, data .import panic, code +#define curproc (cpu_info_primary + CI_CURPROC) + #define EMRG_STACKSIZE (1*NBPG) #define FPEMU_STACKSIZE (1*NBPG) diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index 751e2919af3..cb3fe60b1f5 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.151 2006/05/28 23:08:07 martin Exp $ */ +/* $OpenBSD: machdep.c,v 1.152 2007/05/14 19:54:21 martin Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -124,6 +124,7 @@ int dcache_stride, dcache_line_mask; */ volatile u_int8_t *machine_ledaddr; int machine_ledword, machine_leds; +struct cpu_info cpu_info_primary; /* * CPU params (should be the same for all cpus in the system) diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index cabcae3e572..e46657eae59 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.98 2007/03/15 10:22:29 art Exp $ */ +/* $OpenBSD: trap.c,v 1.99 2007/05/14 19:54:21 martin Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -148,7 +148,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; } void diff --git a/sys/arch/hppa/include/_types.h b/sys/arch/hppa/include/_types.h index ca78d3fbe2a..481795bf2fa 100644 --- a/sys/arch/hppa/include/_types.h +++ b/sys/arch/hppa/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.3 2007/05/05 12:00:55 miod Exp $ */ +/* $OpenBSD: _types.h,v 1.4 2007/05/14 19:54:21 martin Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -125,5 +125,6 @@ typedef void * __wctype_t; /* Feature test macros */ #define __HAVE_DEVICE_REGISTER #define __HAVE_MUTEX +#define __HAVE_CPUINFO #endif /* _HPPA__TYPES_H_ */ diff --git a/sys/arch/hppa/include/cpu.h b/sys/arch/hppa/include/cpu.h index 8ccf039327c..ab186368e29 100644 --- a/sys/arch/hppa/include/cpu.h +++ b/sys/arch/hppa/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.48 2007/03/15 10:22:29 art Exp $ */ +/* $OpenBSD: cpu.h,v 1.49 2007/05/14 19:54:21 martin Exp $ */ /* * Copyright (c) 2000-2004 Michael Shalayeff @@ -63,6 +63,25 @@ #define HPPA_FTRS_W32B 0x00000008 #ifndef _LOCORE +#include <sys/sched.h> + +struct cpu_info { + struct proc *ci_curproc; + + struct schedstate_percpu ci_schedstate; +}; + +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 + /* types */ enum hppa_cpu_type { hpcxs, hpcxt, hpcxta, hpcxl, hpcxl2, hpcxu, hpcxu2, hpcxw diff --git a/sys/arch/hppa/include/intr.h b/sys/arch/hppa/include/intr.h index 3ed7bccee0a..f7a82352d58 100644 --- a/sys/arch/hppa/include/intr.h +++ b/sys/arch/hppa/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.21 2007/04/26 20:52:48 miod Exp $ */ +/* $OpenBSD: intr.h,v 1.22 2007/05/14 19:54:21 martin Exp $ */ /* * Copyright (c) 2002-2004 Michael Shalayeff @@ -114,6 +114,7 @@ splx(int ncpl) #define splvm() splraise(IPL_VM) #define splaudio() splraise(IPL_AUDIO) #define splclock() splraise(IPL_CLOCK) +#define splsched() splraise(IPL_SCHED) #define splstatclock() splraise(IPL_STATCLOCK) #define splhigh() splraise(IPL_HIGH) #define spl0() spllower(IPL_NONE) diff --git a/sys/lib/libkern/arch/hppa/bcopy.m4 b/sys/lib/libkern/arch/hppa/bcopy.m4 index 8629af68272..8548813bce5 100644 --- a/sys/lib/libkern/arch/hppa/bcopy.m4 +++ b/sys/lib/libkern/arch/hppa/bcopy.m4 @@ -1,4 +1,4 @@ -define(_rcsid,``$OpenBSD: bcopy.m4,v 1.15 2005/08/01 12:10:26 miod Exp $'')dnl +define(_rcsid,``$OpenBSD: bcopy.m4,v 1.16 2007/05/14 19:54:21 martin Exp $'')dnl dnl dnl dnl This is the source file for bcopy.S, spcopy.S @@ -232,7 +232,11 @@ ifelse(NAME, `spcopy', * assumes that spaces do not clash, otherwise we lose */ .import curproc, data + .import cpu_info_primary, data .import copy_on_fault, code + +#define curproc (cpu_info_primary + CI_CURPROC) + LEAF_ENTRY(spcopy) ldw HPPA_FRAME_ARG(4)(sp), ret0 sub,<> r0, ret0, r0 |