Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Apr 2000 15:29:19 -0600
From:      Warner Losh <imp@village.org>
To:        "Gary T. Corcoran" <gcorcoran@lucent.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: How to get multiple PCI I/O base addresses in attach()? 
Message-ID:  <200004062129.PAA93631@harmony.village.org>
In-Reply-To: Your message of "Thu, 06 Apr 2000 16:14:03 EDT." <38ECF00B.CA0AD45B@lucent.com> 
References:  <38ECF00B.CA0AD45B@lucent.com>  <38EC3755.DA40DEC8@home.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <38ECF00B.CA0AD45B@lucent.com> "Gary T. Corcoran" writes:
: At first I thought "res1" would be the base address I was looking for.
: However, it appears (boy I wish this stuff was documented!) that
: bus_alloc_resource returns a "struct resource *".  But I looked and
: looked and I can't find the definition of what a "struct resource" is.
: So I'm still in the dark as to how to get my I/O base address from
: the pointer returned by the bus_alloc_resource.  How do I do that?

bt = rman_get_bustag(res1);
bh = rman_get_bushandle(res1);

bus_space_read_{1,2,4}(bt, bh, offset)
bus_space_write_{1,2,4}(bt, bh, offset, value)

Warner


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004062129.PAA93631>