xref: /freebsd/sys/powerpc/include/intr_machdep.h (revision 6d2d7b8c0d17743d61c63a66ec0a29f18676282f)
160727d8bSWarner Losh /*-
2f6a7723dSBenno Rice  * Copyright (C) 2002 Benno Rice.
3f6a7723dSBenno Rice  * All rights reserved.
4f6a7723dSBenno Rice  *
5f6a7723dSBenno Rice  * Redistribution and use in source and binary forms, with or without
6f6a7723dSBenno Rice  * modification, are permitted provided that the following conditions
7f6a7723dSBenno Rice  * are met:
8f6a7723dSBenno Rice  * 1. Redistributions of source code must retain the above copyright
9f6a7723dSBenno Rice  *    notice, this list of conditions and the following disclaimer.
10f6a7723dSBenno Rice  * 2. Redistributions in binary form must reproduce the above copyright
11f6a7723dSBenno Rice  *    notice, this list of conditions and the following disclaimer in the
12f6a7723dSBenno Rice  *    documentation and/or other materials provided with the distribution.
13f6a7723dSBenno Rice  *
14f6a7723dSBenno Rice  * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR
15f6a7723dSBenno Rice  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16f6a7723dSBenno Rice  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17f6a7723dSBenno Rice  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18f6a7723dSBenno Rice  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19f6a7723dSBenno Rice  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20f6a7723dSBenno Rice  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21f6a7723dSBenno Rice  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22f6a7723dSBenno Rice  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23f6a7723dSBenno Rice  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24f6a7723dSBenno Rice  *
25f6a7723dSBenno Rice  * $FreeBSD$
26f6a7723dSBenno Rice  */
27f6a7723dSBenno Rice 
28f6a7723dSBenno Rice #ifndef	_MACHINE_INTR_MACHDEP_H_
29f6a7723dSBenno Rice #define	_MACHINE_INTR_MACHDEP_H_
30f6a7723dSBenno Rice 
3177d40ffdSMarcel Moolenaar #define	INTR_VECTORS	256
32*6d2d7b8cSMarcel Moolenaar 
33eaef5f0aSNathan Whitehorn #define	MAX_PICS		5
34*6d2d7b8cSMarcel Moolenaar #define	INTR_VEC(node, pin)	powerpc_get_irq(node, pin)
35f6a7723dSBenno Rice 
36ca2c1931SNathan Whitehorn /*
37ca2c1931SNathan Whitehorn  * Default base address for MSI messages on PowerPC
38ca2c1931SNathan Whitehorn  */
39ca2c1931SNathan Whitehorn #define	MSI_INTEL_ADDR_BASE		0xfee00000
40ca2c1931SNathan Whitehorn 
41eaef5f0aSNathan Whitehorn extern device_t root_pic;
42f6a7723dSBenno Rice 
4377d40ffdSMarcel Moolenaar struct trapframe;
44f6a7723dSBenno Rice 
4505c62b81SMarcel Moolenaar driver_filter_t powerpc_ipi_handler;
4605c62b81SMarcel Moolenaar 
47707c2fb9SAlexander Motin void	intrcnt_add(const char *name, u_long **countp);
48707c2fb9SAlexander Motin 
49*6d2d7b8cSMarcel Moolenaar void	powerpc_register_pic(device_t, uint32_t, u_int, u_int, u_int);
50*6d2d7b8cSMarcel Moolenaar u_int	powerpc_get_irq(uint32_t, u_int);
514f5d8660SMarcel Moolenaar 
5277d40ffdSMarcel Moolenaar void	powerpc_dispatch_intr(u_int, struct trapframe *);
5377d40ffdSMarcel Moolenaar int	powerpc_enable_intr(void);
54eaef5f0aSNathan Whitehorn int	powerpc_setup_intr(const char *, u_int, driver_filter_t, driver_intr_t,
55eaef5f0aSNathan Whitehorn 	    void *, enum intr_type, void **);
5677d40ffdSMarcel Moolenaar int	powerpc_teardown_intr(void *);
5708393b3eSNathan Whitehorn int	powerpc_bind_intr(u_int irq, u_char cpu);
58d6f59297SMarcel Moolenaar int	powerpc_config_intr(int, enum intr_trigger, enum intr_polarity);
59f6a7723dSBenno Rice 
60f6a7723dSBenno Rice #endif /* _MACHINE_INTR_MACHDEP_H_ */
61