bug-hurd
[Top][All Lists]
Advanced

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

Re: TSS switching


From: Marcus Brinkmann
Subject: Re: TSS switching
Date: Sat, 13 Oct 2001 02:37:33 +0200
User-agent: Mutt/1.3.22i

On Wed, Oct 10, 2001 at 06:46:22PM -0400, Roland McGrath wrote:
> gnumach is never going to have SMP support anyway, so it's all moot (and
> the macros you are using expand to empty).  In oskit-mach, I think we
> should get rid of the lookup table and just hang the data directly off the
> device_t.

That's okay by me, but I looked at the code now and it's not trivial.

The whole purpose of re-using devices requires that dev_open_alloc works for
us.  This allocates a new struct device in the device zone, which has a
fixed size.  So I guess we could make room in the zone for us (pass a larger
size than sizeof(struct device) to zinit), or we make use of space in struct
device_t itself.  There seems to be enough room in the union for example.
I guess I can just use the following:

struct io_perm
union
{
  struct device dev;

  struct io_perm_range
    {
      char [offsetof (struct device) - offsetof (struct device, com)];
      unsigned short from, to;
    } range;
};

Is there an easy way to check at compile time that the size doesn't exceed
sizeof(struct device) at *compile* time?  (cpp can't do it, but gcc has all
the necessary information).

Thanks,
Marcus

-- 
`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]