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

next in thread | previous in thread | raw e-mail | index | archive | help
Warner,

> rid = 0x10;
> res1 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE);
...
> should do the trick.  Change SYS_RES_MEMORY to SYS_RES_IOPORT if it is
> I/O mapped rather than memory mapped.
> 
> In case it wasn't clear, the rid is the offset into the config space
> where the BAR register that you want to use is.  Multiples of 4 only
> need apply.

Thanks, that helps.  BUT...
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?

Thanks,
Gary
-- 
=========================================================
 Gary Corcoran - Distinguished Member of Technical Staff
Lucent Microelectronics - Client Access Broadband Systems
   Communications Protocol & Driver Development Group
   "We make the drivers that make communications work"
              Email: gcorcoran@lucent.com
---------------------------------------------------------
There are only two kinds of machines - those that fail
little by little, and those that fail all at once.
=========================================================


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?38ECF00B.CA0AD45B>