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().
This commit is contained in:
parent
ac4445057f
commit
3aae7b16d2
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user