From: Paul M. <le...@us...> - 2001-11-06 08:59:45
|
Update of /cvsroot/linux-mips/linux/include/asm-mips In directory usw-pr-cvs1:/tmp/cvs-serv10490/include/asm-mips Modified Files: pci.h unistd.h Log Message: Sync with OSS 2.4.13. Index: pci.h =================================================================== RCS file: /cvsroot/linux-mips/linux/include/asm-mips/pci.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- pci.h 2001/10/31 18:26:52 1.4 +++ pci.h 2001/11/06 02:57:38 1.5 @@ -7,6 +7,7 @@ #define _ASM_PCI_H #include <linux/config.h> +#include <linux/types.h> #ifdef __KERNEL__ @@ -115,6 +116,35 @@ } /* + * pci_{map,unmap}_single_page maps a kernel page to a dma_addr_t. identical + * to pci_map_single, but takes a struct page instead of a virtual address + */ +static inline dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page, + unsigned long offset, size_t size, + int direction) +{ + unsigned long addr; + + if (direction == PCI_DMA_NONE) + BUG(); + + addr = (unsigned long) page_address(page); +#ifndef CONFIG_COHERENT_IO + dma_cache_wback_inv(addr, size); +#endif + + return virt_to_bus((void *)addr); +} + +static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, + size_t size, int direction) +{ + if (direction == PCI_DMA_NONE) + BUG(); + /* Nothing to do */ +} + +/* * Map a set of buffers described by scatterlist in streaming * mode for DMA. This is the scather-gather version of the * above pci_map_single interface. Here the scatter gather list @@ -215,7 +245,7 @@ * only drive the low 24-bits during PCI bus mastering, then * you would pass 0x00ffffff as the mask to this function. */ -static inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask) +static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) { /* * we fall back to GFP_DMA when the mask isn't all 1s, @@ -228,6 +258,39 @@ return 1; } +/* This is always fine. */ +/* Well ... this actually needs more thought ... */ +#define pci_dac_dma_supported(pci_dev, mask) (0) + +#if 0 +static __inline__ dma64_addr_t +pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction) +{ + return ((dma64_addr_t) page_to_bus(page) + + (dma64_addr_t) offset); +} + +static __inline__ struct page * +pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr) +{ + unsigned long poff = (dma_addr >> PAGE_SHIFT); + + return mem_map + poff; +} + +static __inline__ unsigned long +pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr) +{ + return (dma_addr & ~PAGE_MASK); +} + +static __inline__ void +pci_dac_dma_sync_single(struct pci_dev *pdev, dma64_addr_t dma_addr, + size_t len, int direction) +{ + /* Nothing to do. */ +} +#endif /* Return the index of the PCI controller for device. */ #define pci_controller_num(pdev) (0) Index: unistd.h =================================================================== RCS file: /cvsroot/linux-mips/linux/include/asm-mips/unistd.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- unistd.h 2001/11/06 00:30:47 1.5 +++ unistd.h 2001/11/06 02:57:38 1.6 @@ -232,11 +232,12 @@ #define __NR_fcntl64 (__NR_Linux + 220) #define __NR_security (__NR_Linux + 221) #define __NR_gettid (__NR_Linux + 222) +#define __NR_readahead (__NR_Linux + 223) /* * Offset of the last Linux flavoured syscall */ -#define __NR_Linux_syscalls 222 +#define __NR_Linux_syscalls 223 #ifndef _LANGUAGE_ASSEMBLY |