This is a WIP (not yet a commit candidate, and if it does become one it
will likely be split up a bit with MI bits separate from x86, etc.).
I decided to use a helper struct for optional attributes of a mapping
ala kib's recent args for make_dev_s(). This also includes an
implementation of RF_UNMAPPED as its implementation becomes fairly
trivial as each bus driver is fixed to move tag/handle setup/teardown
out into the new methods.
This has most of the implementation for x86 (but untested). A problem
with the x86 bits is that there's no easy way to get the size of a
memory mapping in the non-PC98 case, so the size passed to pmap_unmapdev
is wrong. We could fix this by changing the x86 handle to be a struct
that includes the pointer and length instead of just being the pointer.
That hoses the ABI though.
Some other options are to require the mapping args passed to map_resource()
be passed to unmap_resource(), or to define a new MD type that is a
"mapping request" and contains (at minimum) the tag/handle. You could
define this 'struct resource_mapping' with the same names as
'struct resource' for the tag/handle so you can use the shorter
bus_read_X(), etc. macros with it which might be nice.