Subject: Re: com rumblings...
To: None <>
From: Izumi Tsutsui <>
List: tech-kern
Date: 06/16/2006 01:12:21 wrote:

> Note that the handle and tag are cached in local variables.  It was
> harder to do this cleanly in the new code with register access macros,
> so my new code looks like the following.  Ultimately, there could be a
> performance impact depending on how smart the optimizer is:
> struct com_regs {
>     bus_tag_t iot;
>     bus_handle_t   ioh;
> #ifdef COM_REGSMAP
>     bus_size_t map[16];
> #endif
> };

- Why don't you put map[] member to struct com_softc?
- Where is "COM_REGSMAP" defined in your code?
  Is it possible to define it only if a particular MD
  attachment which requires special layout is configured?
- Do all MD attachments have to initialize map[] array
  if COM_REGSMAP is defined?
  (I'm afraid it might make cnattach functions more complicated)

> #define   OUTB(r, o, v)   bus_space_write_1(r->iot, r->ioh, r->map[o], v)

BTW, I don't like names like OUTB/INB.
I prefer COM_WRITE_REG_1 or so.
Izumi Tsutsui