bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: video mem access with oskit-mach


From: Marcus Brinkmann
Subject: Re: video mem access with oskit-mach
Date: Tue, 2 Oct 2001 22:54:40 +0200
User-agent: Mutt/1.3.22i

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 brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]