Re: remove rid pointer (but not rid)...



In message: <20060419220401.GO38619@xxxxxxxxxxxx>
John-Mark Gurney <gurney_j@xxxxxxxxxxxxxxxxxx> writes:
: 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...

More precisely, you need to pass the rid into bus_alloc_resource.
What is no longer needed is to get the modified rid value back. While
in theory with the current API the rid could change, a quick audit of
the tree I just did shows that no one currently changes the rid.

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

This is good.

: 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)

'const int *rid' is another alternative here, that might be less invasive.

: 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...

This will, of course, be a big undertaking in the tree. There are
1216 instances of the string 'alloc_resource' Every single one of
them will need to change in some way. This will make porting to older
versions of FreeBSD more difficult, since you'll need ifdefs for the
passing of this parameter. Moreover, each of these changes isn't
going to be mechanical. There's a number of drivers that assume that
rid will be modified and carefully save it against future need (the
release), so fixes in this area need to be done carefully. While most
of those drivers could benefit from the newer bus_alloc_resources()
API, testing becomes problematic.

We should also make sure that all the override functions for
bus_alloc_resource declare their functions as a bus_alloc_resource_t.
Only the ones in sparc64-land do today.

Warner
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Ilomo trojan-regscan- how do I zap this thing?
    ... 64bit drivers for the computer internal hardware. ... may try triple boot with XPpro, ... gotten rid of it or not. ... the Trojan gets installed again and opens the ...
    (microsoft.public.win2000.general)
  • Bluetooth removal (Was: Registry: removed HID entry, mouse not working)
    ... Now, I'm still trying to figure out, how to physically getting rid of the two drivers I downloaded via Windows update. ... This is what I was trying - deleting the sys files in System32 dir and removing all registry entries. ...
    (microsoft.public.windowsxp.general)
  • Re: Cant get Media Center to turn on
    ... Does getting rid of one get rid of the problems? ... suspect the video card drivers. ... website, reboot, install the new drivers, reboot and check for the problem. ... > Registered JIT debugger is not available. ...
    (microsoft.public.windows.mediacenter)
  • Re: Safely remove Hardware icon
    ... by getting rid of the Nvidia IDE sw drivers. ... When you install the Nforce4 motherboard drivers, you are given the option, ...
    (microsoft.public.windowsxp.hardware)
  • Re: Thinking of reinstalling Windows...
    ... A repair install will preserve your drivers, settings, programs and personal ... files but will not do anything about getting rid of virus's, spyware, ... adware, rootkits etc. ...
    (microsoft.public.windowsxp.general)