> > Why have two files bus_at386.h and bus_pc98.h? I386_BUS_PIO_IND should be
> > able to live with I386_BUS_PIO and I386_BUS_MEMIO happily together.
>
> Because they are different in the type of bus_space_tag_t from each
> other. It is the u_long in PC/AT and the structure in PC-98. For
> example, bus_space_read_1()s of them are:
>
> PC/AT:
> bus_space_read_1(...)
> {
> ...
> return (inb(handle + offset));
> ...
> }
>
> PC-98:
> bus_space_read_1(...)
> {
> ...
> return (inb(bsh.bsh_iat[offset]));
> ...
> }
>
You could set the handle to point to the structure instead:
bus_space_read_1(...)
{
if (tag == I386_BUS_PIO) {
return (inb(handle + offset));
} else if (tag == I386_BUS_PIO_IND) {
struct bus_space_handle_pc98 *bsh = handle;
return (inb(bsh->bsh_iat[offset]));
} else if (tag == I386_BUS_MEMIO) {
...
}
}
-lq
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message