[U-Boot-Users] pci_hose_read_config_byte() definition puzzles

Wolfgang Denk wd at denx.de
Wed Jun 1 10:11:39 CEST 2005


In message <20050601073659.45311.qmail at web15910.mail.cnb.yahoo.com> you wrote:
>
> OK. It defines perfectly BUT where is the function 
> pci_hose_read_config_byte() body? Only declaration
> is not enought to use it......

The code is where it is to be expected - in "drivers/pci.c":

#define PCI_HOSE_OP(rw, size, type)                                     \
int pci_hose_##rw##_config_##size(struct pci_controller *hose,          \
                                  pci_dev_t dev,                        \
                                  int offset, type value)               \
{                                                                       \
        return hose->rw##_##size(hose, dev, offset, value);             \
}

PCI_HOSE_OP(read, byte, u8 *)
PCI_HOSE_OP(read, word, u16 *)
PCI_HOSE_OP(read, dword, u32 *)
PCI_HOSE_OP(write, byte, u8)
PCI_HOSE_OP(write, word, u16)
PCI_HOSE_OP(write, dword, u32)

Sometimes even "grep" cannot save you from actually RTFS ;-)

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The complexity of software is an essential property, not an  acciden-
tal  one. Hence, descriptions of a software entity that abstract away
its complexity often abstract away its essence.    - Fred Brooks, Jr.




More information about the U-Boot mailing list