Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/marvell Part of the interrupt rototill. Us...
details: https://anonhg.NetBSD.org/src/rev/635bf1d02fdf
branches: trunk
changeset: 766180:635bf1d02fdf
user: matt <matt%NetBSD.org@localhost>
date: Fri Jun 17 23:37:38 2011 +0000
description:
Part of the interrupt rototill. Use <powerpc/intr.h> and just override
a few things (like imask_t).
diffstat:
sys/arch/powerpc/marvell/marvell_intr.h | 94 +++-----------------------------
1 files changed, 10 insertions(+), 84 deletions(-)
diffs (121 lines):
diff -r c8e0120dc28d -r 635bf1d02fdf sys/arch/powerpc/marvell/marvell_intr.h
--- a/sys/arch/powerpc/marvell/marvell_intr.h Fri Jun 17 23:36:17 2011 +0000
+++ b/sys/arch/powerpc/marvell/marvell_intr.h Fri Jun 17 23:37:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: marvell_intr.h,v 1.17 2010/04/28 13:51:55 kiyohara Exp $ */
+/* $NetBSD: marvell_intr.h,v 1.18 2011/06/17 23:37:38 matt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -32,94 +32,17 @@
#ifndef _POWERPC_MARVELL_INTR_H_
#define _POWERPC_MARVELL_INTR_H_
-void *intr_establish(int, int, int, int (*)(void *), void *);
-void intr_disestablish(void *);
-const char *intr_typename(int);
-void genppc_cpu_configure(void);
-
-/* Interrupt priority `levels'. */
-#define IPL_NONE 0 /* nothing */
-#define IPL_SOFTCLOCK 1 /* timeouts */
-#define IPL_SOFTBIO 2 /* block I/O */
-#define IPL_SOFTNET 3 /* protocol stacks */
-#define IPL_SOFTSERIAL 4 /* serial */
-#define IPL_VM 5 /* memory allocation */
-#define IPL_SCHED 6
-#define IPL_HIGH 7 /* everything */
-#define NIPL 8
-
-/* Interrupt sharing types. */
-#define IST_NONE 0 /* none */
-#define IST_PULSE 1 /* pulsed */
-#define IST_EDGE 2 /* edge-triggered */
-#define IST_LEVEL 3 /* level-triggered */
#ifndef _LOCORE
-/*
- * Interrupt handler chains. intr_establish() inserts a handler into
- * the list. The handler is called with its (single) argument.
- */
-struct intrhand {
- int (*ih_fun)(void *);
- void *ih_arg;
- struct intrhand *ih_next;
- int ih_level;
- int ih_irq;
-};
-int splraise(int);
-int spllower(int);
-void splx(int);
-void softintr(int);
-
-typedef uint64_t imask_t;
-extern imask_t imask[];
-
-#define NVIRQ 64 /* 64 virtual IRQs */
-#define NIRQ 128 /* up to 128 HW IRQs */
-
-#define HWIRQ_MAX (NVIRQ - 4 - 1)
-#define HWIRQ_MASK 0x0ffffffffffffffeULL
-
-/* Soft interrupt masks. */
-#define SIR_CLOCK 60
-#define SIR_BIO 61
-#define SIR_NET 62
-#define SIR_SERIAL 63
-#define SPL_CLOCK 0
+#define __IMASK_T uint64_t
-#define MS_PENDING(p) (((p) & (1 << SPL_CLOCK)) ? SPL_CLOCK : \
- (((p) & (0xffffffffULL << 32)) ? \
- 63 - cntlzw((p) >> 32) : \
- 32 - cntlzw((p) & 0xffffffff)))
-
-#define setsoftclock() softintr(SIR_CLOCK)
-#define setsoftbio() softintr(SIR_BIO)
-#define setsoftnet() softintr(SIR_NET)
-#define setsoftserial() softintr(SIR_SERIAL)
-
-#define spl0() spllower(0)
+#if 0
+#define PIC_VIRQ_MS_PENDING(p) (((p) != (uint32_t)(p)) \
+ ? __builtin_clz((uint32_t((p) >> 32)) \
+ : 32 + __builtin_clz((uint32_t)(p)))
+#endif
-typedef int ipl_t;
-typedef struct {
- ipl_t _ipl;
-} ipl_cookie_t;
-
-static inline ipl_cookie_t
-makeiplcookie(ipl_t ipl)
-{
-
- return (ipl_cookie_t){._ipl = ipl};
-}
-
-static inline int
-splraiseipl(ipl_cookie_t icookie)
-{
-
- return splraise(icookie._ipl);
-}
-
-#include <sys/spl.h>
#define ICU_LEN (64 + 32) /* Main Interrupt(64) + GPIO(32) */
@@ -127,7 +50,10 @@
extern struct pic_ops *discovery_gpp_pic[4];
struct pic_ops *setup_discovery_pic(void);
struct pic_ops *setup_discovery_gpp_pic(void *, int);
+void genppc_cpu_configure(void);
#endif /* !_LOCORE */
+#include <powerpc/intr.h>
+
#endif /* _POWERPC_MARVELL_INTR_H_ */
Home |
Main Index |
Thread Index |
Old Index