diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-05 00:13:33 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-05 00:13:33 -0800 |
| commit | 5fb612aa91a08c183200312d943de6691f806ce6 (patch) | |
| tree | eeab4310853f2b2f3bed3a1931932d46b2bf39f9 /include | |
| parent | 18a933102825ea1e1b7e059234537d4d927e9216 (diff) | |
v2.5.1.11 -> v2.5.2
- Matt Domsch: combine common crc32 library
- Pete Zaitcev: ymfpci update
- Davide Libenzi: scheduler improvements
- Al Viro: almost there: "struct block_device *" everywhere
- Richard Gooch: devfs cpqarray update, race fix
- Rusty Russell: PATH_MAX should include the final '0' count
- David Miller: various random updates (mainly net and sparc)
Diffstat (limited to 'include')
52 files changed, 373 insertions, 197 deletions
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h index 7cf6d031e47b..e4f65b8134ee 100644 --- a/include/asm-sparc/bitops.h +++ b/include/asm-sparc/bitops.h @@ -1,4 +1,4 @@ -/* $Id: bitops.h,v 1.65 2001/10/30 04:08:26 davem Exp $ +/* $Id: bitops.h,v 1.67 2001/11/19 18:36:34 davem Exp $ * bitops.h: Bit string operations on the Sparc. * * Copyright 1995 David S. Miller (davem@caip.rutgers.edu) diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h index 3d74130c7d23..d42fa22ece83 100644 --- a/include/asm-sparc/io.h +++ b/include/asm-sparc/io.h @@ -1,5 +1,5 @@ /* - * $Id: io.h,v 1.29 2001/11/10 09:28:34 davem Exp $ + * $Id: io.h,v 1.30 2001/12/21 01:23:21 davem Exp $ */ #ifndef __SPARC_IO_H #define __SPARC_IO_H @@ -11,8 +11,7 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> -#define virt_to_bus virt_to_phys -#define bus_to_virt phys_to_virt +#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) static __inline__ u32 flip_dword (u32 d) { diff --git a/include/asm-sparc/keyboard.h b/include/asm-sparc/keyboard.h index 6e59c6d2557d..6155ccbbacac 100644 --- a/include/asm-sparc/keyboard.h +++ b/include/asm-sparc/keyboard.h @@ -1,4 +1,4 @@ -/* $Id: keyboard.h,v 1.7 2001/08/18 09:40:46 davem Exp $ +/* $Id: keyboard.h,v 1.8 2002/01/08 16:00:20 davem Exp $ * linux/include/asm-sparc/keyboard.h * * sparc64 Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be) diff --git a/include/asm-sparc/mmu_context.h b/include/asm-sparc/mmu_context.h index 274707e2d288..8391aff3c9f1 100644 --- a/include/asm-sparc/mmu_context.h +++ b/include/asm-sparc/mmu_context.h @@ -5,6 +5,29 @@ #ifndef __ASSEMBLY__ +/* + * Every architecture must define this function. It's the fastest + * way of searching a 168-bit bitmap where the first 128 bits are + * unlikely to be clear. It's guaranteed that at least one of the 168 + * bits is cleared. + */ +#if MAX_RT_PRIO != 128 || MAX_PRIO != 168 +# error update this function. +#endif + +static inline int sched_find_first_zero_bit(unsigned long *b) +{ + unsigned int rt; + + rt = b[0] & b[1] & b[2] & b[3]; + if (unlikely(rt != 0xffffffff)) + return find_first_zero_bit(b, MAX_RT_PRIO); + + if (b[4] != ~0) + return ffz(b[4]) + MAX_RT_PRIO; + return ffz(b[5]) + 32 + MAX_RT_PRIO; +} + static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) { } diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h index 4e2e6015735b..27ab73c6b056 100644 --- a/include/asm-sparc/oplib.h +++ b/include/asm-sparc/oplib.h @@ -1,4 +1,4 @@ -/* $Id: oplib.h,v 1.21 2000/08/26 02:38:04 anton Exp $ +/* $Id: oplib.h,v 1.23 2001/12/21 00:54:31 davem Exp $ * oplib.h: Describes the interface and available routines in the * Linux Prom library. * @@ -298,15 +298,7 @@ extern int prom_inst2pkg(int); /* Dorking with Bus ranges... */ -/* Adjust reg values with the passed ranges. */ -extern void prom_adjust_regs(struct linux_prom_registers *regp, int nregs, - struct linux_prom_ranges *rangep, int nranges); - -/* Adjust child ranges with the passed parent ranges. */ -extern void prom_adjust_ranges(struct linux_prom_ranges *cranges, int ncranges, - struct linux_prom_ranges *pranges, int npranges); - -/* Apply promlib probed OBIO ranges to registers. */ +/* Apply promlib probes OBIO ranges to registers. */ extern void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs); /* Apply ranges of any prom node (and optionally parent node as well) to registers. */ diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h index 0bc0b4019c95..701ec03bc142 100644 --- a/include/asm-sparc/pci.h +++ b/include/asm-sparc/pci.h @@ -26,6 +26,7 @@ extern inline void pcibios_penalize_isa_irq(int irq) /* Dynamic DMA mapping stuff. */ +#define PCI_DMA_BUS_IS_PHYS (0) #include <asm/scatterlist.h> diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index dbdab2c1ebb6..c283f5157617 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h @@ -190,8 +190,6 @@ extern __inline__ void smp_send_stop(void) { } #define MBOX_IDLECPU2 0xFD #define MBOX_STOPCPU2 0xFE -#define PROC_CHANGE_PENALTY 15 - #endif /* !(CONFIG_SMP) */ #define NO_PROC_ID 0xFF diff --git a/include/asm-sparc/smplock.h b/include/asm-sparc/smplock.h index 96565069c988..dd2cc2b54267 100644 --- a/include/asm-sparc/smplock.h +++ b/include/asm-sparc/smplock.h @@ -3,31 +3,35 @@ * * Default SMP lock implementation */ +#include <linux/sched.h> #include <linux/interrupt.h> #include <linux/spinlock.h> extern spinlock_t kernel_flag; -#define kernel_locked() spin_is_locked(&kernel_flag) +#define kernel_locked() \ + (spin_is_locked(&kernel_flag) &&\ + (current->lock_depth >= 0)) /* * Release global kernel lock and global interrupt lock */ -#define release_kernel_lock(task, cpu) \ -do { \ - if (task->lock_depth >= 0) \ - spin_unlock(&kernel_flag); \ - release_irqlock(cpu); \ - __sti(); \ +#define release_kernel_lock(task, cpu) \ +do { \ + if (unlikely(task->lock_depth >= 0)) { \ + spin_unlock(&kernel_flag); \ + release_irqlock(cpu); \ + __sti(); \ + } \ } while (0) /* * Re-acquire the kernel lock */ -#define reacquire_kernel_lock(task) \ -do { \ - if (task->lock_depth >= 0) \ - spin_lock(&kernel_flag); \ +#define reacquire_kernel_lock(task) \ +do { \ + if (unlikely(task->lock_depth >= 0)) \ + spin_lock(&kernel_flag); \ } while (0) @@ -38,14 +42,14 @@ do { \ * so we only need to worry about other * CPU's. */ -extern __inline__ void lock_kernel(void) -{ - if (!++current->lock_depth) - spin_lock(&kernel_flag); -} +#define lock_kernel() \ +do { \ + if (!++current->lock_depth) \ + spin_lock(&kernel_flag); \ +} while(0) -extern __inline__ void unlock_kernel(void) -{ - if (--current->lock_depth < 0) - spin_unlock(&kernel_flag); -} +#define unlock_kernel() \ +do { \ + if (--current->lock_depth < 0) \ + spin_unlock(&kernel_flag); \ +} while(0) diff --git a/include/asm-sparc/string.h b/include/asm-sparc/string.h index 7bce820e8680..1182435f4163 100644 --- a/include/asm-sparc/string.h +++ b/include/asm-sparc/string.h @@ -1,4 +1,4 @@ -/* $Id: string.h,v 1.35 2000/05/02 01:47:01 davem Exp $ +/* $Id: string.h,v 1.36 2001/12/21 00:54:31 davem Exp $ * string.h: External definitions for optimized assembly string * routines for the Linux Kernel. * @@ -126,9 +126,11 @@ static inline void *__nonconstant_memset(void *s, char c, __kernel_size_t count) }) #define __HAVE_ARCH_MEMCMP +extern int memcmp(const void *,const void *,__kernel_size_t); /* Now the str*() stuff... */ #define __HAVE_ARCH_STRLEN +extern __kernel_size_t strlen(const char *); #define __HAVE_ARCH_STRNCMP diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h index 8a43339c1410..8e726708e1cd 100644 --- a/include/asm-sparc/types.h +++ b/include/asm-sparc/types.h @@ -1,4 +1,4 @@ -/* $Id: types.h,v 1.12 2000/01/29 02:23:25 anton Exp $ */ +/* $Id: types.h,v 1.13 2001/12/21 01:22:59 davem Exp $ */ #ifndef _SPARC_TYPES_H #define _SPARC_TYPES_H @@ -46,6 +46,7 @@ typedef unsigned long long u64; #define BITS_PER_LONG 32 typedef u32 dma_addr_t; +typedef u32 dma64_addr_t; #endif /* __KERNEL__ */ diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h index 17ef06746bfb..69e505905cf2 100644 --- a/include/asm-sparc64/bitops.h +++ b/include/asm-sparc64/bitops.h @@ -1,4 +1,4 @@ -/* $Id: bitops.h,v 1.36 2001/06/14 12:34:49 davem Exp $ +/* $Id: bitops.h,v 1.38 2001/11/19 18:36:34 davem Exp $ * bitops.h: Bit string operations on the V9. * * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu) @@ -13,9 +13,9 @@ extern long ___test_and_set_bit(unsigned long nr, volatile void *addr); extern long ___test_and_clear_bit(unsigned long nr, volatile void *addr); extern long ___test_and_change_bit(unsigned long nr, volatile void *addr); -#define test_and_set_bit(nr,addr) (___test_and_set_bit(nr,addr)!=0) -#define test_and_clear_bit(nr,addr) (___test_and_clear_bit(nr,addr)!=0) -#define test_and_change_bit(nr,addr) (___test_and_change_bit(nr,addr)!=0) +#define test_and_set_bit(nr,addr) ({___test_and_set_bit(nr,addr)!=0;}) +#define test_and_clear_bit(nr,addr) ({___test_and_clear_bit(nr,addr)!=0;}) +#define test_and_change_bit(nr,addr) ({___test_and_change_bit(nr,addr)!=0;}) #define set_bit(nr,addr) ((void)___test_and_set_bit(nr,addr)) #define clear_bit(nr,addr) ((void)___test_and_clear_bit(nr,addr)) #define change_bit(nr,addr) ((void)___test_and_change_bit(nr,addr)) @@ -214,8 +214,8 @@ found_middle: extern long ___test_and_set_le_bit(int nr, volatile void *addr); extern long ___test_and_clear_le_bit(int nr, volatile void *addr); -#define test_and_set_le_bit(nr,addr) (___test_and_set_le_bit(nr,addr)!=0) -#define test_and_clear_le_bit(nr,addr) (___test_and_clear_le_bit(nr,addr)!=0) +#define test_and_set_le_bit(nr,addr) ({___test_and_set_le_bit(nr,addr)!=0;}) +#define test_and_clear_le_bit(nr,addr) ({___test_and_clear_le_bit(nr,addr)!=0;}) #define set_le_bit(nr,addr) ((void)___test_and_set_le_bit(nr,addr)) #define clear_le_bit(nr,addr) ((void)___test_and_clear_le_bit(nr,addr)) diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h index d9a5a903a8dd..dd584acbb34f 100644 --- a/include/asm-sparc64/elf.h +++ b/include/asm-sparc64/elf.h @@ -1,4 +1,4 @@ -/* $Id: elf.h,v 1.30 2001/08/30 23:35:38 kanoj Exp $ */ +/* $Id: elf.h,v 1.31 2002/01/08 16:00:20 davem Exp $ */ #ifndef __ASM_SPARC64_ELF_H #define __ASM_SPARC64_ELF_H @@ -75,24 +75,7 @@ do { unsigned char flags = current->thread.flags; \ else \ flags &= ~SPARC_FLAG_32BIT; \ if (flags != current->thread.flags) { \ - unsigned long pgd_cache = 0UL; \ - if (flags & SPARC_FLAG_32BIT) { \ - pgd_t *pgd0 = ¤t->mm->pgd[0]; \ - if (pgd_none (*pgd0)) { \ - pmd_t *page = pmd_alloc_one_fast(NULL, 0); \ - if (!page) \ - page = pmd_alloc_one(NULL, 0); \ - pgd_set(pgd0, page); \ - } \ - pgd_cache = pgd_val(*pgd0) << 11UL; \ - } \ - __asm__ __volatile__( \ - "stxa\t%0, [%1] %2\n\t" \ - "membar #Sync" \ - : /* no outputs */ \ - : "r" (pgd_cache), \ - "r" (TSB_REG), \ - "i" (ASI_DMMU)); \ + /* flush_thread will update pgd cache */\ current->thread.flags = flags; \ } \ \ diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h index 8b8c056caf02..58a8ae58100a 100644 --- a/include/asm-sparc64/io.h +++ b/include/asm-sparc64/io.h @@ -1,4 +1,4 @@ -/* $Id: io.h,v 1.46 2001/12/13 04:16:52 davem Exp $ */ +/* $Id: io.h,v 1.47 2001/12/13 10:36:02 davem Exp $ */ #ifndef __SPARC64_IO_H #define __SPARC64_IO_H diff --git a/include/asm-sparc64/keyboard.h b/include/asm-sparc64/keyboard.h index 2202e5a94219..fc81294da408 100644 --- a/include/asm-sparc64/keyboard.h +++ b/include/asm-sparc64/keyboard.h @@ -1,4 +1,4 @@ -/* $Id: keyboard.h,v 1.5 2001/08/18 09:40:46 davem Exp $ +/* $Id: keyboard.h,v 1.6 2002/01/08 16:00:20 davem Exp $ * linux/include/asm-sparc64/keyboard.h * * Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be) diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h index c8296b0ce4ff..11bb4c246126 100644 --- a/include/asm-sparc64/mmu_context.h +++ b/include/asm-sparc64/mmu_context.h @@ -1,4 +1,4 @@ -/* $Id: mmu_context.h,v 1.51 2001/08/17 04:55:09 kanoj Exp $ */ +/* $Id: mmu_context.h,v 1.52 2002/01/11 08:45:38 davem Exp $ */ #ifndef __SPARC64_MMU_CONTEXT_H #define __SPARC64_MMU_CONTEXT_H @@ -27,6 +27,27 @@ #include <asm/system.h> #include <asm/spitfire.h> +/* + * Every architecture must define this function. It's the fastest + * way of searching a 168-bit bitmap where the first 128 bits are + * unlikely to be clear. It's guaranteed that at least one of the 168 + * bits is cleared. + */ +#if MAX_RT_PRIO != 128 || MAX_PRIO != 168 +# error update this function. +#endif + +static inline int sched_find_first_zero_bit(unsigned long *b) +{ + unsigned long rt; + + rt = b[0] & b[1]; + if (unlikely(rt != 0xffffffffffffffff)) + return find_first_zero_bit(b, MAX_RT_PRIO); + + return ffz(b[2]) + MAX_RT_PRIO; +} + static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) { } diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h index cf6cbc58967a..77ee8a08400f 100644 --- a/include/asm-sparc64/oplib.h +++ b/include/asm-sparc64/oplib.h @@ -1,4 +1,4 @@ -/* $Id: oplib.h,v 1.13 2000/05/09 17:40:15 davem Exp $ +/* $Id: oplib.h,v 1.14 2001/12/19 00:29:51 davem Exp $ * oplib.h: Describes the interface and available routines in the * Linux Prom library. * @@ -326,20 +326,6 @@ extern int prom_inst2pkg(int); /* Client interface level routines. */ extern void prom_set_trap_table(unsigned long tba); -/* Dorking with Bus ranges... */ - -/* Adjust reg values with the passed ranges. */ -extern void prom_adjust_regs(struct linux_prom_registers *regp, int nregs, - struct linux_prom_ranges *rangep, int nranges); - -/* Adjust child ranges with the passed parent ranges. */ -extern void prom_adjust_ranges(struct linux_prom_ranges *cranges, int ncranges, - struct linux_prom_ranges *pranges, int npranges); - -/* Apply ranges of any prom node (and optionally parent node as well) to registers. */ -extern void prom_apply_generic_ranges(int node, int parent, - struct linux_prom_registers *sbusregs, int nregs); - extern long p1275_cmd (char *, long, ...); diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index 6c65d3241a8b..c5de1e232dcf 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.36 2000/08/10 01:04:53 davem Exp $ */ +/* $Id: page.h,v 1.38 2001/11/30 01:04:10 davem Exp $ */ #ifndef _SPARC64_PAGE_H #define _SPARC64_PAGE_H @@ -18,13 +18,20 @@ #ifndef __ASSEMBLY__ +#ifdef CONFIG_DEBUG_BUGVERBOSE +extern void do_BUG(const char *file, int line); +#define BUG() do { \ + do_BUG(__FILE__, __LINE__); \ + __builtin_trap(); \ +} while (0) +#else #define BUG() __builtin_trap() +#endif + #define PAGE_BUG(page) BUG() extern void _clear_page(void *page); -extern void _copy_page(void *to, void *from); #define clear_page(X) _clear_page((void *)(X)) -#define copy_page(X,Y) _copy_page((void *)(X), (void *)(Y)) extern void clear_user_page(void *page, unsigned long vaddr); extern void copy_user_page(void *to, void *from, unsigned long vaddr); diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index c026b640a103..dc0e88282f50 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.76 2001/10/08 09:32:13 davem Exp $ +/* $Id: processor.h,v 1.80 2001/11/17 00:10:48 davem Exp $ * include/asm-sparc64/processor.h * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -66,6 +66,15 @@ struct thread_struct { unsigned long gsr[7]; unsigned long xfsr[7]; +#ifdef CONFIG_DEBUG_SPINLOCK + /* How many spinlocks held by this thread. + * Used with spin lock debugging to catch tasks + * sleeping illegally with locks held. + */ + int smp_lock_count; + unsigned int smp_lock_pc; +#endif + struct reg_window reg_window[NSWINS]; unsigned long rwbuf_stkptrs[NSWINS]; @@ -88,6 +97,7 @@ struct thread_struct { #define FAULT_CODE_ITLB 0x04 /* Miss happened in I-TLB */ #define FAULT_CODE_WINFIXUP 0x08 /* Miss happened during spill/fill */ +#ifndef CONFIG_DEBUG_SPINLOCK #define INIT_THREAD { \ /* ksp, wstate, cwp, flags, current_ds, */ \ 0, 0, 0, 0, KERNEL_DS, \ @@ -104,6 +114,24 @@ struct thread_struct { /* user_cntd0, user_cndd1, kernel_cntd0, kernel_cntd0, pcr_reg */ \ 0, 0, 0, 0, 0, \ } +#else /* CONFIG_DEBUG_SPINLOCK */ +#define INIT_THREAD { \ +/* ksp, wstate, cwp, flags, current_ds, */ \ + 0, 0, 0, 0, KERNEL_DS, \ +/* w_saved, fpdepth, fault_code, use_blkcommit, */ \ + 0, 0, 0, 0, \ +/* fault_address, fpsaved, __pad2, kregs, */ \ + 0, { 0 }, 0, 0, \ +/* utraps, gsr, xfsr, smp_lock_count, smp_lock_pc, */\ + 0, { 0 }, { 0 }, 0, 0, \ +/* reg_window */ \ + { { { 0, }, { 0, } }, }, \ +/* rwbuf_stkptrs */ \ + { 0, 0, 0, 0, 0, 0, 0, }, \ +/* user_cntd0, user_cndd1, kernel_cntd0, kernel_cntd0, pcr_reg */ \ + 0, 0, 0, 0, 0, \ +} +#endif /* !(CONFIG_DEBUG_SPINLOCK) */ #ifdef __KERNEL__ #if PAGE_SHIFT == 13 diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h index 535ca47717cc..1717d1a5bed6 100644 --- a/include/asm-sparc64/rwsem.h +++ b/include/asm-sparc64/rwsem.h @@ -1,4 +1,4 @@ -/* $Id: rwsem.h,v 1.4 2001/04/26 02:36:36 davem Exp $ +/* $Id: rwsem.h,v 1.5 2001/11/18 00:12:56 davem Exp $ * rwsem.h: R/W semaphores implemented using CAS * * Written by David S. Miller (davem@redhat.com), 2001. @@ -59,7 +59,7 @@ static inline void __down_read(struct rw_semaphore *sem) " add %%g7, 1, %%g7\n\t" "cmp %%g7, 0\n\t" "bl,pn %%icc, 3f\n\t" - " membar #StoreStore\n" + " membar #StoreLoad | #StoreStore\n" "2:\n\t" ".subsection 2\n" "3:\tmov %0, %%g5\n\t" @@ -92,7 +92,7 @@ static inline void __down_write(struct rw_semaphore *sem) "bne,pn %%icc, 1b\n\t" " cmp %%g7, 0\n\t" "bne,pn %%icc, 3f\n\t" - " membar #StoreStore\n" + " membar #StoreLoad | #StoreStore\n" "2:\n\t" ".subsection 2\n" "3:\tmov %0, %%g5\n\t" @@ -122,7 +122,7 @@ static inline void __up_read(struct rw_semaphore *sem) "bne,pn %%icc, 1b\n\t" " cmp %%g7, 0\n\t" "bl,pn %%icc, 3f\n\t" - " membar #StoreStore\n" + " membar #StoreLoad | #StoreStore\n" "2:\n\t" ".subsection 2\n" "3:\tsethi %%hi(%2), %%g1\n\t" @@ -160,7 +160,7 @@ static inline void __up_write(struct rw_semaphore *sem) " sub %%g7, %%g1, %%g7\n\t" "cmp %%g7, 0\n\t" "bl,pn %%icc, 3f\n\t" - " membar #StoreStore\n" + " membar #StoreLoad | #StoreStore\n" "2:\n\t" ".subsection 2\n" "3:\tmov %0, %%g5\n\t" @@ -189,7 +189,7 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) "cas [%2], %%g5, %%g7\n\t" "cmp %%g5, %%g7\n\t" "bne,pn %%icc, 1b\n\t" - " nop\n\t" + " membar #StoreLoad | #StoreStore\n\t" "mov %%g7, %0\n\t" : "=&r" (tmp) : "0" (tmp), "r" (sem) @@ -208,7 +208,7 @@ static inline __u16 rwsem_cmpxchgw(struct rw_semaphore *sem, __u16 __old, __u16 again: __asm__ __volatile__("cas [%2], %3, %0\n\t" - "membar #StoreStore | #StoreLoad" + "membar #StoreLoad | #StoreStore" : "=&r" (prev) : "0" (new), "r" (sem), "r" (old) : "memory"); diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h index 7a8aa9597a84..2aaa3160115e 100644 --- a/include/asm-sparc64/semaphore.h +++ b/include/asm-sparc64/semaphore.h @@ -75,7 +75,7 @@ static __inline__ void down(struct semaphore * sem) " bne,pn %%icc, 1b\n" " cmp %%g7, 1\n" " bl,pn %%icc, 3f\n" -" membar #StoreStore\n" +" membar #StoreLoad | #StoreStore\n" "2:\n" " .subsection 2\n" "3: mov %0, %%g5\n" @@ -120,7 +120,7 @@ static __inline__ int down_interruptible(struct semaphore *sem) " bne,pn %%icc, 1b\n" " cmp %%g7, 1\n" " bl,pn %%icc, 3f\n" -" membar #StoreStore\n" +" membar #StoreLoad | #StoreStore\n" "2:\n" " .subsection 2\n" "3: mov %2, %%g5\n" @@ -173,7 +173,7 @@ static __inline__ int down_trylock(struct semaphore *sem) " cmp %%g5, %%g7\n" " bne,pn %%icc, 1b\n" " mov 0, %0\n" -" membar #StoreStore\n" +" membar #StoreLoad | #StoreStore\n" "2:\n" : "=&r" (ret) : "r" (sem) @@ -207,7 +207,7 @@ static __inline__ void up(struct semaphore * sem) " bne,pn %%icc, 1b\n" " addcc %%g7, 1, %%g0\n" " ble,pn %%icc, 3f\n" -" nop\n" +" membar #StoreLoad | #StoreStore\n" "2:\n" " .subsection 2\n" "3: mov %0, %%g5\n" diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index c2b3a411bbcc..d73d3e657cf5 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h @@ -8,6 +8,7 @@ #include <linux/config.h> #include <linux/threads.h> +#include <linux/cache.h> #include <asm/asi.h> #include <asm/starfire.h> #include <asm/spitfire.h> @@ -34,7 +35,7 @@ extern struct prom_cpuinfo linux_cpus[64]; /* Per processor Sparc parameters we need. */ /* Keep this a multiple of 64-bytes for cache reasons. */ -struct cpuinfo_sparc { +typedef struct { /* Dcache line 1 */ unsigned int __pad0; /* bh_count moved to irq_stat for consistency. KAO */ unsigned int multiplier; @@ -51,9 +52,9 @@ struct cpuinfo_sparc { /* Dcache lines 3 and 4 */ unsigned int irq_worklists[16]; -}; +} ____cacheline_aligned cpuinfo_sparc; -extern struct cpuinfo_sparc cpu_data[NR_CPUS]; +extern cpuinfo_sparc cpu_data[NR_CPUS]; /* * Private routines/data @@ -102,20 +103,22 @@ extern __inline__ int hard_smp_processor_id(void) } } -#define smp_processor_id() (current->processor) +#define smp_processor_id() (current->cpu) /* This needn't do anything as we do not sleep the cpu * inside of the idler task, so an interrupt is not needed * to get a clean fast response. * + * XXX Reverify this assumption... -DaveM + * * Addendum: We do want it to do something for the signal * delivery case, we detect that by just seeing * if we are trying to send this to an idler or not. */ -extern __inline__ void smp_send_reschedule(int cpu) +static __inline__ void smp_send_reschedule(int cpu) { extern void smp_receive_signal(int); - if(cpu_data[cpu].idle_volume == 0) + if (cpu_data[cpu].idle_volume == 0) smp_receive_signal(cpu); } @@ -126,8 +129,6 @@ extern __inline__ void smp_send_stop(void) { } #endif /* !(__ASSEMBLY__) */ -#define PROC_CHANGE_PENALTY 20 - #endif /* !(CONFIG_SMP) */ #define NO_PROC_ID 0xFF diff --git a/include/asm-sparc64/smplock.h b/include/asm-sparc64/smplock.h index 6b3c900de906..dd2cc2b54267 100644 --- a/include/asm-sparc64/smplock.h +++ b/include/asm-sparc64/smplock.h @@ -9,26 +9,29 @@ extern spinlock_t kernel_flag; -#define kernel_locked() spin_is_locked(&kernel_flag) +#define kernel_locked() \ + (spin_is_locked(&kernel_flag) &&\ + (current->lock_depth >= 0)) /* * Release global kernel lock and global interrupt lock */ -#define release_kernel_lock(task, cpu) \ -do { \ - if (task->lock_depth >= 0) \ - spin_unlock(&kernel_flag); \ - release_irqlock(cpu); \ - __sti(); \ +#define release_kernel_lock(task, cpu) \ +do { \ + if (unlikely(task->lock_depth >= 0)) { \ + spin_unlock(&kernel_flag); \ + release_irqlock(cpu); \ + __sti(); \ + } \ } while (0) /* * Re-acquire the kernel lock */ -#define reacquire_kernel_lock(task) \ -do { \ - if (task->lock_depth >= 0) \ - spin_lock(&kernel_flag); \ +#define reacquire_kernel_lock(task) \ +do { \ + if (unlikely(task->lock_depth >= 0)) \ + spin_lock(&kernel_flag); \ } while (0) @@ -39,14 +42,14 @@ do { \ * so we only need to worry about other * CPU's. */ -#define lock_kernel() \ -do { \ - if (!++current->lock_depth) \ - spin_lock(&kernel_flag); \ +#define lock_kernel() \ +do { \ + if (!++current->lock_depth) \ + spin_lock(&kernel_flag); \ } while(0) -#define unlock_kernel() \ -do { \ - if (--current->lock_depth < 0) \ - spin_unlock(&kernel_flag); \ +#define unlock_kernel() \ +do { \ + if (--current->lock_depth < 0) \ + spin_unlock(&kernel_flag); \ } while(0) diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index 06956c1e8920..ce905b46162c 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h @@ -6,11 +6,13 @@ #ifndef __SPARC64_SPINLOCK_H #define __SPARC64_SPINLOCK_H +#include <linux/config.h> + #ifndef __ASSEMBLY__ /* To get debugging spinlocks which detect and catch - * deadlock situations, set DEBUG_SPINLOCKS in the sparc64 - * specific makefile and rebuild your kernel. + * deadlock situations, set CONFIG_DEBUG_SPINLOCK + * and rebuild your kernel. */ /* All of these locking primitives are expected to work properly @@ -26,7 +28,7 @@ * must be pre-V9 branches. */ -#ifndef SPIN_LOCK_DEBUG +#ifndef CONFIG_DEBUG_SPINLOCK typedef unsigned char spinlock_t; #define SPIN_LOCK_UNLOCKED 0 @@ -75,7 +77,7 @@ extern __inline__ void spin_unlock(spinlock_t *lock) : "memory"); } -#else /* !(SPIN_LOCK_DEBUG) */ +#else /* !(CONFIG_DEBUG_SPINLOCK) */ typedef struct { unsigned char lock; @@ -101,11 +103,11 @@ extern int _spin_trylock (spinlock_t *lock); #define spin_lock(lock) _do_spin_lock(lock, "spin_lock") #define spin_unlock(lock) _do_spin_unlock(lock) -#endif /* SPIN_LOCK_DEBUG */ +#endif /* CONFIG_DEBUG_SPINLOCK */ /* Multi-reader locks, these are much saner than the 32-bit Sparc ones... */ -#ifndef SPIN_LOCK_DEBUG +#ifndef CONFIG_DEBUG_SPINLOCK typedef unsigned int rwlock_t; #define RW_LOCK_UNLOCKED 0 @@ -121,7 +123,7 @@ extern void __write_unlock(rwlock_t *); #define write_lock(p) __write_lock(p) #define write_unlock(p) __write_unlock(p) -#else /* !(SPIN_LOCK_DEBUG) */ +#else /* !(CONFIG_DEBUG_SPINLOCK) */ typedef struct { unsigned long lock; @@ -164,7 +166,7 @@ do { unsigned long flags; \ __restore_flags(flags); \ } while(0) -#endif /* SPIN_LOCK_DEBUG */ +#endif /* CONFIG_DEBUG_SPINLOCK */ #endif /* !(__ASSEMBLY__) */ diff --git a/include/asm-sparc64/spitfire.h b/include/asm-sparc64/spitfire.h index 26a67f822452..3839b239fe5a 100644 --- a/include/asm-sparc64/spitfire.h +++ b/include/asm-sparc64/spitfire.h @@ -1,4 +1,4 @@ -/* $Id: spitfire.h,v 1.16 2001/09/24 21:17:57 kanoj Exp $ +/* $Id: spitfire.h,v 1.18 2001/11/29 16:42:10 kanoj Exp $ * spitfire.h: SpitFire/BlackBird/Cheetah inline MMU operations. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -32,6 +32,8 @@ #define VIRT_WATCHPOINT 0x0000000000000038 #define PHYS_WATCHPOINT 0x0000000000000040 +#define SPITFIRE_HIGHEST_LOCKED_TLBENT (64 - 1) + #ifndef __ASSEMBLY__ enum ultra_tlb_layout { @@ -43,7 +45,6 @@ extern enum ultra_tlb_layout tlb_type; #define SPARC64_USE_STICK (tlb_type == cheetah) -#define SPITFIRE_HIGHEST_LOCKED_TLBENT (64 - 1) #define CHEETAH_HIGHEST_LOCKED_TLBENT (16 - 1) #define L1DCACHE_SIZE 0x4000 @@ -357,12 +358,17 @@ extern __inline__ void cheetah_flush_itlb_all(void) * 2 way assosciative, and holds 512 entries. The fourth TLB is for * instruction accesses to 8K non-locked translations, is 2 way * assosciative, and holds 128 entries. + * + * Cheetah has some bug where bogus data can be returned from + * ASI_{D,I}TLB_DATA_ACCESS loads, doing the load twice fixes + * the problem for me. -DaveM */ extern __inline__ unsigned long cheetah_get_ldtlb_data(int entry) { unsigned long data; - __asm__ __volatile__("ldxa [%1] %2, %0" + __asm__ __volatile__("ldxa [%1] %2, %%g0\n\t" + "ldxa [%1] %2, %0" : "=r" (data) : "r" ((0 << 16) | (entry << 3)), "i" (ASI_DTLB_DATA_ACCESS)); @@ -374,7 +380,8 @@ extern __inline__ unsigned long cheetah_get_litlb_data(int entry) { unsigned long data; - __asm__ __volatile__("ldxa [%1] %2, %0" + __asm__ __volatile__("ldxa [%1] %2, %%g0\n\t" + "ldxa [%1] %2, %0" : "=r" (data) : "r" ((0 << 16) | (entry << 3)), "i" (ASI_ITLB_DATA_ACCESS)); @@ -430,7 +437,8 @@ extern __inline__ unsigned long cheetah_get_dtlb_data(int entry) { unsigned long data; - __asm__ __volatile__("ldxa [%1] %2, %0" + __asm__ __volatile__("ldxa [%1] %2, %%g0\n\t" + "ldxa [%1] %2, %0" : "=r" (data) : "r" ((2 << 16) | (entry << 3)), "i" (ASI_DTLB_DATA_ACCESS)); @@ -461,7 +469,8 @@ extern __inline__ unsigned long cheetah_get_itlb_data(int entry) { unsigned long data; - __asm__ __volatile__("ldxa [%1] %2, %0" + __asm__ __volatile__("ldxa [%1] %2, %%g0\n\t" + "ldxa [%1] %2, %0" : "=r" (data) : "r" ((2 << 16) | (entry << 3)), "i" (ASI_ITLB_DATA_ACCESS)); diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index 46dea88f62ae..d5b497ddf5e0 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h @@ -1,4 +1,4 @@ -/* $Id: system.h,v 1.64 2001/08/30 03:22:00 kanoj Exp $ */ +/* $Id: system.h,v 1.68 2001/11/18 00:12:56 davem Exp $ */ #ifndef __SPARC64_SYSTEM_H #define __SPARC64_SYSTEM_H @@ -145,6 +145,24 @@ extern void __flushw_user(void); #define flush_register_windows flushw_all #define prepare_to_switch flushw_all +#ifndef CONFIG_DEBUG_SPINLOCk +#define CHECK_LOCKS(PREV) do { } while(0) +#else /* CONFIG_DEBUG_SPINLOCk */ +#define CHECK_LOCKS(PREV) \ +if ((PREV)->thread.smp_lock_count) { \ + unsigned long rpc; \ + __asm__ __volatile__("mov %%i7, %0" : "=r" (rpc)); \ + printk(KERN_CRIT "(%s)[%d]: Sleeping with %d locks held!\n", \ + (PREV)->comm, (PREV)->pid, \ + (PREV)->thread.smp_lock_count); \ + printk(KERN_CRIT "(%s)[%d]: Last lock at %08x\n", \ + (PREV)->comm, (PREV)->pid, \ + (PREV)->thread.smp_lock_pc); \ + printk(KERN_CRIT "(%s)[%d]: Sched caller %016lx\n", \ + (PREV)->comm, (PREV)->pid, rpc); \ +} +#endif /* !(CONFIG_DEBUG_SPINLOCk) */ + /* See what happens when you design the chip correctly? * * We tell gcc we clobber all non-fixed-usage registers except @@ -155,7 +173,8 @@ extern void __flushw_user(void); * and 2 stores in this critical code path. -DaveM */ #define switch_to(prev, next, last) \ -do { if (current->thread.flags & SPARC_FLAG_PERFCTR) { \ +do { CHECK_LOCKS(prev); \ + if (current->thread.flags & SPARC_FLAG_PERFCTR) { \ unsigned long __tmp; \ read_pcr(__tmp); \ current->thread.pcr_reg = __tmp; \ @@ -276,7 +295,7 @@ extern __inline__ unsigned long __cmpxchg_u32(volatile int *m, int old, int new) { __asm__ __volatile__("cas [%2], %3, %0\n\t" - "membar #StoreStore | #StoreLoad" + "membar #StoreLoad | #StoreStore" : "=&r" (new) : "0" (new), "r" (m), "r" (old) : "memory"); @@ -288,7 +307,7 @@ extern __inline__ unsigned long __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new) { __asm__ __volatile__("casx [%2], %3, %0\n\t" - "membar #StoreStore | #StoreLoad" + "membar #StoreLoad | #StoreStore" : "=&r" (new) : "0" (new), "r" (m), "r" (old) : "memory"); diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h index e9960e1c4812..8ed23fd00ad6 100644 --- a/include/asm-sparc64/ttable.h +++ b/include/asm-sparc64/ttable.h @@ -1,4 +1,4 @@ -/* $Id: ttable.h,v 1.16 2001/03/28 10:56:34 davem Exp $ */ +/* $Id: ttable.h,v 1.17 2001/11/28 23:32:16 davem Exp $ */ #ifndef _SPARC64_TTABLE_H #define _SPARC64_TTABLE_H @@ -29,6 +29,15 @@ clr %l6; \ nop; +#define TRAP_7INSNS(routine) \ + sethi %hi(109f), %g7; \ + ba,pt %xcc, etrap; \ +109: or %g7, %lo(109b), %g7; \ + call routine; \ + add %sp, STACK_BIAS + REGWIN_SZ, %o0; \ + ba,pt %xcc, rtrap; \ + clr %l6; + #define TRAP_SAVEFPU(routine) \ sethi %hi(109f), %g7; \ ba,pt %xcc, do_fptrap; \ @@ -44,6 +53,11 @@ nop; \ nop; nop; nop; nop; nop; nop; +#define TRAP_NOSAVE_7INSNS(routine) \ + ba,pt %xcc, routine; \ + nop; \ + nop; nop; nop; nop; nop; + #define TRAPTL1(routine) \ sethi %hi(109f), %g7; \ ba,pt %xcc, etraptl1; \ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3f11ceb302df..0cbe78286ab5 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -326,10 +326,6 @@ extern int * max_readahead[MAX_BLKDEV]; #define MIN_READAHEAD 3 #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) -#define blkdev_entry_next_request(entry) blkdev_entry_to_request((entry)->next) -#define blkdev_entry_prev_request(entry) blkdev_entry_to_request((entry)->prev) -#define blkdev_next_request(req) blkdev_entry_to_request((req)->queuelist.next) -#define blkdev_prev_request(req) blkdev_entry_to_request((req)->queuelist.prev) extern void drive_stat_acct(struct request *, int, int); diff --git a/include/linux/crc32.h b/include/linux/crc32.h new file mode 100644 index 000000000000..a0033ffee91c --- /dev/null +++ b/include/linux/crc32.h @@ -0,0 +1,17 @@ +/* + * crc32.h + * See linux/lib/crc32.c for license and changes + */ +#ifndef _LINUX_CRC32_H +#define _LINUX_CRC32_H + +#include <linux/types.h> + +extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); +extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); + +#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) +#define ether_crc_le(length, data) crc32_le(~0, data, length) +#define ether_crc(length, data) crc32_be(~0, data, length) + +#endif /* _LINUX_CRC32_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index b102c2d51d54..a01f0c3b4d34 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -245,6 +245,7 @@ struct buffer_head { unsigned short b_size; /* block size */ unsigned short b_list; /* List that this buffer appears */ kdev_t b_dev; /* device (B_FREE = free) */ + struct block_device *b_bdev; atomic_t b_count; /* users using this block */ unsigned long b_state; /* buffer state bitmap (see above) */ @@ -1357,7 +1358,20 @@ extern void insert_inode_hash(struct inode *); extern void remove_inode_hash(struct inode *); extern struct file * get_empty_filp(void); extern void file_move(struct file *f, struct list_head *list); -extern struct buffer_head * get_hash_table(kdev_t, sector_t, int); +extern struct buffer_head * __get_hash_table(struct block_device *, sector_t, int); +static inline struct buffer_head * get_hash_table(kdev_t dev, sector_t block, int size) +{ + struct block_device *bdev; + struct buffer_head *bh; + bdev = bdget(kdev_t_to_nr(dev)); + if (!bdev) { + printk("No block device for %s\n", bdevname(dev)); + BUG(); + } + bh = __get_hash_table(bdev, block, size); + atomic_dec(&bdev->bd_count); + return bh; +} extern struct buffer_head * __getblk(struct block_device *, sector_t, int); static inline struct buffer_head * getblk(kdev_t dev, sector_t block, int size) { @@ -1416,11 +1430,12 @@ static inline struct buffer_head * sb_getblk(struct super_block *sb, int block) } static inline struct buffer_head * sb_get_hash_table(struct super_block *sb, int block) { - return get_hash_table(sb->s_dev, block, sb->s_blocksize); + return __get_hash_table(sb->s_bdev, block, sb->s_blocksize); } static inline void map_bh(struct buffer_head *bh, struct super_block *sb, int block) { bh->b_state |= 1 << BH_Mapped; + bh->b_bdev = sb->s_bdev; bh->b_dev = sb->s_dev; bh->b_blocknr = block; } @@ -1428,7 +1443,7 @@ extern void wakeup_bdflush(void); extern void put_unused_buffer_head(struct buffer_head * bh); extern struct buffer_head * get_unused_buffer_head(int async); -extern int brw_page(int, struct page *, kdev_t, sector_t [], int); +extern int brw_page(int, struct page *, struct block_device *, sector_t [], int); typedef int (get_block_t)(struct inode*,sector_t,struct buffer_head*,int); diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index ba663102f02f..dd936fe6180e 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -82,6 +82,7 @@ /* 787->799 reserved for fibrechannel media types */ #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ +#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index d719560dde0b..97d490fd8dd8 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h @@ -79,6 +79,15 @@ typedef struct slave { u32 link_failure_count; } slave_t; +/* + * Here are the locking policies for the two bonding locks: + * + * 1) Get bond->lock when reading/writing slave list. + * 2) Get bond->ptrlock when reading/writing bond->current_slave. + * (It is unnecessary when the write-lock is put with bond->lock.) + * 3) When we lock with bond->ptrlock, we must lock with bond->lock + * beforehand. + */ typedef struct bonding { slave_t *next; slave_t *prev; diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 465b35c3d245..abc0c3e7bad2 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h @@ -1,6 +1,7 @@ #ifndef _KBD_KERN_H #define _KBD_KERN_H +#include <linux/tty.h> #include <linux/interrupt.h> #include <linux/keyboard.h> diff --git a/include/linux/limits.h b/include/linux/limits.h index 51c49ec4e325..45faa81d981d 100644 --- a/include/linux/limits.h +++ b/include/linux/limits.h @@ -11,7 +11,7 @@ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX 255 /* # chars in a file name */ -#define PATH_MAX 4095 /* # chars in a path name */ +#define PATH_MAX 4096 /* # chars in a path name including nul */ #define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */ #define RTSIG_MAX 32 diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 8ce25aae46f0..f0e8b9927eab 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h @@ -27,6 +27,21 @@ enum ip_conntrack_info IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 }; +/* Bitset representing status of connection. */ +enum ip_conntrack_status { + /* It's an expected connection: bit 0 set. This bit never changed */ + IPS_EXPECTED_BIT = 0, + IPS_EXPECTED = (1 << IPS_EXPECTED_BIT), + + /* We've seen packets both ways: bit 1 set. Can be set, not unset. */ + IPS_SEEN_REPLY_BIT = 1, + IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT), + + /* Conntrack should never be early-expired. */ + IPS_ASSURED_BIT = 2, + IPS_ASSURED = (1 << IPS_ASSURED_BIT), +}; + #ifdef __KERNEL__ #include <linux/types.h> @@ -47,21 +62,6 @@ do { \ #define IP_NF_ASSERT(x) #endif -/* Bitset representing status of connection. */ -enum ip_conntrack_status { - /* It's an expected connection: bit 0 set. This bit never changed */ - IPS_EXPECTED_BIT = 0, - IPS_EXPECTED = (1 << IPS_EXPECTED_BIT), - - /* We've seen packets both ways: bit 1 set. Can be set, not unset. */ - IPS_SEEN_REPLY_BIT = 1, - IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT), - - /* Conntrack should never be early-expired. */ - IPS_ASSURED_BIT = 2, - IPS_ASSURED = (1 << IPS_ASSURED_BIT), -}; - struct ip_conntrack_expect { /* Internal linked list */ diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index 8b6dc4a8bf57..9f6ec0a6bccc 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h @@ -62,6 +62,13 @@ struct ip_conntrack_tuple } dst; }; +enum ip_conntrack_dir +{ + IP_CT_DIR_ORIGINAL, + IP_CT_DIR_REPLY, + IP_CT_DIR_MAX +}; + #ifdef __KERNEL__ #define DUMP_TUPLE(tp) \ @@ -75,13 +82,19 @@ DEBUGP("tuple %p: %u %u.%u.%u.%u:%hu -> %u.%u.%u.%u:%hu\n", \ /* If we're the first tuple, it's the original dir. */ #define DIRECTION(h) ((enum ip_conntrack_dir)(&(h)->ctrack->tuplehash[1] == (h))) -enum ip_conntrack_dir +/* Connections have two entries in the hash table: one for each way */ +struct ip_conntrack_tuple_hash { - IP_CT_DIR_ORIGINAL, - IP_CT_DIR_REPLY, - IP_CT_DIR_MAX + struct list_head list; + + struct ip_conntrack_tuple tuple; + + /* this == &ctrack->tuplehash[DIRECTION(this)]. */ + struct ip_conntrack *ctrack; }; +#endif /* __KERNEL__ */ + static inline int ip_ct_tuple_src_equal(const struct ip_conntrack_tuple *t1, const struct ip_conntrack_tuple *t2) { @@ -115,16 +128,4 @@ static inline int ip_ct_tuple_mask_cmp(const struct ip_conntrack_tuple *t, & mask->dst.protonum)); } -/* Connections have two entries in the hash table: one for each way */ -struct ip_conntrack_tuple_hash -{ - struct list_head list; - - struct ip_conntrack_tuple tuple; - - /* this == &ctrack->tuplehash[DIRECTION(this)]. */ - struct ip_conntrack *ctrack; -}; - -#endif /* __KERNEL__ */ #endif /* _IP_CONNTRACK_TUPLE_H */ diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index b50d60989eae..1c4cec479ba3 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -1651,7 +1651,7 @@ extern wait_queue_head_t reiserfs_commit_thread_wait ; #define _jhashfn(dev,block) \ ((((dev)<<(JBH_HASH_SHIFT - 6)) ^ ((dev)<<(JBH_HASH_SHIFT - 9))) ^ \ (((block)<<(JBH_HASH_SHIFT - 6)) ^ ((block) >> 13) ^ ((block) << (JBH_HASH_SHIFT - 12)))) -#define journal_hash(t,dev,block) ((t)[_jhashfn((kdev_t_to_nr(dev)),(block)) & JBH_HASH_MASK]) +#define journal_hash(t,sb,block) ((t)[_jhashfn((kdev_t_to_nr(sb->s_dev)),(block)) & JBH_HASH_MASK]) /* finds n'th buffer with 0 being the start of this commit. Needs to go away, j_ap_blocks has changed ** since I created this. One chunk of code in journal.c needs changing before deleting it @@ -1678,14 +1678,13 @@ int pop_journal_writer(int windex) ; int journal_lock_dobalance(struct super_block *p_s_sb) ; int journal_unlock_dobalance(struct super_block *p_s_sb) ; int journal_transaction_should_end(struct reiserfs_transaction_handle *, int) ; -int reiserfs_in_journal(struct super_block *p_s_sb, kdev_t dev, unsigned long bl, int size, int searchall, unsigned long *next) ; +int reiserfs_in_journal(struct super_block *p_s_sb, unsigned long bl, int searchall, unsigned long *next) ; int journal_begin(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ; int journal_join(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ; struct super_block *reiserfs_get_super(kdev_t dev) ; void flush_async_commits(struct super_block *p_s_sb) ; int remove_from_transaction(struct super_block *p_s_sb, unsigned long blocknr, int already_cleaned) ; -int remove_from_journal_list(struct super_block *s, struct reiserfs_journal_list *jl, struct buffer_head *bh, int remove_freed) ; int buffer_journaled(const struct buffer_head *bh) ; int mark_buffer_journal_new(struct buffer_head *bh) ; diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 1eee601a12de..a78f78986723 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h @@ -199,7 +199,7 @@ struct reiserfs_super_block_v1 */ struct reiserfs_journal_cnode { struct buffer_head *bh ; /* real buffer head */ - kdev_t dev ; /* dev of real buffer head */ + struct super_block *sb ; /* dev of real buffer head */ unsigned long blocknr ; /* block number of real buffer head, == 0 when buffer on disk */ int state ; struct reiserfs_journal_list *jlist ; /* journal list this cnode lives in */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 068d5b802a23..14b6388cc3c2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -305,7 +305,7 @@ struct task_struct { prio_array_t *array; unsigned int time_slice; - unsigned long swap_cnt_last; + unsigned long sleep_jtime; unsigned long policy; unsigned long cpus_allowed; diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index fbcfce81e110..070eef7b5137 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -11,7 +11,7 @@ * swapper address space. * * We have to move it here, since not every user of fs.h is including - * mm.h, but m.h is including fs.h via sched .h :-/ + * mm.h, but mm.h is including fs.h via sched .h :-/ */ typedef struct { unsigned long val; diff --git a/include/linux/socket.h b/include/linux/socket.h index 7887eee13d79..74303f129fdd 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -156,6 +156,7 @@ struct ucred { #define AF_IRDA 23 /* IRDA sockets */ #define AF_PPPOX 24 /* PPPoX sockets */ #define AF_WANPIPE 25 /* Wanpipe API Sockets */ +#define AF_LLC 26 /* Linux LLC */ #define AF_BLUETOOTH 31 /* Bluetooth sockets */ #define AF_MAX 32 /* For now.. */ @@ -187,6 +188,7 @@ struct ucred { #define PF_IRDA AF_IRDA #define PF_PPPOX AF_PPPOX #define PF_WANPIPE AF_WANPIPE +#define PF_LLC AF_LLC #define PF_BLUETOOTH AF_BLUETOOTH #define PF_MAX AF_MAX @@ -237,6 +239,8 @@ struct ucred { #define SOL_ATM 264 /* ATM layer (cell level) */ #define SOL_AAL 265 /* ATM Adaption Layer (packet level) */ #define SOL_IRDA 266 +#define SOL_NETBEUI 267 +#define SOL_LLC 268 /* IPX options */ #define IPX_TYPE 1 diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 62f4b1bd4dd1..be4c52c62c1c 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -137,7 +137,6 @@ rpc_set_timeout(struct rpc_clnt *clnt, unsigned int retr, unsigned long incr) xprt_set_timeout(&clnt->cl_timeout, retr, incr); } -extern void rpciod_tcp_dispatcher(void); extern void rpciod_wake_up(void); /* diff --git a/include/linux/swap.h b/include/linux/swap.h index 7ea6e7334bc5..b0ac23988cf4 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -65,8 +65,7 @@ struct swap_info_struct { unsigned int flags; kdev_t swap_device; spinlock_t sdev_lock; - struct dentry * swap_file; - struct vfsmount *swap_vfsmnt; + struct file *swap_file; unsigned short * swap_map; unsigned int lowest_bit; unsigned int highest_bit; @@ -141,8 +140,7 @@ extern struct swap_info_struct swap_info[]; extern int is_swap_partition(kdev_t); extern void si_swapinfo(struct sysinfo *); extern swp_entry_t get_swap_page(void); -extern void get_swaphandle_info(swp_entry_t, unsigned long *, kdev_t *, - struct inode **); +extern void get_swaphandle_info(swp_entry_t, unsigned long *, struct inode **); extern int swap_duplicate(swp_entry_t); extern int swap_count(struct page *); extern int valid_swaphandles(swp_entry_t, unsigned long *); diff --git a/include/math-emu/double.h b/include/math-emu/double.h index 04c4c0f4584c..655ccf1c4739 100644 --- a/include/math-emu/double.h +++ b/include/math-emu/double.h @@ -22,6 +22,9 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __MATH_EMU_DOUBLE_H__ +#define __MATH_EMU_DOUBLE_H__ + #if _FP_W_TYPE_SIZE < 32 #error "Here's a nickel kid. Go buy yourself a real computer." #endif @@ -197,3 +200,6 @@ union _FP_UNION_D #define _FP_FRAC_HIGH_RAW_D(X) _FP_FRAC_HIGH_1(X) #endif /* W_TYPE_SIZE < 64 */ + + +#endif /* __MATH_EMU_DOUBLE_H__ */ diff --git a/include/math-emu/extended.h b/include/math-emu/extended.h index ae73cecb399b..84770fceb53e 100644 --- a/include/math-emu/extended.h +++ b/include/math-emu/extended.h @@ -19,6 +19,10 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef __MATH_EMU_EXTENDED_H__ +#define __MATH_EMU_EXTENDED_H__ + #if _FP_W_TYPE_SIZE < 32 #error "Here's a nickel, kid. Go buy yourself a real computer." #endif @@ -388,3 +392,5 @@ union _FP_UNION_E #define _FP_FRAC_HIGH_RAW_E(X) (X##_f0) #endif /* not _FP_W_TYPE_SIZE < 64 */ + +#endif /* __MATH_EMU_EXTENDED_H__ */ diff --git a/include/math-emu/op-1.h b/include/math-emu/op-1.h index 53e0fce1b18d..38c0561b70a6 100644 --- a/include/math-emu/op-1.h +++ b/include/math-emu/op-1.h @@ -22,6 +22,9 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __MATH_EMU_OP_1_H__ +#define __MATH_EMU_OP_1_H__ + #define _FP_FRAC_DECL_1(X) _FP_W_TYPE X##_f #define _FP_FRAC_COPY_1(D,S) (D##_f = S##_f) #define _FP_FRAC_SET_1(X,I) (X##_f = I) @@ -295,3 +298,5 @@ else \ D##_f <<= _FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs; \ } while (0) + +#endif /* __MATH_EMU_OP_1_H__ */ diff --git a/include/math-emu/op-2.h b/include/math-emu/op-2.h index e639d534e67f..81416782bc36 100644 --- a/include/math-emu/op-2.h +++ b/include/math-emu/op-2.h @@ -22,6 +22,9 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __MATH_EMU_OP_2_H__ +#define __MATH_EMU_OP_2_H__ + #define _FP_FRAC_DECL_2(X) _FP_W_TYPE X##_f0, X##_f1 #define _FP_FRAC_COPY_2(D,S) (D##_f0 = S##_f0, D##_f1 = S##_f1) #define _FP_FRAC_SET_2(X,I) __FP_FRAC_SET_2(X, I) @@ -606,3 +609,4 @@ _FP_FRAC_SLL_2(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs)); \ } while (0) +#endif diff --git a/include/math-emu/op-4.h b/include/math-emu/op-4.h index f5235f5d9726..2aa1356325ad 100644 --- a/include/math-emu/op-4.h +++ b/include/math-emu/op-4.h @@ -22,6 +22,9 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __MATH_EMU_OP_4_H__ +#define __MATH_EMU_OP_4_H__ + #define _FP_FRAC_DECL_4(X) _FP_W_TYPE X##_f[4] #define _FP_FRAC_COPY_4(D,S) \ (D##_f[0] = S##_f[0], D##_f[1] = S##_f[1], \ @@ -659,3 +662,4 @@ _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs)); \ } while (0) +#endif diff --git a/include/math-emu/op-8.h b/include/math-emu/op-8.h index a9d7dbf59080..8b8c05eb8283 100644 --- a/include/math-emu/op-8.h +++ b/include/math-emu/op-8.h @@ -21,6 +21,9 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __MATH_EMU_OP_8_H__ +#define __MATH_EMU_OP_8_H__ + /* We need just a few things from here for op-4, if we ever need some other macros, they can be added. */ #define _FP_FRAC_DECL_8(X) _FP_W_TYPE X##_f[8] @@ -101,3 +104,4 @@ X##_f[0] |= (_s != 0); \ } while (0) +#endif diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h index e03e40e656bc..dd37d44940c4 100644 --- a/include/math-emu/op-common.h +++ b/include/math-emu/op-common.h @@ -21,6 +21,9 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __MATH_EMU_OP_COMMON_H__ +#define __MATH_EMU_OP_COMMON_H__ + #define _FP_DECL(wc, X) \ _FP_I_TYPE X##_c, X##_s, X##_e; \ _FP_FRAC_DECL_##wc(X) @@ -846,3 +849,4 @@ do { \ q = n / d, r = n % d; \ } while (0) +#endif /* __MATH_EMU_OP_COMMON_H__ */ diff --git a/include/math-emu/quad.h b/include/math-emu/quad.h index 23b20c3e672f..616113626d09 100644 --- a/include/math-emu/quad.h +++ b/include/math-emu/quad.h @@ -22,6 +22,9 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __MATH_EMU_QUAD_H__ +#define __MATH_EMU_QUAD_H__ + #if _FP_W_TYPE_SIZE < 32 #error "Here's a nickel, kid. Go buy yourself a real computer." #endif @@ -201,3 +204,5 @@ union _FP_UNION_Q #define _FP_FRAC_HIGH_RAW_Q(X) _FP_FRAC_HIGH_2(X) #endif /* not _FP_W_TYPE_SIZE < 64 */ + +#endif /* __MATH_EMU_QUAD_H__ */ diff --git a/include/math-emu/single.h b/include/math-emu/single.h index ea12cb8b0a31..87f90b0f9e5d 100644 --- a/include/math-emu/single.h +++ b/include/math-emu/single.h @@ -22,6 +22,9 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __MATH_EMU_SINGLE_H__ +#define __MATH_EMU_SINGLE_H__ + #if _FP_W_TYPE_SIZE < 32 #error "Here's a nickel kid. Go buy yourself a real computer." #endif @@ -109,3 +112,5 @@ union _FP_UNION_S #define _FP_FRAC_HIGH_S(X) _FP_FRAC_HIGH_1(X) #define _FP_FRAC_HIGH_RAW_S(X) _FP_FRAC_HIGH_1(X) + +#endif /* __MATH_EMU_SINGLE_H__ */ diff --git a/include/math-emu/soft-fp.h b/include/math-emu/soft-fp.h index 1d13451346b5..ca977531a1bc 100644 --- a/include/math-emu/soft-fp.h +++ b/include/math-emu/soft-fp.h @@ -21,8 +21,8 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef SOFT_FP_H -#define SOFT_FP_H +#ifndef __MATH_EMU_SOFT_FP_H__ +#define __MATH_EMU_SOFT_FP_H__ #include <asm/sfp-machine.h> @@ -178,4 +178,4 @@ typedef USItype UHWtype; #include <stdlib/longlong.h> #endif -#endif +#endif /* __MATH_EMU_SOFT_FP_H__ */ |
