From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Gabriel Paubert <paubert@iram.es>
Cc: Amelia De Vivo <amelia.devivo@roma.quadrics.com>,
linuxppc-dev@lists.linuxppc.org
Subject: Re: Addressing PCI memory
Date: Tue, 15 May 2001 14:16:38 -0400 [thread overview]
Message-ID: <3B017286.CC313C9C@mandrakesoft.com> (raw)
In-Reply-To: Pine.HPX.4.10.10105151859290.1451-100000@gra-ux1.iram.es
Gabriel Paubert wrote:
>
> On Tue, 15 May 2001, Amelia De Vivo wrote:
>
> >
> > Hi all, I'm trying to write a driver for a 64 bit PCI device. Something like
> > this works well under i386 Linux, but it doesn't work at all for Linux
> > 2.2.15 by Yellow Dog:
> >
> > struct pci_dev *dev = NULL;
> > dev = pci_find_device(vendor, device, dev);
> > pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &cards[0].addr0);
>
> First, use the resource in the dev structure, they do not necessarily
> correspond to the value read from the base, even on Intel BTW.
>
> cards[0].addr0 = dev->resources[0].start
>
> don't even need to mask the address bits...
correct.
Though note it is highly encouraged to use
pci_resource_{start,end,len,flags} helpers. That makes it transparent
to port code to earlier kernels, and IMHO makes the code easier to read.
--
Jeff Garzik | Game called on account of naked chick
Building 1024 |
MandrakeSoft |
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2001-05-15 18:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-15 16:34 Addressing PCI memory Amelia De Vivo
2001-05-15 16:58 ` Takashi Oe
2001-05-15 17:02 ` Gabriel Paubert
2001-05-15 18:16 ` Jeff Garzik [this message]
2001-05-16 16:40 ` ashish anand
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=3B017286.CC313C9C@mandrakesoft.com \
--to=jgarzik@mandrakesoft.com \
--cc=amelia.devivo@roma.quadrics.com \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=paubert@iram.es \
/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;
as well as URLs for NNTP newsgroup(s).