diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2011-04-21 12:43:00 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2011-04-21 12:43:00 +0000 |
commit | 40346a005059aca0c6ca0ce88f878482abf555e6 (patch) | |
tree | a8520057ed18c56bee53318313452176e39fc658 /sys | |
parent | e65b0f906d0de328894d7c8450269227d90d1295 (diff) |
Move interrupt related defines and prototypes from cpu.h to intr.h.
ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa64/include/cpu.h | 73 | ||||
-rw-r--r-- | sys/arch/hppa64/include/intr.h | 63 |
2 files changed, 69 insertions, 67 deletions
diff --git a/sys/arch/hppa64/include/cpu.h b/sys/arch/hppa64/include/cpu.h index a452ddd7790..d35f3b0a954 100644 --- a/sys/arch/hppa64/include/cpu.h +++ b/sys/arch/hppa64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.24 2011/04/16 22:02:32 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.25 2011/04/21 12:42:59 jsing Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -70,49 +70,6 @@ #define HPPA_FPU_FORK(s) ((s) & ~((u_int64_t)(HPPA_FPU_XMASK)<<32)) #define HPPA_PMSFUS 0x20 /* ??? */ -/* - * Interrupts stuff - */ -#define CPU_NINTS 64 - -#define IPL_NONE 0 -#define IPL_SOFTCLOCK 1 -#define IPL_SOFTNET 2 -#define IPL_BIO 3 -#define IPL_NET 4 -#define IPL_SOFTTTY 5 -#define IPL_TTY 6 -#define IPL_VM 7 -#define IPL_AUDIO 8 -#define IPL_CLOCK 9 -#define IPL_STATCLOCK 10 -#define IPL_SCHED IPL_STATCLOCK -#define IPL_HIGH 11 - -#define NIPL 12 - -#define IST_NONE 0 -#define IST_PULSE 1 -#define IST_EDGE 2 -#define IST_LEVEL 3 - -#define splsoftclock() splraise(IPL_SOFTCLOCK) -#define splsoftnet() splraise(IPL_SOFTNET) -#define splbio() splraise(IPL_BIO) -#define splnet() splraise(IPL_NET) -#define splsofttty() splraise(IPL_SOFTTTY) -#define spltty() splraise(IPL_TTY) -#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) -#define splx(c) spllower(c) - -#define setsoftast() (astpending = 1) - #ifndef _LOCORE #include <sys/time.h> #include <sys/sched.h> @@ -155,7 +112,7 @@ struct cpu_info { }; struct cpu_info *curcpu(void); -#define cpu_number() (curcpu()->ci_number) +#define cpu_number() (curcpu()->ci_number) #define CPU_IS_PRIMARY(ci) ((ci)->ci_number == 0) #define CPU_INFO_ITERATOR int #define CPU_INFO_FOREACH(cii,ci) \ @@ -164,21 +121,6 @@ struct cpu_info *curcpu(void); #define MAXCPUS 1 #define cpu_unidle(ci) -#ifdef DIAGNOSTIC -void splassert_fail(int, int, const char *); -extern int splassert_ctl; -void splassert_check(int, const char *); -#define splassert(__wantipl) do { \ - if (splassert_ctl > 0) { \ - splassert_check(__wantipl, __func__); \ - } \ -} while (0) -#define splsoftassert(__wantipl) splassert(__wantipl) -#else -#define splassert(__wantipl) do { /* nada */ } while (0) -#define splsoftassert(__wantipl) do { /* nada */ } while (0) -#endif /* DIAGNOSTIC */ - /* types */ enum hppa_cpu_type { hpcxu, hpcxu2, hpcxw @@ -228,16 +170,13 @@ extern int want_resched, astpending; #define DELAY(x) delay(x) -int splraise(int cpl); -int spllower(int cpl); - void delay(u_int us); void hppa_init(paddr_t start); void trap(int type, struct trapframe *frame); -int spcopy(pa_space_t ssp, const void *src, - pa_space_t dsp, void *dst, size_t size); -int spstrcpy(pa_space_t ssp, const void *src, - pa_space_t dsp, void *dst, size_t size, size_t *rsize); +int spcopy(pa_space_t ssp, const void *src, pa_space_t dsp, void *dst, + size_t size); +int spstrcpy(pa_space_t ssp, const void *src, pa_space_t dsp, void *dst, + size_t size, size_t *rsize); int copy_on_fault(void); void switch_trampoline(void); int cpu_dumpsize(void); diff --git a/sys/arch/hppa64/include/intr.h b/sys/arch/hppa64/include/intr.h index 4d088f2925f..0dc9a7ffec9 100644 --- a/sys/arch/hppa64/include/intr.h +++ b/sys/arch/hppa64/include/intr.h @@ -17,6 +17,33 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +#define CPU_NINTS 64 + +#define NIPL 12 + +#define IPL_NONE 0 +#define IPL_SOFTCLOCK 1 +#define IPL_SOFTNET 2 +#define IPL_BIO 3 +#define IPL_NET 4 +#define IPL_SOFTTTY 5 +#define IPL_TTY 6 +#define IPL_VM 7 +#define IPL_AUDIO 8 +#define IPL_CLOCK 9 +#define IPL_STATCLOCK 10 +#define IPL_SCHED 10 +#define IPL_HIGH 10 +#define IPL_IPI 11 + +#define IST_NONE 0 +#define IST_PULSE 1 +#define IST_EDGE 2 +#define IST_LEVEL 3 + +#define SOFTINT_MASK ((1 << (IPL_SOFTCLOCK - 1)) | \ + (1 << (IPL_SOFTNET - 1)) | (1 << (IPL_SOFTTTY - 1))) + #if !defined(_LOCORE) && defined(_KERNEL) #define softintr(mask) atomic_setbits_long(&curcpu()->ci_ipending, mask) @@ -26,6 +53,42 @@ void cpu_intr(void *); void *softintr_establish(int, void (*)(void *), void *); void softintr_disestablish(void *); void softintr_schedule(void *); + +int splraise(int cpl); +int spllower(int cpl); + +#define splsoftclock() splraise(IPL_SOFTCLOCK) +#define splsoftnet() splraise(IPL_SOFTNET) +#define splbio() splraise(IPL_BIO) +#define splnet() splraise(IPL_NET) +#define splsofttty() splraise(IPL_SOFTTTY) +#define spltty() splraise(IPL_TTY) +#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) +#define splx(c) spllower(c) + +#define setsoftast() (astpending = 1) + +#ifdef DIAGNOSTIC +extern int splassert_ctl; +void splassert_fail(int, int, const char *); +void splassert_check(int, const char *); +#define splassert(__wantipl) do { \ + if (splassert_ctl > 0) { \ + splassert_check(__wantipl, __func__); \ + } \ +} while (0) +#define splsoftassert(__wantipl) splassert(__wantipl) +#else +#define splassert(__wantipl) do { /* nada */ } while (0) +#define splsoftassert(__wantipl) do { /* nada */ } while (0) +#endif /* DIAGNOSTIC */ + #endif #endif |