diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:24:46 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:24:46 -0800 |
| commit | aed492fcb972130f11cd62fd8ca0b2af95f54d03 (patch) | |
| tree | ecd755228f49b188323b4dd257b06fc43fb2f9ae /include | |
| parent | 2ef7e8cef81e6a091de2aebd9d30c273edf6c13c (diff) | |
v2.4.12.5 -> v2.4.12.6
- Stephen Rothwell: APM idle time handling fixes, docbook update, cleanup
- Jeff Garzik: network driver updates
- Greg KH: USB updates
- Al Viro: UFS update, binfmt_misc rewrite.
- Andreas Dilger: /dev/random fixes
- David Miller: network/sparc updates
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-ppc/pci.h | 165 | ||||
| -rw-r--r-- | include/asm-ppc/scatterlist.h | 20 | ||||
| -rw-r--r-- | include/asm-ppc/types.h | 3 | ||||
| -rw-r--r-- | include/asm-sparc/pgalloc.h | 2 | ||||
| -rw-r--r-- | include/asm-sparc/unistd.h | 4 | ||||
| -rw-r--r-- | include/asm-sparc64/pgalloc.h | 33 | ||||
| -rw-r--r-- | include/asm-sparc64/pgtable.h | 25 | ||||
| -rw-r--r-- | include/asm-sparc64/unistd.h | 4 | ||||
| -rw-r--r-- | include/linux/i2o.h | 1 | ||||
| -rw-r--r-- | include/linux/ufs_fs.h | 10 | ||||
| -rw-r--r-- | include/linux/usb.h | 2 |
11 files changed, 221 insertions, 48 deletions
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index faa00b3bba72..7bf66190c85a 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pci.h 1.12 05/21/01 01:31:30 cort + * BK Id: SCCS/s.pci.h 1.16 10/15/01 22:51:33 paulus */ #ifndef __PPC_PCI_H #define __PPC_PCI_H @@ -41,7 +41,7 @@ extern unsigned long phys_to_bus(unsigned long pa); extern unsigned long pci_phys_to_bus(unsigned long pa, int busnr); extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr); -/* Dynamic DMA Mapping stuff +/* Dynamic DMA Mapping stuff, stolen from i386 * ++ajoshi */ @@ -53,39 +53,139 @@ extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr); struct pci_dev; +/* The PCI address space does equal the physical memory + * address space. The networking and block device layers use + * this boolean for bounce buffer decisions. + */ +#define PCI_DMA_BUS_IS_PHYS (1) + +/* Allocate and map kernel buffer using consistent mode DMA for a device. + * hwdev should be valid struct pci_dev pointer for PCI devices, + * NULL for PCI-like buses (ISA, EISA). + * Returns non-NULL cpu-view pointer to the buffer if successful and + * sets *dma_addrp to the pci side dma address as well, else *dma_addrp + * is undefined. + */ extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle); + +/* Free and unmap a consistent DMA buffer. + * cpu_addr is what was returned from pci_alloc_consistent, + * size must be the same as what as passed into pci_alloc_consistent, + * and likewise dma_addr must be the same as what *dma_addrp was set to. + * + * References to the memory and mappings associated with cpu_addr/dma_addr + * past this call are illegal. + */ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle); -extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, + +/* Map a single buffer of the indicated size for DMA in streaming mode. + * The 32-bit bus address to use is returned. + * + * Once the device is given the dma address, the device owns this memory + * until either pci_unmap_single or pci_dma_sync_single is performed. + */ +static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) { if (direction == PCI_DMA_NONE) BUG(); return virt_to_bus(ptr); } -extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, + +static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) { if (direction == PCI_DMA_NONE) BUG(); /* nothing to do */ } -extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, + + +/* + * 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) +{ + if (direction == PCI_DMA_NONE) + BUG(); + return (page - mem_map) * PAGE_SIZE + PCI_DRAM_OFFSET + offset; +} + +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 + * elements are each tagged with the appropriate dma address + * and length. They are obtained via sg_dma_{address,length}(SG). + * + * NOTE: An implementation may be able to use a smaller number of + * DMA address/length pairs than there are SG table elements. + * (for example via virtual mapping capabilities) + * The routine returns the number of addr/length pairs actually + * used, at most nents. + * + * Device ownership issues as mentioned above for pci_map_single are + * the same here. + */ +static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { + int i; + if (direction == PCI_DMA_NONE) BUG(); + + /* + * temporary 2.4 hack + */ + for (i = 0; i < nents; i++) { + if (sg[i].address && sg[i].page) + BUG(); + else if (!sg[i].address && !sg[i].page) + BUG(); + + if (sg[i].address) + sg[i].dma_address = virt_to_bus(sg[i].address); + else + sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; + } + return nents; } -extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, + +/* Unmap a set of streaming mode DMA translations. + * Again, cpu read rules concerning calls here are the same as for + * pci_unmap_single() above. + */ +static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { if (direction == PCI_DMA_NONE) BUG(); /* nothing to do */ } -extern inline void pci_dma_sync_single(struct pci_dev *hwdev, + +/* Make physical memory consistent for a single + * streaming mode DMA translation after a transfer. + * + * If you perform a pci_map_single() but wish to interrogate the + * buffer using the cpu, yet do not wish to teardown the PCI dma + * mapping, you must call this function before doing so. At the + * next point you give the PCI dma address back to the card, the + * device again owns the buffer. + */ +static inline void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) { @@ -94,7 +194,13 @@ extern inline void pci_dma_sync_single(struct pci_dev *hwdev, /* nothing to do */ } -extern inline void pci_dma_sync_sg(struct pci_dev *hwdev, +/* Make physical memory consistent for a set of streaming + * mode DMA translations after a transfer. + * + * The same as pci_dma_sync_single but for a scatter-gather list, + * same rules and usage. + */ +static inline void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) { @@ -108,11 +214,49 @@ extern inline void pci_dma_sync_sg(struct pci_dev *hwdev, * only drive the low 24-bits during PCI bus mastering, then * you would pass 0x00ffffff as the mask to this function. */ -extern inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) +static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) { return 1; } +/* + * At present there are very few 32-bit PPC machines that can have + * memory above the 4GB point, and we don't support that. + */ +#define pci_dac_dma_supported(pci_dev, mask) (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) + offset; +} + +static __inline__ struct page * +pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr) +{ + return mem_map + (unsigned long)(dma_addr >> PAGE_SHIFT); +} + +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. */ +} + +/* These macros should be used after a pci_map_sg call has been done + * to get bus addresses of each of the SG entries and their lengths. + * You should only work with the number of sg entries pci_map_sg + * returns. + */ +#define sg_dma_address(sg) ((sg)->dma_address) +#define sg_dma_len(sg) ((sg)->length) + /* Return the index of the PCI controller for device PDEV. */ extern int pci_controller_num(struct pci_dev *pdev); @@ -123,9 +267,6 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ #define HAVE_PCI_MMAP 1 -#define sg_dma_address(sg) (virt_to_bus((sg)->address)) -#define sg_dma_len(sg) ((sg)->length) - #endif /* __KERNEL__ */ #endif /* __PPC_PCI_H */ diff --git a/include/asm-ppc/scatterlist.h b/include/asm-ppc/scatterlist.h index 69b7f388b31a..392e89778e78 100644 --- a/include/asm-ppc/scatterlist.h +++ b/include/asm-ppc/scatterlist.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.scatterlist.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.scatterlist.h 1.9 10/15/01 22:51:33 paulus */ #ifdef __KERNEL__ #ifndef _PPC_SCATTERLIST_H @@ -8,10 +8,24 @@ #include <asm/dma.h> struct scatterlist { - char * address; /* Location data is to be transferred to */ - unsigned int length; + char *address; /* Location data is to be transferred to, + * or NULL for highmem page */ + struct page * page; /* Location for highmem page, if any */ + unsigned int offset; /* for highmem, page offset */ + + dma_addr_t dma_address; /* phys/bus dma address */ + unsigned int length; /* length */ }; +/* + * These macros should be used after a pci_map_sg call has been done + * to get bus addresses of each of the SG entries and their lengths. + * You should only work with the number of sg entries pci_map_sg + * returns, or alternatively stop on the first sg_dma_len(sg) which + * is 0. + */ +#define sg_dma_address(sg) ((sg)->dma_address) +#define sg_dma_len(sg) ((sg)->length) #endif /* !(_PPC_SCATTERLIST_H) */ #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h index 59a83febe6dd..f4ce6ebda385 100644 --- a/include/asm-ppc/types.h +++ b/include/asm-ppc/types.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.types.h 1.8 07/07/01 13:37:26 paulus + * BK Id: SCCS/s.types.h 1.10 10/15/01 22:51:33 paulus */ #ifndef _PPC_TYPES_H #define _PPC_TYPES_H @@ -46,6 +46,7 @@ typedef __vector128 vector128; /* DMA addresses are 32-bits wide */ typedef u32 dma_addr_t; +typedef u64 dma64_addr_t; #endif /* __KERNEL__ */ diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h index 4543145b630c..eabf61b512ff 100644 --- a/include/asm-sparc/pgalloc.h +++ b/include/asm-sparc/pgalloc.h @@ -1,4 +1,4 @@ -/* $Id: pgalloc.h,v 1.13 2001/07/17 16:17:33 anton Exp $ */ +/* $Id: pgalloc.h,v 1.15 2001/10/18 09:06:37 davem Exp $ */ #ifndef _SPARC_PGALLOC_H #define _SPARC_PGALLOC_H diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 7fff6e2176be..f89f8fa2f473 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.71 2001/10/09 10:54:39 davem Exp $ */ +/* $Id: unistd.h,v 1.72 2001/10/18 08:27:05 davem Exp $ */ #ifndef _SPARC_UNISTD_H #define _SPARC_UNISTD_H @@ -220,7 +220,7 @@ #define __NR_oldlstat 202 /* Linux Specific */ #define __NR_uselib 203 /* Linux Specific */ #define __NR_readdir 204 /* Linux Specific */ -/* #define __NR_ioperm 205 Linux Specific - i386 specific, unused */ +#define __NR_readahead 205 /* Linux Specific */ #define __NR_socketcall 206 /* Linux Specific */ #define __NR_syslog 207 /* Linux Specific */ /* #define __NR_olduname 208 Linux Specific */ diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index feba6c1a05d4..6ae6191e20ad 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h @@ -1,4 +1,4 @@ -/* $Id: pgalloc.h,v 1.23 2001/09/25 20:21:48 kanoj Exp $ */ +/* $Id: pgalloc.h,v 1.26 2001/10/18 09:06:37 davem Exp $ */ #ifndef _SPARC64_PGALLOC_H #define _SPARC64_PGALLOC_H @@ -32,29 +32,14 @@ extern void flush_icache_range(unsigned long start, unsigned long end); extern void __flush_dcache_page(void *addr, int flush_icache); extern void __flush_icache_page(unsigned long); -#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */ -#define flush_dcache_page(page) \ -do { if ((page)->mapping && \ - !((page)->mapping->i_mmap) && \ - !((page)->mapping->i_mmap_shared)) \ - set_bit(PG_dcache_dirty, &(page)->flags); \ - else \ - __flush_dcache_page((page)->virtual, \ - ((tlb_type == spitfire) && \ - (page)->mapping != NULL)); \ -} while(0) -#else /* L1DCACHE_SIZE > PAGE_SIZE */ -#define flush_dcache_page(page) \ -do { if ((page)->mapping && \ - !((page)->mapping->i_mmap) && \ - !((page)->mapping->i_mmap_shared)) \ - set_bit(PG_dcache_dirty, &(page)->flags); \ - else \ - if ((tlb_type == spitfire) && \ - (page)->mapping != NULL) \ - __flush_icache_page(__get_phys((unsigned long)((page)->virtual))); \ -} while(0) -#endif /* L1DCACHE_SIZE > PAGE_SIZE */ +extern void flush_dcache_page_impl(struct page *page); +#ifdef CONFIG_SMP +extern void smp_flush_dcache_page_impl(struct page *page); +#else +#define smp_flush_dcache_page_impl flush_dcache_page_impl +#endif + +extern void flush_dcache_page(struct page *page); extern void __flush_dcache_range(unsigned long start, unsigned long end); diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 4c0d616dc51b..79c174b02bd1 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.146 2001/09/11 02:20:23 kanoj Exp $ +/* $Id: pgtable.h,v 1.147 2001/10/17 18:26:58 davem Exp $ * pgtable.h: SpitFire page table operations. * * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -48,6 +48,29 @@ #define PG_dcache_dirty PG_arch_1 +#define dcache_dirty_cpu(page) \ + (((page)->flags >> 24) & (NR_CPUS - 1UL)) + +#define set_dcache_dirty(PAGE) \ +do { unsigned long mask = smp_processor_id(); \ + unsigned long non_cpu_bits = (1UL << 24UL) - 1UL; \ + mask = (mask << 24) | (1UL << PG_dcache_dirty); \ + __asm__ __volatile__("1:\n\t" \ + "ldx [%2], %%g7\n\t" \ + "and %%g7, %1, %%g5\n\t" \ + "or %%g5, %0, %%g5\n\t" \ + "casx [%2], %%g7, %%g5\n\t" \ + "cmp %%g7, %%g5\n\t" \ + "bne,pn %%xcc, 1b\n\t" \ + " nop" \ + : /* no outputs */ \ + : "r" (mask), "r" (non_cpu_bits), "r" (&(PAGE)->flags) \ + : "g5", "g7"); \ +} while (0) + +#define clear_dcache_dirty(PAGE) \ + clear_bit(PG_dcache_dirty, &(PAGE)->flags) + /* Certain architectures need to do special things when pte's * within a page table are directly modified. Thus, the following * hook is made available. diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index a9b7cd162fe5..135eb2936520 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.48 2001/10/09 10:54:39 davem Exp $ */ +/* $Id: unistd.h,v 1.49 2001/10/18 08:27:05 davem Exp $ */ #ifndef _SPARC64_UNISTD_H #define _SPARC64_UNISTD_H @@ -220,7 +220,7 @@ #define __NR_oldlstat 202 /* Linux Specific */ #define __NR_uselib 203 /* Linux Specific */ #define __NR_readdir 204 /* Linux Specific */ -/* #define __NR_ioperm 205 Linux Specific - i386 specific, unused */ +#define __NR_readahead 205 /* Linux Specific */ #define __NR_socketcall 206 /* Linux Specific */ #define __NR_syslog 207 /* Linux Specific */ /* #define __NR_olduname 208 Linux Specific */ diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 6fdec1eca6ca..81a50b2e9005 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h @@ -31,6 +31,7 @@ #include <asm/semaphore.h> /* Needed for MUTEX init macros */ #include <linux/config.h> #include <linux/notifier.h> +#include <linux/ioport.h> /* Needed for struct resource */ #include <asm/atomic.h> /* diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 04e4a8a7c7d6..e50451a8602b 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -532,6 +532,14 @@ extern void ufs_put_cylinder (struct super_block *, unsigned); /* dir.c */ extern struct inode_operations ufs_dir_inode_operations; extern int ufs_check_dir_entry (const char *, struct inode *, struct ufs_dir_entry *, struct buffer_head *, unsigned long); +extern int ufs_add_link (struct dentry *, struct inode *); +extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); +extern int ufs_make_empty(struct inode *, struct inode *); +extern struct ufs_dir_entry * ufs_find_entry (struct dentry *, struct buffer_head **); +extern int ufs_delete_entry (struct inode *, struct ufs_dir_entry *, struct buffer_head *); +extern int ufs_empty_dir (struct inode *); +extern struct ufs_dir_entry * ufs_dotdot (struct inode *, struct buffer_head **); +extern void ufs_set_link(struct inode *, struct ufs_dir_entry *, struct buffer_head *, struct inode *); /* file.c */ extern struct inode_operations ufs_file_inode_operations; @@ -541,7 +549,7 @@ extern struct address_space_operations ufs_aops; /* ialloc.c */ extern void ufs_free_inode (struct inode *inode); -extern struct inode * ufs_new_inode (const struct inode *, int, int *); +extern struct inode * ufs_new_inode (const struct inode *, int); /* inode.c */ extern int ufs_frag_map (struct inode *, int); diff --git a/include/linux/usb.h b/include/linux/usb.h index 063061f5511d..e813425c32a4 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -855,7 +855,7 @@ void usb_show_string(struct usb_device *dev, char *id, int index); extern struct list_head usb_driver_list; extern struct list_head usb_bus_list; -extern rwlock_t usb_bus_list_lock; +extern struct semaphore usb_bus_list_lock; /* * USB device fs stuff |
