diff options
author | bde <bde@FreeBSD.org> | 2000-04-30 10:01:56 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2000-04-30 10:01:56 +0000 |
commit | 2c5c997046c6e9a4b46da8c795733ef867dc7053 (patch) | |
tree | ae0bd2763d4f3ed2e02b85b96cbb170999920569 | |
parent | 8b471affb9f3b118378c27a18ddbeff7fccf2186 (diff) | |
download | FreeBSD-src-2c5c997046c6e9a4b46da8c795733ef867dc7053.zip FreeBSD-src-2c5c997046c6e9a4b46da8c795733ef867dc7053.tar.gz |
Fixed the type of some ivar access functions. Ivars have type uintptr_t,
not u_long. On i386's with 64-bit longs, returning u_longs indirectly
in (more than) the space reserved for uintptr_t's tended to corrupt the
previous frame pointer in the stack frame, so it was not easy to debug.
The type mismatches are hidden by the bogus cast in DEVMETHOD().
-rw-r--r-- | sys/dev/atkbdc/atkbdc_isa.c | 8 | ||||
-rw-r--r-- | sys/dev/atkbdc/atkbdc_subr.c | 8 | ||||
-rw-r--r-- | sys/dev/fdc/fdc.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/pci.c | 2 | ||||
-rw-r--r-- | sys/isa/atkbdc_isa.c | 8 | ||||
-rw-r--r-- | sys/isa/fd.c | 2 | ||||
-rw-r--r-- | sys/pci/pci.c | 2 | ||||
-rw-r--r-- | sys/pci/pcisupport.c | 2 |
8 files changed, 17 insertions, 17 deletions
diff --git a/sys/dev/atkbdc/atkbdc_isa.c b/sys/dev/atkbdc/atkbdc_isa.c index b5d5e00..246e274 100644 --- a/sys/dev/atkbdc/atkbdc_isa.c +++ b/sys/dev/atkbdc/atkbdc_isa.c @@ -62,9 +62,9 @@ static int atkbdc_probe(device_t dev); static int atkbdc_attach(device_t dev); static int atkbdc_print_child(device_t bus, device_t dev); static int atkbdc_read_ivar(device_t bus, device_t dev, int index, - u_long *val); + uintptr_t *val); static int atkbdc_write_ivar(device_t bus, device_t dev, int index, - u_long val); + uintptr_t val); static device_method_t atkbdc_methods[] = { DEVMETHOD(device_probe, atkbdc_probe), @@ -254,7 +254,7 @@ atkbdc_print_child(device_t bus, device_t dev) } static int -atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) +atkbdc_read_ivar(device_t bus, device_t dev, int index, uintptr_t *val) { atkbdc_device_t *ivar; @@ -285,7 +285,7 @@ atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) } static int -atkbdc_write_ivar(device_t bus, device_t dev, int index, u_long val) +atkbdc_write_ivar(device_t bus, device_t dev, int index, uintptr_t val) { atkbdc_device_t *ivar; diff --git a/sys/dev/atkbdc/atkbdc_subr.c b/sys/dev/atkbdc/atkbdc_subr.c index b5d5e00..246e274 100644 --- a/sys/dev/atkbdc/atkbdc_subr.c +++ b/sys/dev/atkbdc/atkbdc_subr.c @@ -62,9 +62,9 @@ static int atkbdc_probe(device_t dev); static int atkbdc_attach(device_t dev); static int atkbdc_print_child(device_t bus, device_t dev); static int atkbdc_read_ivar(device_t bus, device_t dev, int index, - u_long *val); + uintptr_t *val); static int atkbdc_write_ivar(device_t bus, device_t dev, int index, - u_long val); + uintptr_t val); static device_method_t atkbdc_methods[] = { DEVMETHOD(device_probe, atkbdc_probe), @@ -254,7 +254,7 @@ atkbdc_print_child(device_t bus, device_t dev) } static int -atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) +atkbdc_read_ivar(device_t bus, device_t dev, int index, uintptr_t *val) { atkbdc_device_t *ivar; @@ -285,7 +285,7 @@ atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) } static int -atkbdc_write_ivar(device_t bus, device_t dev, int index, u_long val) +atkbdc_write_ivar(device_t bus, device_t dev, int index, uintptr_t val) { atkbdc_device_t *ivar; diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index c1b02b1..cd4df13 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -660,7 +660,7 @@ static struct isa_pnp_id fdc_ids[] = { }; static int -fdc_read_ivar(device_t dev, device_t child, int which, u_long *result) +fdc_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct fdc_ivars *ivars = device_get_ivars(child); diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 23d9474..205fdfc 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1267,7 +1267,7 @@ pci_probe_nomatch(device_t dev, device_t child) } static int -pci_read_ivar(device_t dev, device_t child, int which, u_long *result) +pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct pci_devinfo *dinfo; pcicfgregs *cfg; diff --git a/sys/isa/atkbdc_isa.c b/sys/isa/atkbdc_isa.c index b5d5e00..246e274 100644 --- a/sys/isa/atkbdc_isa.c +++ b/sys/isa/atkbdc_isa.c @@ -62,9 +62,9 @@ static int atkbdc_probe(device_t dev); static int atkbdc_attach(device_t dev); static int atkbdc_print_child(device_t bus, device_t dev); static int atkbdc_read_ivar(device_t bus, device_t dev, int index, - u_long *val); + uintptr_t *val); static int atkbdc_write_ivar(device_t bus, device_t dev, int index, - u_long val); + uintptr_t val); static device_method_t atkbdc_methods[] = { DEVMETHOD(device_probe, atkbdc_probe), @@ -254,7 +254,7 @@ atkbdc_print_child(device_t bus, device_t dev) } static int -atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) +atkbdc_read_ivar(device_t bus, device_t dev, int index, uintptr_t *val) { atkbdc_device_t *ivar; @@ -285,7 +285,7 @@ atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) } static int -atkbdc_write_ivar(device_t bus, device_t dev, int index, u_long val) +atkbdc_write_ivar(device_t bus, device_t dev, int index, uintptr_t val) { atkbdc_device_t *ivar; diff --git a/sys/isa/fd.c b/sys/isa/fd.c index c1b02b1..cd4df13 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -660,7 +660,7 @@ static struct isa_pnp_id fdc_ids[] = { }; static int -fdc_read_ivar(device_t dev, device_t child, int which, u_long *result) +fdc_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct fdc_ivars *ivars = device_get_ivars(child); diff --git a/sys/pci/pci.c b/sys/pci/pci.c index 23d9474..205fdfc 100644 --- a/sys/pci/pci.c +++ b/sys/pci/pci.c @@ -1267,7 +1267,7 @@ pci_probe_nomatch(device_t dev, device_t child) } static int -pci_read_ivar(device_t dev, device_t child, int which, u_long *result) +pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct pci_devinfo *dinfo; pcicfgregs *cfg; diff --git a/sys/pci/pcisupport.c b/sys/pci/pcisupport.c index 4ca279e..8d1752f 100644 --- a/sys/pci/pcisupport.c +++ b/sys/pci/pcisupport.c @@ -769,7 +769,7 @@ static int pcib_attach(device_t dev) } static int -pcib_read_ivar(device_t dev, device_t child, int which, u_long *result) +pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { if (which == PCIB_IVAR_HOSE) { /* |