Module Name: src
Committed By: matt
Date: Fri Jun 17 23:37:38 UTC 2011
Modified Files:
src/sys/arch/powerpc/marvell: marvell_intr.h
Log Message:
Part of the interrupt rototill. Use <powerpc/intr.h> and just override
a few things (like imask_t).
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/marvell/marvell_intr.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/powerpc/marvell/marvell_intr.h
diff -u src/sys/arch/powerpc/marvell/marvell_intr.h:1.17 src/sys/arch/powerpc/marvell/marvell_intr.h:1.18
--- src/sys/arch/powerpc/marvell/marvell_intr.h:1.17 Wed Apr 28 13:51:55 2010
+++ src/sys/arch/powerpc/marvell/marvell_intr.h Fri Jun 17 23:37:38 2011
@@ -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 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)
-
-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);
-}
+#define __IMASK_T uint64_t
+
+#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
-#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_ */