On Tue, Oct 02, 2001 at 03:38:39AM -0400, Roland McGrath wrote:
> Perhaps we should have a capability-based interface, but just use special
> ports for this instead of device_t's.  e.g., there could be a new call on
> the device master port to give you a capability port with the given bitmask
> of io ports for access.  Then these ports would be the valid arguments for
> i386_io_port_add.

I include a suggestion for the new interface below.  It's pretty straight
forward.  I do not make use of a bitmask, because that's complicated to
setup.  If we want a bitmap, we will want support code for that in a special
library or at least some macros/inline functions as well.  Instead, you
simply pass it a list of I/O registers you want to manipulate.  Those lists
are usually small, but as there are up to 65536 registers I didn't
specify a fixed size for the array. For all practical purposes, the number of
interesting I/O registers (ISA) does not exceed about 70, so specifying a fixed
size might be just as reasonable.

I wonder if we really need new msg id's for all of them.  The _add and
_remove and _list RPCs are type compatible, and the kernel can check if
a task or a thread was specified, and do the right thing (old kernels will
just return an error).  It seems to be dangerous to exploit that though,
esp if you do it more than once in the history of the interface! ...

Thanks,
Marcus

type io_reg_t = unsigned short;
type io_reg_array_t = array[] of io_reg_t;
type mach_port_t = io_port_t;

routine i386_io_port_create (
        master_port: mach_port_t;
        io_ports: io_reg_array_t;
        out io_port: io_port_t);

routine i386_io_port_add (
        task: task_t;
        io_port: io_port_t);

routine i386_io_port_remove (
        task: task_t;
        io_port: io_port_t);

routine i386_io_port_list (
        task: task_t;
        out io_reg: io_reg_array_t);


-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann              GNU    http://www.gnu.org    [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to