Re: request_region for no dynamic bus sizing

From: Yasushi SHOJI (yashi@atmark-techno.com)
Date: Mon Jul 28 2003 - 20:53:06 EST


At 29 Jul 2003 01:52:29 +0100,
Alan Cox wrote:
>
> On Maw, 2003-07-29 at 00:55, Yasushi SHOJI wrote:
> > the problem is, however, that because there is two memory region for
> > one bus address, I have to call two request_region()s to avoid misuse.
> >
> > what i'd like to ask is that "is anyone using such kind of board to
> > run linux? if so, how do you do?"
>
> Is there any reason you cannot fix request_region for your platform to
> request both itself ?

no, there is not.

Actualy, I was looking at __request_region after I sent the previous
message.

What'd be the proper way to fix request_region for no dynamic bus
sizing platform? use #ifdef in linux/ioport.h and call
__request_region twice or fix __request_region?

how about something like this? (haven't even compile)

#define ADDR_OFFSET(x) WHATEVER(x)

#define request_region(start,n,name) \
      ({ struct resource * __r, __s; \
         __r = __request_region(&ioport_resource, (start), (n), (name)); \
         if (__r) { \
                 __s = __request_region(&ioport_resource, (ADDR_OFFSET(start)), (n), (name)); \
                 if (!__s) { \
                         __release_region(&ioport_resource, (start), (n), (name)); \
                         __r = NULL; \
                 } \
         } \
         __r; })

best regards,

--
           yashi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:38 EST