Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src A pointer typedef entails trading too much flexibility to de...
details: https://anonhg.NetBSD.org/src/rev/5f9c0a258d00
branches: trunk
changeset: 752386:5f9c0a258d00
user: dyoung <dyoung%NetBSD.org@localhost>
date: Wed Feb 24 22:37:54 2010 +0000
description:
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
diffstat:
share/man/man9/pmf.9 | 20 ++--
sys/arch/i386/pci/elan520.c | 16 +-
sys/arch/i386/pci/piixpcib.c | 12 +-
sys/arch/mips/atheros/dev/if_ath_arbus.c | 6 +-
sys/arch/sparc/dev/fd.c | 8 +-
sys/arch/sparc64/dev/fdc.c | 8 +-
sys/arch/x86/pci/ichlpcib.c | 12 +-
sys/arch/x86/pci/pchb.c | 12 +-
sys/arch/x86/x86/cpu.c | 12 +-
sys/arch/x86/x86/x86_autoconf.c | 8 +-
sys/arch/xen/x86/cpu.c | 8 +-
sys/arch/zaurus/dev/zaudio.c | 12 +-
sys/arch/zaurus/dev/zkbd.c | 8 +-
sys/arch/zaurus/dev/zlcd.c | 12 +-
sys/arch/zaurus/dev/zssp.c | 8 +-
sys/arch/zaurus/dev/ztp.c | 12 +-
sys/dev/acpi/acpi.c | 12 +-
sys/dev/acpi/acpi_acad.c | 8 +-
sys/dev/acpi/acpi_bat.c | 8 +-
sys/dev/acpi/acpi_ec.c | 12 +-
sys/dev/acpi/acpi_lid.c | 8 +-
sys/dev/acpi/asus_acpi.c | 12 +-
sys/dev/acpi/dalb_acpi.c | 8 +-
sys/dev/acpi/hpqlb_acpi.c | 8 +-
sys/dev/acpi/sony_acpi.c | 12 +-
sys/dev/acpi/thinkpad_acpi.c | 8 +-
sys/dev/acpi/wmi_acpi.c | 12 +-
sys/dev/ata/ata.c | 12 +-
sys/dev/ata/wd.c | 8 +-
sys/dev/audio.c | 12 +-
sys/dev/cardbus/cardbus.c | 8 +-
sys/dev/cardbus/if_atw_cardbus.c | 12 +-
sys/dev/cardbus/if_rtw_cardbus.c | 12 +-
sys/dev/gpio/gpio.c | 8 +-
sys/dev/hpc/hpcfb.c | 12 +-
sys/dev/i2c/dbcool.c | 8 +-
sys/dev/i2c/dbcool_var.h | 8 +-
sys/dev/i2c/sdtemp.c | 12 +-
sys/dev/ic/aic79xx_osm.c | 12 +-
sys/dev/ic/aic7xxx_osm.c | 12 +-
sys/dev/ic/athvar.h | 4 +-
sys/dev/ic/atw.c | 6 +-
sys/dev/ic/atwvar.h | 8 +-
sys/dev/ic/bwi.c | 8 +-
sys/dev/ic/bwivar.h | 6 +-
sys/dev/ic/com.c | 8 +-
sys/dev/ic/comvar.h | 6 +-
sys/dev/ic/gem.c | 8 +-
sys/dev/ic/gemvar.h | 6 +-
sys/dev/ic/hpet.c | 8 +-
sys/dev/ic/ne2000.c | 8 +-
sys/dev/ic/ne2000var.h | 6 +-
sys/dev/ic/pckbc.c | 6 +-
sys/dev/ic/pckbcvar.h | 4 +-
sys/dev/ic/rtw.c | 8 +-
sys/dev/ic/rtwvar.h | 10 +-
sys/dev/ic/spic.c | 8 +-
sys/dev/ic/spicvar.h | 6 +-
sys/dev/isa/aps.c | 12 +-
sys/dev/isa/com_isa.c | 12 +-
sys/dev/isa/fd.c | 12 +-
sys/dev/isa/sbdsp.c | 8 +-
sys/dev/isa/ym.c | 12 +-
sys/dev/mii/mii_physubr.c | 6 +-
sys/dev/mii/miivar.h | 4 +-
sys/dev/mii/ukphy.c | 9 +-
sys/dev/pci/agp.c | 8 +-
sys/dev/pci/agp_i810.c | 8 +-
sys/dev/pci/agp_intel.c | 8 +-
sys/dev/pci/ahcisata_pci.c | 8 +-
sys/dev/pci/auacer.c | 8 +-
sys/dev/pci/auich.c | 8 +-
sys/dev/pci/auixp.c | 8 +-
sys/dev/pci/autri.c | 8 +-
sys/dev/pci/auvia.c | 8 +-
sys/dev/pci/azalia.c | 8 +-
sys/dev/pci/cs4280.c | 12 +-
sys/dev/pci/cs4281.c | 12 +-
sys/dev/pci/ehci_pci.c | 12 +-
sys/dev/pci/esa.c | 12 +-
sys/dev/pci/esm.c | 12 +-
sys/dev/pci/fwohci_pci.c | 12 +-
sys/dev/pci/gcscaudio.c | 8 +-
sys/dev/pci/hdaudio/hdaudio_afg.c | 12 +-
sys/dev/pci/hdaudio/hdaudio_pci.c | 8 +-
sys/dev/pci/if_age.c | 8 +-
sys/dev/pci/if_ath_pci.c | 8 +-
sys/dev/pci/if_atw_pci.c | 12 +-
sys/dev/pci/if_bce.c | 8 +-
sys/dev/pci/if_cas.c | 12 +-
sys/dev/pci/if_fxp_pci.c | 8 +-
sys/dev/pci/if_gem_pci.c | 12 +-
sys/dev/pci/if_iwn.c | 8 +-
sys/dev/pci/if_msk.c | 14 +-
sys/dev/pci/if_nfe.c | 8 +-
sys/dev/pci/if_rtw_pci.c | 8 +-
sys/dev/pci/if_sip.c | 14 +-
sys/dev/pci/if_sk.c | 16 +-
sys/dev/pci/if_vr.c | 8 +-
sys/dev/pci/if_wpi.c | 8 +-
sys/dev/pci/ixpide.c | 12 +-
sys/dev/pci/mvsata_pci.c | 8 +-
sys/dev/pci/neo.c | 6 +-
sys/dev/pci/pccbb.c | 12 +-
sys/dev/pci/pci.c | 8 +-
sys/dev/pci/piixide.c | 12 +-
sys/dev/pci/piixpm.c | 12 +-
sys/dev/pci/ppb.c | 12 +-
sys/dev/pci/siisata_pci.c | 8 +-
sys/dev/pci/uhci_pci.c | 8 +-
sys/dev/pci/vga_pci.c | 8 +-
sys/dev/pci/viaide.c | 12 +-
sys/dev/pci/yds.c | 8 +-
sys/dev/pckbport/pckbd.c | 8 +-
sys/dev/pckbport/pms.c | 12 +-
sys/dev/pcmcia/bt3c.c | 12 +-
sys/dev/pcmcia/btbc.c | 12 +-
sys/dev/sbus/dbri.c | 12 +-
sys/dev/sbus/p9100.c | 12 +-
sys/dev/scsipi/sd.c | 8 +-
sys/dev/sdmmc/sdhc.c | 8 +-
sys/dev/sdmmc/sdhcvar.h | 6 +-
sys/dev/usb/ehci.c | 8 +-
sys/dev/usb/ehcivar.h | 6 +-
sys/dev/usb/ohci.c | 8 +-
sys/dev/usb/ohcivar.h | 6 +-
sys/dev/usb/uhci.c | 8 +-
sys/dev/usb/uhcivar.h | 6 +-
sys/dev/wscons/wsdisplay.c | 8 +-
sys/dev/wscons/wskbd.c | 8 +-
sys/dev/wsfb/genfbvar.h | 8 +-
sys/external/bsd/drm/dist/bsd-core/i915_drv.c | 4 +-
sys/external/bsd/drm/dist/bsd-core/radeon_drv.c | 4 +-
sys/kern/kern_pmf.c | 109 ++++++++++++-----------
sys/kern/subr_autoconf.c | 28 +++---
sys/sys/device.h | 53 +++++-----
sys/sys/device_if.h | 4 +-
sys/sys/pmf.h | 56 ++++++------
138 files changed, 746 insertions(+), 743 deletions(-)
diffs (truncated from 5798 to 300 lines):
diff -r 113ed97021ed -r 5f9c0a258d00 share/man/man9/pmf.9
--- a/share/man/man9/pmf.9 Wed Feb 24 21:53:26 2010 +0000
+++ b/share/man/man9/pmf.9 Wed Feb 24 22:37:54 2010 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pmf.9,v 1.16 2010/01/26 22:35:11 jruoho Exp $
+.\" $NetBSD: pmf.9,v 1.17 2010/02/24 22:37:54 dyoung Exp $
.\"
.\" Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
.\" All rights reserved.
@@ -52,21 +52,21 @@
.Sh SYNOPSIS
.In sys/device.h
.Ft bool
-.Fn pmf_device_register "device_t dev" "bool (*suspend)(device_t dev, pmf_qual_t qual)" "bool (*resume)(device_t dev, pmf_qual_t qual)"
+.Fn pmf_device_register "device_t dev" "bool (*suspend)(device_t dev, const pmf_qual_t *qual)" "bool (*resume)(device_t dev, const pmf_qual_t *qual)"
.Ft bool
-.Fn pmf_device_register1 "device_t dev" "bool (*suspend)(device_t dev, pmf_qual_t qual)" "bool (*resume)(device_t dev, pmf_qual_t qual)" "bool (*shutdown)(device_t dev, int how)"
+.Fn pmf_device_register1 "device_t dev" "bool (*suspend)(device_t dev, const pmf_qual_t *qual)" "bool (*resume)(device_t dev, const pmf_qual_t *qual)" "bool (*shutdown)(device_t dev, int how)"
.Ft void
.Fn pmf_device_deregister "device_t dev"
.Ft bool
-.Fn pmf_device_suspend "device_t dev" "pmf_qual_t qual"
+.Fn pmf_device_suspend "device_t dev" "const pmf_qual_t *qual"
.Ft bool
-.Fn pmf_device_resume "device_t dev" "pmf_qual_t qual"
+.Fn pmf_device_resume "device_t dev" "const pmf_qual_t *qual"
.Ft bool
-.Fn pmf_device_recursive_suspend "device_t dev" "pmf_qual_t qual"
+.Fn pmf_device_recursive_suspend "device_t dev" "const pmf_qual_t *qual"
.Ft bool
-.Fn pmf_device_recursive_resume "device_t dev" "pmf_qual_t qual"
+.Fn pmf_device_recursive_resume "device_t dev" "const pmf_qual_t *qual"
.Ft bool
-.Fn pmf_device_subtree_resume "device_t dev" "pmf_qual_t qual"
+.Fn pmf_device_subtree_resume "device_t dev" "const pmf_qual_t *qual"
.Ft void
.Fn pmf_class_network_register "device_t dev" "struct ifnet *ifp"
.Ft bool
@@ -74,9 +74,9 @@
.Ft bool
.Fn pmf_class_display_register "device_t dev"
.Ft bool
-.Fn pmf_system_suspend "pmf_qual_t qual"
+.Fn pmf_system_suspend "const pmf_qual_t *qual"
.Ft bool
-.Fn pmf_system_resume "pmf_qual_t qual"
+.Fn pmf_system_resume "const pmf_qual_t *qual"
.Ft void
.Fn pmf_system_shutdown "int"
.Ft bool
diff -r 113ed97021ed -r 5f9c0a258d00 sys/arch/i386/pci/elan520.c
--- a/sys/arch/i386/pci/elan520.c Wed Feb 24 21:53:26 2010 +0000
+++ b/sys/arch/i386/pci/elan520.c Wed Feb 24 22:37:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: elan520.c,v 1.46 2010/01/08 19:45:28 dyoung Exp $ */
+/* $NetBSD: elan520.c,v 1.47 2010/02/24 22:37:55 dyoung Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: elan520.c,v 1.46 2010/01/08 19:45:28 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elan520.c,v 1.47 2010/02/24 22:37:55 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -847,7 +847,7 @@
}
static bool
-elansc_suspend(device_t dev, pmf_qual_t qual)
+elansc_suspend(device_t dev, const pmf_qual_t *qual)
{
bool rc;
struct elansc_softc *sc = device_private(dev);
@@ -861,7 +861,7 @@
}
static bool
-elansc_resume(device_t dev, pmf_qual_t qual)
+elansc_resume(device_t dev, const pmf_qual_t *qual)
{
struct elansc_softc *sc = device_private(dev);
@@ -947,7 +947,7 @@
}
static bool
-elanpex_resume(device_t self, pmf_qual_t qual)
+elanpex_resume(device_t self, const pmf_qual_t *qual)
{
struct elansc_softc *sc = device_private(device_parent(self));
@@ -956,7 +956,7 @@
}
static bool
-elanpex_suspend(device_t self, pmf_qual_t qual)
+elanpex_suspend(device_t self, const pmf_qual_t *qual)
{
struct elansc_softc *sc = device_private(device_parent(self));
@@ -966,7 +966,7 @@
}
static bool
-elanpar_resume(device_t self, pmf_qual_t qual)
+elanpar_resume(device_t self, const pmf_qual_t *qual)
{
struct elansc_softc *sc = device_private(device_parent(self));
@@ -975,7 +975,7 @@
}
static bool
-elanpar_suspend(device_t self, pmf_qual_t qual)
+elanpar_suspend(device_t self, const pmf_qual_t *qual)
{
struct elansc_softc *sc = device_private(device_parent(self));
diff -r 113ed97021ed -r 5f9c0a258d00 sys/arch/i386/pci/piixpcib.c
--- a/sys/arch/i386/pci/piixpcib.c Wed Feb 24 21:53:26 2010 +0000
+++ b/sys/arch/i386/pci/piixpcib.c Wed Feb 24 22:37:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpcib.c,v 1.17 2010/01/08 19:45:28 dyoung Exp $ */
+/* $NetBSD: piixpcib.c,v 1.18 2010/02/24 22:37:55 dyoung Exp $ */
/*-
* Copyright (c) 2004, 2006 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: piixpcib.c,v 1.17 2010/01/08 19:45:28 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpcib.c,v 1.18 2010/02/24 22:37:55 dyoung Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -79,8 +79,8 @@
static int piixpcibmatch(device_t, cfdata_t, void *);
static void piixpcibattach(device_t, device_t, void *);
-static bool piixpcib_suspend(device_t, pmf_qual_t);
-static bool piixpcib_resume(device_t, pmf_qual_t);
+static bool piixpcib_suspend(device_t, const pmf_qual_t *);
+static bool piixpcib_resume(device_t, const pmf_qual_t *);
static void speedstep_configure(struct piixpcib_softc *,
struct pci_attach_args *);
@@ -144,7 +144,7 @@
}
static bool
-piixpcib_suspend(device_t dv, pmf_qual_t qual)
+piixpcib_suspend(device_t dv, const pmf_qual_t *qual)
{
struct piixpcib_softc *sc = device_private(dv);
@@ -160,7 +160,7 @@
}
static bool
-piixpcib_resume(device_t dv, pmf_qual_t qual)
+piixpcib_resume(device_t dv, const pmf_qual_t *qual)
{
struct piixpcib_softc *sc = device_private(dv);
diff -r 113ed97021ed -r 5f9c0a258d00 sys/arch/mips/atheros/dev/if_ath_arbus.c
--- a/sys/arch/mips/atheros/dev/if_ath_arbus.c Wed Feb 24 21:53:26 2010 +0000
+++ b/sys/arch/mips/atheros/dev/if_ath_arbus.c Wed Feb 24 22:37:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ath_arbus.c,v 1.17 2010/01/08 19:49:13 dyoung Exp $ */
+/* $NetBSD: if_ath_arbus.c,v 1.18 2010/02/24 22:37:55 dyoung Exp $ */
/*-
* Copyright (c) 2006 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_arbus.c,v 1.17 2010/01/08 19:49:13 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_arbus.c,v 1.18 2010/02/24 22:37:55 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -96,7 +96,7 @@
}
static bool
-ath_arbus_resume(device_t dv, pmf_qual_t qual)
+ath_arbus_resume(device_t dv, const pmf_qual_t *qual)
{
struct ath_arbus_softc *asc = device_private(dv);
ath_resume(&asc->sc_ath);
diff -r 113ed97021ed -r 5f9c0a258d00 sys/arch/sparc/dev/fd.c
--- a/sys/arch/sparc/dev/fd.c Wed Feb 24 21:53:26 2010 +0000
+++ b/sys/arch/sparc/dev/fd.c Wed Feb 24 22:37:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.148 2010/01/08 19:49:13 dyoung Exp $ */
+/* $NetBSD: fd.c,v 1.149 2010/02/24 22:37:55 dyoung Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.148 2010/01/08 19:49:13 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.149 2010/02/24 22:37:55 dyoung Exp $");
#include "opt_ddb.h"
#include "opt_md.h"
@@ -292,7 +292,7 @@
int fdmatch(struct device *, struct cfdata *, void *);
void fdattach(struct device *, struct device *, void *);
bool fdshutdown(device_t, int);
-bool fdsuspend(device_t, pmf_qual_t);
+bool fdsuspend(device_t, const pmf_qual_t *);
CFATTACH_DECL(fd, sizeof(struct fd_softc),
fdmatch, fdattach, NULL, NULL);
@@ -809,7 +809,7 @@
return true;
}
-bool fdsuspend(device_t self, pmf_qual_t qual)
+bool fdsuspend(device_t self, const pmf_qual_t *qual)
{
return fdshutdown(self, boothowto);
diff -r 113ed97021ed -r 5f9c0a258d00 sys/arch/sparc64/dev/fdc.c
--- a/sys/arch/sparc64/dev/fdc.c Wed Feb 24 21:53:26 2010 +0000
+++ b/sys/arch/sparc64/dev/fdc.c Wed Feb 24 22:37:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdc.c,v 1.32 2010/01/08 19:49:14 dyoung Exp $ */
+/* $NetBSD: fdc.c,v 1.33 2010/02/24 22:37:55 dyoung Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.32 2010/01/08 19:49:14 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.33 2010/02/24 22:37:55 dyoung Exp $");
#include "opt_ddb.h"
#include "opt_md.h"
@@ -324,7 +324,7 @@
int fdmatch(struct device *, struct cfdata *, void *);
void fdattach(struct device *, struct device *, void *);
bool fdshutdown(device_t, int);
-bool fdsuspend(device_t, pmf_qual_t);
+bool fdsuspend(device_t, const pmf_qual_t *);
CFATTACH_DECL(fd, sizeof(struct fd_softc),
fdmatch, fdattach, NULL, NULL);
@@ -979,7 +979,7 @@
return true;
}
-bool fdsuspend(device_t self, pmf_qual_t qual)
+bool fdsuspend(device_t self, const pmf_qual_t *qual)
{
return fdshutdown(self, boothowto);
diff -r 113ed97021ed -r 5f9c0a258d00 sys/arch/x86/pci/ichlpcib.c
--- a/sys/arch/x86/pci/ichlpcib.c Wed Feb 24 21:53:26 2010 +0000
+++ b/sys/arch/x86/pci/ichlpcib.c Wed Feb 24 22:37:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ichlpcib.c,v 1.23 2010/01/08 19:43:26 dyoung Exp $ */
+/* $NetBSD: ichlpcib.c,v 1.24 2010/02/24 22:37:55 dyoung Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.23 2010/01/08 19:43:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.24 2010/02/24 22:37:55 dyoung Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -123,8 +123,8 @@
static int lpcibdetach(device_t, int);
static void lpcibchilddet(device_t, device_t);
static int lpcibrescan(device_t, const char *, const int *);
-static bool lpcib_suspend(device_t, pmf_qual_t);
-static bool lpcib_resume(device_t, pmf_qual_t);
+static bool lpcib_suspend(device_t, const pmf_qual_t *);
+static bool lpcib_resume(device_t, const pmf_qual_t *);
static bool lpcib_shutdown(device_t, int);
static void pmtimer_configure(device_t);
@@ -414,7 +414,7 @@
}
Home |
Main Index |
Thread Index |
Old Index