summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-05 00:13:42 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-05 00:13:42 -0800
commitd694597ed5e1f6613d0933ee692333ab2542b603 (patch)
treeb0b294737db3a07106d4e5b890337fa36d42651b /include
parent5fb612aa91a08c183200312d943de6691f806ce6 (diff)
v2.5.2 -> v2.5.2.1
- Al Viro: fix up silly problem in swapfile filp cleanups in 2.5.2 - Tachino Nobuhiro: fix another error return for swapfile filp code - Robert Love: merge some of Ingo's scheduler fixes - David Miller: networking, sparc and some scsi driver fixes - Tim Waugh: parport update - OGAWA Hirofumi: fatfs cleanups and bugfixes - Roland Dreier: fix vsscanf buglets. - Ben LaHaise: include file cleanup - Andre Hedrick: IDE taskfile update
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/ide.h14
-rw-r--r--include/asm-alpha/pci.h14
-rw-r--r--include/asm-alpha/pgalloc.h8
-rw-r--r--include/asm-alpha/pgtable.h4
-rw-r--r--include/asm-arm/ide.h14
-rw-r--r--include/asm-arm/pci.h25
-rw-r--r--include/asm-arm/pgtable.h4
-rw-r--r--include/asm-arm/proc-armo/cache.h8
-rw-r--r--include/asm-arm/proc-armv/cache.h10
-rw-r--r--include/asm-cris/ide.h14
-rw-r--r--include/asm-cris/pgtable.h6
-rw-r--r--include/asm-generic/tlb.h17
-rw-r--r--include/asm-i386/ide.h14
-rw-r--r--include/asm-i386/pci.h8
-rw-r--r--include/asm-i386/pgalloc.h10
-rw-r--r--include/asm-i386/pgtable.h2
-rw-r--r--include/asm-ia64/ide.h14
-rw-r--r--include/asm-ia64/pci.h14
-rw-r--r--include/asm-ia64/pgalloc.h11
-rw-r--r--include/asm-m68k/ide.h14
-rw-r--r--include/asm-m68k/motorola_pgalloc.h4
-rw-r--r--include/asm-m68k/pgalloc.h4
-rw-r--r--include/asm-m68k/sun3_pgalloc.h3
-rw-r--r--include/asm-mips/gfx.h4
-rw-r--r--include/asm-mips/ide.h20
-rw-r--r--include/asm-mips/pci.h8
-rw-r--r--include/asm-mips/pgalloc.h6
-rw-r--r--include/asm-mips/pgtable.h6
-rw-r--r--include/asm-mips/umap.h2
-rw-r--r--include/asm-mips64/gfx.h4
-rw-r--r--include/asm-mips64/ide.h14
-rw-r--r--include/asm-mips64/pci.h22
-rw-r--r--include/asm-mips64/pgalloc.h10
-rw-r--r--include/asm-mips64/pgtable.h8
-rw-r--r--include/asm-parisc/ide.h14
-rw-r--r--include/asm-parisc/pci.h14
-rw-r--r--include/asm-parisc/pgalloc.h6
-rw-r--r--include/asm-parisc/pgtable.h4
-rw-r--r--include/asm-ppc/ide.h12
-rw-r--r--include/asm-ppc/pci.h7
-rw-r--r--include/asm-ppc/pgtable.h8
-rw-r--r--include/asm-s390/ide.h14
-rw-r--r--include/asm-s390/pgalloc.h8
-rw-r--r--include/asm-s390/pgtable.h2
-rw-r--r--include/asm-s390x/ide.h14
-rw-r--r--include/asm-s390x/pgalloc.h8
-rw-r--r--include/asm-s390x/pgtable.h2
-rw-r--r--include/asm-sh/ide.h14
-rw-r--r--include/asm-sh/pci.h25
-rw-r--r--include/asm-sh/pgalloc.h4
-rw-r--r--include/asm-sh/pgtable.h6
-rw-r--r--include/asm-sparc/ide.h12
-rw-r--r--include/asm-sparc/pci.h14
-rw-r--r--include/asm-sparc/pgalloc.h22
-rw-r--r--include/asm-sparc/pgtable.h4
-rw-r--r--include/asm-sparc64/ide.h12
-rw-r--r--include/asm-sparc64/pci.h14
-rw-r--r--include/asm-sparc64/pgalloc.h29
-rw-r--r--include/asm-sparc64/pgtable.h30
-rw-r--r--include/linux/blkdev.h4
-rw-r--r--include/linux/file.h111
-rw-r--r--include/linux/hdreg.h643
-rw-r--r--include/linux/highmem.h23
-rw-r--r--include/linux/ide.h184
-rw-r--r--include/linux/init_task.h88
-rw-r--r--include/linux/mm.h6
-rw-r--r--include/linux/msdos_fs.h22
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/rtnetlink.h11
-rw-r--r--include/linux/sched.h143
-rw-r--r--include/linux/tcp_diag.h116
-rw-r--r--include/linux/videodev.h3
-rw-r--r--include/net/dn_fib.h4
-rw-r--r--include/net/inetpeer.h6
-rw-r--r--include/net/sock.h7
75 files changed, 1405 insertions, 606 deletions
diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h
index da698627e283..5f6f9f57649e 100644
--- a/include/asm-alpha/ide.h
+++ b/include/asm-alpha/ide.h
@@ -91,7 +91,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
index 7e9e8b213be1..ae1e9c9a2c44 100644
--- a/include/asm-alpha/pci.h
+++ b/include/asm-alpha/pci.h
@@ -101,6 +101,20 @@ extern dma_addr_t pci_map_page(struct pci_dev *, struct page *,
extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int);
+/* pci_unmap_{single,page} is not a nop, thus... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
+ dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
+ __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) \
+ ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+ (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) \
+ ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+ (((PTR)->LEN_NAME) = (VAL))
+
/* Map a set of buffers described by scatterlist in streaming mode for
PCI DMA. This is the scather-gather version of the above
pci_map_single interface. Here the scatter gather list elements
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
index af01b68cd4a3..f00acfd42a73 100644
--- a/include/asm-alpha/pgalloc.h
+++ b/include/asm-alpha/pgalloc.h
@@ -14,7 +14,7 @@ extern void __load_new_mm_context(struct mm_struct *);
/* Caches aren't brain-dead on the Alpha. */
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm, start, end) do { } while (0)
+#define flush_cache_range(vma, start, end) do { } while (0)
#define flush_cache_page(vma, vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
#define flush_dcache_page(page) do { } while (0)
@@ -206,10 +206,10 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
* Flush a specified range of user mapping: on the
* Alpha we flush the whole user tlb.
*/
-static inline void flush_tlb_range(struct mm_struct *mm,
+static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
- flush_tlb_mm(mm);
+ flush_tlb_mm(vma->vm_mm);
}
#else /* CONFIG_SMP */
@@ -217,7 +217,7 @@ static inline void flush_tlb_range(struct mm_struct *mm,
extern void flush_tlb_all(void);
extern void flush_tlb_mm(struct mm_struct *);
extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
-extern void flush_tlb_range(struct mm_struct *, unsigned long, unsigned long);
+extern void flush_tlb_range(struct vm_area_struct *, unsigned long, unsigned long);
#endif /* CONFIG_SMP */
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index 0132a0afd3e5..c3915880beed 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -344,8 +344,8 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
#define kern_addr_valid(addr) (1)
#endif
-#define io_remap_page_range(start, busaddr, size, prot) \
- remap_page_range(start, virt_to_phys(__ioremap(busaddr, size)), size, prot)
+#define io_remap_page_range(vma, start, busaddr, size, prot) \
+ remap_page_range(vma, start, virt_to_phys(__ioremap(busaddr, size)), size, prot)
#define pte_ERROR(e) \
printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
index 5b898dfee540..05161e3e07ae 100644
--- a/include/asm-arm/ide.h
+++ b/include/asm-arm/ide.h
@@ -30,7 +30,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index 720957f606d6..935f73ad7e2c 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -95,6 +95,31 @@ pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int di
/* nothing to do */
}
+/* Whether pci_unmap_{single,page} is a nop depends upon the
+ * configuration.
+ */
+#ifdef CONFIG_SA1111
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
+ dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
+ __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) \
+ ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+ (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) \
+ ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+ (((PTR)->LEN_NAME) = (VAL))
+#else /* !(CONFIG_SA1111) */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME) (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+#endif /* CONFIG_SA1111 */
+
/* 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
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 9123efe107ac..e7ed8b336ca0 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -182,8 +182,8 @@ extern void pgtable_cache_init(void);
* remap a physical address `phys' of size `size' with page protection `prot'
* into virtual address `from'
*/
-#define io_remap_page_range(from,phys,size,prot) \
- remap_page_range(from,phys,size,prot)
+#define io_remap_page_range(vma,from,phys,size,prot) \
+ remap_page_range(vma,from,phys,size,prot)
#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/proc-armo/cache.h b/include/asm-arm/proc-armo/cache.h
index b35b40438ce0..3d87ca3842b6 100644
--- a/include/asm-arm/proc-armo/cache.h
+++ b/include/asm-arm/proc-armo/cache.h
@@ -11,7 +11,7 @@
*/
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm,start,end) do { } while (0)
+#define flush_cache_range(vma,start,end) do { } while (0)
#define flush_cache_page(vma,vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
@@ -34,12 +34,12 @@
* - flush_tlb_all() flushes all processes TLBs
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_range(vma, start, end) flushes a range of pages
*/
#define flush_tlb_all() memc_update_all()
#define flush_tlb_mm(mm) memc_update_mm(mm)
-#define flush_tlb_range(mm,start,end) \
- do { memc_update_mm(mm); (void)(start); (void)(end); } while (0)
+#define flush_tlb_range(vma,start,end) \
+ do { memc_update_mm(vma->vm_mm); (void)(start); (void)(end); } while (0)
#define flush_tlb_page(vma, vmaddr) do { } while (0)
/*
diff --git a/include/asm-arm/proc-armv/cache.h b/include/asm-arm/proc-armv/cache.h
index 26989b94167c..2f5f206fc43c 100644
--- a/include/asm-arm/proc-armv/cache.h
+++ b/include/asm-arm/proc-armv/cache.h
@@ -42,9 +42,9 @@
cpu_cache_clean_invalidate_all(); \
} while (0)
-#define flush_cache_range(_mm,_start,_end) \
+#define flush_cache_range(_vma,_start,_end) \
do { \
- if ((_mm) == current->active_mm) \
+ if ((_vma)->vm_mm == current->active_mm) \
cpu_cache_clean_invalidate_range((_start), (_end), 1); \
} while (0)
@@ -214,7 +214,7 @@ static inline void flush_icache_page(struct vm_area_struct *vma, struct page *pa
* - flush_tlb_all() flushes all processes TLBs
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes TLB for specified page
- * - flush_tlb_range(mm, start, end) flushes TLB for specified range of pages
+ * - flush_tlb_range(vma, start, end) flushes TLB for specified range of pages
*
* We drain the write buffer in here to ensure that the page tables in ram
* are really up to date. It is more efficient to do this here...
@@ -248,9 +248,9 @@ static inline void flush_icache_page(struct vm_area_struct *vma, struct page *pa
*
* _mm may not be current->active_mm, but may not be NULL.
*/
-#define flush_tlb_range(_mm,_start,_end) \
+#define flush_tlb_range(_vma,_start,_end) \
do { \
- if ((_mm) == current->active_mm) \
+ if ((_mm)->vm_mm == current->active_mm) \
cpu_tlb_invalidate_range((_start), (_end)); \
} while (0)
diff --git a/include/asm-cris/ide.h b/include/asm-cris/ide.h
index 39f402021079..4ba84983c4ce 100644
--- a/include/asm-cris/ide.h
+++ b/include/asm-cris/ide.h
@@ -97,7 +97,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
/* some configuration options we don't need */
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h
index 2f2955b8ad60..a99f35703c7f 100644
--- a/include/asm-cris/pgtable.h
+++ b/include/asm-cris/pgtable.h
@@ -111,7 +111,7 @@
*/
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm, start, end) do { } while (0)
+#define flush_cache_range(vma, start, end) do { } while (0)
#define flush_cache_page(vma, vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
#define flush_dcache_page(page) do { } while (0)
@@ -125,7 +125,7 @@
* - flush_tlb_all() flushes all processes TLBs
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_range(vma, start, end) flushes a range of pages
*
*/
@@ -133,7 +133,7 @@ extern void flush_tlb_all(void);
extern void flush_tlb_mm(struct mm_struct *mm);
extern void flush_tlb_page(struct vm_area_struct *vma,
unsigned long addr);
-extern void flush_tlb_range(struct mm_struct *mm,
+extern void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start,
unsigned long end);
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index c427f7eeea67..eafce6e44ff3 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -25,7 +25,7 @@
* shootdown.
*/
typedef struct free_pte_ctx {
- struct mm_struct *mm;
+ struct vm_area_struct *vma;
unsigned long nr; /* set to ~0UL means fast mode */
unsigned long start_addr, end_addr;
pte_t ptes[FREE_PTE_NR];
@@ -37,11 +37,12 @@ extern mmu_gather_t mmu_gathers[NR_CPUS];
/* tlb_gather_mmu
* Return a pointer to an initialized mmu_gather_t.
*/
-static inline mmu_gather_t *tlb_gather_mmu(struct mm_struct *mm)
+static inline mmu_gather_t *tlb_gather_mmu(struct vm_area_struct *vma)
{
mmu_gather_t *tlb = &mmu_gathers[smp_processor_id()];
+ struct mm_struct *mm = vma->vm_mm;
- tlb->mm = mm;
+ tlb->vma = vma;
/* Use fast mode if there is only one user of this mm (this process) */
tlb->nr = (atomic_read(&(mm)->mm_users) == 1) ? ~0UL : 0UL;
return tlb;
@@ -69,7 +70,7 @@ static inline mmu_gather_t *tlb_gather_mmu(struct mm_struct *mm)
/* tlb_finish_mmu
* Called at the end of the shootdown operation to free up any resources
- * that were required. The page talbe lock is still held at this point.
+ * that were required. The page table lock is still held at this point.
*/
static inline void tlb_finish_mmu(struct free_pte_ctx *ctx, unsigned long start, unsigned long end)
{
@@ -77,13 +78,13 @@ static inline void tlb_finish_mmu(struct free_pte_ctx *ctx, unsigned long start,
/* Handle the fast case first. */
if (ctx->nr == ~0UL) {
- flush_tlb_range(ctx->mm, start, end);
+ flush_tlb_range(ctx->vma, start, end);
return;
}
nr = ctx->nr;
ctx->nr = 0;
if (nr)
- flush_tlb_range(ctx->mm, ctx->start_addr, ctx->end_addr);
+ flush_tlb_range(ctx->vma, ctx->start_addr, ctx->end_addr);
for (i=0; i < nr; i++) {
pte_t pte = ctx->ptes[i];
__free_pte(pte);
@@ -96,9 +97,9 @@ static inline void tlb_finish_mmu(struct free_pte_ctx *ctx, unsigned long start,
* attempt to get gcc to generate optimal code since this code is run on each
* page in a process at exit.
*/
-typedef struct mm_struct mmu_gather_t;
+typedef struct vm_area_struct mmu_gather_t;
-#define tlb_gather_mmu(mm) (mm)
+#define tlb_gather_mmu(vma) (vma)
#define tlb_finish_mmu(tlb, start, end) flush_tlb_range(tlb, start, end)
#define tlb_remove_page(tlb, ptep, addr) do {\
pte_t __pte = *(ptep);\
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 6ac787665c0a..6642abf4676b 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -95,7 +95,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index d794eb61d33e..0adbd337732a 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -114,6 +114,14 @@ static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
/* Nothing to do */
}
+/* pci_unmap_{page,single} is a nop so... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
+#define pci_unmap_addr_SET(PTR, ADDR_NAME, VAL) do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME) (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+
/* 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
diff --git a/include/asm-i386/pgalloc.h b/include/asm-i386/pgalloc.h
index 765e7c185ce6..090573f59076 100644
--- a/include/asm-i386/pgalloc.h
+++ b/include/asm-i386/pgalloc.h
@@ -165,7 +165,7 @@ extern int do_check_pgt_cache(int, int);
* - flush_tlb_all() flushes all processes TLBs
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_range(vma, start, end) flushes a range of pages
* - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
*
* ..but the i386 has somewhat limited tlb flushing capabilities,
@@ -191,10 +191,10 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
__flush_tlb_one(addr);
}
-static inline void flush_tlb_range(struct mm_struct *mm,
+static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
- if (mm == current->active_mm)
+ if (vma->vm_mm == current->active_mm)
__flush_tlb();
}
@@ -212,9 +212,9 @@ extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
#define flush_tlb() flush_tlb_current_task()
-static inline void flush_tlb_range(struct mm_struct * mm, unsigned long start, unsigned long end)
+static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end)
{
- flush_tlb_mm(mm);
+ flush_tlb_mm(vma->vm_mm);
}
#define TLBSTATE_OK 1
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 6f99b61e87f3..c22d56a17713 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -27,7 +27,7 @@ extern void paging_init(void);
/* Caches aren't brain-dead on the intel. */
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm, start, end) do { } while (0)
+#define flush_cache_range(vma, start, end) do { } while (0)
#define flush_cache_page(vma, vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h
index c0fe76856689..697c2c51bc7f 100644
--- a/include/asm-ia64/ide.h
+++ b/include/asm-ia64/ide.h
@@ -101,7 +101,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
index 9d5392d07b85..5be0974304c8 100644
--- a/include/asm-ia64/pci.h
+++ b/include/asm-ia64/pci.h
@@ -46,6 +46,20 @@ pcibios_penalize_isa_irq (int irq)
#define pci_dma_sync_sg platform_pci_dma_sync_sg
#define sg_dma_address platform_pci_dma_address
+/* pci_unmap_{single,page} is not a nop, thus... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
+ dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
+ __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) \
+ ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+ (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) \
+ ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+ (((PTR)->LEN_NAME) = (VAL))
+
/*
* Return whether the given PCI device DMA address mask can be supported properly. For
* example, if your device can only drive the low 24-bits during PCI bus mastering, then
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
index 671ab4351af6..8ed75d3a637f 100644
--- a/include/asm-ia64/pgalloc.h
+++ b/include/asm-ia64/pgalloc.h
@@ -181,7 +181,7 @@ flush_tlb_mm (struct mm_struct *mm)
}
}
-extern void flush_tlb_range (struct mm_struct *mm, unsigned long start, unsigned long end);
+extern void flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long end);
/*
* Page-granular tlb flush.
@@ -190,7 +190,7 @@ static inline void
flush_tlb_page (struct vm_area_struct *vma, unsigned long addr)
{
#ifdef CONFIG_SMP
- flush_tlb_range(vma->vm_mm, (addr & PAGE_MASK), (addr & PAGE_MASK) + PAGE_SIZE);
+ flush_tlb_range(vma, (addr & PAGE_MASK), (addr & PAGE_MASK) + PAGE_SIZE);
#else
if (vma->vm_mm == current->active_mm)
asm volatile ("ptc.l %0,%1" :: "r"(addr), "r"(PAGE_SHIFT << 2) : "memory");
@@ -204,9 +204,12 @@ flush_tlb_page (struct vm_area_struct *vma, unsigned long addr)
static inline void
flush_tlb_pgtables (struct mm_struct *mm, unsigned long start, unsigned long end)
{
+ struct vm_area_struct vma;
+
if (rgn_index(start) != rgn_index(end))
printk("flush_tlb_pgtables: can't flush across regions!!\n");
- flush_tlb_range(mm, ia64_thash(start), ia64_thash(end));
+ vma.vm_mm = mm;
+ flush_tlb_range(&vma, ia64_thash(start), ia64_thash(end));
}
/*
@@ -217,7 +220,7 @@ flush_tlb_pgtables (struct mm_struct *mm, unsigned long start, unsigned long end
/* Caches aren't brain-dead on the IA-64. */
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm, start, end) do { } while (0)
+#define flush_cache_range(vma, start, end) do { } while (0)
#define flush_cache_page(vma, vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h
index 10d8ac2d0326..b44b8ccab216 100644
--- a/include/asm-m68k/ide.h
+++ b/include/asm-m68k/ide.h
@@ -89,7 +89,19 @@ typedef union {
unsigned unit : 1; /* drive select number, 0 or 1 */
unsigned head : 4; /* always zeros here */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned HOB : 1; /* 48-bit address ordering */
+ unsigned reserved456 : 3;
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned bit0 : 1;
+ } b;
+} control_t;
static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *device, void *dev_id)
diff --git a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h
index b6d6671593c4..fa6585fbcf3c 100644
--- a/include/asm-m68k/motorola_pgalloc.h
+++ b/include/asm-m68k/motorola_pgalloc.h
@@ -241,10 +241,10 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr
__flush_tlb_one(addr);
}
-static inline void flush_tlb_range(struct mm_struct *mm,
+static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
- if (mm == current->mm)
+ if (vma->vm_mm == current->mm)
__flush_tlb();
}
diff --git a/include/asm-m68k/pgalloc.h b/include/asm-m68k/pgalloc.h
index 04e3b3eca6af..f67a54a355ce 100644
--- a/include/asm-m68k/pgalloc.h
+++ b/include/asm-m68k/pgalloc.h
@@ -89,11 +89,11 @@ extern inline void flush_cache_mm(struct mm_struct *mm)
__flush_cache_030();
}
-extern inline void flush_cache_range(struct mm_struct *mm,
+extern inline void flush_cache_range(struct vm_area_struct *vma,
unsigned long start,
unsigned long end)
{
- if (mm == current->mm)
+ if (vma->vm_mm == current->mm)
__flush_cache_030();
}
diff --git a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h
index bb069bbcfdd0..c9eee306f551 100644
--- a/include/asm-m68k/sun3_pgalloc.h
+++ b/include/asm-m68k/sun3_pgalloc.h
@@ -216,9 +216,10 @@ static inline void flush_tlb_page (struct vm_area_struct *vma,
}
/* Flush a range of pages from TLB. */
-static inline void flush_tlb_range (struct mm_struct *mm,
+static inline void flush_tlb_range (struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
+ struct mm_struct *mm = vma->vm_mm;
unsigned char seg, oldctx;
start &= ~SUN3_PMEG_MASK;
diff --git a/include/asm-mips/gfx.h b/include/asm-mips/gfx.h
index 7cda7a69f5e9..38b0ad5d0bdf 100644
--- a/include/asm-mips/gfx.h
+++ b/include/asm-mips/gfx.h
@@ -48,9 +48,9 @@ struct gfx_attach_board_args {
#ifdef __KERNEL__
/* umap.c */
-extern void remove_mapping (struct task_struct *, unsigned long, unsigned long);
+extern void remove_mapping (struct vm_area_struct *vma, struct task_struct *, unsigned long, unsigned long);
extern void *vmalloc_uncached (unsigned long size);
-extern int vmap_page_range (unsigned long from, unsigned long size, unsigned long vaddr);
+extern int vmap_page_range (struct vm_area_struct *vma, unsigned long from, unsigned long size, unsigned long vaddr);
#endif
#endif /* _ASM_GFX_H */
diff --git a/include/asm-mips/ide.h b/include/asm-mips/ide.h
index f55d96601fd2..26de4e40fccc 100644
--- a/include/asm-mips/ide.h
+++ b/include/asm-mips/ide.h
@@ -92,6 +92,26 @@ typedef union {
} b;
} select_t;
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+#ifdef __MIPSEB__
+ unsigned HOB : 1; /* 48-bit address ordering */
+ unsigned reserved456 : 3;
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned bit0 : 1;
+#else
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+#endif
+ } b;
+} control_t;
+
static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int,void *, struct pt_regs *),
unsigned long flags, const char *device, void *dev_id)
{
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index f4d48c7f4e82..1ae7c25df61f 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -114,6 +114,14 @@ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
/* Nothing to do */
}
+/* pci_unmap_{page,single} is a nop so... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME) (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+
/*
* Map a set of buffers described by scatterlist in streaming
* mode for DMA. This is the scather-gather version of the
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index 66c12260fe6d..9492a50dae76 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -16,12 +16,12 @@
*
* - flush_tlb_all() flushes all processes TLB entries
* - flush_tlb_mm(mm) flushes the specified mm context TLB entries
- * - flush_tlb_page(mm, vmaddr) flushes a single page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_page(vma, vmaddr) flushes a single page
+ * - flush_tlb_range(vma, start, end) flushes a range of pages
*/
extern void flush_tlb_all(void);
extern void flush_tlb_mm(struct mm_struct *mm);
-extern void flush_tlb_range(struct mm_struct *mm, unsigned long start,
+extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 71232fe8f1e2..afc0148e9b83 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -23,14 +23,14 @@
* - flush_cache_all() flushes entire cache
* - flush_cache_mm(mm) flushes the specified mm context's cache lines
* - flush_cache_page(mm, vmaddr) flushes a single page
- * - flush_cache_range(mm, start, end) flushes a range of pages
+ * - flush_cache_range(vma, start, end) flushes a range of pages
* - flush_page_to_ram(page) write back kernel page to ram
* - flush_icache_range(start, end) flush a range of instructions
*/
extern void (*_flush_cache_all)(void);
extern void (*___flush_cache_all)(void);
extern void (*_flush_cache_mm)(struct mm_struct *mm);
-extern void (*_flush_cache_range)(struct mm_struct *mm, unsigned long start,
+extern void (*_flush_cache_range)(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
extern void (*_flush_cache_page)(struct vm_area_struct *vma, unsigned long page);
extern void (*_flush_cache_sigtramp)(unsigned long addr);
@@ -44,7 +44,7 @@ extern void (*_flush_icache_page)(struct vm_area_struct *vma,
#define flush_cache_all() _flush_cache_all()
#define __flush_cache_all() ___flush_cache_all()
#define flush_cache_mm(mm) _flush_cache_mm(mm)
-#define flush_cache_range(mm,start,end) _flush_cache_range(mm,start,end)
+#define flush_cache_range(vma,start,end) _flush_cache_range(vma,start,end)
#define flush_cache_page(vma,page) _flush_cache_page(vma, page)
#define flush_cache_sigtramp(addr) _flush_cache_sigtramp(addr)
#define flush_page_to_ram(page) _flush_page_to_ram(page)
diff --git a/include/asm-mips/umap.h b/include/asm-mips/umap.h
index afa524b10f8a..940148ee2906 100644
--- a/include/asm-mips/umap.h
+++ b/include/asm-mips/umap.h
@@ -1,7 +1,7 @@
#ifndef __MIPS_UMAP_H
#define __MIPS_UMAP_H
-void remove_mapping (struct task_struct *task, unsigned long start,
+void remove_mapping (struct vm_area_struct *vma, struct task_struct *task, unsigned long start,
unsigned long end);
#endif
diff --git a/include/asm-mips64/gfx.h b/include/asm-mips64/gfx.h
index 3c701b74c29b..38ded7211e17 100644
--- a/include/asm-mips64/gfx.h
+++ b/include/asm-mips64/gfx.h
@@ -47,9 +47,9 @@ struct gfx_attach_board_args {
#ifdef __KERNEL__
/* umap.c */
-extern void remove_mapping (struct task_struct *, unsigned long, unsigned long);
+extern void remove_mapping (struct vm_area_struct *vma, struct task_struct *, unsigned long, unsigned long);
extern void *vmalloc_uncached (unsigned long size);
-extern int vmap_page_range (unsigned long from, unsigned long size, unsigned long vaddr);
+extern int vmap_page_range (struct vm_area_struct *vma, unsigned long from, unsigned long size, unsigned long vaddr);
#endif
#endif /* _ASM_GFX_H */
diff --git a/include/asm-mips64/ide.h b/include/asm-mips64/ide.h
index 8b37e1544431..2221ccc4c9d9 100644
--- a/include/asm-mips64/ide.h
+++ b/include/asm-mips64/ide.h
@@ -85,7 +85,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int,void *, struct pt_regs *),
unsigned long flags, const char *device, void *dev_id)
diff --git a/include/asm-mips64/pci.h b/include/asm-mips64/pci.h
index 5e7b91764940..d18ee0cd62ba 100644
--- a/include/asm-mips64/pci.h
+++ b/include/asm-mips64/pci.h
@@ -86,6 +86,20 @@ extern void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle,
extern void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg,
int nelems, int direction);
+/* pci_unmap_{single,page} is not a nop, thus... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
+ dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
+ __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) \
+ ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+ (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) \
+ ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+ (((PTR)->LEN_NAME) = (VAL))
+
#else /* CONFIG_MAPPED_PCI_IO */
/*
@@ -124,6 +138,14 @@ static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
/* Nothing to do */
}
+/* pci_unmap_{page,single} is a nop so... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME) (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+
/*
* Map a set of buffers described by scatterlist in streaming
* mode for DMA. This is the scather-gather version of the
diff --git a/include/asm-mips64/pgalloc.h b/include/asm-mips64/pgalloc.h
index 5954fff588b4..79b58408d660 100644
--- a/include/asm-mips64/pgalloc.h
+++ b/include/asm-mips64/pgalloc.h
@@ -15,13 +15,13 @@
*
* - flush_tlb_all() flushes all processes TLB entries
* - flush_tlb_mm(mm) flushes the specified mm context TLB entries
- * - flush_tlb_page(mm, vmaddr) flushes a single page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_page(vma, vmaddr) flushes a single page
+ * - flush_tlb_range(vma, start, end) flushes a range of pages
* - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
*/
extern void (*_flush_tlb_all)(void);
extern void (*_flush_tlb_mm)(struct mm_struct *mm);
-extern void (*_flush_tlb_range)(struct mm_struct *mm, unsigned long start,
+extern void (*_flush_tlb_range)(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
extern void (*_flush_tlb_page)(struct vm_area_struct *vma, unsigned long page);
@@ -29,14 +29,14 @@ extern void (*_flush_tlb_page)(struct vm_area_struct *vma, unsigned long page);
#define flush_tlb_all() _flush_tlb_all()
#define flush_tlb_mm(mm) _flush_tlb_mm(mm)
-#define flush_tlb_range(mm,vmaddr,end) _flush_tlb_range(mm, vmaddr, end)
+#define flush_tlb_range(vma,vmaddr,end) _flush_tlb_range(vma, vmaddr, end)
#define flush_tlb_page(vma,page) _flush_tlb_page(vma, page)
#else /* CONFIG_SMP */
extern void flush_tlb_all(void);
extern void flush_tlb_mm(struct mm_struct *);
-extern void flush_tlb_range(struct mm_struct *, unsigned long, unsigned long);
+extern void flush_tlb_range(struct vm_area_struct *, unsigned long, unsigned long);
extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
#endif /* CONFIG_SMP */
diff --git a/include/asm-mips64/pgtable.h b/include/asm-mips64/pgtable.h
index c4e31bbd1f00..6c35e0d93c81 100644
--- a/include/asm-mips64/pgtable.h
+++ b/include/asm-mips64/pgtable.h
@@ -24,11 +24,11 @@
* - flush_cache_all() flushes entire cache
* - flush_cache_mm(mm) flushes the specified mm context's cache lines
* - flush_cache_page(mm, vmaddr) flushes a single page
- * - flush_cache_range(mm, start, end) flushes a range of pages
+ * - flush_cache_range(vma, start, end) flushes a range of pages
* - flush_page_to_ram(page) write back kernel page to ram
*/
extern void (*_flush_cache_mm)(struct mm_struct *mm);
-extern void (*_flush_cache_range)(struct mm_struct *mm, unsigned long start,
+extern void (*_flush_cache_range)(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
extern void (*_flush_cache_page)(struct vm_area_struct *vma, unsigned long page);
extern void (*_flush_page_to_ram)(struct page * page);
@@ -38,7 +38,7 @@ extern void (*_flush_page_to_ram)(struct page * page);
#ifndef CONFIG_CPU_R10000
#define flush_cache_mm(mm) _flush_cache_mm(mm)
-#define flush_cache_range(mm,start,end) _flush_cache_range(mm,start,end)
+#define flush_cache_range(vma,start,end) _flush_cache_range(vma,start,end)
#define flush_cache_page(vma,page) _flush_cache_page(vma, page)
#define flush_page_to_ram(page) _flush_page_to_ram(page)
@@ -62,7 +62,7 @@ do { \
*/
extern void andes_flush_icache_page(unsigned long);
#define flush_cache_mm(mm) do { } while(0)
-#define flush_cache_range(mm,start,end) do { } while(0)
+#define flush_cache_range(vma,start,end) do { } while(0)
#define flush_cache_page(vma,page) do { } while(0)
#define flush_page_to_ram(page) do { } while(0)
#define flush_icache_range(start, end) _flush_cache_l1()
diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h
index 08d1c9408d7f..bff2c7b347ee 100644
--- a/include/asm-parisc/ide.h
+++ b/include/asm-parisc/ide.h
@@ -90,7 +90,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index e8e1e6287a86..779eda0707ce 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -172,6 +172,20 @@ static inline int pci_dma_panic(char *msg)
#define pci_map_sg(p, sg, n, d) hppa_dma_ops->map_sg(p, sg, n, d)
#define pci_unmap_sg(p, sg, n, d) hppa_dma_ops->unmap_sg(p, sg, n, d)
+/* pci_unmap_{single,page} is not a nop, thus... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
+ dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
+ __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) \
+ ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+ (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) \
+ ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+ (((PTR)->LEN_NAME) = (VAL))
+
/* For U2/Astro/Ike based platforms (which are fully I/O coherent)
** dma_sync is a NOP. Let's keep the performance path short here.
*/
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h
index 3fbabb0d3a67..d458ec27b74c 100644
--- a/include/asm-parisc/pgalloc.h
+++ b/include/asm-parisc/pgalloc.h
@@ -90,7 +90,7 @@ extern inline void flush_cache_mm(struct mm_struct *mm) {
}
#endif
-#define flush_cache_range(mm, start, end) do { \
+#define flush_cache_range(vma, start, end) do { \
__flush_dcache_range(start, (unsigned long)end - (unsigned long)start); \
__flush_icache_range(start, (unsigned long)end - (unsigned long)start); \
} while(0)
@@ -197,10 +197,10 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
}
-static inline void flush_tlb_range(struct mm_struct *mm,
+static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
- __flush_tlb_range(mm->context, start, end - start);
+ __flush_tlb_range(vma->vm_mm->context, start, end - start);
}
/*
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index 1e2fdf53ec4d..1dfe59ef444e 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -34,10 +34,10 @@ extern void kernel_set_cachemode(unsigned long addr,
#define cache_push(paddr, len) \
do { \
unsigned long vaddr = phys_to_virt(paddr); \
- flush_cache_range(&init_mm, vaddr, vaddr + len); \
+ flush_cache_range(0, vaddr, vaddr + len); \
} while(0)
#define cache_push_v(vaddr, len) \
- flush_cache_range(&init_mm, vaddr, vaddr + len)
+ flush_cache_range(0, vaddr, vaddr + len)
/*
* kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h
index bff070ea28a5..4906bffc816d 100644
--- a/include/asm-ppc/ide.h
+++ b/include/asm-ppc/ide.h
@@ -129,6 +129,18 @@ typedef union {
} b;
} select_t;
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned HOB : 1; /* 48-bit address ordering */
+ unsigned reserved456 : 3;
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned bit0 : 1;
+ } b;
+} control_t;
+
#if !defined(ide_request_irq)
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#endif
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index 7bf66190c85a..e73971cb52b1 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -102,6 +102,13 @@ static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
/* nothing to do */
}
+/* pci_unmap_{page,single} is a nop so... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME) (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
/*
* pci_{map,unmap}_single_page maps a kernel page to a dma_addr_t. identical
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 47aa26cdc47c..8093049039f4 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -18,7 +18,7 @@
extern void local_flush_tlb_all(void);
extern void local_flush_tlb_mm(struct mm_struct *mm);
extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
-extern void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
+extern void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
#define update_mmu_cache(vma, addr, pte) do { } while (0)
@@ -32,7 +32,7 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
static inline void local_flush_tlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
{ __tlbia(); }
-static inline void local_flush_tlb_range(struct mm_struct *mm,
+static inline void local_flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{ __tlbia(); }
#define update_mmu_cache(vma, addr, pte) do { } while (0)
@@ -43,7 +43,7 @@ struct vm_area_struct;
extern void local_flush_tlb_all(void);
extern void local_flush_tlb_mm(struct mm_struct *mm);
extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
-extern void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
+extern void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
/*
@@ -80,7 +80,7 @@ static inline void flush_tlb_pgtables(struct mm_struct *mm,
*/
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm, a, b) do { } while (0)
+#define flush_cache_range(vma, a, b) do { } while (0)
#define flush_cache_page(vma, p) do { } while (0)
#define flush_icache_page(vma, page) do { } while (0)
diff --git a/include/asm-s390/ide.h b/include/asm-s390/ide.h
index eb47027ff22c..528d4faef649 100644
--- a/include/asm-s390/ide.h
+++ b/include/asm-s390/ide.h
@@ -26,7 +26,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
#define ide_request_irq(irq,hand,flg,dev,id) do {} while (0)
#define ide_free_irq(irq,dev_id) do {} while (0)
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index 1f3a006759c7..4d38bda2ea28 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -156,7 +156,7 @@ extern int do_check_pgt_cache(int, int);
* called only from vmalloc/vfree
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_range(vma, start, end) flushes a range of pages
* - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
*/
@@ -196,7 +196,7 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
{
local_flush_tlb();
}
-static inline void flush_tlb_range(struct mm_struct *mm,
+static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
local_flush_tlb();
@@ -264,10 +264,10 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
{
__flush_tlb_mm(vma->vm_mm);
}
-static inline void flush_tlb_range(struct mm_struct *mm,
+static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
- __flush_tlb_mm(mm);
+ __flush_tlb_mm(vma->vm_mm);
}
#endif
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index eac4173c4531..ce43b50b7471 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -36,7 +36,7 @@ extern void paging_init(void);
/* Caches aren't brain-dead on S390. */
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm, start, end) do { } while (0)
+#define flush_cache_range(vma, start, end) do { } while (0)
#define flush_cache_page(vma, vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-s390x/ide.h b/include/asm-s390x/ide.h
index eb47027ff22c..528d4faef649 100644
--- a/include/asm-s390x/ide.h
+++ b/include/asm-s390x/ide.h
@@ -26,7 +26,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
#define ide_request_irq(irq,hand,flg,dev,id) do {} while (0)
#define ide_free_irq(irq,dev_id) do {} while (0)
diff --git a/include/asm-s390x/pgalloc.h b/include/asm-s390x/pgalloc.h
index 6a8e42e15973..72fe8a8ce19c 100644
--- a/include/asm-s390x/pgalloc.h
+++ b/include/asm-s390x/pgalloc.h
@@ -192,7 +192,7 @@ extern int do_check_pgt_cache (int, int);
* called only from vmalloc/vfree
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_range(vma, start, end) flushes a range of pages
* - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
*/
@@ -232,7 +232,7 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
{
local_flush_tlb();
}
-static inline void flush_tlb_range(struct mm_struct *mm,
+static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
local_flush_tlb();
@@ -291,10 +291,10 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
{
__flush_tlb_mm(vma->vm_mm);
}
-static inline void flush_tlb_range(struct mm_struct *mm,
+static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
- __flush_tlb_mm(mm);
+ __flush_tlb_mm(vma->vm_mm);
}
#endif
diff --git a/include/asm-s390x/pgtable.h b/include/asm-s390x/pgtable.h
index 1bc4b2f36e3d..25b30c8607cc 100644
--- a/include/asm-s390x/pgtable.h
+++ b/include/asm-s390x/pgtable.h
@@ -32,7 +32,7 @@ extern void paging_init(void);
/* Caches aren't brain-dead on S390. */
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm, start, end) do { } while (0)
+#define flush_cache_range(vma, start, end) do { } while (0)
#define flush_cache_page(vma, vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h
index 52375f498c3d..3575578b3de1 100644
--- a/include/asm-sh/ide.h
+++ b/include/asm-sh/ide.h
@@ -116,7 +116,19 @@ typedef union {
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit7 : 1; /* always 1 */
} b;
- } select_t;
+} select_t;
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned bit0 : 1;
+ unsigned nIEN : 1; /* device INTRQ to host */
+ unsigned SRST : 1; /* host soft reset bit */
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned reserved456 : 3;
+ unsigned HOB : 1; /* 48-bit address ordering */
+ } b;
+} control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
index 13d83bbd667c..fba443e92df7 100644
--- a/include/asm-sh/pci.h
+++ b/include/asm-sh/pci.h
@@ -89,6 +89,31 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
return virt_to_bus(ptr);
}
+/* pci_unmap_{single,page} being a nop depends upon the
+ * configuration.
+ */
+#ifdef CONFIG_SH_PCIDMA_NONCOHERENT
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
+ dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
+ __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) \
+ ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+ (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) \
+ ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+ (((PTR)->LEN_NAME) = (VAL))
+#else
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME) (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+#endif
+
/* Unmap a single streaming mode DMA translation. The dma_addr and size
* must match what was provided for in a previous pci_map_single call. All
* other usages are undefined.
diff --git a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h
index 0c09199af662..b6753c97397c 100644
--- a/include/asm-sh/pgalloc.h
+++ b/include/asm-sh/pgalloc.h
@@ -78,14 +78,14 @@ static inline int do_check_pgt_cache(int low, int high) { }
* - flush_tlb_all() flushes all processes TLBs
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_range(vma, start, end) flushes a range of pages
* - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
*/
extern void flush_tlb(void);
extern void flush_tlb_all(void);
extern void flush_tlb_mm(struct mm_struct *mm);
-extern void flush_tlb_range(struct mm_struct *mm, unsigned long start,
+extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
extern void __flush_tlb_page(unsigned long asid, unsigned long page);
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index cc962def542d..6c47e1bbb798 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -23,7 +23,7 @@ extern void paging_init(void);
* - flush_cache_all() flushes entire cache
* - flush_cache_mm(mm) flushes the specified mm context's cache lines
* - flush_cache_page(mm, vmaddr) flushes a single page
- * - flush_cache_range(mm, start, end) flushes a range of pages
+ * - flush_cache_range(vma, start, end) flushes a range of pages
*
* - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache
* - flush_page_to_ram(page) write back kernel page to ram
@@ -35,7 +35,7 @@ extern void paging_init(void);
*/
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm, start, end) do { } while (0)
+#define flush_cache_range(vma, start, end) do { } while (0)
#define flush_cache_page(vma, vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
#define flush_dcache_page(page) do { } while (0)
@@ -55,7 +55,7 @@ extern void paging_init(void);
extern void flush_cache_all(void);
extern void flush_cache_mm(struct mm_struct *mm);
-extern void flush_cache_range(struct mm_struct *mm, unsigned long start,
+extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
extern void flush_cache_page(struct vm_area_struct *vma, unsigned long addr);
extern void flush_dcache_page(struct page *pg);
diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h
index d4254fa1eeba..fe8e6751999e 100644
--- a/include/asm-sparc/ide.h
+++ b/include/asm-sparc/ide.h
@@ -84,6 +84,18 @@ typedef union {
} b;
} select_t;
+typedef union {
+ unsigned int all : 8; /* all of the bits together */
+ struct {
+ unsigned int HOB : 1; /* 48-bit address ordering */
+ unsigned int reserved456: 3;
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned int SRST : 1; /* host soft reset bit */
+ unsigned int nIEN : 1; /* device INTRQ to host *
+ unsigned int bit0 : 1;
+ } b;
+} control_t;
+
static __inline__ int ide_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *name, void *devid)
diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h
index 701ec03bc142..53d6d6e546a5 100644
--- a/include/asm-sparc/pci.h
+++ b/include/asm-sparc/pci.h
@@ -64,6 +64,20 @@ extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
*/
extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction);
+/* pci_unmap_{single,page} is not a nop, thus... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
+ dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
+ __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) \
+ ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+ (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) \
+ ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+ (((PTR)->LEN_NAME) = (VAL))
+
/* 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
diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h
index eabf61b512ff..f55ef69a3d88 100644
--- a/include/asm-sparc/pgalloc.h
+++ b/include/asm-sparc/pgalloc.h
@@ -1,4 +1,4 @@
-/* $Id: pgalloc.h,v 1.15 2001/10/18 09:06:37 davem Exp $ */
+/* $Id: pgalloc.h,v 1.16 2001/12/21 04:56:17 davem Exp $ */
#ifndef _SPARC_PGALLOC_H
#define _SPARC_PGALLOC_H
@@ -13,22 +13,22 @@
#ifdef CONFIG_SMP
BTFIXUPDEF_CALL(void, local_flush_cache_all, void)
BTFIXUPDEF_CALL(void, local_flush_cache_mm, struct mm_struct *)
-BTFIXUPDEF_CALL(void, local_flush_cache_range, struct mm_struct *, unsigned long, unsigned long)
+BTFIXUPDEF_CALL(void, local_flush_cache_range, struct vm_area_struct *, unsigned long, unsigned long)
BTFIXUPDEF_CALL(void, local_flush_cache_page, struct vm_area_struct *, unsigned long)
#define local_flush_cache_all() BTFIXUP_CALL(local_flush_cache_all)()
#define local_flush_cache_mm(mm) BTFIXUP_CALL(local_flush_cache_mm)(mm)
-#define local_flush_cache_range(mm,start,end) BTFIXUP_CALL(local_flush_cache_range)(mm,start,end)
+#define local_flush_cache_range(vma,start,end) BTFIXUP_CALL(local_flush_cache_range)(vma,start,end)
#define local_flush_cache_page(vma,addr) BTFIXUP_CALL(local_flush_cache_page)(vma,addr)
BTFIXUPDEF_CALL(void, local_flush_tlb_all, void)
BTFIXUPDEF_CALL(void, local_flush_tlb_mm, struct mm_struct *)
-BTFIXUPDEF_CALL(void, local_flush_tlb_range, struct mm_struct *, unsigned long, unsigned long)
+BTFIXUPDEF_CALL(void, local_flush_tlb_range, struct vm_area_struct *, unsigned long, unsigned long)
BTFIXUPDEF_CALL(void, local_flush_tlb_page, struct vm_area_struct *, unsigned long)
#define local_flush_tlb_all() BTFIXUP_CALL(local_flush_tlb_all)()
#define local_flush_tlb_mm(mm) BTFIXUP_CALL(local_flush_tlb_mm)(mm)
-#define local_flush_tlb_range(mm,start,end) BTFIXUP_CALL(local_flush_tlb_range)(mm,start,end)
+#define local_flush_tlb_range(vma,start,end) BTFIXUP_CALL(local_flush_tlb_range)(vma,start,end)
#define local_flush_tlb_page(vma,addr) BTFIXUP_CALL(local_flush_tlb_page)(vma,addr)
BTFIXUPDEF_CALL(void, local_flush_page_to_ram, unsigned long)
@@ -39,14 +39,14 @@ BTFIXUPDEF_CALL(void, local_flush_sig_insns, struct mm_struct *, unsigned long)
extern void smp_flush_cache_all(void);
extern void smp_flush_cache_mm(struct mm_struct *mm);
-extern void smp_flush_cache_range(struct mm_struct *mm,
+extern void smp_flush_cache_range(struct vm_area_struct *vma,
unsigned long start,
unsigned long end);
extern void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page);
extern void smp_flush_tlb_all(void);
extern void smp_flush_tlb_mm(struct mm_struct *mm);
-extern void smp_flush_tlb_range(struct mm_struct *mm,
+extern void smp_flush_tlb_range(struct vm_area_struct *vma,
unsigned long start,
unsigned long end);
extern void smp_flush_tlb_page(struct vm_area_struct *mm, unsigned long page);
@@ -56,18 +56,18 @@ extern void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr);
BTFIXUPDEF_CALL(void, flush_cache_all, void)
BTFIXUPDEF_CALL(void, flush_cache_mm, struct mm_struct *)
-BTFIXUPDEF_CALL(void, flush_cache_range, struct mm_struct *, unsigned long, unsigned long)
+BTFIXUPDEF_CALL(void, flush_cache_range, struct vm_area_struct *, unsigned long, unsigned long)
BTFIXUPDEF_CALL(void, flush_cache_page, struct vm_area_struct *, unsigned long)
#define flush_cache_all() BTFIXUP_CALL(flush_cache_all)()
#define flush_cache_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm)
-#define flush_cache_range(mm,start,end) BTFIXUP_CALL(flush_cache_range)(mm,start,end)
+#define flush_cache_range(vma,start,end) BTFIXUP_CALL(flush_cache_range)(vma,start,end)
#define flush_cache_page(vma,addr) BTFIXUP_CALL(flush_cache_page)(vma,addr)
#define flush_icache_range(start, end) do { } while (0)
BTFIXUPDEF_CALL(void, flush_tlb_all, void)
BTFIXUPDEF_CALL(void, flush_tlb_mm, struct mm_struct *)
-BTFIXUPDEF_CALL(void, flush_tlb_range, struct mm_struct *, unsigned long, unsigned long)
+BTFIXUPDEF_CALL(void, flush_tlb_range, struct vm_area_struct *, unsigned long, unsigned long)
BTFIXUPDEF_CALL(void, flush_tlb_page, struct vm_area_struct *, unsigned long)
extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end)
@@ -76,7 +76,7 @@ extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long st
#define flush_tlb_all() BTFIXUP_CALL(flush_tlb_all)()
#define flush_tlb_mm(mm) BTFIXUP_CALL(flush_tlb_mm)(mm)
-#define flush_tlb_range(mm,start,end) BTFIXUP_CALL(flush_tlb_range)(mm,start,end)
+#define flush_tlb_range(vma,start,end) BTFIXUP_CALL(flush_tlb_range)(vma,start,end)
#define flush_tlb_page(vma,addr) BTFIXUP_CALL(flush_tlb_page)(vma,addr)
BTFIXUPDEF_CALL(void, __flush_page_to_ram, unsigned long)
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index c7b3b20ed22b..4ed3aed45357 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.109 2001/11/13 00:49:32 davem Exp $ */
+/* $Id: pgtable.h,v 1.110 2001/12/21 04:56:17 davem Exp $ */
#ifndef _SPARC_PGTABLE_H
#define _SPARC_PGTABLE_H
@@ -445,7 +445,7 @@ extern unsigned long *sparc_valid_addr_bitmap;
#define kern_addr_valid(addr) \
(test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
-extern int io_remap_page_range(unsigned long from, unsigned long to,
+extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long to,
unsigned long size, pgprot_t prot, int space);
#include <asm-generic/pgtable.h>
diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h
index cddeb3274448..913ada4e1553 100644
--- a/include/asm-sparc64/ide.h
+++ b/include/asm-sparc64/ide.h
@@ -80,6 +80,18 @@ typedef union {
} b;
} select_t;
+typedef union {
+ unsigned int all : 8; /* all of the bits together */
+ struct {
+ unsigned int HOB : 1; /* 48-bit address ordering */
+ unsigned int reserved456: 3;
+ unsigned bit3 : 1; /* ATA-2 thingy */
+ unsigned int SRST : 1; /* host soft reset bit */
+ unsigned int nIEN : 1; /* device INTRQ to host *
+ unsigned int bit0 : 1;
+ } b;
+} control_t;
+
static __inline__ int ide_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *name, void *devid)
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index b00cae885ff4..5debe1be7c11 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -77,6 +77,20 @@ extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t
pci_map_single(dev, (page_address(page) + (off)), size, dir)
#define pci_unmap_page(dev,addr,sz,dir) pci_unmap_single(dev,addr,sz,dir)
+/* pci_unmap_{single,page} is not a nop, thus... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
+ dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
+ __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) \
+ ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+ (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) \
+ ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+ (((PTR)->LEN_NAME) = (VAL))
+
/* 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
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index 36e4e36bf6b1..ed5d98ec9bbf 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -1,4 +1,4 @@
-/* $Id: pgalloc.h,v 1.29 2001/10/20 12:38:51 davem Exp $ */
+/* $Id: pgalloc.h,v 1.30 2001/12/21 04:56:17 davem Exp $ */
#ifndef _SPARC64_PGALLOC_H
#define _SPARC64_PGALLOC_H
@@ -15,8 +15,7 @@
/* These are the same regardless of whether this is an SMP kernel or not. */
#define flush_cache_mm(__mm) \
do { if ((__mm) == current->mm) flushw_user(); } while(0)
-#define flush_cache_range(mm, start, end) \
- flush_cache_mm(mm)
+extern void flush_cache_range(struct vm_area_struct *, unsigned long, unsigned long);
#define flush_cache_page(vma, page) \
flush_cache_mm((vma)->vm_mm)
@@ -35,8 +34,10 @@ extern void __flush_icache_page(unsigned long);
extern void flush_dcache_page_impl(struct page *page);
#ifdef CONFIG_SMP
extern void smp_flush_dcache_page_impl(struct page *page, int cpu);
+extern void flush_dcache_page_all(struct mm_struct *mm, struct page *page);
#else
#define smp_flush_dcache_page_impl(page,cpu) flush_dcache_page_impl(page)
+#define flush_dcache_page_all(mm,page) flush_dcache_page_impl(page)
#endif
extern void flush_dcache_page(struct page *page);
@@ -62,11 +63,11 @@ do { if(CTX_VALID((__mm)->context)) \
__flush_tlb_mm(CTX_HWBITS((__mm)->context), SECONDARY_CONTEXT); \
} while(0)
-#define flush_tlb_range(__mm, start, end) \
-do { if(CTX_VALID((__mm)->context)) { \
+#define flush_tlb_range(__vma, start, end) \
+do { if(CTX_VALID((__vma)->vm_mm->context)) { \
unsigned long __start = (start)&PAGE_MASK; \
unsigned long __end = PAGE_ALIGN(end); \
- __flush_tlb_range(CTX_HWBITS((__mm)->context), __start, \
+ __flush_tlb_range(CTX_HWBITS((__vma)->vm_mm->context), __start, \
SECONDARY_CONTEXT, __end, PAGE_SIZE, \
(__end - __start)); \
} \
@@ -84,15 +85,15 @@ do { struct mm_struct *__mm = (vma)->vm_mm; \
extern void smp_flush_cache_all(void);
extern void smp_flush_tlb_all(void);
extern void smp_flush_tlb_mm(struct mm_struct *mm);
-extern void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start,
+extern void smp_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
unsigned long end);
extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page);
#define flush_cache_all() smp_flush_cache_all()
#define flush_tlb_all() smp_flush_tlb_all()
#define flush_tlb_mm(mm) smp_flush_tlb_mm(mm)
-#define flush_tlb_range(mm, start, end) \
- smp_flush_tlb_range(mm, start, end)
+#define flush_tlb_range(vma, start, end) \
+ smp_flush_tlb_range(vma, start, end)
#define flush_tlb_page(vma, page) \
smp_flush_tlb_page((vma)->vm_mm, page)
@@ -122,9 +123,13 @@ extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long st
vpte_base = (tlb_type == spitfire ?
VPTE_BASE_SPITFIRE :
VPTE_BASE_CHEETAH);
- flush_tlb_range(mm,
- vpte_base + (s >> (PAGE_SHIFT - 3)),
- vpte_base + (e >> (PAGE_SHIFT - 3)));
+ {
+ struct vm_area_struct vma;
+ vma.vm_mm = mm;
+ flush_tlb_range(&vma,
+ vpte_base + (s >> (PAGE_SHIFT - 3)),
+ vpte_base + (e >> (PAGE_SHIFT - 3)));
+ }
}
#undef VPTE_BASE_SPITFIRE
#undef VPTE_BASE_CHEETAH
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 4fb5bd035b8c..95060ec47b63 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.152 2001/11/12 09:43:39 davem Exp $
+/* $Id: pgtable.h,v 1.155 2001/12/21 04:56:17 davem Exp $
* pgtable.h: SpitFire page table operations.
*
* Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -19,6 +19,23 @@
#include <asm/page.h>
#include <asm/processor.h>
+/* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 16MB).
+ * The page copy blockops use 0x1000000 to 0x18000000 (16MB --> 24MB).
+ * The PROM resides in an area spanning 0xf0000000 to 0x100000000.
+ * The vmalloc area spans 0x140000000 to 0x200000000.
+ * There is a single static kernel PMD which maps from 0x0 to address
+ * 0x400000000.
+ */
+#define TLBTEMP_BASE 0x0000000001000000
+#define MODULES_VADDR 0x0000000002000000
+#define MODULES_LEN 0x000000007e000000
+#define MODULES_END 0x0000000080000000
+#define VMALLOC_START 0x0000000140000000
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+#define VMALLOC_END 0x0000000200000000
+#define LOW_OBP_ADDRESS 0x00000000f0000000
+#define HI_OBP_ADDRESS 0x0000000100000000
+
/* XXX All of this needs to be rethought so we can take advantage
* XXX cheetah's full 64-bit virtual address space, ie. no more hole
* XXX in the middle like on spitfire. -DaveM
@@ -77,13 +94,6 @@
(1) : (PTRS_PER_PGD)))
#define FIRST_USER_PGD_NR 0
-/* NOTE: TLB miss handlers depend heavily upon where this is. */
-#define VMALLOC_START 0x0000000140000000UL
-#define VMALLOC_VMADDR(x) ((unsigned long)(x))
-#define VMALLOC_END 0x0000000200000000UL
-#define LOW_OBP_ADDRESS 0xf0000000UL
-#define HI_OBP_ADDRESS 0x100000000UL
-
#define pte_ERROR(e) __builtin_trap()
#define pmd_ERROR(e) __builtin_trap()
#define pgd_ERROR(e) __builtin_trap()
@@ -290,8 +300,6 @@ extern inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space)
#define swp_entry_to_pte(x) ((pte_t) { (x).val })
extern unsigned long prom_virt_to_phys(unsigned long, int *);
-#define LOW_OBP_ADDRESS 0xf0000000UL
-#define HI_OBP_ADDRESS 0x100000000UL
extern __inline__ unsigned long
sun4u_get_pte (unsigned long addr)
@@ -328,7 +336,7 @@ extern unsigned long *sparc64_valid_addr_bitmap;
#define kern_addr_valid(addr) \
(test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))
-extern int io_remap_page_range(unsigned long from, unsigned long offset,
+extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset,
unsigned long size, pgprot_t prot, int space);
#include <asm-generic/pgtable.h>
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0cbe78286ab5..ad5250710a7c 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -80,6 +80,7 @@ enum rq_flag_bits {
*/
__REQ_DRIVE_CMD,
__REQ_DRIVE_TASK,
+ __REQ_DRIVE_ACB,
__REQ_PC, /* packet command (special) */
__REQ_BLOCK_PC, /* queued down pc from block layer */
@@ -99,11 +100,14 @@ enum rq_flag_bits {
#define REQ_DONTPREP (1 << __REQ_DONTPREP)
#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)
#define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK)
+#define REQ_DRIVE_ACB (1 << __REQ_DRIVE_ACB)
#define REQ_PC (1 << __REQ_PC)
#define REQ_SENSE (1 << __REQ_SENSE)
#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
#define REQ_SPECIAL (1 << __REQ_SPECIAL)
+#define REQ_DRIVE_TASKFILE REQ_DRIVE_ACB
+
#include <linux/elevator.h>
typedef int (merge_request_fn) (request_queue_t *, struct request *,
diff --git a/include/linux/file.h b/include/linux/file.h
index 0994be6129fd..bac31250708c 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -5,31 +5,43 @@
#ifndef __LINUX_FILE_H
#define __LINUX_FILE_H
-#include <linux/sched.h>
+#ifndef _LINUX_POSIX_TYPES_H /* __FD_CLR */
+#include <linux/posix_types.h>
+#endif
+#ifndef __LINUX_COMPILER_H /* unlikely */
+#include <linux/compiler.h>
+#endif
+
+/*
+ * The default fd array needs to be at least BITS_PER_LONG,
+ * as this is the granularity returned by copy_fdset().
+ */
+#define NR_OPEN_DEFAULT BITS_PER_LONG
+
+/*
+ * Open file table structure
+ */
+struct files_struct {
+ atomic_t count;
+ rwlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */
+ int max_fds;
+ int max_fdset;
+ int next_fd;
+ struct file ** fd; /* current fd array */
+ fd_set *close_on_exec;
+ fd_set *open_fds;
+ fd_set close_on_exec_init;
+ fd_set open_fds_init;
+ struct file * fd_array[NR_OPEN_DEFAULT];
+};
extern void FASTCALL(fput(struct file *));
extern struct file * FASTCALL(fget(unsigned int fd));
-
-static inline int get_close_on_exec(unsigned int fd)
-{
- struct files_struct *files = current->files;
- int res;
- read_lock(&files->file_lock);
- res = FD_ISSET(fd, files->close_on_exec);
- read_unlock(&files->file_lock);
- return res;
-}
+extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag));
+extern void put_filp(struct file *);
+extern int get_unused_fd(void);
+extern void FASTCALL(put_unused_fd(unsigned int fd));
-static inline void set_close_on_exec(unsigned int fd, int flag)
-{
- struct files_struct *files = current->files;
- write_lock(&files->file_lock);
- if (flag)
- FD_SET(fd, files->close_on_exec);
- else
- FD_CLR(fd, files->close_on_exec);
- write_unlock(&files->file_lock);
-}
static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
{
@@ -43,60 +55,9 @@ static inline struct file * fcheck_files(struct files_struct *files, unsigned in
/*
* Check whether the specified fd has an open file.
*/
-static inline struct file * fcheck(unsigned int fd)
-{
- struct file * file = NULL;
- struct files_struct *files = current->files;
-
- if (fd < files->max_fds)
- file = files->fd[fd];
- return file;
-}
-
-extern void put_filp(struct file *);
-
-extern int get_unused_fd(void);
-
-static inline void __put_unused_fd(struct files_struct *files, unsigned int fd)
-{
- FD_CLR(fd, files->open_fds);
- if (fd < files->next_fd)
- files->next_fd = fd;
-}
-
-static inline void put_unused_fd(unsigned int fd)
-{
- struct files_struct *files = current->files;
-
- write_lock(&files->file_lock);
- __put_unused_fd(files, fd);
- write_unlock(&files->file_lock);
-}
-
-/*
- * Install a file pointer in the fd array.
- *
- * The VFS is full of places where we drop the files lock between
- * setting the open_fds bitmap and installing the file in the file
- * array. At any such point, we are vulnerable to a dup2() race
- * installing a file in the array before us. We need to detect this and
- * fput() the struct file we are about to overwrite in this case.
- *
- * It should never happen - if we allow dup2() do it, _really_ bad things
- * will follow.
- */
-
-static inline void fd_install(unsigned int fd, struct file * file)
-{
- struct files_struct *files = current->files;
-
- write_lock(&files->file_lock);
- if (files->fd[fd])
- BUG();
- files->fd[fd] = file;
- write_unlock(&files->file_lock);
-}
+#define fcheck(fd) fcheck_files(current->files, fd)
-void put_files_struct(struct files_struct *fs);
+extern void FASTCALL(fd_install(unsigned int fd, struct file * file));
+void FASTCALL(put_files_struct(struct files_struct *fs));
#endif /* __LINUX_FILE_H */
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
index 97289e19fbf0..703b7501102b 100644
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -6,104 +6,269 @@
* Various sources.
*/
-#define HD_IRQ 14 /* the standard disk interrupt */
+#define HD_IRQ 14 /* the standard disk interrupt */
/* ide.c has its own port definitions in "ide.h" */
/* Hd controller regs. Ref: IBM AT Bios-listing */
-#define HD_DATA 0x1f0 /* _CTL when writing */
-#define HD_ERROR 0x1f1 /* see err-bits */
-#define HD_NSECTOR 0x1f2 /* nr of sectors to read/write */
-#define HD_SECTOR 0x1f3 /* starting sector */
-#define HD_LCYL 0x1f4 /* starting cylinder */
-#define HD_HCYL 0x1f5 /* high byte of starting cyl */
-#define HD_CURRENT 0x1f6 /* 101dhhhh , d=drive, hhhh=head */
-#define HD_STATUS 0x1f7 /* see status-bits */
-#define HD_FEATURE HD_ERROR /* same io address, read=error, write=feature */
-#define HD_PRECOMP HD_FEATURE /* obsolete use of this port - predates IDE */
-#define HD_COMMAND HD_STATUS /* same io address, read=status, write=cmd */
-
-#define HD_CMD 0x3f6 /* used for resets */
-#define HD_ALTSTATUS 0x3f6 /* same as HD_STATUS but doesn't clear irq */
+#define HD_DATA 0x1f0 /* _CTL when writing */
+#define HD_ERROR 0x1f1 /* see err-bits */
+#define HD_NSECTOR 0x1f2 /* nr of sectors to read/write */
+#define HD_SECTOR 0x1f3 /* starting sector */
+#define HD_LCYL 0x1f4 /* starting cylinder */
+#define HD_HCYL 0x1f5 /* high byte of starting cyl */
+#define HD_CURRENT 0x1f6 /* 101dhhhh , d=drive, hhhh=head */
+#define HD_STATUS 0x1f7 /* see status-bits */
+#define HD_FEATURE HD_ERROR /* same io address, read=error, write=feature */
+#define HD_PRECOMP HD_FEATURE /* obsolete use of this port - predates IDE */
+#define HD_COMMAND HD_STATUS /* same io address, read=status, write=cmd */
+
+#define HD_CMD 0x3f6 /* used for resets */
+#define HD_ALTSTATUS 0x3f6 /* same as HD_STATUS but doesn't clear irq */
/* remainder is shared between hd.c, ide.c, ide-cd.c, and the hdparm utility */
/* Bits of HD_STATUS */
-#define ERR_STAT 0x01
-#define INDEX_STAT 0x02
-#define ECC_STAT 0x04 /* Corrected error */
-#define DRQ_STAT 0x08
-#define SEEK_STAT 0x10
-#define WRERR_STAT 0x20
-#define READY_STAT 0x40
-#define BUSY_STAT 0x80
-
-/* Values for HD_COMMAND */
-#define WIN_RESTORE 0x10
-#define WIN_READ 0x20
-#define WIN_WRITE 0x30
-#define WIN_WRITE_VERIFY 0x3C
-#define WIN_VERIFY 0x40
-#define WIN_FORMAT 0x50
-#define WIN_INIT 0x60
-#define WIN_SEEK 0x70
-#define WIN_DIAGNOSE 0x90
-#define WIN_SPECIFY 0x91 /* set drive geometry translation */
-#define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */
-#define WIN_SETIDLE1 0xE3
-#define WIN_SETIDLE2 0x97
-
-#define WIN_STANDBYNOW1 0xE0
-#define WIN_STANDBYNOW2 0x94
-#define WIN_SLEEPNOW1 0xE6
-#define WIN_SLEEPNOW2 0x99
-#define WIN_CHECKPOWERMODE1 0xE5
-#define WIN_CHECKPOWERMODE2 0x98
-
-#define WIN_DOORLOCK 0xDE /* lock door on removable drives */
-#define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */
-
-#define WIN_MULTREAD 0xC4 /* read sectors using multiple mode */
-#define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */
-#define WIN_SETMULT 0xC6 /* enable/disable multiple mode */
-#define WIN_IDENTIFY 0xEC /* ask drive to identify itself */
-#define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */
-#define WIN_SETFEATURES 0xEF /* set special drive features */
-#define WIN_READDMA 0xC8 /* read sectors using DMA transfers */
-#define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */
-
-#define WIN_QUEUED_SERVICE 0xA2 /* */
-#define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */
-#define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */
-
-#define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */
-#define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */
-
-#define WIN_SMART 0xB0 /* self-monitoring and reporting */
-
-/* Additional drive command codes used by ATAPI devices. */
-#define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
-#define WIN_SRST 0x08 /* ATAPI soft reset command */
-#define WIN_PACKETCMD 0xA0 /* Send a packet command. */
-
-#define DISABLE_SEAGATE 0xFB
-#define EXABYTE_ENABLE_NEST 0xF0
+#define ERR_STAT 0x01
+#define INDEX_STAT 0x02
+#define ECC_STAT 0x04 /* Corrected error */
+#define DRQ_STAT 0x08
+#define SEEK_STAT 0x10
+#define WRERR_STAT 0x20
+#define READY_STAT 0x40
+#define BUSY_STAT 0x80
-/* WIN_SMART sub-commands */
+/* Bits for HD_ERROR */
+#define MARK_ERR 0x01 /* Bad address mark */
+#define TRK0_ERR 0x02 /* couldn't find track 0 */
+#define ABRT_ERR 0x04 /* Command aborted */
+#define MCR_ERR 0x08 /* media change request */
+#define ID_ERR 0x10 /* ID field not found */
+#define MC_ERR 0x20 /* media changed */
+#define ECC_ERR 0x40 /* Uncorrectable ECC error */
+#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */
+#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */
+
+/*
+ * Command Header sizes for IOCTL commands
+ * HDIO_DRIVE_CMD, HDIO_DRIVE_TASK, and HDIO_DRIVE_TASKFILE
+ */
+
+#if 0
+#include <asm/hdreg.h>
+typedef ide_ioreg_t task_ioreg_t;
+#else
+typedef unsigned char task_ioreg_t;
+#endif
+
+#define HDIO_DRIVE_CMD_HDR_SIZE 4*sizeof(task_ioreg_t)
+#define HDIO_DRIVE_TASK_HDR_SIZE 8*sizeof(task_ioreg_t)
+#define HDIO_DRIVE_HOB_HDR_SIZE 8*sizeof(task_ioreg_t)
-#define SMART_READ_VALUES 0xd0
-#define SMART_READ_THRESHOLDS 0xd1
-#define SMART_AUTOSAVE 0xd2
-#define SMART_SAVE 0xd3
-#define SMART_IMMEDIATE_OFFLINE 0xd4
-#define SMART_READ_LOG_SECTOR 0xd5
-#define SMART_WRITE_LOG_SECTOR 0xd6
-#define SMART_WRITE_THRESHOLDS 0xd7
-#define SMART_ENABLE 0xd8
-#define SMART_DISABLE 0xd9
-#define SMART_STATUS 0xda
-#define SMART_AUTO_OFFLINE 0xdb
+#define IDE_DRIVE_TASK_INVALID -1
+#define IDE_DRIVE_TASK_NO_DATA 0
+#define IDE_DRIVE_TASK_SET_XFER 1
+#define IDE_DRIVE_TASK_IN 2
+
+#define IDE_DRIVE_TASK_OUT 3
+#define IDE_DRIVE_TASK_RAW_WRITE 4
+
+struct hd_drive_cmd_hdr {
+ task_ioreg_t command;
+ task_ioreg_t sector_number;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+};
+
+typedef struct hd_drive_task_hdr {
+ task_ioreg_t data;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+ task_ioreg_t sector_number;
+ task_ioreg_t low_cylinder;
+ task_ioreg_t high_cylinder;
+ task_ioreg_t device_head;
+ task_ioreg_t command;
+} task_struct_t;
+
+typedef struct hd_drive_hob_hdr {
+ task_ioreg_t data;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+ task_ioreg_t sector_number;
+ task_ioreg_t low_cylinder;
+ task_ioreg_t high_cylinder;
+ task_ioreg_t device_head;
+ task_ioreg_t control;
+} hob_struct_t;
+
+typedef union ide_reg_valid_s {
+ unsigned all : 16;
+ struct {
+ unsigned data : 1;
+ unsigned error_feature : 1;
+ unsigned sector : 1;
+ unsigned nsector : 1;
+ unsigned lcyl : 1;
+ unsigned hcyl : 1;
+ unsigned select : 1;
+ unsigned status_command : 1;
+
+ unsigned data_hob : 1;
+ unsigned error_feature_hob : 1;
+ unsigned sector_hob : 1;
+ unsigned nsector_hob : 1;
+ unsigned lcyl_hob : 1;
+ unsigned hcyl_hob : 1;
+ unsigned select_hob : 1;
+ unsigned control_hob : 1;
+ } b;
+} ide_reg_valid_t;
+
+/*
+ * Define standard taskfile in/out register
+ */
+#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
+#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
+#define IDE_HOB_STD_OUT_FLAGS 0xC0
+#define IDE_HOB_STD_IN_FLAGS 0xC0
+
+typedef struct ide_task_request_s {
+ task_ioreg_t io_ports[8];
+ task_ioreg_t hob_ports[8];
+ ide_reg_valid_t out_flags;
+ ide_reg_valid_t in_flags;
+ int data_phase;
+ int req_cmd;
+ unsigned long out_size;
+ unsigned long in_size;
+} ide_task_request_t;
+
+typedef struct ide_ioctl_request_s {
+ ide_task_request_t *task_request;
+ unsigned char *out_buffer;
+ unsigned char *in_buffer;
+} ide_ioctl_request_t;
+
+#define TASKFILE_INVALID 0x7fff
+#define TASKFILE_48 0x8000
+
+#define TASKFILE_NO_DATA 0x0000
+
+#define TASKFILE_IN 0x0001
+#define TASKFILE_MULTI_IN 0x0002
+
+#define TASKFILE_OUT 0x0004
+#define TASKFILE_MULTI_OUT 0x0008
+#define TASKFILE_IN_OUT 0x0010
+
+#define TASKFILE_IN_DMA 0x0020
+#define TASKFILE_OUT_DMA 0x0040
+#define TASKFILE_IN_DMAQ 0x0080
+#define TASKFILE_OUT_DMAQ 0x0100
+
+#define TASKFILE_P_IN 0x0200
+#define TASKFILE_P_OUT 0x0400
+#define TASKFILE_P_IN_DMA 0x0800
+#define TASKFILE_P_OUT_DMA 0x1000
+#define TASKFILE_P_IN_DMAQ 0x2000
+#define TASKFILE_P_OUT_DMAQ 0x4000
+
+/* ATA/ATAPI Commands pre T13 Spec */
+#define WIN_NOP 0x00
+#define CFA_REQ_EXT_ERROR_CODE 0x03 /* CFA Request Extended Error Code */
+#define WIN_SRST 0x08 /* ATAPI soft reset command */
+#define WIN_DEVICE_RESET 0x08
+#define WIN_RESTORE 0x10
+#define WIN_READ 0x20 /* 28-Bit */
+#define WIN_READ_EXT 0x24 /* 48-Bit */
+#define WIN_READDMA_EXT 0x25 /* 48-Bit */
+#define WIN_READDMA_QUEUED_EXT 0x26 /* 48-Bit */
+#define WIN_READ_NATIVE_MAX_EXT 0x27 /* 48-Bit */
+#define WIN_MULTREAD_EXT 0x29 /* 48-Bit */
+#define WIN_WRITE 0x30 /* 28-Bit */
+#define WIN_WRITE_EXT 0x34 /* 48-Bit */
+#define WIN_WRITEDMA_EXT 0x35 /* 48-Bit */
+#define WIN_WRITEDMA_QUEUED_EXT 0x36 /* 48-Bit */
+#define WIN_SET_MAX_EXT 0x37 /* 48-Bit */
+#define CFA_WRITE_SECT_WO_ERASE 0x38 /* CFA Write Sectors without erase */
+#define WIN_MULTWRITE_EXT 0x39 /* 48-Bit */
+#define WIN_WRITE_VERIFY 0x3C /* 28-Bit */
+#define WIN_VERIFY 0x40 /* 28-Bit - Read Verify Sectors */
+#define WIN_VERIFY_EXT 0x42 /* 48-Bit */
+#define WIN_FORMAT 0x50
+#define WIN_INIT 0x60
+#define WIN_SEEK 0x70
+#define CFA_TRANSLATE_SECTOR 0x87 /* CFA Translate Sector */
+#define WIN_DIAGNOSE 0x90
+#define WIN_SPECIFY 0x91 /* set drive geometry translation */
+#define WIN_DOWNLOAD_MICROCODE 0x92
+#define WIN_STANDBYNOW2 0x94
+#define WIN_SETIDLE2 0x97
+#define WIN_CHECKPOWERMODE2 0x98
+#define WIN_SLEEPNOW2 0x99
+#define WIN_PACKETCMD 0xA0 /* Send a packet command. */
+#define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
+#define WIN_QUEUED_SERVICE 0xA2
+#define WIN_SMART 0xB0 /* self-monitoring and reporting */
+#define CFA_ERASE_SECTORS 0xC0
+#define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/
+#define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */
+#define WIN_SETMULT 0xC6 /* enable/disable multiple mode */
+#define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */
+#define WIN_READDMA 0xC8 /* read sectors using DMA transfers */
+#define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */
+#define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */
+#define CFA_WRITE_MULTI_WO_ERASE 0xCD /* CFA Write multiple without erase */
+#define WIN_GETMEDIASTATUS 0xDA
+#define WIN_DOORLOCK 0xDE /* lock door on removable drives */
+#define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */
+#define WIN_STANDBYNOW1 0xE0
+#define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */
+#define WIN_STANDBY 0xE2 /* Set device in Standby Mode */
+#define WIN_SETIDLE1 0xE3
+#define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */
+#define WIN_CHECKPOWERMODE1 0xE5
+#define WIN_SLEEPNOW1 0xE6
+#define WIN_FLUSH_CACHE 0xE7
+#define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */
+#define WIN_FLUSH_CACHE_EXT 0xEA /* 48-Bit */
+#define WIN_IDENTIFY 0xEC /* ask drive to identify itself */
+#define WIN_MEDIAEJECT 0xED
+#define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */
+#define WIN_SETFEATURES 0xEF /* set special drive features */
+#define EXABYTE_ENABLE_NEST 0xF0
+#define WIN_SECURITY_SET_PASS 0xF1
+#define WIN_SECURITY_UNLOCK 0xF2
+#define WIN_SECURITY_ERASE_PREPARE 0xF3
+#define WIN_SECURITY_ERASE_UNIT 0xF4
+#define WIN_SECURITY_FREEZE_LOCK 0xF5
+#define WIN_SECURITY_DISABLE 0xF6
+#define WIN_READ_NATIVE_MAX 0xF8 /* return the native maximum address */
+#define WIN_SET_MAX 0xF9
+#define DISABLE_SEAGATE 0xFB
+
+/* WIN_SMART sub-commands */
+
+#define SMART_READ_VALUES 0xD0
+#define SMART_READ_THRESHOLDS 0xD1
+#define SMART_AUTOSAVE 0xD2
+#define SMART_SAVE 0xD3
+#define SMART_IMMEDIATE_OFFLINE 0xD4
+#define SMART_READ_LOG_SECTOR 0xD5
+#define SMART_WRITE_LOG_SECTOR 0xD6
+#define SMART_WRITE_THRESHOLDS 0xD7
+#define SMART_ENABLE 0xD8
+#define SMART_DISABLE 0xD9
+#define SMART_STATUS 0xDA
+#define SMART_AUTO_OFFLINE 0xDB
+
+/* Password used in TF4 & TF5 executing SMART commands */
+
+#define SMART_LCYL_PASS 0x4F
+#define SMART_HCYL_PASS 0xC2
+
/* WIN_SETFEATURES sub-commands */
#define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */
@@ -131,6 +296,7 @@
#define SETFEATURES_DIS_DEFECT 0x04 /* Disable Defect Management */
#define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */
#define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */
+#define SETFEATURES_EN_AAM 0x42 /* Enable Automatic Acoustic Management */
#define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */
#define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */
#define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */
@@ -141,29 +307,19 @@
#define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */
#define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */
#define SETFEATURES_PREFETCH 0xAB /* Sets drive prefetch value */
+#define SETFEATURES_DIS_AAM 0xC2 /* Disable Automatic Acoustic Management */
#define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */
#define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt */
#define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt */
/* WIN_SECURITY sub-commands */
-#define SECURITY_SET_PASSWORD 0xBA /* 0xF1 */
-#define SECURITY_UNLOCK 0xBB /* 0xF2 */
-#define SECURITY_ERASE_PREPARE 0xBC /* 0xF3 */
-#define SECURITY_ERASE_UNIT 0xBD /* 0xF4 */
-#define SECURITY_FREEZE_LOCK 0xBE /* 0xF5 */
-#define SECURITY_DISABLE_PASSWORD 0xBF /* 0xF6 */
-
-/* Bits for HD_ERROR */
-#define MARK_ERR 0x01 /* Bad address mark */
-#define TRK0_ERR 0x02 /* couldn't find track 0 */
-#define ABRT_ERR 0x04 /* Command aborted */
-#define MCR_ERR 0x08 /* media change request */
-#define ID_ERR 0x10 /* ID field not found */
-#define MC_ERR 0x20 /* media changed */
-#define ECC_ERR 0x40 /* Uncorrectable ECC error */
-#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */
-#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */
+#define SECURITY_SET_PASSWORD 0xBA
+#define SECURITY_UNLOCK 0xBB
+#define SECURITY_ERASE_PREPARE 0xBC
+#define SECURITY_ERASE_UNIT 0xBD
+#define SECURITY_FREEZE_LOCK 0xBE
+#define SECURITY_DISABLE_PASSWORD 0xBF
struct hd_geometry {
unsigned char heads;
@@ -172,6 +328,14 @@ struct hd_geometry {
unsigned long start;
};
+/* BIG GEOMETRY */
+struct hd_big_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned int cylinders;
+ unsigned long start;
+};
+
/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
#define HDIO_GETGEO 0x0301 /* get device geometry */
#define HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */
@@ -186,9 +350,10 @@ struct hd_geometry {
#define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */
#define HDIO_GET_WCACHE 0x030e /* get write cache mode on|off */
#define HDIO_GET_ACOUSTIC 0x030f /* get acoustic value */
+#define HDIO_GET_ADDRESS 0x0310 /* */
#define HDIO_GET_BUSSTATE 0x031a /* get the bus state of the hwif */
-#define HDIO_TRISTATE_HWIF 0x031b /* OBSOLETE - use SET_BUSSTATE */
+#define HDIO_TRISTATE_HWIF 0x031b /* execute a channel tristate */
#define HDIO_DRIVE_RESET 0x031c /* execute a device reset */
#define HDIO_DRIVE_TASKFILE 0x031d /* execute raw taskfile */
#define HDIO_DRIVE_TASK 0x031e /* execute task and special drive command */
@@ -211,6 +376,7 @@ struct hd_geometry {
#define HDIO_SET_ACOUSTIC 0x032c /* change acoustic behavior */
#define HDIO_SET_BUSSTATE 0x032d /* set the bus state of the hwif */
#define HDIO_SET_QDMA 0x032e /* change use-qdma flag */
+#define HDIO_SET_ADDRESS 0x032f /* change lba addressing modes */
/* bus states */
enum {
@@ -219,34 +385,30 @@ enum {
BUSSTATE_TRISTATE
};
-/* BIG GEOMETRY */
-struct hd_big_geometry {
- unsigned char heads;
- unsigned char sectors;
- unsigned int cylinders;
- unsigned long start;
-};
-
/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
#define HDIO_GETGEO_BIG 0x0330 /* */
#define HDIO_GETGEO_BIG_RAW 0x0331 /* */
#define __NEW_HD_DRIVE_ID
-/* structure returned by HDIO_GET_IDENTITY, as per ANSI ATA2 rev.2f spec */
+/* structure returned by HDIO_GET_IDENTITY,
+ * as per ANSI NCITS ATA6 rev.1b spec
+ */
struct hd_driveid {
unsigned short config; /* lots of obsolete bit flags */
- unsigned short cyls; /* "physical" cyls */
+ unsigned short cyls; /* Obsolete, "physical" cyls */
unsigned short reserved2; /* reserved (word 2) */
- unsigned short heads; /* "physical" heads */
+ unsigned short heads; /* Obsolete, "physical" heads */
unsigned short track_bytes; /* unformatted bytes per track */
unsigned short sector_bytes; /* unformatted bytes per sector */
- unsigned short sectors; /* "physical" sectors per track */
+ unsigned short sectors; /* Obsolete, "physical" sectors per track */
unsigned short vendor0; /* vendor unique */
unsigned short vendor1; /* vendor unique */
- unsigned short vendor2; /* vendor unique */
+ unsigned short vendor2; /* Retired vendor unique */
unsigned char serial_no[20]; /* 0 = not_specified */
- unsigned short buf_type;
- unsigned short buf_size; /* 512 byte increments; 0 = not_specified */
+ unsigned short buf_type; /* Retired */
+ unsigned short buf_size; /* Retired, 512 byte increments
+ * 0 = not_specified
+ */
unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */
unsigned char fw_rev[8]; /* 0 = not_specified */
unsigned char model[40]; /* 0 = not_specified */
@@ -254,72 +416,223 @@ struct hd_driveid {
unsigned char vendor3; /* vendor unique */
unsigned short dword_io; /* 0=not_implemented; 1=implemented */
unsigned char vendor4; /* vendor unique */
- unsigned char capability; /* bits 0:DMA 1:LBA 2:IORDYsw 3:IORDYsup*/
+ unsigned char capability; /* (upper byte of word 49)
+ * 3: IORDYsup
+ * 2: IORDYsw
+ * 1: LBA
+ * 0: DMA
+ */
unsigned short reserved50; /* reserved (word 50) */
- unsigned char vendor5; /* vendor unique */
- unsigned char tPIO; /* 0=slow, 1=medium, 2=fast */
- unsigned char vendor6; /* vendor unique */
- unsigned char tDMA; /* 0=slow, 1=medium, 2=fast */
- unsigned short field_valid; /* bits 0:cur_ok 1:eide_ok */
- unsigned short cur_cyls; /* logical cylinders */
- unsigned short cur_heads; /* logical heads */
- unsigned short cur_sectors; /* logical sectors per track */
- unsigned short cur_capacity0; /* logical total sectors on drive */
- unsigned short cur_capacity1; /* (2 words, misaligned int) */
+ unsigned char vendor5; /* Obsolete, vendor unique */
+ unsigned char tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */
+ unsigned char vendor6; /* Obsolete, vendor unique */
+ unsigned char tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */
+ unsigned short field_valid; /* (word 53)
+ * 2: ultra_ok word 88
+ * 1: eide_ok words 64-70
+ * 0: cur_ok words 54-58
+ */
+ unsigned short cur_cyls; /* Obsolete, logical cylinders */
+ unsigned short cur_heads; /* Obsolete, l heads */
+ unsigned short cur_sectors; /* Obsolete, l sectors per track */
+ unsigned short cur_capacity0; /* Obsolete, l total sectors on drive */
+ unsigned short cur_capacity1; /* Obsolete, (2 words, misaligned int) */
unsigned char multsect; /* current multiple sector count */
unsigned char multsect_valid; /* when (bit0==1) multsect is ok */
- unsigned int lba_capacity; /* total number of sectors */
- unsigned short dma_1word; /* single-word dma info */
+ unsigned int lba_capacity; /* Obsolete, total number of sectors */
+ unsigned short dma_1word; /* Obsolete, single-word dma info */
unsigned short dma_mword; /* multiple-word dma info */
unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */
unsigned short eide_dma_min; /* min mword dma cycle time (ns) */
unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */
unsigned short eide_pio; /* min cycle time (ns), no IORDY */
unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */
- unsigned short words69_70[2]; /* reserved words 69-70 */
+ unsigned short words69_70[2]; /* reserved words 69-70
+ * future command overlap and queuing
+ */
/* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
- unsigned short words71_74[4]; /* reserved words 71-74 */
- unsigned short queue_depth; /* */
+ unsigned short words71_74[4]; /* reserved words 71-74
+ * for IDENTIFY PACKET DEVICE command
+ */
+ unsigned short queue_depth; /* (word 75)
+ * 15:5 reserved
+ * 4:0 Maximum queue depth -1
+ */
unsigned short words76_79[4]; /* reserved words 76-79 */
- unsigned short major_rev_num; /* */
- unsigned short minor_rev_num; /* */
- unsigned short command_set_1; /* bits 0:Smart 1:Security 2:Removable 3:PM */
- unsigned short command_set_2; /* bits 14:Smart Enabled 13:0 zero */
- unsigned short cfsse; /* command set-feature supported extensions */
- unsigned short cfs_enable_1; /* command set-feature enabled */
- unsigned short cfs_enable_2; /* command set-feature enabled */
- unsigned short csf_default; /* command set-feature default */
- unsigned short dma_ultra; /* */
+ unsigned short major_rev_num; /* (word 80) */
+ unsigned short minor_rev_num; /* (word 81) */
+ unsigned short command_set_1; /* (word 82) supported
+ * 15: Obsolete
+ * 14: NOP command
+ * 13: READ_BUFFER
+ * 12: WRITE_BUFFER
+ * 11: Obsolete
+ * 10: Host Protected Area
+ * 9: DEVICE Reset
+ * 8: SERVICE Interrupt
+ * 7: Release Interrupt
+ * 6: look-ahead
+ * 5: write cache
+ * 4: PACKET Command
+ * 3: Power Management Feature Set
+ * 2: Removable Feature Set
+ * 1: Security Feature Set
+ * 0: SMART Feature Set
+ */
+ unsigned short command_set_2; /* (word 83)
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13: FLUSH CACHE EXT
+ * 12: FLUSH CACHE
+ * 11: Device Configuration Overlay
+ * 10: 48-bit Address Feature Set
+ * 9: Automatic Acoustic Management
+ * 8: SET MAX security
+ * 7: reserved 1407DT PARTIES
+ * 6: SetF sub-command Power-Up
+ * 5: Power-Up in Standby Feature Set
+ * 4: Removable Media Notification
+ * 3: APM Feature Set
+ * 2: CFA Feature Set
+ * 1: READ/WRITE DMA QUEUED
+ * 0: Download MicroCode
+ */
+ unsigned short cfsse; /* (word 84)
+ * cmd set-feature supported extensions
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:3 reserved
+ * 2: Media Serial Number Valid
+ * 1: SMART selt-test supported
+ * 0: SMART error logging
+ */
+ unsigned short cfs_enable_1; /* (word 85)
+ * command set-feature enabled
+ * 15: Obsolete
+ * 14: NOP command
+ * 13: READ_BUFFER
+ * 12: WRITE_BUFFER
+ * 11: Obsolete
+ * 10: Host Protected Area
+ * 9: DEVICE Reset
+ * 8: SERVICE Interrupt
+ * 7: Release Interrupt
+ * 6: look-ahead
+ * 5: write cache
+ * 4: PACKET Command
+ * 3: Power Management Feature Set
+ * 2: Removable Feature Set
+ * 1: Security Feature Set
+ * 0: SMART Feature Set
+ */
+ unsigned short cfs_enable_2; /* (word 86)
+ * command set-feature enabled
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13: FLUSH CACHE EXT
+ * 12: FLUSH CACHE
+ * 11: Device Configuration Overlay
+ * 10: 48-bit Address Feature Set
+ * 9: Automatic Acoustic Management
+ * 8: SET MAX security
+ * 7: reserved 1407DT PARTIES
+ * 6: SetF sub-command Power-Up
+ * 5: Power-Up in Standby Feature Set
+ * 4: Removable Media Notification
+ * 3: APM Feature Set
+ * 2: CFA Feature Set
+ * 1: READ/WRITE DMA QUEUED
+ * 0: Download MicroCode
+ */
+ unsigned short csf_default; /* (word 87)
+ * command set-feature default
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:3 reserved
+ * 2: Media Serial Number Valid
+ * 1: SMART selt-test supported
+ * 0: SMART error logging
+ */
+ unsigned short dma_ultra; /* (word 88) */
unsigned short word89; /* reserved (word 89) */
unsigned short word90; /* reserved (word 90) */
unsigned short CurAPMvalues; /* current APM values */
unsigned short word92; /* reserved (word 92) */
- unsigned short hw_config; /* hardware config */
- unsigned short words94_125[32];/* reserved words 94-125 */
- unsigned short last_lun; /* reserved (word 126) */
- unsigned short word127; /* reserved (word 127) */
- unsigned short dlf; /* device lock function
+ unsigned short hw_config; /* hardware config (word 93)
+ * 15:
+ * 14:
+ * 13:
+ * 12:
+ * 11:
+ * 10:
+ * 9:
+ * 8:
+ * 7:
+ * 6:
+ * 5:
+ * 4:
+ * 3:
+ * 2:
+ * 1:
+ * 0:
+ */
+ unsigned short acoustic; /* (word 94)
+ * 15:8 Vendor's recommended value
+ * 7:0 current value
+ */
+ unsigned short words95_99[5]; /* reserved words 95-99 */
+#if 0
+ unsigned short words100_103[4] ;/* reserved words 100-103 */
+#else
+ unsigned long long lba_capacity_2;/* 48-bit total number of sectors */
+#endif
+ unsigned short words104_125[22];/* reserved words 104-125 */
+ unsigned short last_lun; /* (word 126) */
+ unsigned short word127; /* (word 127) Feature Set
+ * Removable Media Notification
+ * 15:2 reserved
+ * 1:0 00 = not supported
+ * 01 = supported
+ * 10 = reserved
+ * 11 = reserved
+ */
+ unsigned short dlf; /* (word 128)
+ * device lock function
* 15:9 reserved
- * 8 security level 1:max 0:high
- * 7:6 reserved
- * 5 enhanced erase
- * 4 expire
- * 3 frozen
- * 2 locked
- * 1 en/disabled
- * 0 capability
+ * 8 security level 1:max 0:high
+ * 7:6 reserved
+ * 5 enhanced erase
+ * 4 expire
+ * 3 frozen
+ * 2 locked
+ * 1 en/disabled
+ * 0 capability
*/
- unsigned short csfo; /* current set features options
+ unsigned short csfo; /* (word 129)
+ * current set features options
* 15:4 reserved
- * 3 auto reassign
- * 2 reverting
- * 1 read-look-ahead
- * 0 write cache
+ * 3: auto reassign
+ * 2: reverting
+ * 1: read-look-ahead
+ * 0: write cache
*/
unsigned short words130_155[26];/* reserved vendor words 130-155 */
- unsigned short word156;
+ unsigned short word156; /* reserved vendor word 156 */
unsigned short words157_159[3];/* reserved vendor words 157-159 */
- unsigned short words160_255[95];/* reserved words 160-255 */
+ unsigned short cfa_power; /* (word 160) CFA Power Mode
+ * 15 word 160 supported
+ * 14 reserved
+ * 13
+ * 12
+ * 11:0
+ */
+ unsigned short words161_175[14];/* Reserved for CFA */
+ unsigned short words176_205[31];/* Current Media Serial Number */
+ unsigned short words206_254[48];/* reserved words 206-254 */
+ unsigned short integrity_word; /* (word 255)
+ * 15:8 Checksum
+ * 7:0 Signature
+ */
};
/*
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 7aa92d2c257a..118afad79eb4 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -95,17 +95,6 @@ static inline void clear_highpage(struct page *page)
kunmap(page);
}
-static inline void memclear_highpage(struct page *page, unsigned int offset, unsigned int size)
-{
- char *kaddr;
-
- if (offset + size > PAGE_SIZE)
- BUG();
- kaddr = kmap(page);
- memset(kaddr + offset, 0, size);
- kunmap(page);
-}
-
/*
* Same but also flushes aliased cache contents to RAM.
*/
@@ -117,6 +106,7 @@ static inline void memclear_highpage_flush(struct page *page, unsigned int offse
BUG();
kaddr = kmap(page);
memset(kaddr + offset, 0, size);
+ flush_dcache_page(page);
flush_page_to_ram(page);
kunmap(page);
}
@@ -132,15 +122,4 @@ static inline void copy_user_highpage(struct page *to, struct page *from, unsign
kunmap_atomic(vto, KM_USER1);
}
-static inline void copy_highpage(struct page *to, struct page *from)
-{
- char *vfrom, *vto;
-
- vfrom = kmap(from);
- vto = kmap(to);
- copy_page(vto, vfrom);
- kunmap(from);
- kunmap(to);
-}
-
#endif /* _LINUX_HIGHMEM_H */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index a8e2d11c46a7..b5e752a49e7d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -65,13 +65,14 @@ void cmd640_dump_regs (void);
/*
* IDE_DRIVE_CMD is used to implement many features of the hdparm utility
*/
-#define IDE_DRIVE_CMD 99 /* (magic) undef to reduce kernel size*/
+#define IDE_DRIVE_CMD 99 /* (magic) undef to reduce kernel size*/
+
+#define IDE_DRIVE_TASK 98
/*
- * IDE_DRIVE_TASK is used to implement many features needed for raw tasks
+ * IDE_DRIVE_TASKFILE is used to implement many features needed for raw tasks
*/
-#define IDE_DRIVE_TASK 98
-#define IDE_DRIVE_CMD_AEB 98
+#define IDE_DRIVE_TASKFILE 97
/*
* "No user-serviceable parts" beyond this point :)
@@ -120,6 +121,17 @@ typedef unsigned char byte; /* used everywhere */
#define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET
#define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET
+#define IDE_DATA_OFFSET_HOB (0)
+#define IDE_ERROR_OFFSET_HOB (1)
+#define IDE_NSECTOR_OFFSET_HOB (2)
+#define IDE_SECTOR_OFFSET_HOB (3)
+#define IDE_LCYL_OFFSET_HOB (4)
+#define IDE_HCYL_OFFSET_HOB (5)
+#define IDE_SELECT_OFFSET_HOB (6)
+#define IDE_CONTROL_OFFSET_HOB (7)
+
+#define IDE_FEATURE_OFFSET_HOB IDE_ERROR_OFFSET_HOB
+
#define IDE_DATA_REG (HWIF(drive)->io_ports[IDE_DATA_OFFSET])
#define IDE_ERROR_REG (HWIF(drive)->io_ports[IDE_ERROR_OFFSET])
#define IDE_NSECTOR_REG (HWIF(drive)->io_ports[IDE_NSECTOR_OFFSET])
@@ -131,6 +143,16 @@ typedef unsigned char byte; /* used everywhere */
#define IDE_CONTROL_REG (HWIF(drive)->io_ports[IDE_CONTROL_OFFSET])
#define IDE_IRQ_REG (HWIF(drive)->io_ports[IDE_IRQ_OFFSET])
+#define IDE_DATA_REG_HOB (HWIF(drive)->io_ports[IDE_DATA_OFFSET])
+#define IDE_ERROR_REG_HOB (HWIF(drive)->io_ports[IDE_ERROR_OFFSET])
+#define IDE_NSECTOR_REG_HOB (HWIF(drive)->io_ports[IDE_NSECTOR_OFFSET])
+#define IDE_SECTOR_REG_HOB (HWIF(drive)->io_ports[IDE_SECTOR_OFFSET])
+#define IDE_LCYL_REG_HOB (HWIF(drive)->io_ports[IDE_LCYL_OFFSET])
+#define IDE_HCYL_REG_HOB (HWIF(drive)->io_ports[IDE_HCYL_OFFSET])
+#define IDE_SELECT_REG_HOB (HWIF(drive)->io_ports[IDE_SELECT_OFFSET])
+#define IDE_STATUS_REG_HOB (HWIF(drive)->io_ports[IDE_STATUS_OFFSET])
+#define IDE_CONTROL_REG_HOB (HWIF(drive)->io_ports[IDE_CONTROL_OFFSET])
+
#define IDE_FEATURE_REG IDE_ERROR_REG
#define IDE_COMMAND_REG IDE_STATUS_REG
#define IDE_ALTSTATUS_REG IDE_CONTROL_REG
@@ -171,11 +193,21 @@ typedef unsigned char byte; /* used everywhere */
#define PARTN_BITS 6 /* number of minor dev bits for partitions */
#define PARTN_MASK ((1<<PARTN_BITS)-1) /* a useful bit mask */
#define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */
-#define SECTOR_WORDS (512 / 4) /* number of 32bit words per sector */
+#define CASCADE_DRIVES 8 /* per interface; 8|2 assumed by lots of code */
+#define SECTOR_SIZE 512
+#define SECTOR_WORDS (SECTOR_SIZE / 4) /* number of 32bit words per sector */
#define IDE_LARGE_SEEK(b1,b2,t) (((b1) > (b2) + (t)) || ((b2) > (b1) + (t)))
#define IDE_MIN(a,b) ((a)<(b) ? (a):(b))
#define IDE_MAX(a,b) ((a)>(b) ? (a):(b))
+#ifndef SPLIT_WORD
+# define SPLIT_WORD(W,HB,LB) ((HB)=(W>>8), (LB)=(W-((W>>8)<<8)))
+#endif
+#ifndef MAKE_WORD
+# define MAKE_WORD(W,HB,LB) ((W)=((HB<<8)+LB))
+#endif
+
+
/*
* Timeouts for various operations:
*/
@@ -185,8 +217,7 @@ typedef unsigned char byte; /* used everywhere */
#else
#define WAIT_READY (3*HZ/100) /* 30msec - should be instantaneous */
#endif /* CONFIG_APM || CONFIG_APM_MODULE */
-#define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?)
- if all ATAPI CD is closed at boot */
+#define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */
#define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */
#define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */
#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */
@@ -224,6 +255,11 @@ typedef unsigned char byte; /* used everywhere */
(drive)->quirk_list = hwif->quirkproc(drive); \
}
+#define HOST(hwif,chipset) \
+{ \
+ return ((hwif)->chipset == chipset) ? 1 : 0; \
+}
+
#define IDE_DEBUG(lineno) \
printk("%s,%s,line=%d\n", __FILE__, __FUNCTION__, (lineno))
@@ -249,11 +285,11 @@ typedef enum { ide_unknown, ide_generic, ide_pci,
ide_pmac, ide_etrax100
} hwif_chipset_t;
+
#define IDE_CHIPSET_PCI_MASK \
((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx))
#define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1)
-
/*
* Structure to hold all information about the location of this port
*/
@@ -292,16 +328,20 @@ void ide_setup_ports( hw_regs_t *hw,
#ifndef HAVE_ARCH_OUT_BYTE
#ifdef REALLY_FAST_IO
#define OUT_BYTE(b,p) outb((b),(p))
+#define OUT_WORD(w,p) outw((w),(p))
#else
#define OUT_BYTE(b,p) outb_p((b),(p))
+#define OUT_WORD(w,p) outw_p((w),(p))
#endif
#endif
#ifndef HAVE_ARCH_IN_BYTE
#ifdef REALLY_FAST_IO
-#define IN_BYTE(p) (byte)inb_p(p)
-#else
#define IN_BYTE(p) (byte)inb(p)
+#define IN_WORD(p) (short)inw(p)
+#else
+#define IN_BYTE(p) (byte)inb_p(p)
+#define IN_WORD(p) (short)inw_p(p)
#endif
#endif
@@ -361,6 +401,7 @@ typedef struct ide_drive_s {
unsigned autotune : 2; /* 1=autotune, 2=noautotune, 0=default */
unsigned remap_0_to_1 : 2; /* 0=remap if ezdrive, 1=remap, 2=noremap */
unsigned ata_flash : 1; /* 1=present, 0=default */
+ unsigned addressing; /* : 2; 0=28-bit, 1=48-bit, 2=64-bit */
byte scsi; /* 0=default, 1=skip current ide-subdriver for ide-scsi emulation */
byte media; /* disk, cdrom, tape, floppy, ... */
select_t select; /* basic drive/head select reg value */
@@ -373,7 +414,7 @@ typedef struct ide_drive_s {
byte bad_wstat; /* used for ignoring WRERR_STAT */
byte nowerr; /* used for ignoring WRERR_STAT */
byte sect0; /* offset of first sector for DM6:DDO */
- byte usage; /* current "open()" count for drive */
+ unsigned int usage; /* current "open()" count for drive */
byte head; /* "real" number of heads */
byte sect; /* "real" sectors per track */
byte bios_head; /* BIOS/fdisk/LILO number of heads */
@@ -381,6 +422,7 @@ typedef struct ide_drive_s {
unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */
unsigned int cyl; /* "real" number of cyls */
unsigned long capacity; /* total number of sectors */
+ unsigned long long capacity48; /* total number of sectors */
unsigned int drive_data; /* for use by tuneproc/selectproc as needed */
void *hwif; /* actually (ide_hwif_t *) */
wait_queue_head_t wqueue; /* used to wait for drive in open() */
@@ -402,6 +444,8 @@ typedef struct ide_drive_s {
byte init_speed; /* transfer rate set at boot */
byte current_speed; /* current transfer rate set */
byte dn; /* now wide spread use */
+ byte wcache; /* status of write cache */
+ byte acoustic; /* acoustic management */
unsigned int failures; /* current failure count */
unsigned int max_failures; /* maximum allowed failure count */
} ide_drive_t;
@@ -471,7 +515,7 @@ typedef void (ide_rw_proc_t) (ide_drive_t *, ide_dma_action_t);
/*
* ide soft-power support
*/
-typedef int (ide_busproc_t) (struct hwif_s *, int);
+typedef int (ide_busproc_t) (ide_drive_t *, int);
#ifdef CONFIG_BLK_DEV_IDEPCI
typedef struct ide_pci_devid_s {
@@ -538,7 +582,6 @@ typedef struct hwif_s {
byte bus_state; /* power state of the IDE bus */
} ide_hwif_t;
-
/*
* Status returned from various ide_ functions
*/
@@ -550,7 +593,9 @@ typedef enum {
/*
* internal ide interrupt handler type
*/
+typedef ide_startstop_t (ide_pre_handler_t)(ide_drive_t *, struct request *);
typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
+typedef ide_startstop_t (ide_post_handler_t)(ide_drive_t *);
/*
* when ide_timer_expiry fires, invoke a handler of this type
@@ -573,6 +618,8 @@ typedef struct hwgroup_s {
ide_expiry_t *expiry; /* queried upon timeouts */
} ide_hwgroup_t;
+/* structure attached to the request for IDE_TASK_CMDS */
+
/*
* configurable drive settings
*/
@@ -623,6 +670,8 @@ typedef struct {
#ifdef CONFIG_PROC_FS
void proc_ide_create(void);
void proc_ide_destroy(void);
+void recreate_proc_ide_device(ide_hwif_t *, ide_drive_t *);
+void destroy_proc_ide_device(ide_hwif_t *, ide_drive_t *);
void destroy_proc_ide_drives(ide_hwif_t *);
void create_proc_ide_interfaces(void);
void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void *data);
@@ -655,6 +704,8 @@ read_proc_t proc_ide_read_geometry;
#define IDE_SUBDRIVER_VERSION 1
typedef int (ide_cleanup_proc)(ide_drive_t *);
+typedef int (ide_standby_proc)(ide_drive_t *);
+typedef int (ide_flushcache_proc)(ide_drive_t *);
typedef ide_startstop_t (ide_do_request_proc)(ide_drive_t *, struct request *, unsigned long);
typedef void (ide_end_request_proc)(byte, ide_hwgroup_t *);
typedef int (ide_ioctl_proc)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long);
@@ -676,6 +727,8 @@ typedef struct ide_driver_s {
unsigned supports_dma : 1;
unsigned supports_dsc_overlap : 1;
ide_cleanup_proc *cleanup;
+ ide_standby_proc *standby;
+ ide_flushcache_proc *flushcache;
ide_do_request_proc *do_request;
ide_end_request_proc *end_request;
ide_ioctl_proc *ioctl;
@@ -733,19 +786,7 @@ extern int noautodma;
inline int __ide_end_request(ide_hwgroup_t *, int, int);
int ide_end_request(byte uptodate, ide_hwgroup_t *hwgroup);
-/*
- * This is used for (nearly) all data transfers from/to the IDE interface
- * FIXME for 2.5, to a pointer pass verses memcpy........
- */
-void ide_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
-void ide_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
-
-/*
- * This is used for (nearly) all ATAPI data transfers from/to the IDE interface
- * FIXME for 2.5, to a pointer pass verses memcpy........
- */
-void atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount);
-void atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount);
+int drive_is_ready (ide_drive_t *drive);
/*
* This is used on exit from the driver, to designate the next irq handler
@@ -768,7 +809,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
* Issue a simple drive command
* The drive must be selected beforehand.
*/
-void ide_cmd(ide_drive_t *drive, byte cmd, byte nsect, ide_handler_t *handler);
+void ide_cmd (ide_drive_t *drive, byte cmd, byte nsect, ide_handler_t *handler);
/*
* ide_fixstring() cleans up and (optionally) byte-swaps a text string,
@@ -883,24 +924,91 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
/*
* Clean up after success/failure of an explicit drive cmd.
* stat/err are used only when (HWGROUP(drive)->rq->cmd == IDE_DRIVE_CMD).
+ * stat/err are used only when (HWGROUP(drive)->rq->cmd == IDE_DRIVE_TASK_MASK).
*/
void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err);
/*
- * Issue ATA command and wait for completion.
+ * Issue ATA command and wait for completion. use for implementing commands in kernel
*/
int ide_wait_cmd (ide_drive_t *drive, int cmd, int nsect, int feature, int sectors, byte *buf);
+
int ide_wait_cmd_task (ide_drive_t *drive, byte *buf);
+
+typedef struct ide_task_s {
+ task_ioreg_t tfRegister[8];
+ task_ioreg_t hobRegister[8];
+ ide_reg_valid_t tf_out_flags;
+ ide_reg_valid_t tf_in_flags;
+ int data_phase;
+ int command_type;
+ ide_pre_handler_t *prehandler;
+ ide_handler_t *handler;
+ ide_post_handler_t *posthandler;
+ void *special; /* valid_t generally */
+ struct request *rq; /* copy of request */
+ unsigned long block; /* copy of block */
+} ide_task_t;
+
+void ata_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
+void ata_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
+void atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount);
+void atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount);
+void taskfile_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
+void taskfile_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
+
+/*
+ * taskfile io for disks for now...
+ */
+ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task);
+
+/*
+ * Builds request from ide_ioctl
+ */
+void do_taskfile (ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile, ide_handler_t *handler);
+
+/*
+ * Special Flagged Register Validation Caller
+ */
+// ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task);
+
+ide_startstop_t set_multmode_intr (ide_drive_t *drive);
+ide_startstop_t set_geometry_intr (ide_drive_t *drive);
+ide_startstop_t recal_intr (ide_drive_t *drive);
+ide_startstop_t task_no_data_intr (ide_drive_t *drive);
+ide_startstop_t task_in_intr (ide_drive_t *drive);
+ide_startstop_t task_mulin_intr (ide_drive_t *drive);
+ide_startstop_t pre_task_out_intr (ide_drive_t *drive, struct request *rq);
+ide_startstop_t task_out_intr (ide_drive_t *drive);
+ide_startstop_t task_mulout_intr (ide_drive_t *drive);
+void ide_init_drive_taskfile (struct request *rq);
+
+int ide_wait_taskfile (ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile, byte *buf);
+
+int ide_raw_taskfile (ide_drive_t *drive, ide_task_t *cmd, byte *buf);
+
+ide_pre_handler_t * ide_pre_handler_parser (struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile);
+ide_handler_t * ide_handler_parser (struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile);
+/* Expects args is a full set of TF registers and parses the command type */
+int ide_cmd_type_parser (ide_task_t *args);
+
+int ide_taskfile_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
+int ide_cmd_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
+int ide_task_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
+
+#ifdef CONFIG_PKT_TASK_IOCTL
+int pkt_taskfile_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
+#endif /* CONFIG_PKT_TASK_IOCTL */
void ide_delay_50ms (void);
int system_bus_clock(void);
byte ide_auto_reduce_xfer (ide_drive_t *drive);
int ide_driveid_update (ide_drive_t *drive);
-int ide_ata66_check (ide_drive_t *drive, byte cmd, byte nsect, byte feature);
+int ide_ata66_check (ide_drive_t *drive, ide_task_t *args);
int ide_config_drive_speed (ide_drive_t *drive, byte speed);
byte eighty_ninty_three (ide_drive_t *drive);
-int set_transfer (ide_drive_t *drive, byte cmd, byte nsect, byte feature);
+int set_transfer (ide_drive_t *drive, ide_task_t *args);
/*
* ide_system_bus_speed() returns what we think is the system VESA/PCI
@@ -911,12 +1019,6 @@ int set_transfer (ide_drive_t *drive, byte cmd, byte nsect, byte feature);
int ide_system_bus_speed (void);
/*
- * ide_multwrite() transfers a block of up to mcount sectors of data
- * to a drive as part of a disk multwrite operation.
- */
-int ide_multwrite (ide_drive_t *drive, unsigned int mcount);
-
-/*
* idedisk_input_data() is a wrapper around ide_input_data() which copes
* with byte-swapping the input data if required.
*/
@@ -951,23 +1053,30 @@ extern struct block_device_operations ide_fops[];
extern ide_proc_entry_t generic_subdriver_entries[];
#endif
+int ide_reinit_drive (ide_drive_t *drive);
+
#ifdef _IDE_C
#ifdef CONFIG_BLK_DEV_IDE
int ideprobe_init (void);
#endif /* CONFIG_BLK_DEV_IDE */
#ifdef CONFIG_BLK_DEV_IDEDISK
+int idedisk_reinit (ide_drive_t *drive);
int idedisk_init (void);
#endif /* CONFIG_BLK_DEV_IDEDISK */
#ifdef CONFIG_BLK_DEV_IDECD
+int ide_cdrom_reinit (ide_drive_t *drive);
int ide_cdrom_init (void);
#endif /* CONFIG_BLK_DEV_IDECD */
#ifdef CONFIG_BLK_DEV_IDETAPE
+int idetape_reinit (ide_drive_t *drive);
int idetape_init (void);
#endif /* CONFIG_BLK_DEV_IDETAPE */
#ifdef CONFIG_BLK_DEV_IDEFLOPPY
+int idefloppy_reinit (ide_drive_t *drive);
int idefloppy_init (void);
#endif /* CONFIG_BLK_DEV_IDEFLOPPY */
#ifdef CONFIG_BLK_DEV_IDESCSI
+int idescsi_reinit (ide_drive_t *drive);
int idescsi_init (void);
#endif /* CONFIG_BLK_DEV_IDESCSI */
#endif /* _IDE_C */
@@ -1007,6 +1116,9 @@ unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif, int extra, const char *
void hwif_unregister (ide_hwif_t *hwif);
+void export_ide_init_queue (ide_drive_t *drive);
+byte export_probe_for_drive (ide_drive_t *drive);
+
extern spinlock_t ide_lock;
#endif /* _IDE_H */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
new file mode 100644
index 000000000000..3c4e71fc0a60
--- /dev/null
+++ b/include/linux/init_task.h
@@ -0,0 +1,88 @@
+#ifndef _LINUX__INIT_TASK_H
+#define _LINUX__INIT_TASK_H
+
+#ifndef __LINUX_FILE_H
+#include <linux/file.h>
+#endif
+
+#define INIT_FILES \
+{ \
+ count: ATOMIC_INIT(1), \
+ file_lock: RW_LOCK_UNLOCKED, \
+ max_fds: NR_OPEN_DEFAULT, \
+ max_fdset: __FD_SETSIZE, \
+ next_fd: 0, \
+ fd: &init_files.fd_array[0], \
+ close_on_exec: &init_files.close_on_exec_init, \
+ open_fds: &init_files.open_fds_init, \
+ close_on_exec_init: { { 0, } }, \
+ open_fds_init: { { 0, } }, \
+ fd_array: { NULL, } \
+}
+
+#define INIT_MM(name) \
+{ \
+ mm_rb: RB_ROOT, \
+ pgd: swapper_pg_dir, \
+ mm_users: ATOMIC_INIT(2), \
+ mm_count: ATOMIC_INIT(1), \
+ mmap_sem: __RWSEM_INITIALIZER(name.mmap_sem), \
+ page_table_lock: SPIN_LOCK_UNLOCKED, \
+ mmlist: LIST_HEAD_INIT(name.mmlist), \
+}
+
+#define INIT_SIGNALS { \
+ count: ATOMIC_INIT(1), \
+ action: { {{0,}}, }, \
+ siglock: SPIN_LOCK_UNLOCKED \
+}
+
+/*
+ * INIT_TASK is used to set up the first task table, touch at
+ * your own risk!. Base=0, limit=0x1fffff (=2MB)
+ */
+#define INIT_TASK(tsk) \
+{ \
+ state: 0, \
+ flags: 0, \
+ sigpending: 0, \
+ addr_limit: KERNEL_DS, \
+ exec_domain: &default_exec_domain, \
+ lock_depth: -1, \
+ __nice: DEF_USER_NICE, \
+ policy: SCHED_OTHER, \
+ cpus_allowed: -1, \
+ mm: NULL, \
+ active_mm: &init_mm, \
+ run_list: LIST_HEAD_INIT(tsk.run_list), \
+ time_slice: NICE_TO_TIMESLICE(DEF_USER_NICE), \
+ next_task: &tsk, \
+ prev_task: &tsk, \
+ p_opptr: &tsk, \
+ p_pptr: &tsk, \
+ thread_group: LIST_HEAD_INIT(tsk.thread_group), \
+ wait_chldexit: __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\
+ real_timer: { \
+ function: it_real_fn \
+ }, \
+ cap_effective: CAP_INIT_EFF_SET, \
+ cap_inheritable: CAP_INIT_INH_SET, \
+ cap_permitted: CAP_FULL_SET, \
+ keep_capabilities: 0, \
+ rlim: INIT_RLIMITS, \
+ user: INIT_USER, \
+ comm: "swapper", \
+ thread: INIT_THREAD, \
+ fs: &init_fs, \
+ files: &init_files, \
+ sigmask_lock: SPIN_LOCK_UNLOCKED, \
+ sig: &init_signals, \
+ pending: { NULL, &tsk.pending.head, {{0}}}, \
+ blocked: {{0}}, \
+ alloc_lock: SPIN_LOCK_UNLOCKED, \
+ journal_info: NULL, \
+}
+
+
+
+#endif
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 51363ad4e1e0..ba870227f387 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -356,10 +356,10 @@ struct file *shmem_file_setup(char * name, loff_t size);
extern void shmem_lock(struct file * file, int lock);
extern int shmem_zero_setup(struct vm_area_struct *);
-extern void zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long size);
+extern void zap_page_range(struct vm_area_struct *vma, unsigned long address, unsigned long size);
extern int copy_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma);
-extern int remap_page_range(unsigned long from, unsigned long to, unsigned long size, pgprot_t prot);
-extern int zeromap_page_range(unsigned long from, unsigned long size, pgprot_t prot);
+extern int remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long to, unsigned long size, pgprot_t prot);
+extern int zeromap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long size, pgprot_t prot);
extern int vmtruncate(struct inode * inode, loff_t offset);
extern pmd_t *FASTCALL(__pmd_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address));
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 63efd4caea6f..49d37edb82ba 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -19,13 +19,14 @@
#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */
+/* directory limit */
+#define FAT_MAX_DIR_ENTRIES (65536)
+#define FAT_MAX_DIR_SIZE (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
+
#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
#define FAT_CACHE 8 /* FAT cache size */
-#define MSDOS_MAX_EXTRA 3 /* tolerate up to that number of clusters which are
- inaccessible because the FAT is too short */
-
#define ATTR_RO 1 /* read-only */
#define ATTR_HIDDEN 2 /* hidden */
#define ATTR_SYS 4 /* system */
@@ -48,11 +49,6 @@
#define CASE_LOWER_BASE 8 /* base is lower case */
#define CASE_LOWER_EXT 16 /* extension is lower case */
-#define SCAN_ANY 0 /* either hidden or not */
-#define SCAN_HID 1 /* only hidden */
-#define SCAN_NOTHID 2 /* only not hidden */
-#define SCAN_NOTANY 3 /* test name, then use SCAN_HID or SCAN_NOTHID */
-
#define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */
#define IS_FREE(n) (!*(n) || *(const unsigned char *) (n) == DELETED_FLAG)
@@ -78,8 +74,8 @@
#define FAT_FSINFO_SIG1 0x41615252
#define FAT_FSINFO_SIG2 0x61417272
-#define IS_FSINFO(x) (CF_LE_L((x)->signature1) == FAT_FSINFO_SIG1 \
- && CF_LE_L((x)->signature2) == FAT_FSINFO_SIG2)
+#define IS_FSINFO(x) (CF_LE_L((x)->signature1) == FAT_FSINFO_SIG1 \
+ && CF_LE_L((x)->signature2) == FAT_FSINFO_SIG2)
/*
* Inode flags
@@ -184,10 +180,6 @@ struct vfat_slot_info {
int ino; /* ino for the file */
};
-/* Determine whether this FS has kB-aligned data. */
-#define MSDOS_CAN_BMAP(mib) (!(((mib)->cluster_size & 1) || \
- ((mib)->data_start & 1)))
-
/* Convert attribute bits and a mask to the UNIX mode. */
#define MSDOS_MKMODE(a,m) (m & (a & ATTR_RO ? S_IRUGO|S_IXUGO : S_IRWXUGO))
@@ -297,7 +289,7 @@ extern void fat_write_inode(struct inode *inode, int wait);
extern int fat_notify_change(struct dentry * dentry, struct iattr * attr);
/* fat/misc.c */
-extern void fat_fs_panic(struct super_block *s, const char *msg);
+extern void fat_fs_panic(struct super_block *s, const char *fmt, ...);
extern int fat_is_binary(char conversion, char *extension);
extern void lock_fat(struct super_block *sb);
extern void unlock_fat(struct super_block *sb);
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 3bc55e03d1e3..226767fbbfb2 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -5,6 +5,7 @@
#define NETLINK_SKIP 1 /* Reserved for ENskip */
#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
#define NETLINK_FIREWALL 3 /* Firewalling hook */
+#define NETLINK_TCPDIAG 4 /* TCP socket monitoring */
#define NETLINK_ARPD 8
#define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */
#define NETLINK_IP6_FW 13
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index dd55198d9397..4f6105ff6667 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -546,7 +546,6 @@ static __inline__ int rtattr_strcmp(struct rtattr *rta, char *str)
extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len);
-#ifdef CONFIG_RTNETLINK
extern struct sock *rtnl;
struct rtnetlink_link
@@ -568,12 +567,6 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
-#else
-
-#define rtmsg_ifinfo(a,b,c) do { } while (0)
-
-#endif
-
extern struct semaphore rtnl_sem;
#define rtnl_exlock() do { } while(0)
@@ -583,14 +576,10 @@ extern struct semaphore rtnl_sem;
#define rtnl_shlock() down(&rtnl_sem)
#define rtnl_shlock_nowait() down_trylock(&rtnl_sem)
-#ifndef CONFIG_RTNETLINK
-#define rtnl_shunlock() up(&rtnl_sem)
-#else
#define rtnl_shunlock() do { up(&rtnl_sem); \
if (rtnl && rtnl->receive_queue.qlen) \
rtnl->data_ready(rtnl, 0); \
} while(0)
-#endif
extern void rtnl_lock(void);
extern void rtnl_unlock(void);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 14b6388cc3c2..b8d564fd0c08 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -156,44 +156,7 @@ extern void flush_scheduled_tasks(void);
extern int start_context_thread(void);
extern int current_is_keventd(void);
-/*
- * The default fd array needs to be at least BITS_PER_LONG,
- * as this is the granularity returned by copy_fdset().
- */
-#define NR_OPEN_DEFAULT BITS_PER_LONG
-
struct namespace;
-/*
- * Open file table structure
- */
-struct files_struct {
- atomic_t count;
- rwlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */
- int max_fds;
- int max_fdset;
- int next_fd;
- struct file ** fd; /* current fd array */
- fd_set *close_on_exec;
- fd_set *open_fds;
- fd_set close_on_exec_init;
- fd_set open_fds_init;
- struct file * fd_array[NR_OPEN_DEFAULT];
-};
-
-#define INIT_FILES \
-{ \
- count: ATOMIC_INIT(1), \
- file_lock: RW_LOCK_UNLOCKED, \
- max_fds: NR_OPEN_DEFAULT, \
- max_fdset: __FD_SETSIZE, \
- next_fd: 0, \
- fd: &init_files.fd_array[0], \
- close_on_exec: &init_files.close_on_exec_init, \
- open_fds: &init_files.open_fds_init, \
- close_on_exec_init: { { 0, } }, \
- open_fds_init: { { 0, } }, \
- fd_array: { NULL, } \
-}
/* Maximum number of active map areas.. This is a random (large) number */
#define MAX_MAP_COUNT (65536)
@@ -230,17 +193,6 @@ struct mm_struct {
extern int mmlist_nr;
-#define INIT_MM(name) \
-{ \
- mm_rb: RB_ROOT, \
- pgd: swapper_pg_dir, \
- mm_users: ATOMIC_INIT(2), \
- mm_count: ATOMIC_INIT(1), \
- mmap_sem: __RWSEM_INITIALIZER(name.mmap_sem), \
- page_table_lock: SPIN_LOCK_UNLOCKED, \
- mmlist: LIST_HEAD_INIT(name.mmlist), \
-}
-
struct signal_struct {
atomic_t count;
struct k_sigaction action[_NSIG];
@@ -248,12 +200,6 @@ struct signal_struct {
};
-#define INIT_SIGNALS { \
- count: ATOMIC_INIT(1), \
- action: { {{0,}}, }, \
- siglock: SPIN_LOCK_UNLOCKED \
-}
-
/*
* Some day this will be a full-fledged user tracking system..
*/
@@ -455,45 +401,19 @@ struct task_struct {
#define DEF_USER_NICE 0
/*
- * Scales user-nice values [ -20 ... 0 ... 19 ]
- * to static priority [ 24 ... 63 (MAX_PRIO-1) ]
- *
- * User-nice value of -20 == static priority 24, and
- * user-nice value 19 == static priority 63. The lower
- * the priority value, the higher the task's priority.
- *
- * Note that while static priority cannot go below 24,
- * the priority of a process can go as low as 0.
+ * Default timeslice is 80 msecs, maximum is 160 msecs.
+ * Minimum timeslice is 10 msecs.
*/
-#define NICE_TO_PRIO(n) (MAX_PRIO-1 + (n) - 19)
-
-#define DEF_PRIO NICE_TO_PRIO(DEF_USER_NICE)
-
-/*
- * Default timeslice is 90 msecs, maximum is 150 msecs.
- * Minimum timeslice is 20 msecs.
- */
-#define MIN_TIMESLICE ( 20 * HZ / 1000)
-#define MAX_TIMESLICE (150 * HZ / 1000)
+#define MIN_TIMESLICE (10 * HZ / 1000)
+#define MAX_TIMESLICE (160 * HZ / 1000)
#define USER_PRIO(p) ((p)-MAX_RT_PRIO)
#define MAX_USER_PRIO (USER_PRIO(MAX_PRIO))
+#define DEF_PRIO (MAX_RT_PRIO + MAX_USER_PRIO / 3)
+#define NICE_TO_PRIO(n) (MAX_PRIO-1 + (n) - 19)
-/*
- * PRIO_TO_TIMESLICE scales priority values [ 100 ... 139 ]
- * to initial time slice values [ MAX_TIMESLICE (150 msec) ... 2 ]
- *
- * The higher a process's priority, the bigger timeslices
- * it gets during one round of execution. But even the lowest
- * priority process gets MIN_TIMESLICE worth of execution time.
- */
-#define PRIO_TO_TIMESLICE(p) \
- ((( (MAX_USER_PRIO-1-USER_PRIO(p))*(MAX_TIMESLICE-MIN_TIMESLICE) + \
- MAX_USER_PRIO-1) / MAX_USER_PRIO) + MIN_TIMESLICE)
-
-#define RT_PRIO_TO_TIMESLICE(p) \
- ((( (MAX_RT_PRIO-(p)-1)*(MAX_TIMESLICE-MIN_TIMESLICE) + \
- MAX_RT_PRIO-1) / MAX_RT_PRIO) + MIN_TIMESLICE)
+#define NICE_TO_TIMESLICE(n) (MIN_TIMESLICE + \
+ ((MAX_TIMESLICE - MIN_TIMESLICE) * (19 - (n))) / 39)
extern void set_cpus_allowed(task_t *p, unsigned long new_mask);
extern void set_user_nice(task_t *p, long nice);
@@ -505,53 +425,6 @@ asmlinkage long sys_sched_yield(void);
*/
extern struct exec_domain default_exec_domain;
-/*
- * INIT_TASK is used to set up the first task table, touch at
- * your own risk!. Base=0, limit=0x1fffff (=2MB)
- */
-#define INIT_TASK(tsk) \
-{ \
- state: 0, \
- flags: 0, \
- sigpending: 0, \
- addr_limit: KERNEL_DS, \
- exec_domain: &default_exec_domain, \
- lock_depth: -1, \
- __nice: DEF_USER_NICE, \
- policy: SCHED_OTHER, \
- cpus_allowed: -1, \
- mm: NULL, \
- active_mm: &init_mm, \
- run_list: LIST_HEAD_INIT(tsk.run_list), \
- time_slice: PRIO_TO_TIMESLICE(DEF_PRIO), \
- next_task: &tsk, \
- prev_task: &tsk, \
- p_opptr: &tsk, \
- p_pptr: &tsk, \
- thread_group: LIST_HEAD_INIT(tsk.thread_group), \
- wait_chldexit: __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\
- real_timer: { \
- function: it_real_fn \
- }, \
- cap_effective: CAP_INIT_EFF_SET, \
- cap_inheritable: CAP_INIT_INH_SET, \
- cap_permitted: CAP_FULL_SET, \
- keep_capabilities: 0, \
- rlim: INIT_RLIMITS, \
- user: INIT_USER, \
- comm: "swapper", \
- thread: INIT_THREAD, \
- fs: &init_fs, \
- files: &init_files, \
- sigmask_lock: SPIN_LOCK_UNLOCKED, \
- sig: &init_signals, \
- pending: { NULL, &tsk.pending.head, {{0}}}, \
- blocked: {{0}}, \
- alloc_lock: SPIN_LOCK_UNLOCKED, \
- journal_info: NULL, \
-}
-
-
#ifndef INIT_TASK_SIZE
# define INIT_TASK_SIZE 2048*sizeof(long)
#endif
diff --git a/include/linux/tcp_diag.h b/include/linux/tcp_diag.h
new file mode 100644
index 000000000000..91a8fa70e198
--- /dev/null
+++ b/include/linux/tcp_diag.h
@@ -0,0 +1,116 @@
+#ifndef _TCP_DIAG_H_
+#define _TCP_DIAG_H_ 1
+
+/* Just some random number */
+#define TCPDIAG_GETSOCK 18
+
+/* Socket identity */
+struct tcpdiag_sockid
+{
+ __u16 tcpdiag_sport;
+ __u16 tcpdiag_dport;
+ __u32 tcpdiag_src[4];
+ __u32 tcpdiag_dst[4];
+ __u32 tcpdiag_if;
+ __u32 tcpdiag_cookie[2];
+#define TCPDIAG_NOCOOKIE (~0U)
+};
+
+/* Request structure */
+
+struct tcpdiagreq
+{
+ __u8 tcpdiag_family; /* Family of addresses. */
+ __u8 tcpdiag_src_len;
+ __u8 tcpdiag_dst_len;
+ __u8 tcpdiag_ext; /* Query extended information */
+
+ struct tcpdiag_sockid id;
+
+ __u32 tcpdiag_states; /* States to dump */
+ __u32 tcpdiag_dbs; /* Tables to dump (NI) */
+};
+
+enum
+{
+ TCPDIAG_REQ_NONE,
+ TCPDIAG_REQ_BYTECODE,
+};
+
+#define TCPDIAG_REQ_MAX TCPDIAG_REQ_BYTECODE
+
+/* Bytecode is sequence of 4 byte commands followed by variable arguments.
+ * All the commands identified by "code" are conditional jumps forward:
+ * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
+ * length of the command and its arguments.
+ */
+
+struct tcpdiag_bc_op
+{
+ unsigned char code;
+ unsigned char yes;
+ unsigned short no;
+};
+
+enum
+{
+ TCPDIAG_BC_NOP,
+ TCPDIAG_BC_JMP,
+ TCPDIAG_BC_S_GE,
+ TCPDIAG_BC_S_LE,
+ TCPDIAG_BC_D_GE,
+ TCPDIAG_BC_D_LE,
+ TCPDIAG_BC_AUTO,
+ TCPDIAG_BC_S_COND,
+ TCPDIAG_BC_D_COND,
+};
+
+struct tcpdiag_hostcond
+{
+ __u8 family;
+ __u8 prefix_len;
+ int port;
+ __u32 addr[0];
+};
+
+/* Base info structure. It contains socket identity (addrs/ports/cookie)
+ * and, alas, the information shown by netstat. */
+struct tcpdiagmsg
+{
+ __u8 tcpdiag_family;
+ __u8 tcpdiag_state;
+ __u8 tcpdiag_timer;
+ __u8 tcpdiag_retrans;
+
+ struct tcpdiag_sockid id;
+
+ __u32 tcpdiag_expires;
+ __u32 tcpdiag_rqueue;
+ __u32 tcpdiag_wqueue;
+ __u32 tcpdiag_uid;
+ __u32 tcpdiag_inode;
+};
+
+/* Extensions */
+
+enum
+{
+ TCPDIAG_NONE,
+ TCPDIAG_MEMINFO,
+ TCPDIAG_INFO,
+};
+
+#define TCPDIAG_MAX TCPDIAG_INFO
+
+
+/* TCPDIAG_MEM */
+
+struct tcpdiag_meminfo
+{
+ __u32 tcpdiag_rmem;
+ __u32 tcpdiag_wmem;
+ __u32 tcpdiag_fmem;
+ __u32 tcpdiag_tmem;
+};
+
+#endif /* _TCP_DIAG_H_ */
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 0055d5810dae..efa4caddc83f 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -8,6 +8,7 @@
#include <linux/poll.h>
#include <linux/devfs_fs_kernel.h>
+#include <linux/mm.h>
struct video_device
{
@@ -25,7 +26,7 @@ struct video_device
unsigned int (*poll)(struct video_device *, struct file *, poll_table *);
#endif
int (*ioctl)(struct video_device *, unsigned int , void *);
- int (*mmap)(struct video_device *, const char *, unsigned long);
+ int (*mmap)(struct vm_area_struct *vma, struct video_device *, const char *, unsigned long);
int (*initialize)(struct video_device *);
void *priv; /* Used to be 'private' but that upsets C++ */
int busy;
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h
index 0bd6357cbc91..e3e5d7b9e118 100644
--- a/include/net/dn_fib.h
+++ b/include/net/dn_fib.h
@@ -113,9 +113,7 @@ struct dn_fib_table {
int (*get_info)(struct dn_fib_table *table, char *buf,
int first, int count);
#endif /* CONFIG_PROC_FS */
-#ifdef CONFIG_RTNETLINK
int (*dump)(struct dn_fib_table *t, struct sk_buff *skb, struct netlink_callback *cb);
-#endif /* CONFIG_RTNETLINK */
unsigned char data[0];
};
@@ -163,7 +161,6 @@ extern int dn_fib_lookup(struct dn_fib_key *key, struct dn_fib_res *res);
/*
* rtnetlink interface
*/
-#ifdef CONFIG_RTNETLINK
extern int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
extern int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb);
@@ -171,7 +168,6 @@ extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb);
extern int dn_fib_rtm_delrule(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
extern int dn_fib_rtm_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
extern int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb);
-#endif /* CONFIG_RTNETLINK */
#define DN_NUM_TABLES 255
#define DN_MIN_TABLE 1
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 3b69aed93978..f71621990094 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -1,7 +1,7 @@
/*
* INETPEER - A storage for permanent information about peers
*
- * Version: $Id: inetpeer.h,v 1.1 2000/01/06 00:41:51 davem Exp $
+ * Version: $Id: inetpeer.h,v 1.2 2002/01/12 07:54:56 davem Exp $
*
* Authors: Andrey V. Savochkin <saw@msu.ru>
*/
@@ -38,7 +38,7 @@ extern spinlock_t inet_peer_unused_lock;
extern struct inet_peer *inet_peer_unused_head;
extern struct inet_peer **inet_peer_unused_tailp;
/* can be called from BH context or outside */
-extern inline void inet_putpeer(struct inet_peer *p)
+static inline void inet_putpeer(struct inet_peer *p)
{
spin_lock_bh(&inet_peer_unused_lock);
if (atomic_dec_and_test(&p->refcnt)) {
@@ -53,7 +53,7 @@ extern inline void inet_putpeer(struct inet_peer *p)
extern spinlock_t inet_peer_idlock;
/* can be called with or without local BH being disabled */
-extern inline __u16 inet_getid(struct inet_peer *p)
+static inline __u16 inet_getid(struct inet_peer *p)
{
__u16 id;
diff --git a/include/net/sock.h b/include/net/sock.h
index bc364e73eb30..e4b723ca4545 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -643,9 +643,7 @@ struct sock {
#if defined(CONFIG_PPPOE) || defined(CONFIG_PPPOE_MODULE)
struct pppox_opt *pppox;
#endif
-#ifdef CONFIG_NETLINK
struct netlink_opt *af_netlink;
-#endif
#if defined(CONFIG_ECONET) || defined(CONFIG_ECONET_MODULE)
struct econet_opt *af_econet;
#endif
@@ -828,6 +826,11 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk,
unsigned long size,
int noblock,
int *errcode);
+extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
+ unsigned long header_len,
+ unsigned long data_len,
+ int noblock,
+ int *errcode);
extern void *sock_kmalloc(struct sock *sk, int size, int priority);
extern void sock_kfree_s(struct sock *sk, void *mem, int size);