For ports that wire up pciide in compatibility mode, have

them define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
in pci_machdep.h and pciide_map_compat_intr() only calls
pciide_machdep_compat_intr_establish() if that preprocessor
define exists.

Ports that don't need to do this no longer need to supply a
dummy function.
This commit is contained in:
simonb 2001-06-08 04:48:54 +00:00
parent 9a3de71872
commit e5bd00e48d
16 changed files with 31 additions and 285 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.h,v 1.1 2001/05/28 16:22:19 thorpej Exp $ */
/* $NetBSD: pci_machdep.h,v 1.2 2001/06/08 04:48:56 simonb Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@ -30,6 +30,7 @@
/*
* Machine-specific definitions for PCI autoconfiguration.
*/
#define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
/*
* Types provided to machine-independent PCI code

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.h,v 1.6 2000/12/28 22:59:06 sommerfeld Exp $ */
/* $NetBSD: pci_machdep.h,v 1.7 2001/06/08 04:48:56 simonb Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@ -30,6 +30,7 @@
/*
* Machine-specific definitions for PCI autoconfiguration.
*/
#define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
/*
* Types provided to machine-independent PCI code

View File

@ -1,4 +1,4 @@
# $NetBSD: files.arc,v 1.30 2001/05/22 03:22:49 soda Exp $
# $NetBSD: files.arc,v 1.31 2001/06/08 04:48:56 simonb Exp $
# $OpenBSD: files.arc,v 1.21 1999/09/11 10:20:20 niklas Exp $
#
# maxpartitions must be first item in files.${ARCH}
@ -156,8 +156,6 @@ define pcmcia {} # XXX dummy decl...
include "dev/pci/files.pci"
include "dev/isa/files.isa"
file arch/arc/pci/pciide_machdep.c pciide
# Real time clock, must have one..
device aclock
attach aclock at jazzio with aclock_jazzio

View File

@ -1,70 +0,0 @@
/* $NetBSD: pciide_machdep.c,v 1.1 2000/06/09 05:42:02 soda Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* PCI IDE controller driver (ARC machine-dependent portion).
*
* Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
* sys/dev/pci/ppb.c, revision 1.16).
*
* See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
* PCI SIG.
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.1 2000/06/09 05:42:02 soda Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pciidereg.h>
#include <dev/pci/pciidevar.h>
void *
pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg)
struct device *dev;
struct pci_attach_args *pa;
int chan;
int (*func) __P((void *));
void *arg;
{
/*
* The PCI IDE on the ARC is never wired to compatibility
* mode. This place holder simply returns a NULL interrupt cookie.
* It is necessary for the PCI IDE driver to link.
*/
return (NULL);
}

View File

@ -1,3 +1,5 @@
/* $NetBSD: pci_machdep.h,v 1.8 2001/02/23 21:23:51 reinoud Exp $ */
/* $NetBSD: pci_machdep.h,v 1.9 2001/06/08 04:48:56 simonb Exp $ */
#include <arm/pci_machdep.h>
#define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.h,v 1.7 2000/12/28 22:59:08 sommerfeld Exp $ */
/* $NetBSD: pci_machdep.h,v 1.8 2001/06/08 04:48:57 simonb Exp $ */
/*
* Copyright (c) 1996 Leo Weppelman. All rights reserved.
@ -36,6 +36,11 @@
#include <atari/atari/intr.h>
/*
* Machine-specific definitions for PCI autoconfiguration.
*/
#define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
/*
* Forward declarations.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.h,v 1.3 2000/12/28 22:59:09 sommerfeld Exp $ */
/* $NetBSD: pci_machdep.h,v 1.4 2001/06/08 04:48:57 simonb Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -33,6 +33,7 @@
/*
* Machine-specific definitions for PCI autoconfiguration.
*/
#define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
/*
* Forward declarations.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.h,v 1.16 2000/12/28 22:59:09 sommerfeld Exp $ */
/* $NetBSD: pci_machdep.h,v 1.17 2001/06/08 04:48:57 simonb Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -33,6 +33,7 @@
/*
* Machine-specific definitions for PCI autoconfiguration.
*/
#define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
/*
* Many i386 PCI systems only work properly with I/O mapped space, in

View File

@ -1,4 +1,4 @@
# $NetBSD: files.macppc,v 1.42 2001/05/16 10:56:43 tsubai Exp $
# $NetBSD: files.macppc,v 1.43 2001/06/08 04:48:57 simonb Exp $
#
# macppc-specific configuration info
@ -99,8 +99,6 @@ file arch/macppc/pci/uninorth.c uninorth
# PCI bus support
include "dev/pci/files.pci"
file arch/macppc/pci/pciide_machdep.c pciide
# network devices MII bus
include "dev/mii/files.mii"

View File

@ -1,70 +0,0 @@
/* $NetBSD: pciide_machdep.c,v 1.3 1999/11/15 23:52:07 wrstuden Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* PCI IDE controller driver (Power Macintosh machine-dependent portion).
*
* Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
* sys/dev/pci/ppb.c, revision 1.16).
*
* See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
* PCI SIG.
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.3 1999/11/15 23:52:07 wrstuden Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pciidereg.h>
#include <dev/pci/pciidevar.h>
void *
pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg)
struct device *dev;
struct pci_attach_args *pa;
int chan;
int (*func) __P((void *));
void *arg;
{
/*
* The PCI IDE on the Power Macintosh is never wired to compatibility
* mode. This place holder simply returns a NULL interrupt cookie.
* It is necessary for the PCI IDE driver to link.
*/
return (NULL);
}

View File

@ -1,3 +1,5 @@
/* $NetBSD: pci_machdep.h,v 1.1 2001/04/19 07:11:03 matt Exp $ */
/* $NetBSD: pci_machdep.h,v 1.2 2001/06/08 04:48:58 simonb Exp $ */
#include <arm/pci_machdep.h>
#define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH

View File

@ -1,53 +0,0 @@
/* $NetBSD: pciide_machdep.c,v 1.1 2000/06/14 16:07:00 soren Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed for the
* NetBSD Project. See http://www.netbsd.org/ for
* information about NetBSD.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pciidereg.h>
#include <dev/pci/pciidevar.h>
void *
pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg)
struct device *dev;
struct pci_attach_args *pa;
int chan;
int (*func)(void *);
void *arg;
{
return NULL;
}

View File

@ -1,4 +1,4 @@
# $NetBSD: files.sparc64,v 1.47 2001/06/06 21:19:48 mrg Exp $
# $NetBSD: files.sparc64,v 1.48 2001/06/08 04:48:58 simonb Exp $
# @(#)files.sparc64 8.1 (Berkeley) 7/19/93
# sparc64-specific configuration info
@ -53,7 +53,6 @@ attach simba at pci
file arch/sparc64/dev/simba.c simba
include "dev/ata/files.ata"
file arch/sparc64/dev/pciide_machdep.c pciide
device ebus {[addr = -1]}: pcibus
attach ebus at pci

View File

@ -1,75 +0,0 @@
/* $NetBSD: pciide_machdep.c,v 1.2 1999/11/21 11:17:35 pk Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* PCI IDE controller driver (SUN4U machine-dependent portion).
*
* Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
* sys/dev/pci/ppb.c, revision 1.16).
*
* See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
* PCI SIG.
*/
/*
* this version copied from macppc:
* NetBSD: pciide_machdep.c,v 1.2 1999/04/22 18:48:59 wrstuden Exp
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.2 1999/11/21 11:17:35 pk Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pciidereg.h>
#include <dev/pci/pciidevar.h>
void *
pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg)
struct device *dev;
struct pci_attach_args *pa;
int chan;
int (*func) __P((void *));
void *arg;
{
/*
* The PCI IDE on the sun4u is never wired to compatibility
* mode. This place holder simply returns a NULL interrupt cookie.
* It is necessary for the PCI IDE driver to link.
*/
return (NULL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pciide.c,v 1.118 2001/05/30 20:30:02 bouyer Exp $ */
/* $NetBSD: pciide.c,v 1.119 2001/06/08 04:48:58 simonb Exp $ */
/*
@ -1258,13 +1258,17 @@ pciide_map_compat_intr(pa, cp, compatchan, interface)
if ((interface & PCIIDE_INTERFACE_PCI(wdc_cp->channel)) != 0)
return;
#ifdef __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
cp->ih = pciide_machdep_compat_intr_establish(&sc->sc_wdcdev.sc_dev,
pa, compatchan, pciide_compat_intr, cp);
if (cp->ih == NULL) {
#endif
printf("%s: no compatibility interrupt for use by %s "
"channel\n", sc->sc_wdcdev.sc_dev.dv_xname, cp->name);
cp->hw_ok = 0;
#ifdef __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
}
#endif
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: pciidevar.h,v 1.6 2001/01/12 16:04:00 bouyer Exp $ */
/* $NetBSD: pciidevar.h,v 1.7 2001/06/08 04:48:58 simonb Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
@ -83,5 +83,7 @@ struct pciide_softc {
*/
/* Attach compat interrupt handler, returning handle or NULL if failed. */
#ifdef __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
void *pciide_machdep_compat_intr_establish __P((struct device *,
struct pci_attach_args *, int, int (*)(void *), void *));
#endif