Re: [PATCH] add legacy I/O port & memory APIs to /proc/bus/pci

David Mosberger
2004-12-16T18:45:58Z

>>>>> On Thu, 16 Dec 2004 08:50:19 -0800, Jesse Barnes <jbarnes@engr.sgi.com> said:

Jesse> +int ia64_pci_legacy_read(struct pci_dev *dev, u16 port, u32 *val, u8 size)
Jesse> +{
Jesse> + int ret = 0;
Jesse> :
Jesse> + case 1:
Jesse> + addr = (unsigned long *)paddr;
Jesse> + *val = (u8)(*(volatile u8 *)(addr));
Jesse> + break;
Jesse> + case 2:
Jesse> + addr = (unsigned long *)paddr;
Jesse> + *val = (u16)(*(volatile u16 *)(addr));
Jesse> + break;
Jesse> :
Jesse> +}

Jesse> +int ia64_pci_legacy_write(struct pci_dev *dev, u16 port, u32 val, u8 size)
Jesse> +{
Jesse> + switch (size) {
Jesse> + case 1:
Jesse> + addr = (unsigned long *)paddr;
Jesse> + *(volatile u8 *)(addr) = (u8)(val);
Jesse> + break;
Jesse> + case 2:
Jesse> + addr = (unsigned long *)paddr;
Jesse> + *(volatile u16 *)(addr) = (u16)(val);
Jesse> + break;
Jesse> :
Jesse> + }

No offense, but what's up with this castamania?

--david