Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Neither pci_dma64_available(), pci_probe_device(), ...
details: https://anonhg.NetBSD.org/src/rev/602547eedbf9
branches: trunk
changeset: 763823:602547eedbf9
user: dyoung <dyoung%NetBSD.org@localhost>
date: Mon Apr 04 20:37:44 2011 +0000
description:
Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.
For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:
Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.
siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.
slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.
viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.
While I'm here, make pci_mapreg_submap() static.
With these changes in place, I have tested the compilation of these
kernels:
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:
### evbmips-el GDIUM
nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop
### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'
### ia64 GENERIC
/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type
### sgimips GENERIC32_IP3x
crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
diffstat:
sys/arch/alpha/include/pci_machdep.h | 8 ++++----
sys/arch/alpha/pci/pci_1000.c | 8 ++++----
sys/arch/alpha/pci/pci_1000a.c | 8 ++++----
sys/arch/alpha/pci/pci_2100_a50.c | 9 +++++----
sys/arch/alpha/pci/pci_2100_a500.c | 13 +++++++------
sys/arch/alpha/pci/pci_550.c | 13 +++++++------
sys/arch/alpha/pci/pci_6600.c | 13 +++++++------
sys/arch/alpha/pci/pci_alphabook1.c | 10 ++++++----
sys/arch/alpha/pci/pci_axppci_33.c | 9 +++++----
sys/arch/alpha/pci/pci_eb164.c | 15 ++++++++-------
sys/arch/alpha/pci/pci_eb64plus.c | 8 ++++----
sys/arch/alpha/pci/pci_eb66.c | 8 ++++----
sys/arch/alpha/pci/pci_kn20aa.c | 8 ++++----
sys/arch/alpha/pci/pci_kn300.c | 8 ++++----
sys/arch/alpha/pci/pci_kn8ae.c | 8 ++++----
sys/arch/alpha/pci/pci_up1000.c | 17 +++++++++--------
sys/arch/alpha/pci/pciide_machdep.c | 7 ++++---
sys/arch/arc/include/pci_machdep.h | 4 ++--
sys/arch/arc/pci/necpb.c | 9 +++++----
sys/arch/arm/footbridge/footbridge_pci.c | 9 +++++----
sys/arch/arm/gemini/gemini_pci.c | 8 ++++----
sys/arch/arm/include/pci_machdep.h | 4 ++--
sys/arch/arm/marvell/pci_machdep.c | 9 +++++----
sys/arch/arm/s3c2xx0/s3c2800_pci.c | 9 +++++----
sys/arch/arm/xscale/becc_pci.c | 8 ++++----
sys/arch/atari/include/pci_machdep.h | 5 +++--
sys/arch/atari/pci/pci_machdep.c | 6 +++---
sys/arch/atari/pci/pciide_machdep.c | 7 ++++---
sys/arch/cats/pci/pciide_machdep.c | 7 ++++---
sys/arch/cobalt/include/pci_machdep.h | 5 +++--
sys/arch/cobalt/pci/pci_machdep.c | 6 +++---
sys/arch/cobalt/pci/pciide_machdep.c | 6 +++---
sys/arch/evbarm/cp3100/cp3100_pci.c | 9 +++++----
sys/arch/evbarm/hdl_g/hdlg_pci.c | 8 ++++----
sys/arch/evbarm/ifpga/ifpga_pci.c | 8 ++++----
sys/arch/evbarm/iq31244/iq31244_pci.c | 9 +++++----
sys/arch/evbarm/iq80310/iq80310_pci.c | 11 ++++++-----
sys/arch/evbarm/iq80321/iq80321_pci.c | 9 +++++----
sys/arch/evbarm/ixdp425/ixdp425_pci.c | 9 +++++----
sys/arch/evbarm/ixm1200/ixm1200_pci.c | 8 ++++----
40 files changed, 183 insertions(+), 160 deletions(-)
diffs (truncated from 1422 to 300 lines):
diff -r 9ab882c1df3d -r 602547eedbf9 sys/arch/alpha/include/pci_machdep.h
--- a/sys/arch/alpha/include/pci_machdep.h Mon Apr 04 20:01:14 2011 +0000
+++ b/sys/arch/alpha/include/pci_machdep.h Mon Apr 04 20:37:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.12 2005/12/11 12:16:16 christos Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.13 2011/04/04 20:37:44 dyoung Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@@ -60,7 +60,7 @@
void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t);
void *pc_intr_v;
- int (*pc_intr_map)(struct pci_attach_args *,
+ int (*pc_intr_map)(const struct pci_attach_args *,
pci_intr_handle_t *);
const char *(*pc_intr_string)(void *, pci_intr_handle_t);
const struct evcnt *(*pc_intr_evcnt)(void *, pci_intr_handle_t);
@@ -69,8 +69,8 @@
void (*pc_intr_disestablish)(void *, void *);
void *(*pc_pciide_compat_intr_establish)(void *,
- struct device *, struct pci_attach_args *, int,
- int (*)(void *), void *);
+ struct device *, const struct pci_attach_args *,
+ int, int (*)(void *), void *);
};
/*
diff -r 9ab882c1df3d -r 602547eedbf9 sys/arch/alpha/pci/pci_1000.c
--- a/sys/arch/alpha/pci/pci_1000.c Mon Apr 04 20:01:14 2011 +0000
+++ b/sys/arch/alpha/pci/pci_1000.c Mon Apr 04 20:37:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_1000.c,v 1.22 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: pci_1000.c,v 1.23 2011/04/04 20:37:44 dyoung Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pci_1000.c,v 1.22 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_1000.c,v 1.23 2011/04/04 20:37:44 dyoung Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -86,7 +86,7 @@
static bus_space_tag_t another_mystery_icu_iot;
static bus_space_handle_t another_mystery_icu_ioh;
-int dec_1000_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
+int dec_1000_intr_map(const struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_1000_intr_string(void *, pci_intr_handle_t);
const struct evcnt *dec_1000_intr_evcnt(void *, pci_intr_handle_t);
void *dec_1000_intr_establish(void *, pci_intr_handle_t,
@@ -144,7 +144,7 @@
}
int
-dec_1000_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+dec_1000_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
pcitag_t bustag = pa->pa_intrtag;
int buspin = pa->pa_intrpin;
diff -r 9ab882c1df3d -r 602547eedbf9 sys/arch/alpha/pci/pci_1000a.c
--- a/sys/arch/alpha/pci/pci_1000a.c Mon Apr 04 20:01:14 2011 +0000
+++ b/sys/arch/alpha/pci/pci_1000a.c Mon Apr 04 20:37:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_1000a.c,v 1.24 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: pci_1000a.c,v 1.25 2011/04/04 20:37:44 dyoung Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pci_1000a.c,v 1.24 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_1000a.c,v 1.25 2011/04/04 20:37:44 dyoung Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -92,7 +92,7 @@
static bus_space_tag_t mystery_icu_iot;
static bus_space_handle_t mystery_icu_ioh[2];
-int dec_1000a_intr_map(struct pci_attach_args *,
+int dec_1000a_intr_map(const struct pci_attach_args *,
pci_intr_handle_t *);
const char *dec_1000a_intr_string(void *, pci_intr_handle_t);
const struct evcnt *dec_1000a_intr_evcnt(void *, pci_intr_handle_t);
@@ -148,7 +148,7 @@
}
int
-dec_1000a_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+dec_1000a_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
pcitag_t bustag = pa->pa_intrtag;
int buspin = pa->pa_intrpin;
diff -r 9ab882c1df3d -r 602547eedbf9 sys/arch/alpha/pci/pci_2100_a50.c
--- a/sys/arch/alpha/pci/pci_2100_a50.c Mon Apr 04 20:01:14 2011 +0000
+++ b/sys/arch/alpha/pci/pci_2100_a50.c Mon Apr 04 20:37:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_2100_a50.c,v 1.37 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: pci_2100_a50.c,v 1.38 2011/04/04 20:37:44 dyoung Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.37 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.38 2011/04/04 20:37:44 dyoung Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -54,7 +54,8 @@
#include "sio.h"
-int dec_2100_a50_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
+int dec_2100_a50_intr_map(const struct pci_attach_args *,
+ pci_intr_handle_t *);
const char *dec_2100_a50_intr_string(void *, pci_intr_handle_t);
const struct evcnt *dec_2100_a50_intr_evcnt(void *, pci_intr_handle_t);
void *dec_2100_a50_intr_establish(void *, pci_intr_handle_t,
@@ -96,7 +97,7 @@
}
int
-dec_2100_a50_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+dec_2100_a50_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
pcitag_t bustag = pa->pa_intrtag;
int buspin = pa->pa_intrpin;
diff -r 9ab882c1df3d -r 602547eedbf9 sys/arch/alpha/pci/pci_2100_a500.c
--- a/sys/arch/alpha/pci/pci_2100_a500.c Mon Apr 04 20:01:14 2011 +0000
+++ b/sys/arch/alpha/pci/pci_2100_a500.c Mon Apr 04 20:37:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_2100_a500.c,v 1.9 2008/04/28 20:23:11 martin Exp $ */
+/* $NetBSD: pci_2100_a500.c,v 1.10 2011/04/04 20:37:44 dyoung Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pci_2100_a500.c,v 1.9 2008/04/28 20:23:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_2100_a500.c,v 1.10 2011/04/04 20:37:44 dyoung Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -60,10 +60,10 @@
static const int pic_slave_to_master[4] = { 1, 3, 4, 5 };
-int dec_2100_a500_pic_intr_map(struct pci_attach_args *,
+int dec_2100_a500_pic_intr_map(const struct pci_attach_args *,
pci_intr_handle_t *);
-int dec_2100_a500_icic_intr_map(struct pci_attach_args *,
+int dec_2100_a500_icic_intr_map(const struct pci_attach_args *,
pci_intr_handle_t *);
const char *dec_2100_a500_intr_string(void *, pci_intr_handle_t);
@@ -267,7 +267,7 @@
*****************************************************************************/
int
-dec_2100_a500_pic_intr_map(struct pci_attach_args *pa,
+dec_2100_a500_pic_intr_map(const struct pci_attach_args *pa,
pci_intr_handle_t *ihp)
{
/*
@@ -368,7 +368,8 @@
}
int
-dec_2100_a500_icic_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+dec_2100_a500_icic_intr_map(const struct pci_attach_args *pa,
+ pci_intr_handle_t *ihp)
{
pcitag_t bustag = pa->pa_intrtag;
int buspin = pa->pa_intrpin;
diff -r 9ab882c1df3d -r 602547eedbf9 sys/arch/alpha/pci/pci_550.c
--- a/sys/arch/alpha/pci/pci_550.c Mon Apr 04 20:01:14 2011 +0000
+++ b/sys/arch/alpha/pci/pci_550.c Mon Apr 04 20:37:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_550.c,v 1.33 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: pci_550.c,v 1.34 2011/04/04 20:37:44 dyoung Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pci_550.c,v 1.33 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_550.c,v 1.34 2011/04/04 20:37:44 dyoung Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -88,7 +88,7 @@
#include <alpha/pci/siovar.h>
#endif
-int dec_550_intr_map(struct pci_attach_args *,
+int dec_550_intr_map(const struct pci_attach_args *,
pci_intr_handle_t *);
const char *dec_550_intr_string(void *, pci_intr_handle_t);
const struct evcnt *dec_550_intr_evcnt(void *, pci_intr_handle_t);
@@ -97,7 +97,7 @@
void dec_550_intr_disestablish(void *, void *);
void *dec_550_pciide_compat_intr_establish(void *, struct device *,
- struct pci_attach_args *, int, int (*)(void *), void *);
+ const struct pci_attach_args *, int, int (*)(void *), void *);
#define DEC_550_PCI_IRQ_BEGIN 8
#define DEC_550_MAX_IRQ (64 - DEC_550_PCI_IRQ_BEGIN)
@@ -168,7 +168,7 @@
}
int
-dec_550_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+dec_550_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
pcitag_t bustag = pa->pa_intrtag;
int buspin = pa->pa_intrpin, line = pa->pa_intrline;
@@ -350,7 +350,8 @@
}
void *
-dec_550_pciide_compat_intr_establish(void *v, struct device *dev, struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
+dec_550_pciide_compat_intr_establish(void *v, struct device *dev,
+ const struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
{
pci_chipset_tag_t pc = pa->pa_pc;
void *cookie = NULL;
diff -r 9ab882c1df3d -r 602547eedbf9 sys/arch/alpha/pci/pci_6600.c
--- a/sys/arch/alpha/pci/pci_6600.c Mon Apr 04 20:01:14 2011 +0000
+++ b/sys/arch/alpha/pci/pci_6600.c Mon Apr 04 20:37:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_6600.c,v 1.20 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: pci_6600.c,v 1.21 2011/04/04 20:37:44 dyoung Exp $ */
/*-
* Copyright (c) 1999 by Ross Harvey. All rights reserved.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_6600.c,v 1.20 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_6600.c,v 1.21 2011/04/04 20:37:44 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -83,9 +83,9 @@
void *, pci_intr_handle_t, int, int (*func)(void *), void *);
const char *dec_6600_intr_string(void *, pci_intr_handle_t);
const struct evcnt *dec_6600_intr_evcnt(void *, pci_intr_handle_t);
-int dec_6600_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
+int dec_6600_intr_map(const struct pci_attach_args *, pci_intr_handle_t *);
void *dec_6600_pciide_compat_intr_establish(void *, struct device *,
- struct pci_attach_args *, int, int (*)(void *), void *);
+ const struct pci_attach_args *, int, int (*)(void *), void *);
struct alpha_shared_intr *dec_6600_pci_intr;
@@ -137,7 +137,7 @@
}
int
-dec_6600_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+dec_6600_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
pcitag_t bustag = pa->pa_intrtag;
int buspin = pa->pa_intrpin, line = pa->pa_intrline;
@@ -307,7 +307,8 @@
}
void *
-dec_6600_pciide_compat_intr_establish(void *v, struct device *dev, struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
+dec_6600_pciide_compat_intr_establish(void *v, struct device *dev,
+ const struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
{
pci_chipset_tag_t pc = pa->pa_pc;
void *cookie = NULL;
diff -r 9ab882c1df3d -r 602547eedbf9 sys/arch/alpha/pci/pci_alphabook1.c
--- a/sys/arch/alpha/pci/pci_alphabook1.c Mon Apr 04 20:01:14 2011 +0000
+++ b/sys/arch/alpha/pci/pci_alphabook1.c Mon Apr 04 20:37:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_alphabook1.c,v 1.14 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: pci_alphabook1.c,v 1.15 2011/04/04 20:37:44 dyoung Exp $ */
/*-
Home |
Main Index |
Thread Index |
Old Index