remove rid pointer (but not rid)...

John-Mark Gurney gurney_j at resnet.uoregon.edu
Wed Apr 19 22:04:27 UTC 2006


I was looking at our interface, and realized that since we now have
rman_get_rid, that passing in a rid pointer to bus_alloc_resource is
out dated... you can get the new updated rid directly from the resource
returned...

This will benifit bus_alloc_resources, as we can constify the _spec
parameter, to make driver writing simpler...

We can also reduce the use of the type parameter by including it as
part of the resource, and then eliminate that parameter from the
release, free cases...

I have briefly discussed this w/ jhb, phk and imp, and they agree that
this should be fixed...

My new proposed prototypes:
# this is the bus_if.m:
static struct resource *bus_alloc_resource(device_t dev, device_t child,
int type, int rid, u_long start, u_long end, u_long count, u_int flags)

from bus.h:
int bus_alloc_resources(device_t dev, const struct resource_spec *rs, struct resource 
**res);
void bus_release_resources(device_t dev, const struct resource_spec *rs, struct resource **res);
struct resource *bus_alloc_resource(device_t dev, int type, int rid, u_long start, u_long end, u_long count, u_int flags);
int bus_activate_resource(device_t dev, struct resource *r);
int bus_deactivate_resource(device_t dev, struct resource *r);
int bus_release_resource(device_t dev, struct resource *r);
int bus_free_resource(device_t dev, struct resource *r);

we'll add a couple more functions:
int rman_get_restype(struct resource *);
void rman_set_restype(struct resource *, int);

and of course add the appropriate field to resource_i...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-arch mailing list