[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pci_read_config_byte ?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sat, 08 Nov 2003 00:13:49 -0800
Eric Lin <qlyz@sbcglobal.net> wrote:
>Try to understanding how pci_read_config_byte is implemented.
>
>Search the kernel source, find only prototype in pci.h
>
>I am using 2.4.22 on i386.
>
>Can someone help?
Take a look at drivers/pci/pci.c. It's defined in this manner but its code
should be clearly understandable.
#define PCI_byte_BAD 0
#define PCI_OP(rw,size,type) \
int pci_##rw##_config_##size (struct pci_dev *dev, int pos, type value) \
{ \
int res; \
unsigned long flags; \
if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER; \
spin_lock_irqsave(&pci_lock, flags); \
res = dev->bus->ops->rw##_##size(dev, pos, value); \
spin_unlock_irqrestore(&pci_lock, flags); \
return res; \
}
PCI_OP(read, byte, u8 *)
Regards.
- --
Angelo Dell'Aera 'buffer'
Antifork Research, Inc. http://buffer.antifork.org
PGP information in e-mail header
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/rR2WpONIzxnBXKIRAjjAAKDI7AAMATeZK10Tb+mCCB9flegMOACgrhBu
N/Z8xK+OKkCL8sgiq3KatBo=
=ngw6
-----END PGP SIGNATURE-----
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/