From: Christoph Hellwig <hch@infradead.org>
To: Patrick Gefre <pfg@sgi.com>
Cc: akpm@osdl.org, davidm@napali.hpl.hp.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6] Altix updates
Date: Tue, 20 Jan 2004 23:34:17 +0000 [thread overview]
Message-ID: <20040120233417.A23173@infradead.org> (raw)
In-Reply-To: <400DAA76.2080103@sgi.com>; from pfg@sgi.com on Tue, Jan 20, 2004 at 04:23:50PM -0600
On Tue, Jan 20, 2004 at 04:23:50PM -0600, Patrick Gefre wrote:
> I had one for bridge address/TIO, one for bridge address/nonTIO, one for
> soft address/TIO and one for soft address/nonTIO.
> I thought that was what you were proposing. In any event, here's how the
> basic code looks (leaving out type defs/error checking/
> etc) - the wrapper is embedded in the macro - note that we would always
> like to use the soft struct because it doesn't cost us a PIO
> but in the event that the soft struct is not available the bridge
> address must be used:
(horrible piece of sh^H^H^code snipped)
Eeek!
So taking your pio cycle stuff into account, what about:
void *
__pcireg_xxx_get(bridge_t *bridge, int type)
{
switch (type ) {
case BT_TIO:
return bridge_addr->ti_xxx;
case BT_PIC:
return bridge->addr->pic_xxx;
default:
/* */
}
}
and then have wrappers for both the plain bridge_t and the pcibr_soft.
In fact I wonder why you want the one taking bridge_t at all, there is
absolutely no reason why you should be able to get a bridge_t without
getting at the pcibr_soft easily.
>
> void *
> pcireg_xxx_get(void *ptr)
> {
> if ( IS_IOADDR(ptr) )
> return REAL_pcireg_xxx_get(ptr, IS_TIO(ptr) ? BT_TIO : BT_PIC);
> else
> return REAL_pcireg_xxx_get(ptr->bs_base, ptr->bs_bridge_type);
>
> }
No, this is borked again. The IS_IOADDR tests must go away.
next prev parent reply other threads:[~2004-01-20 23:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-15 21:54 Pat Gefre
2004-01-16 2:34 ` Andrew Morton
2004-01-16 14:41 ` Christoph Hellwig
2004-01-20 17:50 ` Patrick Gefre
2004-01-20 18:08 ` Christoph Hellwig
2004-01-20 20:12 ` Patrick Gefre
2004-01-20 20:21 ` Christoph Hellwig
2004-01-20 22:23 ` Patrick Gefre
2004-01-20 23:34 ` Christoph Hellwig [this message]
2004-01-21 0:23 ` Patrick Gefre
2004-01-21 0:26 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040120233417.A23173@infradead.org \
--to=hch@infradead.org \
--cc=akpm@osdl.org \
--cc=davidm@napali.hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pfg@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome