openpicvar.h revision 285830
164562Sgshapiro/*- 2261194Sgshapiro * Copyright (C) 2002 Benno Rice. 364562Sgshapiro * All rights reserved. 464562Sgshapiro * 564562Sgshapiro * Redistribution and use in source and binary forms, with or without 664562Sgshapiro * modification, are permitted provided that the following conditions 764562Sgshapiro * are met: 864562Sgshapiro * 1. Redistributions of source code must retain the above copyright 964562Sgshapiro * notice, this list of conditions and the following disclaimer. 10266527Sgshapiro * 2. Redistributions in binary form must reproduce the above copyright 1164562Sgshapiro * notice, this list of conditions and the following disclaimer in the 1264562Sgshapiro * documentation and/or other materials provided with the distribution. 1364562Sgshapiro * 1464562Sgshapiro * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR 1564562Sgshapiro * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1664562Sgshapiro * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1764562Sgshapiro * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1864562Sgshapiro * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1964562Sgshapiro * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20132943Sgshapiro * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21203004Sgshapiro * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22203004Sgshapiro * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23203004Sgshapiro * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24203004Sgshapiro * 25203004Sgshapiro * $FreeBSD: releng/10.2/sys/powerpc/include/openpicvar.h 222813 2011-06-07 08:46:13Z attilio $ 26203004Sgshapiro */ 27203004Sgshapiro 28203004Sgshapiro#ifndef _POWERPC_OPENPICVAR_H_ 29132943Sgshapiro#define _POWERPC_OPENPICVAR_H_ 30132943Sgshapiro 31168515Sgshapiro#define OPENPIC_DEVSTR "OpenPIC Interrupt Controller" 32168515Sgshapiro 33168515Sgshapiro#define OPENPIC_IRQMAX 256 /* h/w allows more */ 34168515Sgshapiro 3594334Sgshapirostruct openpic_softc { 3690792Sgshapiro device_t sc_dev; 3790792Sgshapiro struct resource *sc_memr; 38132943Sgshapiro struct resource *sc_intr; 39132943Sgshapiro bus_space_tag_t sc_bt; 4064562Sgshapiro bus_space_handle_t sc_bh; 4164562Sgshapiro char *sc_version; 4264562Sgshapiro int sc_rid; 43132943Sgshapiro int sc_irq; 44132943Sgshapiro void *sc_icookie; 45132943Sgshapiro u_int sc_ncpu; 46363466Sgshapiro u_int sc_nirq; 47132943Sgshapiro int sc_psim; 4864562Sgshapiro}; 4964562Sgshapiro 50363466Sgshapiroextern devclass_t openpic_devclass; 5164562Sgshapiro 5264562Sgshapiro/* 5364562Sgshapiro * Bus-independent attach i/f 54168515Sgshapiro */ 5564562Sgshapiroint openpic_common_attach(device_t, uint32_t); 5664562Sgshapiro 5764562Sgshapiro/* 5864562Sgshapiro * PIC interface. 59168515Sgshapiro */ 60168515Sgshapirovoid openpic_bind(device_t dev, u_int irq, cpuset_t cpumask); 61363466Sgshapirovoid openpic_config(device_t, u_int, enum intr_trigger, enum intr_polarity); 6264562Sgshapirovoid openpic_dispatch(device_t, struct trapframe *); 6364562Sgshapirovoid openpic_enable(device_t, u_int, u_int); 6464562Sgshapirovoid openpic_eoi(device_t, u_int); 6564562Sgshapirovoid openpic_ipi(device_t, u_int); 6664562Sgshapirovoid openpic_mask(device_t, u_int); 6764562Sgshapirovoid openpic_unmask(device_t, u_int); 6864562Sgshapiro 6964562Sgshapiro#endif /* _POWERPC_OPENPICVAR_H_ */ 7064562Sgshapiro