diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-05-12 21:05:59 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-05-12 21:05:59 +0000 |
commit | ba2dacab305c598cd4c34a604f8e276bf5bab5ff (patch) | |
tree | 78670a0139bf4d5ace617b29b7eba82bbc74d602 /include | |
parent | b77bf69998121e689c5e86cc5630d39a0a9ee6ca (diff) |
Merge with Linux 2.3.99-pre7 and various other bits.
Diffstat (limited to 'include')
110 files changed, 1987 insertions, 533 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h index 81f7b8268..cc8b6f278 100644 --- a/include/asm-alpha/atomic.h +++ b/include/asm-alpha/atomic.h @@ -1,6 +1,8 @@ #ifndef _ALPHA_ATOMIC_H #define _ALPHA_ATOMIC_H +#include <linux/config.h> + /* * Atomic operations that C can't guarantee us. Useful for * resource counting etc... @@ -9,7 +11,7 @@ * than regular operations. */ -#ifdef __SMP__ +#ifdef CONFIG_SMP typedef struct { volatile int counter; } atomic_t; #else typedef struct { int counter; } atomic_t; diff --git a/include/asm-alpha/delay.h b/include/asm-alpha/delay.h index 84b6d1eb5..74cb75ec2 100644 --- a/include/asm-alpha/delay.h +++ b/include/asm-alpha/delay.h @@ -1,6 +1,7 @@ #ifndef __ALPHA_DELAY_H #define __ALPHA_DELAY_H +#include <linux/config.h> #include <asm/smp.h> /* @@ -37,7 +38,7 @@ __udelay(unsigned long usecs, unsigned long lps) __delay((long)usecs >> 32); } -#ifdef __SMP__ +#ifdef CONFIG_SMP #define udelay(u) __udelay((u), cpu_data[smp_processor_id()].loops_per_sec) #else #define udelay(u) __udelay((u), loops_per_sec) diff --git a/include/asm-alpha/hardirq.h b/include/asm-alpha/hardirq.h index 1c8101d58..3961ac4a4 100644 --- a/include/asm-alpha/hardirq.h +++ b/include/asm-alpha/hardirq.h @@ -3,9 +3,10 @@ /* Initially just a straight copy of the i386 code. */ +#include <linux/config.h> #include <linux/threads.h> -#ifndef __SMP__ +#ifndef CONFIG_SMP extern int __local_irq_count; #define local_irq_count(cpu) ((void)(cpu), __local_irq_count) extern unsigned long __irq_attempt[]; @@ -28,7 +29,7 @@ extern unsigned long __irq_attempt[]; #define in_irq() (local_irq_count(smp_processor_id()) != 0) -#ifndef __SMP__ +#ifndef CONFIG_SMP #define hardirq_trylock(cpu) (local_irq_count(cpu) == 0) #define hardirq_endlock(cpu) ((void) 0) @@ -88,5 +89,5 @@ static inline int hardirq_trylock(int cpu) extern void synchronize_irq(void); -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ #endif /* _ALPHA_HARDIRQ_H */ diff --git a/include/asm-alpha/mmu_context.h b/include/asm-alpha/mmu_context.h index c42c1ae54..b44e4a428 100644 --- a/include/asm-alpha/mmu_context.h +++ b/include/asm-alpha/mmu_context.h @@ -84,16 +84,16 @@ __reload_thread(struct thread_struct *pcb) * +-------------+----------------+--------------+ */ -#ifdef __SMP__ +#ifdef CONFIG_SMP #include <asm/smp.h> #define cpu_last_asn(cpuid) (cpu_data[cpuid].last_asn) #else extern unsigned long last_asn; #define cpu_last_asn(cpuid) last_asn -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ #define WIDTH_HARDWARE_ASN 8 -#ifdef __SMP__ +#ifdef CONFIG_SMP #define WIDTH_THIS_PROCESSOR 5 #else #define WIDTH_THIS_PROCESSOR 0 diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h index f3d42ed96..36e9d37cb 100644 --- a/include/asm-alpha/pgalloc.h +++ b/include/asm-alpha/pgalloc.h @@ -30,7 +30,7 @@ extern void __load_new_mm_context(struct mm_struct *); icache flushing. While functional, it is _way_ overkill. The icache is tagged with ASNs and it suffices to allocate a new ASN for the process. */ -#ifndef __SMP__ +#ifndef CONFIG_SMP #define flush_icache_range(start, end) imb() #else #define flush_icache_range(start, end) smp_imb() @@ -45,7 +45,7 @@ extern void smp_imb(void); that icache entries are tagged with the ASN and load a new mm context. */ /* ??? Ought to use this in arch/alpha/kernel/signal.c too. */ -#ifndef __SMP__ +#ifndef CONFIG_SMP static inline void flush_icache_page(struct vm_area_struct *vma, struct page *page) { @@ -154,7 +154,7 @@ static inline void flush_tlb_pgtables(struct mm_struct *mm, { } -#ifndef __SMP__ +#ifndef CONFIG_SMP /* * Flush everything (kernel mapping may also have * changed due to vmalloc/vfree) @@ -204,21 +204,21 @@ static inline void flush_tlb_range(struct mm_struct *mm, flush_tlb_mm(mm); } -#else /* __SMP__ */ +#else /* CONFIG_SMP */ 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); -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ /* * Allocate and free page tables. The xxx_kernel() versions are * used to allocate a kernel page table - this turns on ASN bits * if any. */ -#ifndef __SMP__ +#ifndef CONFIG_SMP extern struct pgtable_cache_struct { unsigned long *pgd_cache; unsigned long *pte_cache; diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h index b05076263..3143b0872 100644 --- a/include/asm-alpha/smp.h +++ b/include/asm-alpha/smp.h @@ -1,6 +1,7 @@ #ifndef __ASM_SMP_H #define __ASM_SMP_H +#include <linux/config.h> #include <asm/pal.h> /* HACK: Cabrio WHAMI return value is bogus if more than 8 bits used.. :-( */ @@ -17,7 +18,7 @@ __hard_smp_processor_id(void) return __r0; } -#ifdef __SMP__ +#ifdef CONFIG_SMP #include <linux/threads.h> #include <asm/irq.h> @@ -56,7 +57,7 @@ extern int __cpu_logical_map[NR_CPUS]; extern unsigned long cpu_present_mask; -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ #define NO_PROC_ID (-1) diff --git a/include/asm-alpha/softirq.h b/include/asm-alpha/softirq.h index 8b2713ed6..ef77f861e 100644 --- a/include/asm-alpha/softirq.h +++ b/include/asm-alpha/softirq.h @@ -1,11 +1,12 @@ #ifndef _ALPHA_SOFTIRQ_H #define _ALPHA_SOFTIRQ_H +#include <linux/config.h> #include <linux/stddef.h> #include <asm/atomic.h> #include <asm/hardirq.h> -#ifndef __SMP__ +#ifndef CONFIG_SMP extern int __local_bh_count; #define local_bh_count(cpu) ((void)(cpu), __local_bh_count) #else diff --git a/include/asm-alpha/string.h b/include/asm-alpha/string.h index 8f87ba2cb..2b9cf9438 100644 --- a/include/asm-alpha/string.h +++ b/include/asm-alpha/string.h @@ -11,7 +11,10 @@ */ #define __HAVE_ARCH_MEMCPY +extern void * memcpy(void *, const void *, size_t); #define __HAVE_ARCH_MEMMOVE +extern void * memmove(void *, const void *, size_t); + /* For backward compatibility with modules. Unused otherwise. */ extern void * __memcpy(void *, const void *, size_t); @@ -22,6 +25,7 @@ extern void * __memcpy(void *, const void *, size_t); #define __HAVE_ARCH_MEMSET extern void * __constant_c_memset(void *, unsigned long, size_t); extern void * __memset(void *, int, size_t); +extern void * memset(void *, int, size_t); #if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 #define memset(s, c, n) \ @@ -38,13 +42,21 @@ extern void * __memset(void *, int, size_t); #endif #define __HAVE_ARCH_STRCPY +extern char * strcpy(char *,const char *); #define __HAVE_ARCH_STRNCPY +extern char * strncpy(char *, const char *, size_t); #define __HAVE_ARCH_STRCAT +extern char * strcat(char *, const char *); #define __HAVE_ARCH_STRNCAT +extern char * strncat(char *, const char *, size_t); #define __HAVE_ARCH_STRCHR +extern char * strchr(const char *,int); #define __HAVE_ARCH_STRRCHR +extern char * strrchr(const char *,int); #define __HAVE_ARCH_STRLEN +extern size_t strlen(const char *); #define __HAVE_ARCH_MEMCHR +extern void * memchr(const void *, int, size_t); /* The following routine is like memset except that it writes 16-bit aligned values. The DEST and COUNT parameters must be even for diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index 49d68b447..919d2b751 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h @@ -290,7 +290,7 @@ extern int __min_ipl; #define local_irq_disable() __cli() #define local_irq_enable() __sti() -#ifdef __SMP__ +#ifdef CONFIG_SMP extern int global_irq_holder; @@ -306,7 +306,7 @@ extern void __global_restore_flags(unsigned long flags); #define save_flags(flags) ((flags) = __global_save_flags()) #define restore_flags(flags) __global_restore_flags(flags) -#else /* __SMP__ */ +#else /* CONFIG_SMP */ #define cli() __cli() #define sti() __sti() @@ -314,7 +314,7 @@ extern void __global_restore_flags(unsigned long flags); #define save_and_cli(flags) __save_and_cli(flags) #define restore_flags(flags) __restore_flags(flags) -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ /* * TB routines.. diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h index 234e79275..ff0524fce 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-i386/spinlock.h @@ -12,7 +12,7 @@ extern int printk(const char * fmt, ...) * initialize their spinlocks properly, tsk tsk. * Remember to turn this off in 2.4. -ben */ -#define SPINLOCK_DEBUG 1 +#define SPINLOCK_DEBUG 0 /* * Your basic SMP spinlocks, allowing only a single CPU anywhere diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h index 5db9768d0..62bf7916c 100644 --- a/include/asm-i386/string.h +++ b/include/asm-i386/string.h @@ -30,7 +30,7 @@ */ #define __HAVE_ARCH_STRCPY -extern inline char * strcpy(char * dest,const char *src) +static inline char * strcpy(char * dest,const char *src) { int d0, d1, d2; __asm__ __volatile__( @@ -44,7 +44,7 @@ return dest; } #define __HAVE_ARCH_STRNCPY -extern inline char * strncpy(char * dest,const char *src,size_t count) +static inline char * strncpy(char * dest,const char *src,size_t count) { int d0, d1, d2, d3; __asm__ __volatile__( @@ -63,7 +63,7 @@ return dest; } #define __HAVE_ARCH_STRCAT -extern inline char * strcat(char * dest,const char * src) +static inline char * strcat(char * dest,const char * src) { int d0, d1, d2, d3; __asm__ __volatile__( @@ -80,7 +80,7 @@ return dest; } #define __HAVE_ARCH_STRNCAT -extern inline char * strncat(char * dest,const char * src,size_t count) +static inline char * strncat(char * dest,const char * src,size_t count) { int d0, d1, d2, d3; __asm__ __volatile__( @@ -103,7 +103,7 @@ return dest; } #define __HAVE_ARCH_STRCMP -extern inline int strcmp(const char * cs,const char * ct) +static inline int strcmp(const char * cs,const char * ct) { int d0, d1; register int __res; @@ -124,7 +124,7 @@ return __res; } #define __HAVE_ARCH_STRNCMP -extern inline int strncmp(const char * cs,const char * ct,size_t count) +static inline int strncmp(const char * cs,const char * ct,size_t count) { register int __res; int d0, d1, d2; @@ -147,7 +147,7 @@ return __res; } #define __HAVE_ARCH_STRCHR -extern inline char * strchr(const char * s, int c) +static inline char * strchr(const char * s, int c) { int d0; register char * __res; @@ -166,7 +166,7 @@ return __res; } #define __HAVE_ARCH_STRRCHR -extern inline char * strrchr(const char * s, int c) +static inline char * strrchr(const char * s, int c) { int d0, d1; register char * __res; @@ -183,7 +183,7 @@ return __res; } #define __HAVE_ARCH_STRLEN -extern inline size_t strlen(const char * s) +static inline size_t strlen(const char * s) { int d0; register int __res; @@ -196,7 +196,7 @@ __asm__ __volatile__( return __res; } -extern inline void * __memcpy(void * to, const void * from, size_t n) +static inline void * __memcpy(void * to, const void * from, size_t n) { int d0, d1, d2; __asm__ __volatile__( @@ -218,7 +218,7 @@ return (to); * This looks horribly ugly, but the compiler can optimize it totally, * as the count is constant. */ -extern inline void * __constant_memcpy(void * to, const void * from, size_t n) +static inline void * __constant_memcpy(void * to, const void * from, size_t n) { switch (n) { case 0: @@ -300,7 +300,7 @@ __asm__ __volatile__( \ * This CPU favours 3DNow strongly (eg AMD Athlon) */ -extern inline void * __constant_memcpy3d(void * to, const void * from, size_t len) +static inline void * __constant_memcpy3d(void * to, const void * from, size_t len) { if(len<512 || in_interrupt()) return __constant_memcpy(to, from, len); @@ -349,7 +349,7 @@ extern void __struct_cpy_bug (void); }) #define __HAVE_ARCH_MEMMOVE -extern inline void * memmove(void * dest,const void * src, size_t n) +static inline void * memmove(void * dest,const void * src, size_t n) { int d0, d1, d2; if (dest<src) @@ -376,7 +376,7 @@ return dest; #define memcmp __builtin_memcmp #define __HAVE_ARCH_MEMCHR -extern inline void * memchr(const void * cs,int c,size_t count) +static inline void * memchr(const void * cs,int c,size_t count) { int d0; register void * __res; @@ -392,7 +392,7 @@ __asm__ __volatile__( return __res; } -extern inline void * __memset_generic(void * s, char c,size_t count) +static inline void * __memset_generic(void * s, char c,size_t count) { int d0, d1; __asm__ __volatile__( @@ -412,7 +412,7 @@ return s; * things 32 bits at a time even when we don't know the size of the * area at compile-time.. */ -extern inline void * __constant_c_memset(void * s, unsigned long c, size_t count) +static inline void * __constant_c_memset(void * s, unsigned long c, size_t count) { int d0, d1; __asm__ __volatile__( @@ -432,7 +432,7 @@ return (s); /* Added by Gertjan van Wingerde to make minix and sysv module work */ #define __HAVE_ARCH_STRNLEN -extern inline size_t strnlen(const char * s, size_t count) +static inline size_t strnlen(const char * s, size_t count) { int d0; register int __res; @@ -453,7 +453,7 @@ return __res; /* end of additional stuff */ #define __HAVE_ARCH_STRSTR -extern inline char * strstr(const char * cs,const char * ct) +static inline char * strstr(const char * cs,const char * ct) { int d0, d1; register char * __res; @@ -486,7 +486,7 @@ return __res; * This looks horribly ugly, but the compiler can optimize it totally, * as we by now know that both pattern and count is constant.. */ -extern inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count) +static inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count) { switch (count) { case 0: @@ -545,7 +545,7 @@ __asm__ __volatile__( \ * find the first occurrence of byte 'c', or 1 past the area if none */ #define __HAVE_ARCH_MEMSCAN -extern inline void * memscan(void * addr, int c, size_t size) +static inline void * memscan(void * addr, int c, size_t size) { if (!size) return addr; diff --git a/include/asm-m68k/string.h b/include/asm-m68k/string.h index 710288a1a..7e144e03e 100644 --- a/include/asm-m68k/string.h +++ b/include/asm-m68k/string.h @@ -5,7 +5,7 @@ #include <asm/page.h> #define __HAVE_ARCH_STRCPY -extern inline char * strcpy(char * dest,const char *src) +static inline char * strcpy(char * dest,const char *src) { char *xdest = dest; @@ -18,7 +18,7 @@ extern inline char * strcpy(char * dest,const char *src) } #define __HAVE_ARCH_STRNCPY -extern inline char * strncpy(char *dest, const char *src, size_t n) +static inline char * strncpy(char *dest, const char *src, size_t n) { char *xdest = dest; @@ -38,7 +38,7 @@ extern inline char * strncpy(char *dest, const char *src, size_t n) } #define __HAVE_ARCH_STRCAT -extern inline char * strcat(char * dest, const char * src) +static inline char * strcat(char * dest, const char * src) { char *tmp = dest; @@ -51,7 +51,7 @@ extern inline char * strcat(char * dest, const char * src) } #define __HAVE_ARCH_STRNCAT -extern inline char * strncat(char *dest, const char *src, size_t count) +static inline char * strncat(char *dest, const char *src, size_t count) { char *tmp = dest; @@ -70,7 +70,7 @@ extern inline char * strncat(char *dest, const char *src, size_t count) } #define __HAVE_ARCH_STRCHR -extern inline char * strchr(const char * s, int c) +static inline char * strchr(const char * s, int c) { const char ch = c; @@ -81,7 +81,7 @@ extern inline char * strchr(const char * s, int c) } #define __HAVE_ARCH_STRPBRK -extern inline char * strpbrk(const char * cs,const char * ct) +static inline char * strpbrk(const char * cs,const char * ct) { const char *sc1,*sc2; @@ -93,7 +93,7 @@ extern inline char * strpbrk(const char * cs,const char * ct) } #define __HAVE_ARCH_STRSPN -extern inline size_t strspn(const char *s, const char *accept) +static inline size_t strspn(const char *s, const char *accept) { const char *p; const char *a; @@ -114,7 +114,7 @@ extern inline size_t strspn(const char *s, const char *accept) } #define __HAVE_ARCH_STRTOK -extern inline char * strtok(char * s,const char * ct) +static inline char * strtok(char * s,const char * ct) { char *sbegin, *send; @@ -137,7 +137,7 @@ extern inline char * strtok(char * s,const char * ct) /* strstr !! */ #define __HAVE_ARCH_STRLEN -extern inline size_t strlen(const char * s) +static inline size_t strlen(const char * s) { const char *sc; for (sc = s; *sc != '\0'; ++sc) ; @@ -147,7 +147,7 @@ extern inline size_t strlen(const char * s) /* strnlen !! */ #define __HAVE_ARCH_STRCMP -extern inline int strcmp(const char * cs,const char * ct) +static inline int strcmp(const char * cs,const char * ct) { char __res; @@ -166,7 +166,7 @@ extern inline int strcmp(const char * cs,const char * ct) } #define __HAVE_ARCH_STRNCMP -extern inline int strncmp(const char * cs,const char * ct,size_t count) +static inline int strncmp(const char * cs,const char * ct,size_t count) { char __res; @@ -199,7 +199,7 @@ extern inline int strncmp(const char * cs,const char * ct,size_t count) * 680[46]0 doesn't really care due to their copy-back caches. * 10/09/96 - Jes Sorensen */ -extern inline void * __memset_g(void * s, int c, size_t count) +static inline void * __memset_g(void * s, int c, size_t count) { void *xs = s; size_t temp; @@ -304,7 +304,7 @@ extern inline void * __memset_g(void * s, int c, size_t count) * caveat is that the destination address must be 16-byte aligned. * 01/09/96 - Jes Sorensen */ -extern inline void * __memset_page(void * s,int c,size_t count) +static inline void * __memset_page(void * s,int c,size_t count) { unsigned long data, tmp; void *xs, *sp; @@ -381,7 +381,7 @@ extern inline void * __memset_page(void * s,int c,size_t count) * both source and destination must be 16-byte aligned, if not we fall * back to the generic memcpy function. - Jes */ -extern inline void * __memcpy_page(void * to, const void * from, size_t count) +static inline void * __memcpy_page(void * to, const void * from, size_t count) { unsigned long tmp; void *xto = to; @@ -429,7 +429,7 @@ extern inline void * __memcpy_page(void * to, const void * from, size_t count) memcpy((to),(from),(n))) #define __HAVE_ARCH_MEMMOVE -extern inline void * memmove(void * dest,const void * src, size_t n) +static inline void * memmove(void * dest,const void * src, size_t n) { void *xdest = dest; size_t temp; diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h index 98fe1ec3d..a7fa5e56f 100644 --- a/include/asm-mips/delay.h +++ b/include/asm-mips/delay.h @@ -12,6 +12,8 @@ #include <linux/config.h> +#include <linux/config.h> + extern __inline__ void __delay(unsigned long loops) { diff --git a/include/asm-mips/hardirq.h b/include/asm-mips/hardirq.h index f881937a6..59d6681de 100644 --- a/include/asm-mips/hardirq.h +++ b/include/asm-mips/hardirq.h @@ -12,6 +12,7 @@ #include <linux/config.h> +#include <linux/config.h> #include <linux/threads.h> #include <linux/irq.h> diff --git a/include/asm-mips/offset.h b/include/asm-mips/offset.h index d807d8e82..42d7a5b81 100644 --- a/include/asm-mips/offset.h +++ b/include/asm-mips/offset.h @@ -52,7 +52,7 @@ #define TASK_COUNTER 32 #define TASK_PRIORITY 36 #define TASK_MM 44 -#define TASK_STRUCT_SIZE 904 +#define TASK_STRUCT_SIZE 880 /* MIPS specific thread_struct offsets. */ #define THREAD_REG16 584 diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index c9600661e..a91913bcc 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h @@ -12,6 +12,8 @@ #include <linux/config.h> +#include <linux/config.h> + /* TLB flushing: * * - flush_tlb_all() flushes all processes TLB entries diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index d6fb7526d..ab996d0b2 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -16,6 +16,8 @@ #include <asm/isadep.h> +#include <linux/config.h> + /* * Default implementation of macro that returns current * instruction pointer ("program counter"). diff --git a/include/asm-mips64/delay.h b/include/asm-mips64/delay.h index 2913275ab..4c05d3cc1 100644 --- a/include/asm-mips64/delay.h +++ b/include/asm-mips64/delay.h @@ -13,6 +13,8 @@ #include <linux/config.h> +#include <linux/config.h> + extern __inline__ void __delay(unsigned long loops) { diff --git a/include/asm-mips64/offset.h b/include/asm-mips64/offset.h index db114b04c..1397e3203 100644 --- a/include/asm-mips64/offset.h +++ b/include/asm-mips64/offset.h @@ -53,7 +53,7 @@ #define TASK_PRIORITY 64 #define TASK_MM 80 #define TASK_PROCESSOR 100 -#define TASK_STRUCT_SIZE 1480 +#define TASK_STRUCT_SIZE 1432 /* MIPS specific thread_struct offsets. */ #define THREAD_REG16 896 diff --git a/include/asm-mips64/pgalloc.h b/include/asm-mips64/pgalloc.h index 74d3e2998..4db514c48 100644 --- a/include/asm-mips64/pgalloc.h +++ b/include/asm-mips64/pgalloc.h @@ -12,6 +12,8 @@ #include <linux/config.h> +#include <linux/config.h> + /* TLB flushing: * * - flush_tlb_all() flushes all processes TLB entries diff --git a/include/asm-mips64/processor.h b/include/asm-mips64/processor.h index 1932672e7..7245e27b0 100644 --- a/include/asm-mips64/processor.h +++ b/include/asm-mips64/processor.h @@ -20,6 +20,7 @@ */ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) +#include <linux/config.h> #if !defined (_LANGUAGE_ASSEMBLY) #include <asm/cachectl.h> #include <asm/mipsregs.h> diff --git a/include/asm-ppc/atomic.h b/include/asm-ppc/atomic.h index c9103a393..c3c5133d6 100644 --- a/include/asm-ppc/atomic.h +++ b/include/asm-ppc/atomic.h @@ -18,94 +18,60 @@ typedef struct { int counter; } atomic_t; #define atomic_read(v) ((v)->counter) #define atomic_set(v,i) (((v)->counter) = (i)) -extern void atomic_add(int a, atomic_t *v); -extern int atomic_add_return(int a, atomic_t *v); -extern void atomic_sub(int a, atomic_t *v); -extern void atomic_inc(atomic_t *v); -extern int atomic_inc_return(atomic_t *v); -extern void atomic_dec(atomic_t *v); -extern int atomic_dec_return(atomic_t *v); -extern int atomic_dec_and_test(atomic_t *v); - extern void atomic_clear_mask(unsigned long mask, unsigned long *addr); extern void atomic_set_mask(unsigned long mask, unsigned long *addr); -#if 0 /* for now */ -extern __inline__ void atomic_add(atomic_t a, atomic_t *v) +extern __inline__ int atomic_add_return(int a, atomic_t *v) { - atomic_t t; + int t; __asm__ __volatile__("\n\ 1: lwarx %0,0,%3\n\ add %0,%2,%0\n\ stwcx. %0,0,%3\n\ - bne 1b" + bne- 1b" : "=&r" (t), "=m" (*v) - : "r" (a), "r" (v) + : "r" (a), "r" (v), "m" (*v) : "cc"); -} -extern __inline__ void atomic_sub(atomic_t a, atomic_t *v) -{ - atomic_t t; - - __asm__ __volatile__("\n\ -1: lwarx %0,0,%3\n\ - subf %0,%2,%0\n\ - stwcx. %0,0,%3\n\ - bne 1b" - : "=&r" (t), "=m" (*v) - : "r" (a), "r" (v) - : "cc"); + return t; } -extern __inline__ int atomic_sub_and_test(atomic_t a, atomic_t *v) +extern __inline__ int atomic_sub_return(int a, atomic_t *v) { - atomic_t t; + int t; __asm__ __volatile__("\n\ 1: lwarx %0,0,%3\n\ subf %0,%2,%0\n\ stwcx. %0,0,%3\n\ - bne 1b" + bne- 1b" : "=&r" (t), "=m" (*v) - : "r" (a), "r" (v) + : "r" (a), "r" (v), "m" (*v) : "cc"); - return t == 0; + return t; } -extern __inline__ void atomic_inc(atomic_t *v) +extern __inline__ int atomic_inc_return(atomic_t *v) { - atomic_t t; + int t; __asm__ __volatile__("\n\ 1: lwarx %0,0,%2\n\ addic %0,%0,1\n\ stwcx. %0,0,%2\n\ - bne 1b" + bne- 1b" : "=&r" (t), "=m" (*v) - : "r" (v) + : "r" (v), "m" (*v) : "cc"); -} - -extern __inline__ void atomic_dec(atomic_t *v) -{ - atomic_t t; - __asm__ __volatile__("\n\ -1: lwarx %0,0,%2\n\ - addic %0,%0,-1\n\ - stwcx. %0,0,%2\n\ - bne 1b" - : "=&r" (t), "=m" (*v) - : "r" (v) - : "cc"); + return t; } -extern __inline__ int atomic_dec_and_test(atomic_t *v) +extern __inline__ int atomic_dec_return(atomic_t *v) { - atomic_t t; + int t; __asm__ __volatile__("\n\ 1: lwarx %0,0,%2\n\ @@ -113,11 +79,17 @@ extern __inline__ int atomic_dec_and_test(atomic_t *v) stwcx. %0,0,%2\n\ bne 1b" : "=&r" (t), "=m" (*v) - : "r" (v) + : "r" (v), "m" (*v) : "cc"); - return t == 0; + return t; } -#endif /* 0 */ + +#define atomic_add(a, v) ((void) atomic_add_return((a), (v))) +#define atomic_sub(a, v) ((void) atomic_sub_return((a), (v))) +#define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0) +#define atomic_inc(v) ((void) atomic_inc_return((v))) +#define atomic_dec(v) ((void) atomic_dec_return((v))) +#define atomic_dec_and_test(v) (atomic_dec_return((v)) == 0) #endif /* _ASM_PPC_ATOMIC_H_ */ diff --git a/include/asm-ppc/bitops.h b/include/asm-ppc/bitops.h index c981d5fa0..d5506a348 100644 --- a/include/asm-ppc/bitops.h +++ b/include/asm-ppc/bitops.h @@ -6,6 +6,7 @@ #ifndef _PPC_BITOPS_H #define _PPC_BITOPS_H +#include <linux/config.h> #include <asm/system.h> #include <asm/byteorder.h> @@ -16,15 +17,18 @@ extern int test_and_set_bit(int nr, volatile void *addr); extern int test_and_clear_bit(int nr, volatile void *addr); extern int test_and_change_bit(int nr, volatile void *addr); - -/* Returns the number of 0's to the left of the most significant 1 bit */ -extern __inline__ int cntlzw(int bits) -{ - int lz; - - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (bits)); - return lz; -} +/* + * Arguably these bit operations don't imply any memory barrier or + * SMP ordering, but in fact a lot of drivers expect them to imply + * both, since they do on x86 cpus. + */ +#ifdef CONFIG_SMP +#define SMP_WMB "eieio\n" +#define SMP_MB "\nsync" +#else +#define SMP_WMB +#define SMP_MB +#endif /* CONFIG_SMP */ /* * These are if'd out here because using : "cc" as a constraint @@ -95,15 +99,20 @@ extern __inline__ int test_bit(int nr, __const__ volatile void *addr) return ((p[nr >> 5] >> (nr & 0x1f)) & 1) != 0; } -extern __inline__ int ffz(unsigned int x) +/* Return the bit position of the most significant 1 bit in a word */ +extern __inline__ int __ilog2(unsigned int x) { - int n; + int lz; + + asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); + return 31 - lz; +} - if (x == ~0) +extern __inline__ int ffz(unsigned int x) +{ + if ((x = ~x) == 0) return 32; - x = ~x & (x+1); /* set LS zero to 1, other bits to 0 */ - __asm__ ("cntlzw %0,%1" : "=r" (n) : "r" (x)); - return 31 - n; + return __ilog2(x & -x); } #ifdef __KERNEL__ @@ -113,19 +122,10 @@ extern __inline__ int ffz(unsigned int x) * the libc and compiler builtin ffs routines, therefore * differs in spirit from the above ffz (man ffs). */ - -#define ffs(x) generic_ffs(x) - -#if 0 -/* untested, someone with PPC knowledge? */ -/* From Alexander Kjeldaas <astor@guardian.no> */ extern __inline__ int ffs(int x) { - int result; - asm ("cntlzw %0,%1" : "=r" (result) : "r" (x)); - return 32 - result; /* IBM backwards ordering of bits */ + return __ilog2(x & -x) + 1; } -#endif /* * hweightN: returns the hamming weight (i.e. the number diff --git a/include/asm-ppc/cache.h b/include/asm-ppc/cache.h index 0a7f79689..069ad9707 100644 --- a/include/asm-ppc/cache.h +++ b/include/asm-ppc/cache.h @@ -8,11 +8,16 @@ #include <asm/processor.h> /* bytes per L1 cache line */ -#define L1_CACHE_BYTES 32 -#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) -#define L1_CACHE_PAGES 8 +#if !defined(CONFIG_8xx) || defined(CONFIG_8260) +#define L1_CACHE_BYTES 32 +#else +#define L1_CACHE_BYTES 16 +#endif /* !8xx || 8260 */ + +#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) +#define L1_CACHE_PAGES 8 -#define SMP_CACHE_BYTES L1_CACHE_BYTES +#define SMP_CACHE_BYTES L1_CACHE_BYTES #ifdef MODULE #define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES))) diff --git a/include/asm-ppc/cpm_8260.h b/include/asm-ppc/cpm_8260.h new file mode 100644 index 000000000..c479f87d2 --- /dev/null +++ b/include/asm-ppc/cpm_8260.h @@ -0,0 +1,551 @@ + +/* + * MPC8260 Communication Processor Module. + * Copyright (c) 1999 Dan Malek (dmalek@jlc.net) + * + * This file contains structures and information for the communication + * processor channels found in the dual port RAM or parameter RAM. + * All CPM control and status is available through the MPC8260 internal + * memory map. See immap.h for details. + */ +#ifndef __CPM_82XX__ +#define __CPM_82XX__ + +#include <asm/immap_8260.h> + +/* CPM Command register. +*/ +#define CPM_CR_RST ((uint)0x80000000) +#define CPM_CR_PAGE ((uint)0x7c000000) +#define CPM_CR_SBLOCK ((uint)0x03e00000) +#define CPM_CR_FLG ((uint)0x00010000) +#define CPM_CR_MCN ((uint)0x00003fc0) +#define CPM_CR_OPCODE ((uint)0x0000000f) + +/* Device sub-block and page codes. +*/ +#define CPM_CR_SCC1_SBLOCK (0x04) +#define CPM_CR_SCC2_SBLOCK (0x05) +#define CPM_CR_SCC3_SBLOCK (0x06) +#define CPM_CR_SCC4_SBLOCK (0x07) +#define CPM_CR_SMC1_SBLOCK (0x08) +#define CPM_CR_SMC2_SBLOCK (0x09) +#define CPM_CR_SPI_SBLOCK (0x0a) +#define CPM_CR_I2C_SBLOCK (0x0b) +#define CPM_CR_TIMER_SBLOCK (0x0f) +#define CPM_CR_RAND_SBLOCK (0x0e) +#define CPM_CR_FCC1_SBLOCK (0x10) +#define CPM_CR_FCC2_SBLOCK (0x11) +#define CPM_CR_FCC3_SBLOCK (0x12) +#define CPM_CR_IDMA1_SBLOCK (0x14) +#define CPM_CR_IDMA2_SBLOCK (0x15) +#define CPM_CR_IDMA3_SBLOCK (0x16) +#define CPM_CR_IDMA4_SBLOCK (0x17) +#define CPM_CR_MCC1_SBLOCK (0x1c) + +#define CPM_CR_SCC1_PAGE (0x00) +#define CPM_CR_SCC2_PAGE (0x01) +#define CPM_CR_SCC3_PAGE (0x02) +#define CPM_CR_SCC4_PAGE (0x03) +#define CPM_CR_SMC1_PAGE (0x07) +#define CPM_CR_SMC2_PAGE (0x08) +#define CPM_CR_SPI_PAGE (0x09) +#define CPM_CR_I2C_PAGE (0x0a) +#define CPM_CR_TIMER_PAGE (0x0a) +#define CPM_CR_RAND_PAGE (0x0a) +#define CPM_CR_FCC1_PAGE (0x04) +#define CPM_CR_FCC2_PAGE (0x05) +#define CPM_CR_FCC3_PAGE (0x06) +#define CPM_CR_IDMA1_PAGE (0x07) +#define CPM_CR_IDMA2_PAGE (0x08) +#define CPM_CR_IDMA3_PAGE (0x09) +#define CPM_CR_IDMA4_PAGE (0x0a) +#define CPM_CR_MCC1_PAGE (0x07) +#define CPM_CR_MCC2_PAGE (0x08) + +/* Some opcodes (there are more...later) +*/ +#define CPM_CR_INIT_TRX ((ushort)0x0000) +#define CPM_CR_INIT_RX ((ushort)0x0001) +#define CPM_CR_INIT_TX ((ushort)0x0002) +#define CPM_CR_HUNT_MODE ((ushort)0x0003) +#define CPM_CR_STOP_TX ((ushort)0x0004) +#define CPM_CR_RESTART_TX ((ushort)0x0006) +#define CPM_CR_SET_GADDR ((ushort)0x0008) + +#define mk_cr_cmd(PG, SBC, MCN, OP) \ + ((PG << 26) | (SBC << 21) | (MCN << 6) | OP) + +/* Dual Port RAM addresses. The first 16K is available for almost + * any CPM use, so we put the BDs there. The first 128 bytes are + * used for SMC1 and SMC2 parameter RAM, so we start allocating + * BDs above that. All of this must change when we start + * downloading RAM microcode. + */ +#define CPM_DATAONLY_BASE ((uint)128) +#define CPM_DATAONLY_SIZE ((uint)(16 * 1024) - CPM_DATAONLY_BASE) +#define CPM_DP_NOSPACE ((uint)0x7fffffff) + +/* The number of pages of host memory we allocate for CPM. This is + * done early in kernel initialization to get physically contiguous + * pages. + */ +#define NUM_CPM_HOST_PAGES 2 + + +/* Export the base address of the communication processor registers + * and dual port ram. + */ +extern cpm8260_t *cpmp; /* Pointer to comm processor */ +uint m8260_cpm_dpalloc(uint size); +uint m8260_cpm_hostalloc(uint size); +void m8260_cpm_setbrg(uint brg, uint rate); +void m8260_cpm_fastbrg(uint brg, uint rate, int div16); + +/* Buffer descriptors used by many of the CPM protocols. +*/ +typedef struct cpm_buf_desc { + ushort cbd_sc; /* Status and Control */ + ushort cbd_datlen; /* Data length in buffer */ + uint cbd_bufaddr; /* Buffer address in host memory */ +} cbd_t; + +#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */ +#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */ +#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */ +#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */ +#define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */ +#define BD_SC_CM ((ushort)0x0200) /* Continous mode */ +#define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */ +#define BD_SC_P ((ushort)0x0100) /* xmt preamble */ +#define BD_SC_BR ((ushort)0x0020) /* Break received */ +#define BD_SC_FR ((ushort)0x0010) /* Framing error */ +#define BD_SC_PR ((ushort)0x0008) /* Parity error */ +#define BD_SC_OV ((ushort)0x0002) /* Overrun */ +#define BD_SC_CD ((ushort)0x0001) /* ?? */ + +/* Parameter RAM offsets from the base. +*/ +#define PROFF_SCC1 ((uint)0x8000) +#define PROFF_SCC2 ((uint)0x8100) +#define PROFF_SCC3 ((uint)0x8200) +#define PROFF_SCC4 ((uint)0x8300) +#define PROFF_FCC1 ((uint)0x8400) +#define PROFF_FCC2 ((uint)0x8500) +#define PROFF_FCC3 ((uint)0x8600) +#define PROFF_MCC1 ((uint)0x8700) +#define PROFF_SMC1_BASE ((uint)0x87fc) +#define PROFF_IDMA1_BASE ((uint)0x87fe) +#define PROFF_MCC2 ((uint)0x8800) +#define PROFF_SMC2_BASE ((uint)0x88fc) +#define PROFF_IDMA2_BASE ((uint)0x88fe) +#define PROFF_SPI_BASE ((uint)0x89fc) +#define PROFF_IDMA3_BASE ((uint)0x89fe) +#define PROFF_TIMERS ((uint)0x8ae0) +#define PROFF_REVNUM ((uint)0x8af0) +#define PROFF_RAND ((uint)0x8af8) +#define PROFF_I2C_BASE ((uint)0x8afc) +#define PROFF_IDMA4_BASE ((uint)0x89fe) + +/* The SMCs are relocated to any of the first eight DPRAM pages. + * We will fix these at the first locations of DPRAM, until we + * get some microcode patches :-). + * The parameter ram space for the SMCs is fifty-some bytes, and + * they are required to start on a 64 byte boundary. + */ +#define PROFF_SMC1 (0) +#define PROFF_SMC2 (64) + + +/* Define enough so I can at least use the serial port as a UART. + */ +typedef struct smc_uart { + ushort smc_rbase; /* Rx Buffer descriptor base address */ + ushort smc_tbase; /* Tx Buffer descriptor base address */ + u_char smc_rfcr; /* Rx function code */ + u_char smc_tfcr; /* Tx function code */ + ushort smc_mrblr; /* Max receive buffer length */ + uint smc_rstate; /* Internal */ + uint smc_idp; /* Internal */ + ushort smc_rbptr; /* Internal */ + ushort smc_ibc; /* Internal */ + uint smc_rxtmp; /* Internal */ + uint smc_tstate; /* Internal */ + uint smc_tdp; /* Internal */ + ushort smc_tbptr; /* Internal */ + ushort smc_tbc; /* Internal */ + uint smc_txtmp; /* Internal */ + ushort smc_maxidl; /* Maximum idle characters */ + ushort smc_tmpidl; /* Temporary idle counter */ + ushort smc_brklen; /* Last received break length */ + ushort smc_brkec; /* rcv'd break condition counter */ + ushort smc_brkcr; /* xmt break count register */ + ushort smc_rmask; /* Temporary bit mask */ + uint smc_stmp; /* SDMA Temp */ +} smc_uart_t; + +/* Function code bits. +*/ +#define SMC_GBL ((u_char)0x20) /* Set memory snooping */ +#define SMC_EB ((u_char)0x10) /* Set big endian byte order */ +#define SMC_TC2 ((u_char)0x04) /* Transfer code 2 value */ +#define SMC_DTB ((u_char)0x02) /* Use local bus when set */ + +/* SMC uart mode register (Internal memory map). +*/ +#define SMCMR_REN ((ushort)0x0001) +#define SMCMR_TEN ((ushort)0x0002) +#define SMCMR_DM ((ushort)0x000c) +#define SMCMR_SM_GCI ((ushort)0x0000) +#define SMCMR_SM_UART ((ushort)0x0020) +#define SMCMR_SM_TRANS ((ushort)0x0030) +#define SMCMR_SM_MASK ((ushort)0x0030) +#define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */ +#define SMCMR_REVD SMCMR_PM_EVEN +#define SMCMR_PEN ((ushort)0x0200) /* Parity enable */ +#define SMCMR_BS SMCMR_PEN +#define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */ +#define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */ +#define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK) + +/* SMC Event and Mask register. +*/ +#define SMCM_TXE ((unsigned char)0x10) +#define SMCM_BSY ((unsigned char)0x04) +#define SMCM_TX ((unsigned char)0x02) +#define SMCM_RX ((unsigned char)0x01) + +/* Baud rate generators. +*/ +#define CPM_BRG_RST ((uint)0x00020000) +#define CPM_BRG_EN ((uint)0x00010000) +#define CPM_BRG_EXTC_INT ((uint)0x00000000) +#define CPM_BRG_EXTC_CLK3_9 ((uint)0x00004000) +#define CPM_BRG_EXTC_CLK5_15 ((uint)0x00008000) +#define CPM_BRG_ATB ((uint)0x00002000) +#define CPM_BRG_CD_MASK ((uint)0x00001ffe) +#define CPM_BRG_DIV16 ((uint)0x00000001) + +/* SCCs. +*/ +#define SCC_GSMRH_IRP ((uint)0x00040000) +#define SCC_GSMRH_GDE ((uint)0x00010000) +#define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000) +#define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000) +#define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000) +#define SCC_GSMRH_REVD ((uint)0x00002000) +#define SCC_GSMRH_TRX ((uint)0x00001000) +#define SCC_GSMRH_TTX ((uint)0x00000800) +#define SCC_GSMRH_CDP ((uint)0x00000400) +#define SCC_GSMRH_CTSP ((uint)0x00000200) +#define SCC_GSMRH_CDS ((uint)0x00000100) +#define SCC_GSMRH_CTSS ((uint)0x00000080) +#define SCC_GSMRH_TFL ((uint)0x00000040) +#define SCC_GSMRH_RFW ((uint)0x00000020) +#define SCC_GSMRH_TXSY ((uint)0x00000010) +#define SCC_GSMRH_SYNL16 ((uint)0x0000000c) +#define SCC_GSMRH_SYNL8 ((uint)0x00000008) +#define SCC_GSMRH_SYNL4 ((uint)0x00000004) +#define SCC_GSMRH_RTSM ((uint)0x00000002) +#define SCC_GSMRH_RSYN ((uint)0x00000001) + +#define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */ +#define SCC_GSMRL_EDGE_NONE ((uint)0x60000000) +#define SCC_GSMRL_EDGE_NEG ((uint)0x40000000) +#define SCC_GSMRL_EDGE_POS ((uint)0x20000000) +#define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000) +#define SCC_GSMRL_TCI ((uint)0x10000000) +#define SCC_GSMRL_TSNC_3 ((uint)0x0c000000) +#define SCC_GSMRL_TSNC_4 ((uint)0x08000000) +#define SCC_GSMRL_TSNC_14 ((uint)0x04000000) +#define SCC_GSMRL_TSNC_INF ((uint)0x00000000) +#define SCC_GSMRL_RINV ((uint)0x02000000) +#define SCC_GSMRL_TINV ((uint)0x01000000) +#define SCC_GSMRL_TPL_128 ((uint)0x00c00000) +#define SCC_GSMRL_TPL_64 ((uint)0x00a00000) +#define SCC_GSMRL_TPL_48 ((uint)0x00800000) +#define SCC_GSMRL_TPL_32 ((uint)0x00600000) +#define SCC_GSMRL_TPL_16 ((uint)0x00400000) +#define SCC_GSMRL_TPL_8 ((uint)0x00200000) +#define SCC_GSMRL_TPL_NONE ((uint)0x00000000) +#define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000) +#define SCC_GSMRL_TPP_01 ((uint)0x00100000) +#define SCC_GSMRL_TPP_10 ((uint)0x00080000) +#define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000) +#define SCC_GSMRL_TEND ((uint)0x00040000) +#define SCC_GSMRL_TDCR_32 ((uint)0x00030000) +#define SCC_GSMRL_TDCR_16 ((uint)0x00020000) +#define SCC_GSMRL_TDCR_8 ((uint)0x00010000) +#define SCC_GSMRL_TDCR_1 ((uint)0x00000000) +#define SCC_GSMRL_RDCR_32 ((uint)0x0000c000) +#define SCC_GSMRL_RDCR_16 ((uint)0x00008000) +#define SCC_GSMRL_RDCR_8 ((uint)0x00004000) +#define SCC_GSMRL_RDCR_1 ((uint)0x00000000) +#define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000) +#define SCC_GSMRL_RENC_MANCH ((uint)0x00002000) +#define SCC_GSMRL_RENC_FM0 ((uint)0x00001000) +#define SCC_GSMRL_RENC_NRZI ((uint)0x00000800) +#define SCC_GSMRL_RENC_NRZ ((uint)0x00000000) +#define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600) +#define SCC_GSMRL_TENC_MANCH ((uint)0x00000400) +#define SCC_GSMRL_TENC_FM0 ((uint)0x00000200) +#define SCC_GSMRL_TENC_NRZI ((uint)0x00000100) +#define SCC_GSMRL_TENC_NRZ ((uint)0x00000000) +#define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */ +#define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080) +#define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040) +#define SCC_GSMRL_DIAG_NORM ((uint)0x00000000) +#define SCC_GSMRL_ENR ((uint)0x00000020) +#define SCC_GSMRL_ENT ((uint)0x00000010) +#define SCC_GSMRL_MODE_ENET ((uint)0x0000000c) +#define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009) +#define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008) +#define SCC_GSMRL_MODE_V14 ((uint)0x00000007) +#define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006) +#define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005) +#define SCC_GSMRL_MODE_UART ((uint)0x00000004) +#define SCC_GSMRL_MODE_SS7 ((uint)0x00000003) +#define SCC_GSMRL_MODE_ATALK ((uint)0x00000002) +#define SCC_GSMRL_MODE_HDLC ((uint)0x00000000) + +#define SCC_TODR_TOD ((ushort)0x8000) + +/* SCC Event and Mask register. +*/ +#define SCCM_TXE ((unsigned char)0x10) +#define SCCM_BSY ((unsigned char)0x04) +#define SCCM_TX ((unsigned char)0x02) +#define SCCM_RX ((unsigned char)0x01) + +typedef struct scc_param { + ushort scc_rbase; /* Rx Buffer descriptor base address */ + ushort scc_tbase; /* Tx Buffer descriptor base address */ + u_char scc_rfcr; /* Rx function code */ + u_char scc_tfcr; /* Tx function code */ + ushort scc_mrblr; /* Max receive buffer length */ + uint scc_rstate; /* Internal */ + uint scc_idp; /* Internal */ + ushort scc_rbptr; /* Internal */ + ushort scc_ibc; /* Internal */ + uint scc_rxtmp; /* Internal */ + uint scc_tstate; /* Internal */ + uint scc_tdp; /* Internal */ + ushort scc_tbptr; /* Internal */ + ushort scc_tbc; /* Internal */ + uint scc_txtmp; /* Internal */ + uint scc_rcrc; /* Internal */ + uint scc_tcrc; /* Internal */ +} sccp_t; + +/* Function code bits. +*/ +#define SCC_EB ((u_char)0x10) /* Set big endian byte order */ + +/* CPM Ethernet through SCC1. + */ +typedef struct scc_enet { + sccp_t sen_genscc; + uint sen_cpres; /* Preset CRC */ + uint sen_cmask; /* Constant mask for CRC */ + uint sen_crcec; /* CRC Error counter */ + uint sen_alec; /* alignment error counter */ + uint sen_disfc; /* discard frame counter */ + ushort sen_pads; /* Tx short frame pad character */ + ushort sen_retlim; /* Retry limit threshold */ + ushort sen_retcnt; /* Retry limit counter */ + ushort sen_maxflr; /* maximum frame length register */ + ushort sen_minflr; /* minimum frame length register */ + ushort sen_maxd1; /* maximum DMA1 length */ + ushort sen_maxd2; /* maximum DMA2 length */ + ushort sen_maxd; /* Rx max DMA */ + ushort sen_dmacnt; /* Rx DMA counter */ + ushort sen_maxb; /* Max BD byte count */ + ushort sen_gaddr1; /* Group address filter */ + ushort sen_gaddr2; + ushort sen_gaddr3; + ushort sen_gaddr4; + uint sen_tbuf0data0; /* Save area 0 - current frame */ + uint sen_tbuf0data1; /* Save area 1 - current frame */ + uint sen_tbuf0rba; /* Internal */ + uint sen_tbuf0crc; /* Internal */ + ushort sen_tbuf0bcnt; /* Internal */ + ushort sen_paddrh; /* physical address (MSB) */ + ushort sen_paddrm; + ushort sen_paddrl; /* physical address (LSB) */ + ushort sen_pper; /* persistence */ + ushort sen_rfbdptr; /* Rx first BD pointer */ + ushort sen_tfbdptr; /* Tx first BD pointer */ + ushort sen_tlbdptr; /* Tx last BD pointer */ + uint sen_tbuf1data0; /* Save area 0 - current frame */ + uint sen_tbuf1data1; /* Save area 1 - current frame */ + uint sen_tbuf1rba; /* Internal */ + uint sen_tbuf1crc; /* Internal */ + ushort sen_tbuf1bcnt; /* Internal */ + ushort sen_txlen; /* Tx Frame length counter */ + ushort sen_iaddr1; /* Individual address filter */ + ushort sen_iaddr2; + ushort sen_iaddr3; + ushort sen_iaddr4; + ushort sen_boffcnt; /* Backoff counter */ + + /* NOTE: Some versions of the manual have the following items + * incorrectly documented. Below is the proper order. + */ + ushort sen_taddrh; /* temp address (MSB) */ + ushort sen_taddrm; + ushort sen_taddrl; /* temp address (LSB) */ +} scc_enet_t; + + +/* SCC Event register as used by Ethernet. +*/ +#define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */ +#define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */ +#define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */ +#define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */ +#define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */ +#define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */ + +/* SCC Mode Register (PMSR) as used by Ethernet. +*/ +#define SCC_PMSR_HBC ((ushort)0x8000) /* Enable heartbeat */ +#define SCC_PMSR_FC ((ushort)0x4000) /* Force collision */ +#define SCC_PMSR_RSH ((ushort)0x2000) /* Receive short frames */ +#define SCC_PMSR_IAM ((ushort)0x1000) /* Check individual hash */ +#define SCC_PMSR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */ +#define SCC_PMSR_PRO ((ushort)0x0200) /* Promiscuous mode */ +#define SCC_PMSR_BRO ((ushort)0x0100) /* Catch broadcast pkts */ +#define SCC_PMSR_SBT ((ushort)0x0080) /* Special backoff timer */ +#define SCC_PMSR_LPB ((ushort)0x0040) /* Set Loopback mode */ +#define SCC_PMSR_SIP ((ushort)0x0020) /* Sample Input Pins */ +#define SCC_PMSR_LCW ((ushort)0x0010) /* Late collision window */ +#define SCC_PMSR_NIB22 ((ushort)0x000a) /* Start frame search */ +#define SCC_PMSR_FDE ((ushort)0x0001) /* Full duplex enable */ + +/* Buffer descriptor control/status used by Ethernet receive. +*/ +#define BD_ENET_RX_EMPTY ((ushort)0x8000) +#define BD_ENET_RX_WRAP ((ushort)0x2000) +#define BD_ENET_RX_INTR ((ushort)0x1000) +#define BD_ENET_RX_LAST ((ushort)0x0800) +#define BD_ENET_RX_FIRST ((ushort)0x0400) +#define BD_ENET_RX_MISS ((ushort)0x0100) +#define BD_ENET_RX_LG ((ushort)0x0020) +#define BD_ENET_RX_NO ((ushort)0x0010) +#define BD_ENET_RX_SH ((ushort)0x0008) +#define BD_ENET_RX_CR ((ushort)0x0004) +#define BD_ENET_RX_OV ((ushort)0x0002) +#define BD_ENET_RX_CL ((ushort)0x0001) +#define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */ + +/* Buffer descriptor control/status used by Ethernet transmit. +*/ +#define BD_ENET_TX_READY ((ushort)0x8000) +#define BD_ENET_TX_PAD ((ushort)0x4000) +#define BD_ENET_TX_WRAP ((ushort)0x2000) +#define BD_ENET_TX_INTR ((ushort)0x1000) +#define BD_ENET_TX_LAST ((ushort)0x0800) +#define BD_ENET_TX_TC ((ushort)0x0400) +#define BD_ENET_TX_DEF ((ushort)0x0200) +#define BD_ENET_TX_HB ((ushort)0x0100) +#define BD_ENET_TX_LC ((ushort)0x0080) +#define BD_ENET_TX_RL ((ushort)0x0040) +#define BD_ENET_TX_RCMASK ((ushort)0x003c) +#define BD_ENET_TX_UN ((ushort)0x0002) +#define BD_ENET_TX_CSL ((ushort)0x0001) +#define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */ + +/* SCC as UART +*/ +typedef struct scc_uart { + sccp_t scc_genscc; + uint scc_res1; /* Reserved */ + uint scc_res2; /* Reserved */ + ushort scc_maxidl; /* Maximum idle chars */ + ushort scc_idlc; /* temp idle counter */ + ushort scc_brkcr; /* Break count register */ + ushort scc_parec; /* receive parity error counter */ + ushort scc_frmec; /* receive framing error counter */ + ushort scc_nosec; /* receive noise counter */ + ushort scc_brkec; /* receive break condition counter */ + ushort scc_brkln; /* last received break length */ + ushort scc_uaddr1; /* UART address character 1 */ + ushort scc_uaddr2; /* UART address character 2 */ + ushort scc_rtemp; /* Temp storage */ + ushort scc_toseq; /* Transmit out of sequence char */ + ushort scc_char1; /* control character 1 */ + ushort scc_char2; /* control character 2 */ + ushort scc_char3; /* control character 3 */ + ushort scc_char4; /* control character 4 */ + ushort scc_char5; /* control character 5 */ + ushort scc_char6; /* control character 6 */ + ushort scc_char7; /* control character 7 */ + ushort scc_char8; /* control character 8 */ + ushort scc_rccm; /* receive control character mask */ + ushort scc_rccr; /* receive control character register */ + ushort scc_rlbc; /* receive last break character */ +} scc_uart_t; + +/* SCC Event and Mask registers when it is used as a UART. +*/ +#define UART_SCCM_GLR ((ushort)0x1000) +#define UART_SCCM_GLT ((ushort)0x0800) +#define UART_SCCM_AB ((ushort)0x0200) +#define UART_SCCM_IDL ((ushort)0x0100) +#define UART_SCCM_GRA ((ushort)0x0080) +#define UART_SCCM_BRKE ((ushort)0x0040) +#define UART_SCCM_BRKS ((ushort)0x0020) +#define UART_SCCM_CCR ((ushort)0x0008) +#define UART_SCCM_BSY ((ushort)0x0004) +#define UART_SCCM_TX ((ushort)0x0002) +#define UART_SCCM_RX ((ushort)0x0001) + +/* The SCC PMSR when used as a UART. +*/ +#define SCU_PMSR_FLC ((ushort)0x8000) +#define SCU_PMSR_SL ((ushort)0x4000) +#define SCU_PMSR_CL ((ushort)0x3000) +#define SCU_PMSR_UM ((ushort)0x0c00) +#define SCU_PMSR_FRZ ((ushort)0x0200) +#define SCU_PMSR_RZS ((ushort)0x0100) +#define SCU_PMSR_SYN ((ushort)0x0080) +#define SCU_PMSR_DRT ((ushort)0x0040) +#define SCU_PMSR_PEN ((ushort)0x0010) +#define SCU_PMSR_RPM ((ushort)0x000c) +#define SCU_PMSR_REVP ((ushort)0x0008) +#define SCU_PMSR_TPM ((ushort)0x0003) +#define SCU_PMSR_TEVP ((ushort)0x0003) + +/* CPM Transparent mode SCC. + */ +typedef struct scc_trans { + sccp_t st_genscc; + uint st_cpres; /* Preset CRC */ + uint st_cmask; /* Constant mask for CRC */ +} scc_trans_t; + +#define BD_SCC_TX_LAST ((ushort)0x0800) + +/* IIC parameter RAM. +*/ +typedef struct iic { + ushort iic_rbase; /* Rx Buffer descriptor base address */ + ushort iic_tbase; /* Tx Buffer descriptor base address */ + u_char iic_rfcr; /* Rx function code */ + u_char iic_tfcr; /* Tx function code */ + ushort iic_mrblr; /* Max receive buffer length */ + uint iic_rstate; /* Internal */ + uint iic_rdp; /* Internal */ + ushort iic_rbptr; /* Internal */ + ushort iic_rbc; /* Internal */ + uint iic_rxtmp; /* Internal */ + uint iic_tstate; /* Internal */ + uint iic_tdp; /* Internal */ + ushort iic_tbptr; /* Internal */ + ushort iic_tbc; /* Internal */ + uint iic_txtmp; /* Internal */ +} iic_t; + +#define BD_IIC_START ((ushort)0x0400) + +#endif /* __CPM_82XX__ */ diff --git a/include/asm-ppc/est8260.h b/include/asm-ppc/est8260.h new file mode 100644 index 000000000..201286ab4 --- /dev/null +++ b/include/asm-ppc/est8260.h @@ -0,0 +1,20 @@ + +#define IMAP_ADDR ((uint)0xf0000000) + + +/* A Board Information structure that is given to a program when + * prom starts it up. + */ +typedef struct bd_info { + unsigned int bi_memstart; /* Memory start address */ + unsigned int bi_memsize; /* Memory (end) size in bytes */ + unsigned int bi_intfreq; /* Internal Freq, in Hz */ + unsigned int bi_busfreq; /* Bus Freq, in MHz */ + unsigned int bi_cpmfreq; /* CPM Freq, in MHz */ + unsigned int bi_brgfreq; /* BRG Freq, in MHz */ + unsigned char bi_enetaddr[6]; + unsigned int bi_baudrate; +} bd_t; + +extern bd_t m8xx_board_info; + diff --git a/include/asm-ppc/feature.h b/include/asm-ppc/feature.h index 318150dab..78d73b532 100644 --- a/include/asm-ppc/feature.h +++ b/include/asm-ppc/feature.h @@ -32,8 +32,8 @@ enum system_feature { FEATURE_Mediabay_reset, FEATURE_Mediabay_power, FEATURE_Mediabay_PCI_enable, - FEATURE_Mediabay_IDE_enable, /* Also IDE 1 */ - FEATURE_Mediabay_IDE_reset, /* Also IDE 1 */ + FEATURE_IDE1_enable, /* MediaBay IDE */ + FEATURE_IDE1_reset, /* MediaBay IDE */ FEATURE_Mediabay_floppy_enable, FEATURE_BMac_reset, FEATURE_BMac_IO_enable, @@ -43,6 +43,8 @@ enum system_feature { FEATURE_Sound_CLK_enable, FEATURE_IDE2_enable, FEATURE_IDE2_reset, + FEATURE_Mediabay_IDE_switch, /* MB IDE bus switch */ + FEATURE_Mediabay_content, /* MB content indicator enable */ FEATURE_last, }; diff --git a/include/asm-ppc/gemini_serial.h b/include/asm-ppc/gemini_serial.h index 745c24a39..089a0ce60 100644 --- a/include/asm-ppc/gemini_serial.h +++ b/include/asm-ppc/gemini_serial.h @@ -14,10 +14,10 @@ #define BASE_BAUD (24576000 / 16) #ifdef CONFIG_SERIAL_DETECT_IRQ -#define STD_COM_FLAGS (/*ASYNC_BOOT_AUTOCONF|*/ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ) +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ) #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ) #else -#define STD_COM_FLAGS (/*ASYNC_BOOT_AUTOCONF|*/ASYNC_SKIP_TEST) +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST) #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF) #endif diff --git a/include/asm-ppc/heathrow.h b/include/asm-ppc/heathrow.h index 4081e1237..84a862670 100644 --- a/include/asm-ppc/heathrow.h +++ b/include/asm-ppc/heathrow.h @@ -13,7 +13,7 @@ * Bits in feature control register. * Bits postfixed with a _N are in inverse logic */ -#define HRW_RESET_SCC 1 /* Named in_use_led in OF ??? */ +#define HRW_MODEM_POWER_N 1 /* turns off modem power */ #define HRW_BAY_POWER_N 2 #define HRW_BAY_PCI_ENABLE 4 #define HRW_BAY_IDE_ENABLE 8 @@ -38,8 +38,11 @@ #define HRW_ARB_BYPASS 0x400000 /* ??? (0 on main, 1 on gatwick) */ #define HRW_IDE1_RESET_N 0x800000 /* Media bay */ #define HRW_SLOW_SCC_PCLK 0x1000000 /* ??? (0) */ -#define HRW_MODEM_POWER_N 0x2000000 /* Used by internal modem on wallstreet */ +#define HRW_RESET_SCC 0x2000000 /* perhaps? */ #define HRW_MFDC_CELL_ENABLE 0x4000000 /* ??? (0) */ #define HRW_USE_MFDC 0x8000000 /* ??? (0) */ #define HRW_BMAC_IO_ENABLE 0x60000000 /* two bits, not documented in OF */ #define HRW_BMAC_RESET 0x80000000 /* not documented in OF */ + + +#define PADD_MODEM_POWER_N 0x00000001 /* modem power on paddington */ diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h index 8b50f862b..198132fa4 100644 --- a/include/asm-ppc/ide.h +++ b/include/asm-ppc/ide.h @@ -63,6 +63,7 @@ void ide_insw(ide_ioreg_t port, void *buf, int ns); void ide_outsw(ide_ioreg_t port, void *buf, int ns); void ppc_generic_ide_fix_driveid(struct hd_driveid *id); +#if 0 #undef insw #define insw(port, buf, ns) do { \ ppc_ide_md.insw((port), (buf), (ns)); \ @@ -72,6 +73,7 @@ void ppc_generic_ide_fix_driveid(struct hd_driveid *id); #define outsw(port, buf, ns) do { \ ppc_ide_md.outsw((port), (buf), (ns)); \ } while (0) +#endif #undef SUPPORT_SLOW_DATA_PORTS #define SUPPORT_SLOW_DATA_PORTS 0 diff --git a/include/asm-ppc/immap_8260.h b/include/asm-ppc/immap_8260.h new file mode 100644 index 000000000..407cbf04c --- /dev/null +++ b/include/asm-ppc/immap_8260.h @@ -0,0 +1,433 @@ + +/* + * MPC8260 Internal Memory Map + * Copyright (c) 1999 Dan Malek (dmalek@jlc.net) + * + * The Internal Memory Map of the 8260. I don't know how generic + * this will be, as I don't have any knowledge of the subsequent + * parts at this time. I copied this from the 8xx_immap.h. + */ +#ifndef __IMMAP_82XX__ +#define __IMMAP_82XX__ + +/* System configuration registers. +*/ +typedef struct sys_conf { + uint sc_siumcr; + uint sc_sypcr; + char res1[6]; + ushort sc_swsr; + char res2[20]; + uint sc_bcr; + u_char sc_ppc_acr; + char res3[3]; + uint sc_ppc_alrh; + uint sc_ppc_alrl; + u_char sc_lcl_acr; + char res4[3]; + uint sc_lcl_alrh; + uint sc_lcl_alrl; + uint sc_tescr1; + uint sc_tescr2; + uint sc_ltescr1; + uint sc_ltescr2; + uint sc_pdtea; + u_char sc_pdtem; + char res5[3]; + uint sc_ldtea; + u_char sc_ldtem; + char res6[163]; +} sysconf8260_t; + + +/* Memory controller registers. +*/ +typedef struct mem_ctlr { + uint memc_br0; + uint memc_or0; + uint memc_br1; + uint memc_or1; + uint memc_br2; + uint memc_or2; + uint memc_br3; + uint memc_or3; + uint memc_br4; + uint memc_or4; + uint memc_br5; + uint memc_or5; + uint memc_br6; + uint memc_or6; + uint memc_br7; + uint memc_or7; + uint memc_br8; + uint memc_or8; + uint memc_br9; + uint memc_or9; + uint memc_br10; + uint memc_or10; + uint memc_br11; + uint memc_or11; + char res1[8]; + uint memc_mar; + char res2[4]; + uint memc_mamr; + uint memc_mbmr; + uint memc_mcmr; + char res3[8]; + ushort memc_mptpr; + char res4[2]; + uint memc_mdr; + char res5[4]; + uint memc_psdmr; + uint memc_lsdmr; + u_char memc_purt; + char res6[3]; + u_char memc_psrt; + char res7[3]; + u_char memc_lurt; + char res8[3]; + u_char memc_lsrt; + char res9[3]; + uint memc_immr; + char res10[84]; +} memctl8260_t; + +/* System Integration Timers. +*/ +typedef struct sys_int_timers { + char res1[32]; + ushort sit_tmcntsc; + char res2[2]; + uint sit_tmcnt; + char res3[4]; + uint sit_tmcntal; + char res4[16]; + ushort sit_piscr; + char res5[2]; + uint sit_pitc; + uint sit_pitr; + char res6[94]; + char res7[2390]; +} sit8260_t; + +#define PISCR_PIRQ_MASK ((ushort)0xff00) +#define PISCR_PS ((ushort)0x0080) +#define PISCR_PIE ((ushort)0x0004) +#define PISCR_PTF ((ushort)0x0002) +#define PISCR_PTE ((ushort)0x0001) + +/* Interrupt Controller. +*/ +typedef struct interrupt_controller { + ushort ic_sicr; + char res1[2]; + uint ic_sivec; + uint ic_sipnrh; + uint ic_sipnrl; + uint ic_siprr; + uint ic_scprrh; + uint ic_scprrl; + uint ic_simrh; + uint ic_simrl; + uint ic_siexr; + char res2[88]; +} intctl8260_t; + +/* Clocks and Reset. +*/ +typedef struct clk_and_reset { + uint car_sccr; + char res1[4]; + uint car_scmr; + char res2[4]; + uint car_rsr; + uint car_rmr; + char res[104]; +} car8260_t; + +/* Input/Output Port control/status registers. + * Names consistent with processor manual, although they are different + * from the original 8xx names....... + */ +typedef struct io_port { + uint iop_pdira; + uint iop_ppara; + uint iop_psora; + uint iop_podra; + uint iop_pdata; + char res1[12]; + uint iop_pdirb; + uint iop_pparb; + uint iop_psorb; + uint iop_podrb; + uint iop_pdatb; + char res2[12]; + uint iop_pdirc; + uint iop_pparc; + uint iop_psorc; + uint iop_podrc; + uint iop_pdatc; + char res3[12]; + uint iop_pdird; + uint iop_ppard; + uint iop_psord; + uint iop_podrd; + uint iop_pdatd; + char res4[12]; +} iop8260_t; + +/* Communication Processor Module Timers +*/ +typedef struct cpm_timers { + u_char cpmt_tgcr1; + char res1[3]; + u_char cpmt_tgcr2; + char res2[11]; + ushort cpmt_tmr1; + ushort cpmt_tmr2; + ushort cpmt_trr1; + ushort cpmt_trr2; + ushort cpmt_tcr1; + ushort cpmt_tcr2; + ushort cpmt_tcn1; + ushort cpmt_tcn2; + ushort cpmt_tmr3; + ushort cpmt_tmr4; + ushort cpmt_trr3; + ushort cpmt_trr4; + ushort cpmt_tcr3; + ushort cpmt_tcr4; + ushort cpmt_tcn3; + ushort cpmt_tcn4; + ushort cpmt_ter1; + ushort cpmt_ter2; + ushort cpmt_ter3; + ushort cpmt_ter4; + char res3[584]; +} cpmtimer8260_t; + +/* DMA control/status registers. +*/ +typedef struct sdma_csr { + char res0[24]; + u_char sdma_sdsr; + char res1[3]; + u_char sdma_sdmr; + char res2[3]; + u_char sdma_idsr1; + char res3[3]; + u_char sdma_idmr1; + char res4[3]; + u_char sdma_idsr2; + char res5[3]; + u_char sdma_idmr2; + char res6[3]; + u_char sdma_idsr3; + char res7[3]; + u_char sdma_idmr3; + char res8[3]; + u_char sdma_idsr4; + char res9[3]; + u_char sdma_idmr4; + char res10[707]; +} sdma8260_t; + +/* Fast controllers +*/ +typedef struct fcc { + uint fcc_gfmr; + uint fcc_fpsmr; + ushort fcc_ftodr; + char res1[2]; + ushort fcc_fdsr; + char res2[2]; + uint fcc_fcce; + uint fcc_fccm; + u_char fcc_fccs; + char res3[3]; + u_char fcc_ftirr_phy[4]; +} fcc_t; + +/* I2C +*/ +typedef struct i2c { + u_char i2c_i2mod; + char res1[3]; + u_char i2c_i2add; + char res2[3]; + u_char i2c_i2brg; + char res3[3]; + u_char i2c_i2com; + char res4[3]; + u_char i2c_i2cer; + char res5[3]; + u_char i2c_i2cmr; + char res6[331]; +} i2c8260_t; + +typedef struct scc { /* Serial communication channels */ + uint scc_gsmrl; + uint scc_gsmrh; + ushort scc_pmsr; + char res1[2]; + ushort scc_todr; + ushort scc_dsr; + ushort scc_scce; + char res2[2]; + ushort scc_sccm; + char res3; + u_char scc_sccs; + char res4[8]; +} scc_t; + +typedef struct smc { /* Serial management channels */ + char res1[2]; + ushort smc_smcmr; + char res2[2]; + u_char smc_smce; + char res3[3]; + u_char smc_smcm; + char res4[5]; +} smc_t; + +/* Serial Peripheral Interface. +*/ +typedef struct spi { + ushort spi_spmode; + char res1[4]; + u_char spi_spie; + char res2[3]; + u_char spi_spim; + char res3[2]; + u_char spi_spcom; + char res4[82]; +} spi_t; + +/* CPM Mux. +*/ +typedef struct cpmux { + u_char cmx_si1cr; + char res1; + u_char cmx_si2cr; + char res2; + uint cmx_fcr; + uint cmx_scr; + u_char cmx_smr; + char res3; + ushort cmx_uar; + char res4[16]; +} cpmux_t; + +/* SIRAM control +*/ +typedef struct siram { + ushort si_amr; + ushort si_bmr; + ushort si_cmr; + ushort si_dmr; + u_char si_gmr; + char res1; + u_char si_cmdr; + char res2; + u_char si_str; + char res3; + ushort si_rsr; +} siramctl_t; + +typedef struct mcc { + ushort mcc_mcce; + char res1[2]; + ushort mcc_mccm; + char res2[2]; + u_char mcc_mccf; + char res3[7]; +} mcc_t; + +typedef struct comm_proc { + uint cp_cpcr; + uint cp_rccr; + char res1[14]; + ushort cp_rter; + char res2[2]; + ushort cp_rtmr; + ushort cp_rtscr; + char res3[2]; + uint cp_rtsr; + char res4[12]; +} cpm8260_t; + +/* ...and the whole thing wrapped up.... +*/ +typedef struct immap { + /* Some references are into the unique and known dpram spaces, + * others are from the generic base. + */ +#define im_dprambase im_dpram1 + u_char im_dpram1[16*1024]; + char res1[16*1024]; + u_char im_dpram2[4*1024]; + char res2[8*1024]; + u_char im_dpram3[4*1024]; + char res3[16*1024]; + + sysconf8260_t im_siu_conf; /* SIU Configuration */ + memctl8260_t im_memctl; /* Memory Controller */ + sit8260_t im_sit; /* System Integration Timers */ + intctl8260_t im_intctl; /* Interrupt Controller */ + car8260_t im_clkrst; /* Clocks and reset */ + iop8260_t im_ioport; /* IO Port control/status */ + cpmtimer8260_t im_cpmtimer; /* CPM timers */ + sdma8260_t im_sdma; /* SDMA control/status */ + + fcc_t im_fcc[3]; /* Three FCCs */ + + char res4[159]; + + /* First set of baud rate generators. + */ + char res4a[496]; + uint im_brgc5; + uint im_brgc6; + uint im_brgc7; + uint im_brgc8; + + char res5[608]; + + i2c8260_t im_i2c; /* I2C control/status */ + cpm8260_t im_cpm; /* Communication processor */ + + /* Second set of baud rate generators. + */ + uint im_brgc1; + uint im_brgc2; + uint im_brgc3; + uint im_brgc4; + + scc_t im_scc[4]; /* Four SCCs */ + smc_t im_smc[2]; /* Couple of SMCs */ + spi_t im_spi; /* A SPI */ + cpmux_t im_cpmux; /* CPM clock route mux */ + siramctl_t im_siramctl1; /* First SI RAM Control */ + mcc_t im_mcc1; /* First MCC */ + siramctl_t im_siramctl2; /* Second SI RAM Control */ + mcc_t im_mcc2; /* Second MCC */ + + char res6[1184]; + + ushort im_si1txram[256]; + char res7[512]; + ushort im_si1rxram[256]; + char res8[512]; + ushort im_si2txram[256]; + char res9[512]; + ushort im_si2rxram[256]; + char res10[512]; + char res11[4096]; +} immap_t; + +/* The 8260 relies heavily on the IMMR, so we keep it around as a + * kernel global symbol now. Should have done this for the 8xx...... + */ +immap_t *immr; + +#endif /* __IMMAP_82XX__ */ diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 7bb3d901d..a4be6b7e2 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h @@ -23,6 +23,8 @@ #include <asm/board.h> #elif defined(CONFIG_8xx) #include <asm/mpc8xx.h> +#elif defined(CONFIG_8260) +#include <asm/mpc8260.h> #else #ifdef CONFIG_APUS #define _IO_BASE 0 @@ -52,12 +54,18 @@ extern unsigned long pci_dram_offset; #define writel(b,addr) out_le32((volatile u32 *)(addr),(b)) #endif +/* + * The insw/outsw/insl/outsl macros don't do byte-swapping. + * They are only used in practice for transferring buffers which + * are arrays of bytes, and byte-swapping is not appropriate in + * that case. - paulus + */ #define insb(port, buf, ns) _insb((u8 *)((port)+_IO_BASE), (buf), (ns)) #define outsb(port, buf, ns) _outsb((u8 *)((port)+_IO_BASE), (buf), (ns)) -#define insw(port, buf, ns) _insw((u16 *)((port)+_IO_BASE), (buf), (ns)) -#define outsw(port, buf, ns) _outsw((u16 *)((port)+_IO_BASE), (buf), (ns)) -#define insl(port, buf, nl) _insl((u32 *)((port)+_IO_BASE), (buf), (nl)) -#define outsl(port, buf, nl) _outsl((u32 *)((port)+_IO_BASE), (buf), (nl)) +#define insw(port, buf, ns) _insw_ns((u16 *)((port)+_IO_BASE), (buf), (ns)) +#define outsw(port, buf, ns) _outsw_ns((u16 *)((port)+_IO_BASE), (buf), (ns)) +#define insl(port, buf, nl) _insl_ns((u32 *)((port)+_IO_BASE), (buf), (nl)) +#define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+_IO_BASE), (buf), (nl)) #define inb(port) in_8((u8 *)((port)+_IO_BASE)) #define outb(val, port) out_8((u8 *)((port)+_IO_BASE), (val)) @@ -86,19 +94,21 @@ extern void _insw(volatile u16 *port, void *buf, int ns); extern void _outsw(volatile u16 *port, const void *buf, int ns); extern void _insl(volatile u32 *port, void *buf, int nl); extern void _outsl(volatile u32 *port, const void *buf, int nl); +extern void _insw_ns(volatile u16 *port, void *buf, int ns); +extern void _outsw_ns(volatile u16 *port, const void *buf, int ns); +extern void _insl_ns(volatile u32 *port, void *buf, int nl); +extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); /* * The *_ns versions below don't do byte-swapping. + * Neither do the standard versions now, these are just here + * for older code. */ #define insw_ns(port, buf, ns) _insw_ns((u16 *)((port)+_IO_BASE), (buf), (ns)) #define outsw_ns(port, buf, ns) _outsw_ns((u16 *)((port)+_IO_BASE), (buf), (ns)) #define insl_ns(port, buf, nl) _insl_ns((u32 *)((port)+_IO_BASE), (buf), (nl)) #define outsl_ns(port, buf, nl) _outsl_ns((u32 *)((port)+_IO_BASE), (buf), (nl)) -extern void _insw_ns(volatile u16 *port, void *buf, int ns); -extern void _outsw_ns(volatile u16 *port, const void *buf, int ns); -extern void _insl_ns(volatile u32 *port, void *buf, int nl); -extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); #define IO_SPACE_LIMIT ~0 diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h index 867dd0bab..0f1972ddf 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-ppc/irq.h @@ -57,21 +57,15 @@ irq_cannonicalize(int irq) * There are eight external interrupts (IRQs) that can be configured * as either level or edge sensitive. * - * The 82xx can have up to 64 interrupts on the internal controller. - * * On some implementations, there is also the possibility of an 8259 * through the PCI and PCI-ISA bridges. */ -#ifdef CONFIG_82xx -#define NR_SIU_INTS 64 -#else #define NR_SIU_INTS 16 -#endif #define NR_IRQS (NR_SIU_INTS + NR_8259_INTS) /* These values must be zero-based and map 1:1 with the SIU configuration. - * They are used throughout the 8xx/82xx I/O subsystem to generate + * They are used throughout the 8xx I/O subsystem to generate * interrupt masks, flags, and other control patterns. This is why the * current kernel assumption of the 8259 as the base controller is such * a pain in the butt. @@ -166,11 +160,37 @@ extern irq_node_t *new_irq_node(void); */ #define NR_IRQS 256 +#ifndef CONFIG_8260 + #define NUM_8259_INTERRUPTS 16 #define IRQ_8259_CASCADE 16 #define openpic_to_irq(n) ((n)+NUM_8259_INTERRUPTS) #define irq_to_openpic(n) ((n)-NUM_8259_INTERRUPTS) +#else /* CONFIG_8260 */ + +/* The 8260 has an internal interrupt controller with a maximum of + * 64 IRQs. We will use NR_IRQs from above since it is large enough. + * Don't be confused by the 8260 documentation where they list an + * "interrupt number" and "interrupt vector". We are only interested + * in the interrupt vector. There are "reserved" holes where the + * vector number increases, but the interrupt number in the table does not. + * (Document errata updates have fixed this...make sure you have up to + * date processor documentation -- Dan). + */ +#define NR_SIU_INTS 64 + +/* There are many more than these, we will add them as we need them. +*/ +#define SIU_INT_SMC1 ((uint)0x04) +#define SIU_INT_SMC2 ((uint)0x05) +#define SIU_INT_SCC1 ((uint)0x28) +#define SIU_INT_SCC2 ((uint)0x29) +#define SIU_INT_SCC3 ((uint)0x2a) +#define SIU_INT_SCC4 ((uint)0x2b) + +#endif /* CONFIG_8260 */ + /* * This gets called from serial.c, which is now used on * powermacs as well as prep/chrp boxes. diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h new file mode 100644 index 000000000..10d586cad --- /dev/null +++ b/include/asm-ppc/mpc8260.h @@ -0,0 +1,42 @@ + +/* This is the single file included by all MPC8260 build options. + * Since there are many different boards and no standard configuration, + * we have a unique include file for each. Rather than change every + * file that has to include MPC8260 configuration, they all include + * this one and the configuration switching is done here. + */ +#ifndef __CONFIG_8260_DEFS +#define __CONFIG_8260_DEFS + +#include <linux/config.h> + +#ifdef CONFIG_8260 + +#ifdef CONFIG_EST8260 +#include <asm/est8260.h> +#endif + +/* I don't yet have the ISA or PCI stuff done....no 8260 with + * such thing..... + */ +#define _IO_BASE 0 +#define _ISA_MEM_BASE 0 +#define PCI_DRAM_OFFSET 0 + +/* The "residual" data board information structure the boot loader + * hands to us. + */ +extern unsigned char __res[]; + +/* I need this to get pt_regs....... +*/ +#include <asm/ptrace.h> + +extern int request_8xxirq(unsigned int irq, + void (*handler)(int, void *, struct pt_regs *), + unsigned long flags, + const char *device, + void *dev_id); + +#endif /* CONFIG_8260 */ +#endif diff --git a/include/asm-ppc/nvram.h b/include/asm-ppc/nvram.h index ea7bf1914..985d2a321 100644 --- a/include/asm-ppc/nvram.h +++ b/include/asm-ppc/nvram.h @@ -30,4 +30,30 @@ #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) #endif +/* PowerMac specific nvram stuffs */ + +enum { + pmac_nvram_OF, /* Open Firmware partition */ + pmac_nvram_XPRAM, /* MacOS XPRAM partition */ + pmac_nvram_NR /* MacOS Name Registry partition */ +}; + +/* Return partition offset in nvram */ +extern int pmac_get_partition(int partition); + +/* Direct access to XPRAM */ +extern u8 pmac_xpram_read(int xpaddr); +extern void pmac_xpram_write(int xpaddr, u8 data); + +/* Some offsets in XPRAM */ +#define PMAC_XPRAM_MACHINE_LOC 0xe4 +#define PMAC_XPRAM_SOUND_VOLUME 0x08 + +/* Machine location structure in XPRAM */ +struct pmac_machine_location { + u32 latitude; /* 2+30 bit Fractional number */ + u32 longitude; /* 2+30 bit Fractional number */ + u32 delta; /* mix of GMT delta and DLS */ +}; + #endif diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 9218c665b..5c4e39902 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -65,12 +65,11 @@ extern inline void flush_tlb_pgtables(struct mm_struct *mm, #define flush_cache_mm(mm) do { } while (0) #define flush_cache_range(mm, a, b) do { } while (0) #define flush_cache_page(vma, p) do { } while (0) +#define flush_icache_page(vma, page) do { } while (0) extern void flush_icache_range(unsigned long, unsigned long); extern void __flush_page_to_ram(unsigned long page_va); #define flush_page_to_ram(page) __flush_page_to_ram(page_address(page)) -extern void __flush_icache_page(unsigned long page_va); -#define flush_icache_page(vma, page) __flush_icache_page(page_address(page)) extern unsigned long va_to_phys(unsigned long address); extern pte_t *va_to_pte(struct task_struct *tsk, unsigned long address); @@ -197,22 +196,18 @@ extern unsigned long ioremap_bot, ioremap_base; #define _PAGE_NO_CACHE 0x0002 /* I: cache inhibit */ #define _PAGE_SHARED 0x0004 /* No ASID (context) compare */ -/* These four software bits must be masked out when the entry is loaded +/* These five software bits must be masked out when the entry is loaded * into the TLB. */ +#define _PAGE_DIRTY 0x0008 /* software: page changed */ #define _PAGE_GUARDED 0x0010 /* software: guarded access */ #define _PAGE_WRITETHRU 0x0020 /* software: use writethrough cache */ #define _PAGE_RW 0x0040 /* software: user write access allowed */ #define _PAGE_ACCESSED 0x0080 /* software: page referenced */ -#define _PAGE_DIRTY 0x0100 /* C: page changed (write protect) */ +#define _PAGE_HWWRITE 0x0100 /* C: page changed (write protect) */ #define _PAGE_USER 0x0800 /* One of the PP bits, the other must be 0 */ -/* This is used to enable or disable the actual hardware write - * protection. - */ -#define _PAGE_HWWRITE _PAGE_DIRTY - #else /* CONFIG_6xx */ /* Definitions for 60x, 740/750, etc. */ #define _PAGE_PRESENT 0x001 /* software: pte contains a translation */ @@ -432,6 +427,7 @@ extern inline pte_t * pte_offset(pmd_t * dir, unsigned long address) } extern pgd_t swapper_pg_dir[1024]; +extern void paging_init(void); /* * Page tables may have changed. We don't need to do anything here diff --git a/include/asm-ppc/posix_types.h b/include/asm-ppc/posix_types.h index 04c59a5b3..47539d3a7 100644 --- a/include/asm-ppc/posix_types.h +++ b/include/asm-ppc/posix_types.h @@ -1,6 +1,8 @@ #ifndef _PPC_POSIX_TYPES_H #define _PPC_POSIX_TYPES_H +#include <linux/config.h> /* for CONFIG_PPC64 */ + /* * This file is generally used by user-level software, so you need to * be a little careful about namespace pollution etc. Also, we cannot @@ -15,8 +17,17 @@ typedef long __kernel_off_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid_t; typedef unsigned int __kernel_gid_t; + +/* Grrr... gcc thinks size_t is unsigned int, so we either + have to have this nonsense or use -fno-builtin. - paulus */ +#ifdef CONFIG_PPC64 typedef unsigned long __kernel_size_t; typedef long __kernel_ssize_t; +#else +typedef unsigned int __kernel_size_t; +typedef int __kernel_ssize_t; +#endif /* CONFIG_PPC64 */ + typedef long __kernel_ptrdiff_t; typedef long __kernel_time_t; typedef long __kernel_suseconds_t; diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index 5212c5b71..3088dd279 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -483,6 +483,14 @@ #define PVR_8260 PVR_8240 +/* I am just adding a single entry for 8260 boards. I think we may be + * able to combine mbx, fads, rpxlite, bseip, and classic into a single + * generic 8xx as well. The boards containing these processors are either + * identical at the processor level (due to the high integration) or so + * wildly different that testing _machine at run time is best replaced by + * conditional compilation by board type (found in their respective .h file). + * -- Dan + */ #define _MACH_prep 0x00000001 #define _MACH_Pmac 0x00000002 /* pmac or pmac clone (non-chrp) */ #define _MACH_chrp 0x00000004 /* chrp machine */ @@ -496,6 +504,7 @@ #define _MACH_classic 0x00000400 /* RPCG RPX-Classic 8xx board */ #define _MACH_oak 0x00000800 /* IBM "Oak" 403 eval. board */ #define _MACH_walnut 0x00001000 /* IBM "Walnut" 405GP eval. board */ +#define _MACH_8260 0x00002000 /* Generic 8260 */ /* see residual.h for these */ @@ -707,6 +716,9 @@ void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); #elif defined(CONFIG_GEMINI) #define _machine _MACH_gemini #define have_of 0 +#elif defined(CONFIG_8260) +#define _machine _MACH_8260 +#define have_of 0 #else #error "Machine not defined correctly" #endif diff --git a/include/asm-ppc/resource.h b/include/asm-ppc/resource.h index c27aa8591..d31976a3d 100644 --- a/include/asm-ppc/resource.h +++ b/include/asm-ppc/resource.h @@ -14,6 +14,8 @@ #define RLIM_NLIMITS 10 +#ifdef __KERNEL__ + /* * SuS says limits have to be unsigned. * Which makes a ton more sense anyway. @@ -21,8 +23,6 @@ #define RLIM_INFINITY (~0UL) -#ifdef __KERNEL__ - #define INIT_RLIMITS \ { \ { RLIM_INFINITY, RLIM_INFINITY }, \ diff --git a/include/asm-ppc/rpxclassic.h b/include/asm-ppc/rpxclassic.h index fd733b38e..74be56085 100644 --- a/include/asm-ppc/rpxclassic.h +++ b/include/asm-ppc/rpxclassic.h @@ -62,6 +62,6 @@ extern bd_t m8xx_board_info; /* Machine type */ -#define _MACH_8xx (_MACH_rpxclassic) +#define _MACH_8xx (_MACH_classic) #endif diff --git a/include/asm-ppc/semaphore.h b/include/asm-ppc/semaphore.h index 461ac0360..92063a868 100644 --- a/include/asm-ppc/semaphore.h +++ b/include/asm-ppc/semaphore.h @@ -12,6 +12,7 @@ #ifdef __KERNEL__ #include <asm/atomic.h> +#include <asm/system.h> #include <linux/wait.h> struct semaphore { diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index 162a09a1d..fa9bc9944 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -8,6 +8,7 @@ #include <linux/config.h> #include <linux/kdev_t.h> +#include <linux/bitops.h> #include <asm/processor.h> #include <asm/atomic.h> diff --git a/include/asm-ppc/termbits.h b/include/asm-ppc/termbits.h index 11b4c513a..324b62600 100644 --- a/include/asm-ppc/termbits.h +++ b/include/asm-ppc/termbits.h @@ -57,12 +57,9 @@ struct termios { #define ICRNL 0000400 #define IXON 0001000 #define IXOFF 0002000 -#if defined(__KERNEL__) || defined(__USE_BSD) - /* POSIX.1 doesn't want these... */ -# define IXANY 0004000 -# define IUCLC 0010000 -# define IMAXBEL 0020000 -#endif +#define IXANY 0004000 +#define IUCLC 0010000 +#define IMAXBEL 0020000 /* c_oflag bits */ #define OPOST 0000001 diff --git a/include/asm-sparc/asm_offsets.h b/include/asm-sparc/asm_offsets.h index 66ebe6e4c..e46a4c1ce 100644 --- a/include/asm-sparc/asm_offsets.h +++ b/include/asm-sparc/asm_offsets.h @@ -184,8 +184,8 @@ #define ASIZ_task_parent_exec_id 0x00000004 #define AOFF_task_self_exec_id 0x000005fc #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x00000600 -#define ASIZ_task_exit_sem 0x00000020 +#define AOFF_task_alloc_lock 0x00000600 +#define ASIZ_task_alloc_lock 0x00000004 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000004 #define AOFF_mm_mmap_avl 0x00000004 @@ -228,25 +228,21 @@ #define ASIZ_mm_env_start 0x00000004 #define AOFF_mm_env_end 0x0000006c #define ASIZ_mm_env_end 0x00000004 -#define AOFF_mm_min_flt 0x00000070 -#define ASIZ_mm_min_flt 0x00000004 -#define AOFF_mm_maj_flt 0x00000074 -#define ASIZ_mm_maj_flt 0x00000004 -#define AOFF_mm_rss 0x00000078 +#define AOFF_mm_rss 0x00000070 #define ASIZ_mm_rss 0x00000004 -#define AOFF_mm_total_vm 0x0000007c +#define AOFF_mm_total_vm 0x00000074 #define ASIZ_mm_total_vm 0x00000004 -#define AOFF_mm_locked_vm 0x00000080 +#define AOFF_mm_locked_vm 0x00000078 #define ASIZ_mm_locked_vm 0x00000004 -#define AOFF_mm_def_flags 0x00000084 +#define AOFF_mm_def_flags 0x0000007c #define ASIZ_mm_def_flags 0x00000004 -#define AOFF_mm_cpu_vm_mask 0x00000088 +#define AOFF_mm_cpu_vm_mask 0x00000080 #define ASIZ_mm_cpu_vm_mask 0x00000004 -#define AOFF_mm_swap_cnt 0x0000008c +#define AOFF_mm_swap_cnt 0x00000084 #define ASIZ_mm_swap_cnt 0x00000004 -#define AOFF_mm_swap_address 0x00000090 +#define AOFF_mm_swap_address 0x00000088 #define ASIZ_mm_swap_address 0x00000004 -#define AOFF_mm_segments 0x00000094 +#define AOFF_mm_segments 0x0000008c #define ASIZ_mm_segments 0x00000004 #define AOFF_thread_uwinmask 0x00000000 #define ASIZ_thread_uwinmask 0x00000004 @@ -469,8 +465,8 @@ #define ASIZ_task_parent_exec_id 0x00000004 #define AOFF_task_self_exec_id 0x00000700 #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x00000704 -#define ASIZ_task_exit_sem 0x00000024 +#define AOFF_task_alloc_lock 0x00000704 +#define ASIZ_task_alloc_lock 0x00000008 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000004 #define AOFF_mm_mmap_avl 0x00000004 @@ -513,25 +509,21 @@ #define ASIZ_mm_env_start 0x00000004 #define AOFF_mm_env_end 0x00000074 #define ASIZ_mm_env_end 0x00000004 -#define AOFF_mm_min_flt 0x00000078 -#define ASIZ_mm_min_flt 0x00000004 -#define AOFF_mm_maj_flt 0x0000007c -#define ASIZ_mm_maj_flt 0x00000004 -#define AOFF_mm_rss 0x00000080 +#define AOFF_mm_rss 0x00000078 #define ASIZ_mm_rss 0x00000004 -#define AOFF_mm_total_vm 0x00000084 +#define AOFF_mm_total_vm 0x0000007c #define ASIZ_mm_total_vm 0x00000004 -#define AOFF_mm_locked_vm 0x00000088 +#define AOFF_mm_locked_vm 0x00000080 #define ASIZ_mm_locked_vm 0x00000004 -#define AOFF_mm_def_flags 0x0000008c +#define AOFF_mm_def_flags 0x00000084 #define ASIZ_mm_def_flags 0x00000004 -#define AOFF_mm_cpu_vm_mask 0x00000090 +#define AOFF_mm_cpu_vm_mask 0x00000088 #define ASIZ_mm_cpu_vm_mask 0x00000004 -#define AOFF_mm_swap_cnt 0x00000094 +#define AOFF_mm_swap_cnt 0x0000008c #define ASIZ_mm_swap_cnt 0x00000004 -#define AOFF_mm_swap_address 0x00000098 +#define AOFF_mm_swap_address 0x00000090 #define ASIZ_mm_swap_address 0x00000004 -#define AOFF_mm_segments 0x0000009c +#define AOFF_mm_segments 0x00000094 #define ASIZ_mm_segments 0x00000004 #define AOFF_thread_uwinmask 0x00000000 #define ASIZ_thread_uwinmask 0x00000004 diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h index 5b96e139b..dc29a13cd 100644 --- a/include/asm-sparc/atomic.h +++ b/include/asm-sparc/atomic.h @@ -6,7 +6,9 @@ #ifndef __ARCH_SPARC_ATOMIC__ #define __ARCH_SPARC_ATOMIC__ -#ifdef __SMP__ +#include <linux/config.h> + +#ifdef CONFIG_SMP /* This is a temporary measure. -DaveM */ typedef struct { volatile int counter; } atomic_t; #define ATOMIC_INIT(i) { (i << 8) } @@ -19,7 +21,7 @@ typedef struct { int counter; } atomic_t; #include <asm/system.h> #include <asm/psr.h> -#ifndef __SMP__ +#ifndef CONFIG_SMP #define atomic_read(v) ((v)->counter) #define atomic_set(v, i) (((v)->counter) = i) diff --git a/include/asm-sparc/atops.h b/include/asm-sparc/atops.h index 0bb70752d..30bdf0fb7 100644 --- a/include/asm-sparc/atops.h +++ b/include/asm-sparc/atops.h @@ -5,7 +5,9 @@ #ifndef _SPARC_ATOPS_H #define _SPARC_ATOPS_H -#ifdef __SMP__ +#include <linux/config.h> + +#ifdef CONFIG_SMP extern __inline__ __volatile__ unsigned char ldstub(volatile unsigned char *lock) { diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h index 1139f58f7..09a08baa2 100644 --- a/include/asm-sparc/bitops.h +++ b/include/asm-sparc/bitops.h @@ -8,6 +8,7 @@ #ifndef _SPARC_BITOPS_H #define _SPARC_BITOPS_H +#include <linux/config.h> #include <linux/kernel.h> #include <asm/byteorder.h> @@ -82,7 +83,7 @@ extern __inline__ void change_bit(unsigned long nr, void *addr) #include <asm/system.h> -#ifdef __SMP__ +#ifdef CONFIG_SMP #define __SMPVOL volatile #else #define __SMPVOL diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h index bbe134c28..c34312aa4 100644 --- a/include/asm-sparc/hardirq.h +++ b/include/asm-sparc/hardirq.h @@ -7,9 +7,10 @@ #ifndef __SPARC_HARDIRQ_H #define __SPARC_HARDIRQ_H +#include <linux/config.h> #include <linux/threads.h> -#ifndef __SMP__ +#ifndef CONFIG_SMP extern unsigned int local_irq_count; /* @@ -81,6 +82,6 @@ static inline int hardirq_trylock(int cpu) extern void synchronize_irq(void); -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ #endif /* __SPARC_HARDIRQ_H */ diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h index b7ea70091..1f40557b4 100644 --- a/include/asm-sparc/irq.h +++ b/include/asm-sparc/irq.h @@ -7,6 +7,7 @@ #ifndef _SPARC_IRQ_H #define _SPARC_IRQ_H +#include <linux/config.h> #include <linux/linkage.h> #include <linux/threads.h> /* For NR_CPUS */ @@ -21,7 +22,7 @@ BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int) #define NR_IRQS 15 /* IRQ handler dispatch entry and exit. */ -#ifdef __SMP__ +#ifdef CONFIG_SMP extern unsigned int local_irq_count[NR_CPUS]; #define irq_enter(cpu, irq) \ do { hardirq_enter(cpu); \ @@ -63,7 +64,7 @@ extern void claim_ticker14(void (*irq_handler)(int, void *, struct pt_regs *), int irq, unsigned int timeout); -#ifdef __SMP__ +#ifdef CONFIG_SMP BTFIXUPDEF_CALL(void, set_cpu_int, int, int) BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) BTFIXUPDEF_CALL(void, set_irq_udt, int) diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h index fc323280b..7a2b81beb 100644 --- a/include/asm-sparc/pgalloc.h +++ b/include/asm-sparc/pgalloc.h @@ -2,6 +2,7 @@ #ifndef _SPARC_PGALLOC_H #define _SPARC_PGALLOC_H +#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -9,7 +10,7 @@ #include <asm/btfixup.h> /* Fine grained cache/tlb flushing. */ -#ifdef __SMP__ +#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) diff --git a/include/asm-sparc/semaphore-helper.h b/include/asm-sparc/semaphore-helper.h index e3b5a8f88..a4dd421be 100644 --- a/include/asm-sparc/semaphore-helper.h +++ b/include/asm-sparc/semaphore-helper.h @@ -1,6 +1,8 @@ #ifndef _SPARC_SEMAPHORE_HELPER_H #define _SPARC_SEMAPHORE_HELPER_H +#include <linux/config.h> + /* * (barely) SMP- and interrupt-safe semaphore helper functions, sparc version. * @@ -12,7 +14,7 @@ static __inline__ int waking_non_zero(struct semaphore *sem) { int ret; -#ifdef __SMP__ +#ifdef CONFIG_SMP int tmp; __asm__ __volatile__(" @@ -62,7 +64,7 @@ static __inline__ int waking_non_zero_interruptible(struct semaphore *sem, { int ret; -#ifdef __SMP__ +#ifdef CONFIG_SMP int tmp; __asm__ __volatile__(" @@ -115,7 +117,7 @@ static __inline__ int waking_non_zero_trylock(struct semaphore *sem) { int ret; -#ifdef __SMP__ +#ifdef CONFIG_SMP int tmp; __asm__ __volatile__(" diff --git a/include/asm-sparc/sfp-machine.h b/include/asm-sparc/sfp-machine.h index c3f12332d..f5372637f 100644 --- a/include/asm-sparc/sfp-machine.h +++ b/include/asm-sparc/sfp-machine.h @@ -24,6 +24,8 @@ #ifndef _SFP_MACHINE_H #define _SFP_MACHINE_H + +#include <linux/config.h> #define _FP_W_TYPE_SIZE 32 #define _FP_W_TYPE unsigned long @@ -174,13 +176,13 @@ "3" ((USItype)(x0)) \ : "cc") -#ifndef __SMP__ +#ifndef CONFIG_SMP extern struct task_struct *last_task_used_math; #endif /* Obtain the current rounding mode. */ #ifndef FP_ROUNDMODE -#ifdef __SMP__ +#ifdef CONFIG_SMP #define FP_ROUNDMODE ((current->thread.fsr >> 30) & 0x3) #else #define FP_ROUNDMODE ((last_task_used_math->thread.fsr >> 30) & 0x3) @@ -196,7 +198,7 @@ extern struct task_struct *last_task_used_math; #define FP_HANDLE_EXCEPTIONS return _fex -#ifdef __SMP__ +#ifdef CONFIG_SMP #define FP_INHIBIT_RESULTS ((current->thread.fsr >> 23) & _fex) #else #define FP_INHIBIT_RESULTS ((last_task_used_math->thread.fsr >> 23) & _fex) diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index ca4604fe7..5f7040345 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h @@ -6,6 +6,7 @@ #ifndef _SPARC_SMP_H #define _SPARC_SMP_H +#include <linux/config.h> #include <linux/threads.h> #include <asm/head.h> #include <asm/btfixup.h> @@ -23,7 +24,7 @@ extern int linux_num_cpus; /* number of CPUs probed */ #endif /* !(__ASSEMBLY__) */ -#ifdef __SMP__ +#ifdef CONFIG_SMP #ifndef __ASSEMBLY__ @@ -183,7 +184,7 @@ extern __inline__ void smp_send_stop(void) { } #define PROC_CHANGE_PENALTY 15 -#endif /* !(__SMP__) */ +#endif /* !(CONFIG_SMP) */ #define NO_PROC_ID 0xFF diff --git a/include/asm-sparc/softirq.h b/include/asm-sparc/softirq.h index d61b56554..ec3e43f59 100644 --- a/include/asm-sparc/softirq.h +++ b/include/asm-sparc/softirq.h @@ -7,6 +7,7 @@ #ifndef __SPARC_SOFTIRQ_H #define __SPARC_SOFTIRQ_H +#include <linux/config.h> #include <linux/threads.h> /* For NR_CPUS */ #include <asm/atomic.h> @@ -14,7 +15,7 @@ #include <asm/hardirq.h> -#ifdef __SMP__ +#ifdef CONFIG_SMP extern unsigned int local_bh_count[NR_CPUS]; #define local_bh_disable() (local_bh_count[smp_processor_id()]++) diff --git a/include/asm-sparc/string.h b/include/asm-sparc/string.h index 7f8d06587..7bce820e8 100644 --- a/include/asm-sparc/string.h +++ b/include/asm-sparc/string.h @@ -1,4 +1,4 @@ -/* $Id: string.h,v 1.34 1998/01/30 10:59:55 jj Exp $ +/* $Id: string.h,v 1.35 2000/05/02 01:47:01 davem Exp $ * string.h: External definitions for optimized assembly string * routines for the Linux Kernel. * @@ -34,7 +34,7 @@ extern __kernel_size_t __memset(void *,int,__kernel_size_t); #define __HAVE_ARCH_MEMCPY -extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n) +static inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n) { extern void __copy_1page(void *, const void *); @@ -53,7 +53,7 @@ extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_ return to; } -extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_size_t n) +static inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_size_t n) { __memcpy(to, from, n); return to; @@ -67,7 +67,7 @@ extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_si #define __HAVE_ARCH_MEMSET -extern inline void *__constant_c_and_count_memset(void *s, char c, __kernel_size_t count) +static inline void *__constant_c_and_count_memset(void *s, char c, __kernel_size_t count) { extern void bzero_1page(void *); extern __kernel_size_t __bzero(void *, __kernel_size_t); @@ -83,7 +83,7 @@ extern inline void *__constant_c_and_count_memset(void *s, char c, __kernel_size return s; } -extern inline void *__constant_c_memset(void *s, char c, __kernel_size_t count) +static inline void *__constant_c_memset(void *s, char c, __kernel_size_t count) { extern __kernel_size_t __bzero(void *, __kernel_size_t); @@ -94,7 +94,7 @@ extern inline void *__constant_c_memset(void *s, char c, __kernel_size_t count) return s; } -extern inline void *__nonconstant_memset(void *s, char c, __kernel_size_t count) +static inline void *__nonconstant_memset(void *s, char c, __kernel_size_t count) { __memset(s, c, count); return s; @@ -134,7 +134,7 @@ extern inline void *__nonconstant_memset(void *s, char c, __kernel_size_t count) extern int __strncmp(const char *, const char *, __kernel_size_t); -extern inline int __constant_strncmp(const char *src, const char *dest, __kernel_size_t count) +static inline int __constant_strncmp(const char *src, const char *dest, __kernel_size_t count) { register int retval; switch(count) { diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h index 112145b0b..00e33e3bf 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h @@ -66,7 +66,7 @@ extern void synchronize_user_stack(void); extern void fpsave(unsigned long *fpregs, unsigned long *fsr, void *fpqueue, unsigned long *fpqdepth); -#ifdef __SMP__ +#ifdef CONFIG_SMP #define SWITCH_ENTER \ if(prev->flags & PF_USEDFPU) { \ put_psr(get_psr() | PSR_EF); \ @@ -249,7 +249,7 @@ extern __inline__ unsigned long read_psr_and_cli(void) #define local_irq_save(flags) __save_and_cli(flags) #define local_irq_restore(flags) __restore_flags(flags) -#ifdef __SMP__ +#ifdef CONFIG_SMP extern unsigned char global_irq_holder; @@ -285,13 +285,13 @@ extern void __global_restore_flags(unsigned long flags); #define nop() __asm__ __volatile__ ("nop"); /* This has special calling conventions */ -#ifndef __SMP__ +#ifndef CONFIG_SMP BTFIXUPDEF_CALL(void, ___xchg32, void) #endif extern __inline__ unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val) { -#ifdef __SMP__ +#ifdef CONFIG_SMP __asm__ __volatile__("swap [%2], %0" : "=&r" (val) : "0" (val), "r" (m)); diff --git a/include/asm-sparc/winmacro.h b/include/asm-sparc/winmacro.h index 90f70cbc8..e76082257 100644 --- a/include/asm-sparc/winmacro.h +++ b/include/asm-sparc/winmacro.h @@ -7,6 +7,7 @@ #ifndef _SPARC_WINMACRO_H #define _SPARC_WINMACRO_H +#include <linux/config.h> #include <asm/ptrace.h> #include <asm/psr.h> @@ -111,7 +112,7 @@ add %scratch, 1, %scratch; \ st %scratch, [%cur_reg + AOFF_task_thread + AOFF_thread_w_saved]; -#ifdef __SMP__ +#ifdef CONFIG_SMP #define LOAD_CURRENT4M(dest_reg, idreg) \ rd %tbr, %idreg; \ sethi %hi(C_LABEL(current_set)), %dest_reg; \ diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h index f04220ee6..4507a6716 100644 --- a/include/asm-sparc64/asm_offsets.h +++ b/include/asm-sparc64/asm_offsets.h @@ -190,9 +190,9 @@ #define ASIZ_task_parent_exec_id 0x00000004 #define AOFF_task_self_exec_id 0x00000834 #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x00000838 -#define ASIZ_task_exit_sem 0x00000038 -#define ASIZ_task 0x00000870 +#define AOFF_task_alloc_lock 0x00000838 +#define ASIZ_task_alloc_lock 0x00000004 +#define ASIZ_task 0x00000840 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 #define AOFF_mm_mmap_avl 0x00000008 @@ -235,27 +235,23 @@ #define ASIZ_mm_env_start 0x00000008 #define AOFF_mm_env_end 0x000000c8 #define ASIZ_mm_env_end 0x00000008 -#define AOFF_mm_min_flt 0x000000d0 -#define ASIZ_mm_min_flt 0x00000008 -#define AOFF_mm_maj_flt 0x000000d8 -#define ASIZ_mm_maj_flt 0x00000008 -#define AOFF_mm_rss 0x000000e0 +#define AOFF_mm_rss 0x000000d0 #define ASIZ_mm_rss 0x00000008 -#define AOFF_mm_total_vm 0x000000e8 +#define AOFF_mm_total_vm 0x000000d8 #define ASIZ_mm_total_vm 0x00000008 -#define AOFF_mm_locked_vm 0x000000f0 +#define AOFF_mm_locked_vm 0x000000e0 #define ASIZ_mm_locked_vm 0x00000008 -#define AOFF_mm_def_flags 0x000000f8 +#define AOFF_mm_def_flags 0x000000e8 #define ASIZ_mm_def_flags 0x00000008 -#define AOFF_mm_cpu_vm_mask 0x00000100 +#define AOFF_mm_cpu_vm_mask 0x000000f0 #define ASIZ_mm_cpu_vm_mask 0x00000008 -#define AOFF_mm_swap_cnt 0x00000108 +#define AOFF_mm_swap_cnt 0x000000f8 #define ASIZ_mm_swap_cnt 0x00000008 -#define AOFF_mm_swap_address 0x00000110 +#define AOFF_mm_swap_address 0x00000100 #define ASIZ_mm_swap_address 0x00000008 -#define AOFF_mm_segments 0x00000118 +#define AOFF_mm_segments 0x00000108 #define ASIZ_mm_segments 0x00000008 -#define ASIZ_mm 0x00000120 +#define ASIZ_mm 0x00000110 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 #define AOFF_thread_wstate 0x00000008 @@ -488,9 +484,9 @@ #define ASIZ_task_parent_exec_id 0x00000004 #define AOFF_task_self_exec_id 0x00000a24 #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x00000a28 -#define ASIZ_task_exit_sem 0x00000038 -#define ASIZ_task 0x00000a60 +#define AOFF_task_alloc_lock 0x00000a28 +#define ASIZ_task_alloc_lock 0x00000001 +#define ASIZ_task 0x00000a30 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 #define AOFF_mm_mmap_avl 0x00000008 @@ -533,27 +529,23 @@ #define ASIZ_mm_env_start 0x00000008 #define AOFF_mm_env_end 0x000000c8 #define ASIZ_mm_env_end 0x00000008 -#define AOFF_mm_min_flt 0x000000d0 -#define ASIZ_mm_min_flt 0x00000008 -#define AOFF_mm_maj_flt 0x000000d8 -#define ASIZ_mm_maj_flt 0x00000008 -#define AOFF_mm_rss 0x000000e0 +#define AOFF_mm_rss 0x000000d0 #define ASIZ_mm_rss 0x00000008 -#define AOFF_mm_total_vm 0x000000e8 +#define AOFF_mm_total_vm 0x000000d8 #define ASIZ_mm_total_vm 0x00000008 -#define AOFF_mm_locked_vm 0x000000f0 +#define AOFF_mm_locked_vm 0x000000e0 #define ASIZ_mm_locked_vm 0x00000008 -#define AOFF_mm_def_flags 0x000000f8 +#define AOFF_mm_def_flags 0x000000e8 #define ASIZ_mm_def_flags 0x00000008 -#define AOFF_mm_cpu_vm_mask 0x00000100 +#define AOFF_mm_cpu_vm_mask 0x000000f0 #define ASIZ_mm_cpu_vm_mask 0x00000008 -#define AOFF_mm_swap_cnt 0x00000108 +#define AOFF_mm_swap_cnt 0x000000f8 #define ASIZ_mm_swap_cnt 0x00000008 -#define AOFF_mm_swap_address 0x00000110 +#define AOFF_mm_swap_address 0x00000100 #define ASIZ_mm_swap_address 0x00000008 -#define AOFF_mm_segments 0x00000118 +#define AOFF_mm_segments 0x00000108 #define ASIZ_mm_segments 0x00000008 -#define ASIZ_mm 0x00000120 +#define ASIZ_mm 0x00000110 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 #define AOFF_thread_wstate 0x00000008 @@ -784,9 +776,9 @@ #define ASIZ_task_parent_exec_id 0x00000004 #define AOFF_task_self_exec_id 0x00000a3c #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x00000a40 -#define ASIZ_task_exit_sem 0x00000040 -#define ASIZ_task 0x00000a80 +#define AOFF_task_alloc_lock 0x00000a40 +#define ASIZ_task_alloc_lock 0x0000000c +#define ASIZ_task 0x00000a50 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 #define AOFF_mm_mmap_avl 0x00000008 @@ -829,27 +821,23 @@ #define ASIZ_mm_env_start 0x00000008 #define AOFF_mm_env_end 0x000000d8 #define ASIZ_mm_env_end 0x00000008 -#define AOFF_mm_min_flt 0x000000e0 -#define ASIZ_mm_min_flt 0x00000008 -#define AOFF_mm_maj_flt 0x000000e8 -#define ASIZ_mm_maj_flt 0x00000008 -#define AOFF_mm_rss 0x000000f0 +#define AOFF_mm_rss 0x000000e0 #define ASIZ_mm_rss 0x00000008 -#define AOFF_mm_total_vm 0x000000f8 +#define AOFF_mm_total_vm 0x000000e8 #define ASIZ_mm_total_vm 0x00000008 -#define AOFF_mm_locked_vm 0x00000100 +#define AOFF_mm_locked_vm 0x000000f0 #define ASIZ_mm_locked_vm 0x00000008 -#define AOFF_mm_def_flags 0x00000108 +#define AOFF_mm_def_flags 0x000000f8 #define ASIZ_mm_def_flags 0x00000008 -#define AOFF_mm_cpu_vm_mask 0x00000110 +#define AOFF_mm_cpu_vm_mask 0x00000100 #define ASIZ_mm_cpu_vm_mask 0x00000008 -#define AOFF_mm_swap_cnt 0x00000118 +#define AOFF_mm_swap_cnt 0x00000108 #define ASIZ_mm_swap_cnt 0x00000008 -#define AOFF_mm_swap_address 0x00000120 +#define AOFF_mm_swap_address 0x00000110 #define ASIZ_mm_swap_address 0x00000008 -#define AOFF_mm_segments 0x00000128 +#define AOFF_mm_segments 0x00000118 #define ASIZ_mm_segments 0x00000008 -#define ASIZ_mm 0x00000130 +#define ASIZ_mm 0x00000120 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 #define AOFF_thread_wstate 0x00000008 diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h index 6d93fde96..4a9bfdb1c 100644 --- a/include/asm-sparc64/delay.h +++ b/include/asm-sparc64/delay.h @@ -7,7 +7,8 @@ #ifndef __SPARC64_DELAY_H #define __SPARC64_DELAY_H -#ifdef __SMP__ +#include <linux/config.h> +#ifdef CONFIG_SMP #include <linux/sched.h> #include <asm/smp.h> #endif @@ -39,7 +40,7 @@ extern __inline__ void __udelay(unsigned long usecs, unsigned long lps) __delay(usecs); } -#ifdef __SMP__ +#ifdef CONFIG_SMP #define __udelay_val cpu_data[smp_processor_id()].udelay_val #else #define __udelay_val loops_per_sec diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h index fac8894e1..92b419aff 100644 --- a/include/asm-sparc64/hardirq.h +++ b/include/asm-sparc64/hardirq.h @@ -6,11 +6,12 @@ #ifndef __SPARC64_HARDIRQ_H #define __SPARC64_HARDIRQ_H +#include <linux/config.h> #include <linux/threads.h> #include <linux/brlock.h> #include <linux/spinlock.h> -#ifndef __SMP__ +#ifndef CONFIG_SMP extern unsigned int local_irq_count; #define irq_enter(cpu, irq) (local_irq_count++) #define irq_exit(cpu, irq) (local_irq_count--) @@ -29,7 +30,7 @@ extern unsigned int local_irq_count; /* This tests only the local processors hw IRQ context disposition. */ #define in_irq() (local_irq_count != 0) -#ifndef __SMP__ +#ifndef CONFIG_SMP #define hardirq_trylock(cpu) ((void)(cpu), local_irq_count == 0) #define hardirq_endlock(cpu) do { (void)(cpu); } while(0) @@ -39,7 +40,7 @@ extern unsigned int local_irq_count; #define synchronize_irq() barrier() -#else /* (__SMP__) */ +#else /* (CONFIG_SMP) */ static __inline__ int irqs_running(void) { @@ -74,6 +75,6 @@ static inline int hardirq_trylock(int cpu) extern void synchronize_irq(void); -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ #endif /* !(__SPARC64_HARDIRQ_H) */ diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h index 53124b0ea..cff5236ed 100644 --- a/include/asm-sparc64/irq.h +++ b/include/asm-sparc64/irq.h @@ -8,6 +8,7 @@ #ifndef _SPARC64_IRQ_H #define _SPARC64_IRQ_H +#include <linux/config.h> #include <linux/linkage.h> #include <linux/kernel.h> @@ -113,7 +114,7 @@ extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigne extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); extern unsigned int psycho_build_irq(void *psycho, int imap_off, int ino, int need_dma_sync); -#ifdef __SMP__ +#ifdef CONFIG_SMP extern void set_cpu_int(int, int); extern void clear_cpu_int(int, int); extern void set_irq_udt(int); diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h index 7036f6e82..963ce73e4 100644 --- a/include/asm-sparc64/oplib.h +++ b/include/asm-sparc64/oplib.h @@ -9,6 +9,7 @@ #ifndef __SPARC64_OPLIB_H #define __SPARC64_OPLIB_H +#include <linux/config.h> #include <asm/openprom.h> /* Enumeration to describe the prom major version we have detected. */ @@ -175,7 +176,7 @@ enum prom_output_device { extern enum prom_output_device prom_query_output_device(void); /* Multiprocessor operations... */ -#ifdef __SMP__ +#ifdef CONFIG_SMP /* Start the CPU with the given device tree node, context table, and context * at the passed program counter. */ diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index 9a0d67494..7ca23a02e 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h @@ -2,6 +2,7 @@ #ifndef _SPARC64_PGALLOC_H #define _SPARC64_PGALLOC_H +#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -32,7 +33,7 @@ extern void __flush_tlb_range(unsigned long context, unsigned long start, unsigned long pgsz, unsigned long size); extern void __flush_tlb_page(unsigned long context, unsigned long page, unsigned long r); -#ifndef __SMP__ +#ifndef CONFIG_SMP #define flush_cache_all() __flush_cache_all() #define flush_tlb_all() __flush_tlb_all() @@ -59,7 +60,7 @@ do { struct mm_struct *__mm = (vma)->vm_mm; \ SECONDARY_CONTEXT); \ } while(0) -#else /* __SMP__ */ +#else /* CONFIG_SMP */ extern void smp_flush_cache_all(void); extern void smp_flush_tlb_all(void); @@ -76,7 +77,7 @@ extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page); #define flush_tlb_page(vma, page) \ smp_flush_tlb_page((vma)->vm_mm, page) -#endif /* ! __SMP__ */ +#endif /* ! CONFIG_SMP */ /* This will change for Cheetah and later chips. */ #define VPTE_BASE 0xfffffffe00000000 @@ -101,7 +102,7 @@ extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long st } /* Page table allocation/freeing. */ -#ifdef __SMP__ +#ifdef CONFIG_SMP /* Sliiiicck */ #define pgt_quicklists cpu_data[smp_processor_id()] #else @@ -118,7 +119,7 @@ extern struct pgtable_cache_struct { #define pgtable_cache_size (pgt_quicklists.pgcache_size) #define pgd_cache_size (pgt_quicklists.pgdcache_size) -#ifndef __SMP__ +#ifndef CONFIG_SMP extern __inline__ void free_pgd_fast(pgd_t *pgd) { @@ -167,7 +168,7 @@ extern __inline__ pgd_t *get_pgd_fast(void) return (pgd_t *)ret; } -#else /* __SMP__ */ +#else /* CONFIG_SMP */ extern __inline__ void free_pgd_fast(pgd_t *pgd) { @@ -197,7 +198,7 @@ extern __inline__ void free_pgd_slow(pgd_t *pgd) free_page((unsigned long)pgd); } -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ extern pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long address_premasked); diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index f368d64b3..ed35381bc 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.125 2000/04/12 08:10:26 davem Exp $ +/* $Id: pgtable.h,v 1.126 2000/05/05 21:57:03 davem Exp $ * pgtable.h: SpitFire page table operations. * * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -196,6 +196,7 @@ extern inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot) * Undefined behaviour if not.. */ #define pte_read(pte) (pte_val(pte) & _PAGE_READ) +#define pte_exec(pte) pte_read(pte) #define pte_write(pte) (pte_val(pte) & _PAGE_WRITE) #define pte_dirty(pte) (pte_val(pte) & _PAGE_MODIFIED) #define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED) diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index 7237736fe..b731a18aa 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h @@ -13,6 +13,7 @@ */ #define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; }) +#include <linux/config.h> #include <asm/asi.h> #include <asm/a.out.h> #include <asm/pstate.h> @@ -127,7 +128,7 @@ extern __inline__ unsigned long thread_saved_pc(struct thread_struct *t) } /* On Uniprocessor, even in RMO processes see TSO semantics */ -#ifdef __SMP__ +#ifdef CONFIG_SMP #define TSTATE_INITIAL_MM TSTATE_TSO #else #define TSTATE_INITIAL_MM TSTATE_RMO diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index 7bb2b3250..c70b95dad 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h @@ -6,6 +6,7 @@ #ifndef _SPARC64_SMP_H #define _SPARC64_SMP_H +#include <linux/config.h> #include <linux/threads.h> #include <asm/asi.h> @@ -24,7 +25,7 @@ extern struct prom_cpuinfo linux_cpus[64]; #endif /* !(__ASSEMBLY__) */ -#ifdef __SMP__ +#ifdef CONFIG_SMP #ifndef __ASSEMBLY__ @@ -122,7 +123,7 @@ extern __inline__ void smp_send_stop(void) { } #define PROC_CHANGE_PENALTY 20 -#endif /* !(__SMP__) */ +#endif /* !(CONFIG_SMP) */ #define NO_PROC_ID 0xFF diff --git a/include/asm-sparc64/softirq.h b/include/asm-sparc64/softirq.h index 460c96633..9a4f442ff 100644 --- a/include/asm-sparc64/softirq.h +++ b/include/asm-sparc64/softirq.h @@ -6,11 +6,12 @@ #ifndef __SPARC64_SOFTIRQ_H #define __SPARC64_SOFTIRQ_H +#include <linux/config.h> #include <asm/atomic.h> #include <asm/hardirq.h> #include <asm/system.h> /* for membar() */ -#ifndef __SMP__ +#ifndef CONFIG_SMP extern unsigned int local_bh_count; #else #define local_bh_count (cpu_data[smp_processor_id()].bh_count) diff --git a/include/asm-sparc64/string.h b/include/asm-sparc64/string.h index f6b69aa53..31bbf32e7 100644 --- a/include/asm-sparc64/string.h +++ b/include/asm-sparc64/string.h @@ -1,4 +1,4 @@ -/* $Id: string.h,v 1.15 1999/12/23 17:02:20 jj Exp $ +/* $Id: string.h,v 1.16 2000/05/02 01:47:01 davem Exp $ * string.h: External definitions for optimized assembly string * routines for the Linux Kernel. * @@ -41,7 +41,7 @@ extern void *__builtin_memset(void *,int,__kernel_size_t); #define __HAVE_ARCH_MEMCPY -extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n) +static inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n) { if(n) { if(n <= 32) { @@ -53,7 +53,7 @@ extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_ return to; } -extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_size_t n) +static inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_size_t n) { __memcpy(to, from, n); return to; @@ -67,7 +67,7 @@ extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_si #define __HAVE_ARCH_MEMSET -extern inline void *__constant_memset(void *s, int c, __kernel_size_t count) +static inline void *__constant_memset(void *s, int c, __kernel_size_t count) { extern __kernel_size_t __bzero(void *, __kernel_size_t); @@ -127,7 +127,7 @@ extern __kernel_size_t strlen(const char *); extern int __strncmp(const char *, const char *, __kernel_size_t); -extern inline int __constant_strncmp(const char *src, const char *dest, __kernel_size_t count) +static inline int __constant_strncmp(const char *src, const char *dest, __kernel_size_t count) { register int retval; switch(count) { diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index 1429e7772..895cd74df 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h @@ -1,7 +1,8 @@ -/* $Id: system.h,v 1.57 2000/03/27 10:38:57 davem Exp $ */ +/* $Id: system.h,v 1.58 2000/05/05 18:47:41 davem Exp $ */ #ifndef __SPARC64_SYSTEM_H #define __SPARC64_SYSTEM_H +#include <linux/config.h> #include <asm/ptrace.h> #include <asm/processor.h> #include <asm/asm_offsets.h> @@ -71,7 +72,7 @@ extern unsigned long empty_zero_page; #define local_irq_save(flags) __save_and_cli(flags) #define local_irq_restore(flags) __restore_flags(flags) -#ifndef __SMP__ +#ifndef CONFIG_SMP #define cli() __cli() #define sti() __sti() #define save_flags(x) __save_flags(x) @@ -257,6 +258,61 @@ static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr, extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn)); +/* + * Atomic compare and exchange. Compare OLD with MEM, if identical, + * store NEW in MEM. Return the initial value in MEM. Success is + * indicated by comparing RETURN with OLD. + */ + +#define __HAVE_ARCH_CMPXCHG 1 + +extern __inline__ unsigned long +__cmpxchg_u32(volatile int *m, int old, int new) +{ + __asm__ __volatile__("cas [%2], %3, %0" + : "=&r" (new) + : "0" (new), "r" (m), "r" (old) + : "memory"); + + return new; +} + +extern __inline__ unsigned long +__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new) +{ + __asm__ __volatile__("casx [%2], %3, %0" + : "=&r" (new) + : "0" (new), "r" (m), "r" (old) + : "memory"); + + return new; +} + +/* This function doesn't exist, so you'll get a linker error + if something tries to do an invalid cmpxchg(). */ +extern void __cmpxchg_called_with_bad_pointer(void); + +static __inline__ unsigned long +__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) +{ + switch (size) { + case 4: + return __cmpxchg_u32(ptr, old, new); + case 8: + return __cmpxchg_u64(ptr, old, new); + } + __cmpxchg_called_with_bad_pointer(); + return old; +} + +#define cmpxchg(ptr,o,n) \ + ({ \ + __typeof__(*(ptr)) _o_ = (o); \ + __typeof__(*(ptr)) _n_ = (n); \ + (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ + (unsigned long)_n_, sizeof(*(ptr))); \ + }) + #endif /* !(__ASSEMBLY__) */ #endif /* !(__SPARC64_SYSTEM_H) */ diff --git a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h index 2d1067c7d..8eb30d7d8 100644 --- a/include/asm-sparc64/timer.h +++ b/include/asm-sparc64/timer.h @@ -23,6 +23,8 @@ * and also profiling if enabled. */ +#include <linux/config.h> + /* Two timers, traditionally steered to PIL's 10 and 14 respectively. * But since INO packets are used on sun5, we could use any PIL level * we like, however for now we use the normal ones. @@ -48,7 +50,7 @@ struct sun5_timer { */ #define SUN5_HZ_TO_LIMIT(__hz) (1000000/(__hz)) -#ifdef __SMP__ +#ifdef CONFIG_SMP extern unsigned long timer_tick_offset; extern void timer_tick_interrupt(struct pt_regs *); #endif diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index 777f5f8ee..b5a9999a5 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h @@ -72,7 +72,8 @@ #define D_TX 256 /* show tx packets */ #define D_RX 512 /* show rx packets */ #define D_SKB 1024 /* show skb's */ -#define D_TIMING 2048 /* show time needed to copy buffers to card */ +#define D_SKB_SIZE 2048 /* show skb sizes */ +#define D_TIMING 4096 /* show time needed to copy buffers to card */ #ifndef ARCNET_DEBUG_MAX #define ARCNET_DEBUG_MAX (~0) /* enable ALL debug messages */ @@ -174,6 +175,13 @@ extern int arcnet_debug; #define NORMALconf 0x00 /* 1-249 byte packets */ #define EXTconf 0x08 /* 250-504 byte packets */ +/* card feature flags, set during auto-detection. + * (currently only used by com20020pci) + */ +#define ARC_IS_5MBIT 1 /* card default speed is 5MBit */ +#define ARC_CAN_10MBIT 2 /* card uses COM20022, supporting 10MBit, + but default is 2.5MBit. */ + /* information needed to define an encapsulation driver */ struct ArcProto { @@ -227,8 +235,10 @@ struct arcnet_local { uint8_t config, /* current value of CONFIG register */ timeout, /* Extended timeout for COM20020 */ backplane, /* Backplane flag for COM20020 */ - clock, /* COM20020 clock speed flag */ - setup, /* Contents of setup register */ + clockp, /* COM20020 clock divider */ + clockm, /* COM20020 clock multiplier flag */ + setup, /* Contents of setup1 register */ + setup2, /* Contents of setup2 register */ intmask; /* current value of INTMASK register */ uint8_t default_proto[256]; /* default encap to use for each host */ int cur_tx, /* buffer used by current transmit, or -1 */ @@ -236,7 +246,8 @@ struct arcnet_local { cur_rx; /* current receive buffer */ int lastload_dest, /* can last loaded packet be acked? */ lasttrans_dest; /* can last TX'd packet be acked? */ - int basename_len; /* name length without suffix ('arc0e' -> 4) */ + char *card_name; /* card ident string */ + int card_flags; /* special card features */ /* * Buffer management: an ARCnet card has 4 x 512-byte buffers, each of diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index 21f5bad13..08ccef4c4 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h @@ -102,7 +102,7 @@ void coda_sysctl_clean(void); if (coda_debug & mask) { \ printk("(%s,l. %d): ", __FUNCTION__, __LINE__); \ printk(format, ## a); } \ -} while (0) ; +} while (0) #define ENTRY \ if(coda_print_entry) printk("Process %d entered %s\n",current->pid,__FUNCTION__) diff --git a/include/linux/com20020.h b/include/linux/com20020.h index b386bf34d..89cefc2ba 100644 --- a/include/linux/com20020.h +++ b/include/linux/com20020.h @@ -29,6 +29,7 @@ int com20020_check(struct net_device *dev); int com20020_found(struct net_device *dev, int shared); +void com20020_remove(struct net_device *dev); /* The number of low I/O ports used by the card. */ #define ARCNET_TOTAL_SIZE 9 @@ -41,8 +42,10 @@ int com20020_found(struct net_device *dev, int shared); #define _ADDR_HI (ioaddr+2) /* control registers for IO-mapped memory */ #define _ADDR_LO (ioaddr+3) #define _MEMDATA (ioaddr+4) /* data port for IO-mapped memory */ +#define _SUBADR (ioaddr+5) /* the extended port _XREG refers to */ #define _CONFIG (ioaddr+6) /* configuration register */ -#define _SETUP (ioaddr+7) /* setup register */ +#define _XREG (ioaddr+7) /* extra registers (indexed by _CONFIG + or _SUBADR) */ /* in the ADDR_HI register */ #define RDDATAflag 0x80 /* next access is a read (not a write) */ @@ -57,10 +60,28 @@ int com20020_found(struct net_device *dev, int shared); /* in SETUP register */ #define PROMISCset 0x10 /* enable RCV_ALL */ -#define REGTENTID (lp->config &= ~3); -#define REGNID (lp->config = (lp->config&~2)|1); -#define REGSETUP (lp->config = (lp->config&~1)|2); -#define REGNXTID (lp->config |= 3); +/* COM2002x */ +#define SUB_TENTATIVE 0 /* tentative node ID */ +#define SUB_NODE 1 /* node ID */ +#define SUB_SETUP1 2 /* various options */ +#define SUB_TEST 3 /* test/diag register */ + +/* COM20022 only */ +#define SUB_SETUP2 4 /* sundry options */ +#define SUB_BUSCTL 5 /* bus control options */ +#define SUB_DMACOUNT 6 /* DMA count options */ + +#define SET_SUBADR(x) do { \ + if ((x) < 4) \ + { \ + lp->config = (lp->config & ~0x03) | (x); \ + SETCONF; \ + } \ + else \ + { \ + outb(x, _SUBADR); \ + } \ +} while (0) #undef ARCRESET #undef ASTATUS @@ -80,6 +101,6 @@ int com20020_found(struct net_device *dev, int shared); #define ACOMMAND(cmd) outb((cmd),_COMMAND) #define AINTMASK(msk) outb((msk),_INTMASK) -#define SETCONF(cfg) outb(cfg, _CONFIG) +#define SETCONF outb(lp->config, _CONFIG) #endif /* __COM20020_H */ diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 9ed7e0726..7eccee7b9 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -61,8 +61,7 @@ struct dentry { unsigned int d_flags; struct inode * d_inode; /* Where the name belongs to - NULL is negative */ struct dentry * d_parent; /* parent directory */ - struct dentry * d_mounts; /* mount information */ - struct dentry * d_covers; + struct list_head d_vfsmnt; struct list_head d_hash; /* lookup hash list */ struct list_head d_lru; /* d_count = 0 LRU list */ struct list_head d_child; /* child of parent list */ @@ -151,18 +150,18 @@ extern int d_invalidate(struct dentry *); #define shrink_dcache() prune_dcache(0) struct zone_struct; /* dcache memory management */ -extern int shrink_dcache_memory(int, unsigned int, struct zone_struct *); +extern int shrink_dcache_memory(int, unsigned int); extern void prune_dcache(int); /* icache memory management (defined in linux/fs/inode.c) */ -extern int shrink_icache_memory(int, int, struct zone_struct *); +extern int shrink_icache_memory(int, int); extern void prune_icache(int); /* only used at mount-time */ extern struct dentry * d_alloc_root(struct inode *); /* test whether root is busy without destroying dcache */ -extern int is_root_busy(struct dentry *); +extern int d_active_refs(struct dentry *); /* test whether we have any submounts in a subdir tree */ extern int have_submounts(struct dentry *); @@ -235,10 +234,9 @@ static __inline__ int d_unhashed(struct dentry *dentry) extern void dput(struct dentry *); -/* MOUNT_REWRITE: replace with the check for d_vfsmnt */ static __inline__ int d_mountpoint(struct dentry *dentry) { - return dentry != dentry->d_mounts; + return !list_empty(&dentry->d_vfsmnt); } diff --git a/include/linux/file.h b/include/linux/file.h index a6998496c..8ac96f574 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -7,23 +7,19 @@ extern void _fput(struct file *); -/* - * Check whether the specified task has the fd open. Since the task - * may not have a files_struct, we must test for p->files != NULL. - */ -extern inline struct file * fcheck_task(struct task_struct *p, unsigned int fd) +static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) { struct file * file = NULL; - if (fd < p->files->max_fds) - file = p->files->fd[fd]; + if (fd < files->max_fds) + file = files->fd[fd]; return file; } /* * Check whether the specified fd has an open file. */ -extern inline struct file * fcheck(unsigned int fd) +static inline struct file * fcheck(unsigned int fd) { struct file * file = NULL; struct files_struct *files = current->files; @@ -33,7 +29,7 @@ extern inline struct file * fcheck(unsigned int fd) return file; } -extern inline struct file * frip(struct files_struct *files, unsigned int fd) +static inline struct file * frip(struct files_struct *files, unsigned int fd) { struct file * file = NULL; @@ -42,7 +38,7 @@ extern inline struct file * frip(struct files_struct *files, unsigned int fd) return file; } -extern inline struct file * fget(unsigned int fd) +static inline struct file * fget(unsigned int fd) { struct file * file = NULL; struct files_struct *files = current->files; @@ -58,10 +54,10 @@ extern inline struct file * fget(unsigned int fd) /* * 23/12/1998 Marcin Dalecki <dalecki@cs.net.pl>: * - * Since those functions where calling other functions, it was compleatly - * bogous to make them all "extern inline". + * Since those functions where calling other functions, it was completely + * bogus to make them all "extern inline". * - * The removal of this pseudo optimization saved me scandaleous: + * The removal of this pseudo optimization saved me scandalous: * * 3756 (i386 arch) * @@ -71,7 +67,7 @@ extern inline struct file * fget(unsigned int fd) * I suspect there are many other similar "optimizations" across the * kernel... */ -extern inline void fput(struct file * file) +static inline void fput(struct file * file) { if (atomic_dec_and_test(&file->f_count)) _fput(file); @@ -88,7 +84,7 @@ extern void put_filp(struct file *); * fput() the struct file we are about to overwrite in this case. */ -extern inline void fd_install(unsigned int fd, struct file * file) +static inline void fd_install(unsigned int fd, struct file * file) { struct files_struct *files = current->files; struct file * result; @@ -100,4 +96,6 @@ extern inline void fd_install(unsigned int fd, struct file * file) fput(result); } +void put_files_struct(struct files_struct *fs); + #endif /* __LINUX_FILE_H */ diff --git a/include/linux/filter.h b/include/linux/filter.h index 58ad8b1bc..ae1a1ebed 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -38,7 +38,7 @@ struct sk_filter struct sock_filter insns[0]; }; -extern __inline__ unsigned int sk_filter_len(struct sk_filter *fp) +static inline unsigned int sk_filter_len(struct sk_filter *fp) { return fp->len*sizeof(struct sock_filter) + sizeof(*fp); } diff --git a/include/linux/fs.h b/include/linux/fs.h index 3f135fa01..4eb593aba 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -20,6 +20,7 @@ #include <linux/stat.h> #include <linux/cache.h> #include <linux/stddef.h> +#include <linux/string.h> #include <asm/atomic.h> #include <asm/bitops.h> @@ -78,7 +79,11 @@ extern int max_super_blocks, nr_super_blocks; #define FS_NO_PRELIM 4 /* prevent preloading of dentries, even if * FS_NO_DCACHE is not set. */ - +#define FS_SINGLE 8 /* + * Filesystem that can have only one superblock; + * kernel-wide vfsmnt is kept in ->kern_mnt. + */ +#define FS_NOMOUNT 16 /* Never mount from userland */ /* * These are the fs-independent mount-flags: up to 16 flags are supported */ @@ -173,7 +178,6 @@ extern int max_super_blocks, nr_super_blocks; #ifdef __KERNEL__ -#include <linux/string.h> #include <asm/semaphore.h> #include <asm/byteorder.h> @@ -251,7 +255,7 @@ void init_buffer(struct buffer_head *, bh_end_io_t *, void *); extern void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long offset); -#define touch_buffer(bh) set_bit(PG_referenced, &bh->b_page->flags) +#define touch_buffer(bh) SetPageReferenced(bh->b_page) #include <linux/pipe_fs_i.h> @@ -338,8 +342,8 @@ struct page; struct address_space; struct address_space_operations { - int (*writepage)(struct file *, struct dentry *, struct page *); - int (*readpage)(struct dentry *, struct page *); + int (*writepage)(struct file *, struct page *); + int (*readpage)(struct file *, struct page *); int (*sync_page)(struct page *); int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); int (*commit_write)(struct file *, struct page *, unsigned, unsigned); @@ -625,6 +629,7 @@ struct super_block { struct list_head s_files; struct block_device *s_bdev; + struct list_head s_mounts; /* vfsmount(s) of this one */ struct quota_mount_options s_dquot; /* Diskquota specific options */ union { @@ -769,6 +774,7 @@ struct file_system_type { int fs_flags; struct super_block *(*read_super) (struct super_block *, void *, int); struct module *owner; + struct vfsmount *kern_mnt; /* For kernel mount, if it's FS_SINGLE fs */ struct file_system_type * next; }; @@ -785,16 +791,11 @@ struct file_system_type var = { \ extern int register_filesystem(struct file_system_type *); extern int unregister_filesystem(struct file_system_type *); +extern struct vfsmount *kern_mount(struct file_system_type *); +extern void kern_umount(struct vfsmount *); +extern int may_umount(struct vfsmount *); -static inline int vfs_statfs(struct super_block *sb, struct statfs *buf) -{ - if (!sb) - return -ENODEV; - if (!sb->s_op || !sb->s_op->statfs) - return -ENOSYS; - memset(buf, 0, sizeof(struct statfs)); - return sb->s_op->statfs(sb, buf); -} +extern int vfs_statfs(struct super_block *, struct statfs *); /* Return value for VFS lock functions - tells locks.c to lock conventionally * REALLY kosha for root NFS and nfs_lock @@ -821,7 +822,7 @@ static inline int locks_verify_locked(struct inode *inode) return 0; } -extern inline int locks_verify_area(int read_write, struct inode *inode, +static inline int locks_verify_area(int read_write, struct inode *inode, struct file *filp, loff_t offset, size_t count) { @@ -830,7 +831,7 @@ extern inline int locks_verify_area(int read_write, struct inode *inode, return 0; } -extern inline int locks_verify_truncate(struct inode *inode, +static inline int locks_verify_truncate(struct inode *inode, struct file *filp, loff_t size) { @@ -898,7 +899,6 @@ extern struct file_operations write_pipe_fops; extern struct file_operations rdwr_pipe_fops; extern int fs_may_remount_ro(struct super_block *); -extern int fs_may_mount(kdev_t); extern int try_to_free_buffers(struct page *); extern void refile_buffer(struct buffer_head * buf); @@ -912,7 +912,7 @@ extern void refile_buffer(struct buffer_head * buf); /* * This is called by bh->b_end_io() handlers when I/O has completed. */ -extern inline void mark_buffer_uptodate(struct buffer_head * bh, int on) +static inline void mark_buffer_uptodate(struct buffer_head * bh, int on) { if (on) set_bit(BH_Uptodate, &bh->b_state); @@ -922,12 +922,12 @@ extern inline void mark_buffer_uptodate(struct buffer_head * bh, int on) #define atomic_set_buffer_clean(bh) test_and_clear_bit(BH_Dirty, &(bh)->b_state) -extern inline void __mark_buffer_clean(struct buffer_head *bh) +static inline void __mark_buffer_clean(struct buffer_head *bh) { refile_buffer(bh); } -extern inline void mark_buffer_clean(struct buffer_head * bh) +static inline void mark_buffer_clean(struct buffer_head * bh) { if (atomic_set_buffer_clean(bh)) __mark_buffer_clean(bh); @@ -935,12 +935,12 @@ extern inline void mark_buffer_clean(struct buffer_head * bh) #define atomic_set_buffer_protected(bh) test_and_set_bit(BH_Protected, &(bh)->b_state) -extern inline void __mark_buffer_protected(struct buffer_head *bh) +static inline void __mark_buffer_protected(struct buffer_head *bh) { refile_buffer(bh); } -extern inline void mark_buffer_protected(struct buffer_head * bh) +static inline void mark_buffer_protected(struct buffer_head * bh) { if (!atomic_set_buffer_protected(bh)) __mark_buffer_protected(bh); @@ -968,7 +968,6 @@ extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int); extern int get_write_access(struct inode *); extern void put_write_access(struct inode *); -extern struct dentry * do_mknod(const char *, int, dev_t); extern int do_pipe(int *); extern int open_namei(const char *, int, int, struct nameidata *); @@ -1031,14 +1030,16 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, u /* needed for stackable file system support */ extern loff_t default_llseek(struct file *file, loff_t offset, int origin); -extern struct dentry * lookup_dentry(const char *, unsigned int); -extern int walk_init(const char *, unsigned, struct nameidata *); -extern int walk_name(const char *, struct nameidata *); +extern int __user_walk(const char *, unsigned, struct nameidata *); +extern int path_init(const char *, unsigned, struct nameidata *); +extern int path_walk(const char *, struct nameidata *); +extern void path_release(struct nameidata *); +extern int follow_down(struct vfsmount **, struct dentry **); +extern int follow_up(struct vfsmount **, struct dentry **); extern struct dentry * lookup_one(const char *, struct dentry *); -extern struct dentry * __namei(const char *, unsigned int); - -#define namei(pathname) __namei(pathname, LOOKUP_FOLLOW) -#define lnamei(pathname) __namei(pathname, 0) +extern struct dentry * lookup_hash(struct qstr *, struct dentry *); +#define user_path_walk(name,nd) __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd) +#define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd) extern void iput(struct inode *); extern struct inode * igrab(struct inode *); @@ -1064,13 +1065,13 @@ extern struct buffer_head * getblk(kdev_t, int, int); extern void ll_rw_block(int, int, struct buffer_head * bh[]); extern int is_read_only(kdev_t); extern void __brelse(struct buffer_head *); -extern inline void brelse(struct buffer_head *buf) +static inline void brelse(struct buffer_head *buf) { if (buf) __brelse(buf); } extern void __bforget(struct buffer_head *); -extern inline void bforget(struct buffer_head *buf) +static inline void bforget(struct buffer_head *buf) { if (buf) __bforget(buf); @@ -1083,7 +1084,6 @@ extern void wakeup_bdflush(int wait); extern int brw_page(int, struct page *, kdev_t, int [], int); -typedef int (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *); typedef int (get_block_t)(struct inode*,long,struct buffer_head*,int); /* Generic buffer handling for block filesystems.. */ @@ -1119,7 +1119,6 @@ extern int vfs_readdir(struct file *, filldir_t, void *); extern struct super_block *get_super(kdev_t); struct super_block *get_empty_super(void); -void remove_vfsmnt(kdev_t dev); extern void put_super(kdev_t); unsigned long generate_cluster(kdev_t, int b[], int); unsigned long generate_cluster_swab32(kdev_t, int b[], int); diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index e9c32f386..53f9c44f7 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h @@ -31,8 +31,10 @@ static inline void set_fs_root(struct fs_struct *fs, struct vfsmount *old_rootmnt = fs->rootmnt; fs->rootmnt = mntget(mnt); fs->root = dget(dentry); - dput(old_root); - mntput(old_rootmnt); + if (old_root) { + dput(old_root); + mntput(old_rootmnt); + } } /* @@ -48,8 +50,10 @@ static inline void set_fs_pwd(struct fs_struct *fs, struct vfsmount *old_pwdmnt = fs->pwdmnt; fs->pwdmnt = mntget(mnt); fs->pwd = dget(dentry); - dput(old_pwd); - mntput(old_pwdmnt); + if (old_pwd) { + dput(old_pwd); + mntput(old_pwdmnt); + } } struct fs_struct *copy_fs_struct(struct fs_struct *old); diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h index c4d398e94..a882aaea5 100644 --- a/include/linux/hdlcdrv.h +++ b/include/linux/hdlcdrv.h @@ -109,7 +109,6 @@ struct hdlcdrv_ioctl { #include <linux/spinlock.h> #define HDLCDRV_MAGIC 0x5ac6e778 -#define HDLCDRV_IFNAMELEN 6 #define HDLCDRV_HDLCBUFFER 32 /* should be a power of 2 for speed reasons */ #define HDLCDRV_BITBUFFER 256 /* should be a power of 2 for speed reasons */ #undef HDLCDRV_LOOPBACK /* define for HDLC debugging purposes */ @@ -182,8 +181,6 @@ struct hdlcdrv_ops { struct hdlcdrv_state { int magic; - char ifname[HDLCDRV_IFNAMELEN]; - const struct hdlcdrv_ops *ops; struct { diff --git a/include/linux/i2o.h b/include/linux/i2o.h index f55c5de88..c15faa66f 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h @@ -142,7 +142,6 @@ struct i2o_controller void (*bus_disable)(struct i2o_controller *c); void *page_frame; /* Message buffers */ - int inbound_size; /* Inbound queue size */ }; /* @@ -304,8 +303,6 @@ extern int i2o_query_table(int, struct i2o_controller *, int, int, int, void *, extern int i2o_clear_table(struct i2o_controller *, int, int); extern int i2o_row_add_table(struct i2o_controller *, int, int, int, void *, int); -extern int i2o_row_delete_table(struct i2o_controller *, int, int, int, void *, - int); extern int i2o_issue_params(int, struct i2o_controller *, int, void *, int, void *, int); @@ -401,13 +398,12 @@ extern int i2o_delete_controller(struct i2o_controller *); #define I2O_PRIVATE_MSG 0xFF -/* - * Init Outbound Q status - */ -#define I2O_CMD_OUTBOUND_INIT_IN_PROGRESS 0x01 -#define I2O_CMD_OUTBOUND_INIT_REJECTED 0x02 -#define I2O_CMD_OUTBOUND_INIT_FAILED 0x03 -#define I2O_CMD_OUTBOUND_INIT_COMPLETE 0x04 +/* Command status values */ + +#define I2O_CMD_IN_PROGRESS 0x01 +#define I2O_CMD_REJECTED 0x02 +#define I2O_CMD_FAILED 0x03 +#define I2O_CMD_COMPLETED 0x04 /* I2O API function return values */ @@ -490,6 +486,25 @@ extern int i2o_delete_controller(struct i2o_controller *); #define I2O_DSC_DEVICE_BUSY 0x001B #define I2O_DSC_DEVICE_NOT_AVAILABLE 0x001C +/* FailureStatusCodes, Table 3-3 Message Failure Codes */ + +#define I2O_FSC_TRANSPORT_SERVICE_SUSPENDED 0x81 +#define I2O_FSC_TRANSPORT_SERVICE_TERMINATED 0x82 +#define I2O_FSC_TRANSPORT_CONGESTION 0x83 +#define I2O_FSC_TRANSPORT_FAILURE 0x84 +#define I2O_FSC_TRANSPORT_STATE_ERROR 0x85 +#define I2O_FSC_TRANSPORT_TIME_OUT 0x86 +#define I2O_FSC_TRANSPORT_ROUTING_FAILURE 0x87 +#define I2O_FSC_TRANSPORT_INVALID_VERSION 0x88 +#define I2O_FSC_TRANSPORT_INVALID_OFFSET 0x89 +#define I2O_FSC_TRANSPORT_INVALID_MSG_FLAGS 0x8A +#define I2O_FSC_TRANSPORT_FRAME_TOO_SMALL 0x8B +#define I2O_FSC_TRANSPORT_FRAME_TOO_LARGE 0x8C +#define I2O_FSC_TRANSPORT_INVALID_TARGET_ID 0x8D +#define I2O_FSC_TRANSPORT_INVALID_INITIATOR_ID 0x8E +#define I2O_FSC_TRANSPORT_INVALID_INITIATOR_CONTEXT 0x8F +#define I2O_FSC_TRANSPORT_UNKNOWN_FAILURE 0xFF + /* Device Claim Types */ #define I2O_CLAIM_PRIMARY 0x01000000 #define I2O_CLAIM_MANAGEMENT 0x02000000 @@ -526,7 +541,7 @@ extern int i2o_delete_controller(struct i2o_controller *); #define MSG_64BIT_CNTXT 0x0200 #define MSG_MULTI_TRANS 0x1000 #define MSG_FAIL 0x2000 -#define MSG_LAST 0x4000 +#define MSG_FINAL 0x4000 #define MSG_REPLY 0x8000 /* minimum size msg */ diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 18bde1113..67ded69e1 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -56,6 +56,8 @@ #define ETH_P_AARP 0x80F3 /* Appletalk AARP */ #define ETH_P_IPX 0x8137 /* IPX over DIX */ #define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ +#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */ +#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */ /* * Non DIX types. Won't clash for 1500 types. diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h new file mode 100644 index 000000000..873a7d9d6 --- /dev/null +++ b/include/linux/if_pppox.h @@ -0,0 +1,136 @@ +/*************************************************************************** + * Linux PPP over X - Generic PPP transport layer sockets + * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516) + * + * This file supplies definitions required by the PPP over Ethernet driver + * (pppox.c). All version information wrt this file is located in pppox.c + * + * License: + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + */ + +#ifndef __LINUX_IF_PPPOX_H +#define __LINUX_IF_PPPOX_H + +#include <linux/if_ether.h> +#include <linux/if.h> + +#include <asm/types.h> +#include <asm/byteorder.h> +#ifdef __KERNEL__ +#include <linux/netdevice.h> +#include <linux/sched.h> +#include <asm/semaphore.h> +#include <linux/ppp_channel.h> +#endif /* __KERNEL__ */ + +/* For user-space programs to pick up these definitions + * which they wouldn't get otherwise without defining __KERNEL__ + */ +#ifndef AF_PPPOX +#define AF_PPPOX 24 +#define PF_PPPOX AF_PPPOX +#endif /* !(AF_PPPOX) */ + +/************************************************************************ + * PPPoE addressing definition + */ +typedef __u16 sid_t; +struct pppoe_addr{ + sid_t sid; /* Session identifier */ + unsigned char remote[ETH_ALEN]; /* Remote address */ + char dev[IFNAMSIZ]; /* Local device to use */ +}; + +/************************************************************************ + * Protocols supported by AF_PPPOX + */ +#define PX_PROTO_OE 0 /* Currently just PPPoE */ +#define PX_MAX_PROTO 1 + +struct sockaddr_pppox { + sa_family_t sa_family; /* address family, AF_PPPOX */ + unsigned int sa_protocol; /* protocol identifier */ + union{ + struct pppoe_addr pppoe; + }sa_addr; +}__attribute__ ((packed)); + + +/********************************************************************* + * + * ioctl interface for defining forwarding of connections + * + ********************************************************************/ + +#define PPPOEIOCSFWD _IOW(0xB1 ,0, sizeof(struct sockaddr_pppox)) +#define PPPOEIOCDFWD _IO(0xB1 ,1) +/*#define PPPOEIOCGFWD _IOWR(0xB1,2, sizeof(struct sockaddr_pppox))*/ + +/* Codes to identify message types */ +#define PADI_CODE 0x09 +#define PADO_CODE 0x07 +#define PADR_CODE 0x19 +#define PADS_CODE 0x65 +#define PADT_CODE 0xa7 +struct pppoe_tag { + __u16 tag_type; + __u16 tag_len; + char tag_data[0]; +} __attribute ((packed)); + +/* Tag identifiers */ +#define PTT_EOL __constant_htons(0x0000) +#define PTT_SRV_NAME __constant_htons(0x0101) +#define PTT_AC_NAME __constant_htons(0x0102) +#define PTT_HOST_UNIQ __constant_htons(0x0103) +#define PTT_AC_COOKIE __constant_htons(0x0104) +#define PTT_VENDOR __constant_htons(0x0105) +#define PTT_RELAY_SID __constant_htons(0x0110) +#define PTT_SRV_ERR __constant_htons(0x0201) +#define PTT_SYS_ERR __constant_htons(0x0202) +#define PTT_GEN_ERR __constant_htons(0x0203) + +struct pppoe_hdr { + __u8 ver : 4; + __u8 type : 4; + __u8 code; + __u16 sid; + __u16 length; + struct pppoe_tag tag[0]; +} __attribute__ ((packed)); + +#ifdef __KERNEL__ + +struct pppox_proto { + int (*create)(struct socket *sock); + int (*ioctl)(struct socket *sock, unsigned int cmd, + unsigned long arg); +}; + +extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); +extern void unregister_pppox_proto(int proto_num); +extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ +extern int pppox_channel_ioctl(struct ppp_channel *pc, unsigned int cmd, + unsigned long arg); + +/* PPPoE socket states */ +enum { + PPPOX_NONE = 0, /* initial state */ + PPPOX_CONNECTED = 1, /* connection established ==TCP_ESTABLISHED */ + PPPOX_BOUND = 2, /* bound to ppp device */ + PPPOX_RELAY = 4, /* forwarding is enabled */ + PPPOX_DEAD = 8 +}; + +extern struct ppp_channel_ops pppoe_chan_ops; + +extern void pppox_proto_init(struct net_proto *np); + +#endif /* __KERNEL__ */ + +#endif /* !(__LINUX_IF_PPPOX_H) */ diff --git a/include/linux/input.h b/include/linux/input.h index 17f6c046f..d43d1e5a7 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -416,7 +416,7 @@ struct input_id { #include <linux/devfs_fs_kernel.h> #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) -#define BIT(x) (1<<((x)%BITS_PER_LONG)) +#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) #define LONG(x) ((x)/BITS_PER_LONG) struct input_dev { diff --git a/include/linux/mm.h b/include/linux/mm.h index 278eb959b..337ff6182 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -173,7 +173,7 @@ typedef struct page { #define PG_slab 8 #define PG_swap_cache 9 #define PG_skip 10 -#define PG_swap_entry 11 +#define PG_unused_03 11 #define PG_highmem 12 /* bits 21-30 unused */ #define PG_reserved 31 @@ -196,7 +196,11 @@ typedef struct page { #define SetPageError(page) set_bit(PG_error, &(page)->flags) #define ClearPageError(page) clear_bit(PG_error, &(page)->flags) #define PageReferenced(page) test_bit(PG_referenced, &(page)->flags) +#define SetPageReferenced(page) set_bit(PG_referenced, &(page)->flags) +#define PageTestandClearReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) #define PageDecrAfter(page) test_bit(PG_decr_after, &(page)->flags) +#define SetPageDecrAfter(page) set_bit(PG_decr_after, &(page)->flags) +#define PageTestandClearDecrAfter(page) test_and_clear_bit(PG_decr_after, &(page)->flags) #define PageSlab(page) test_bit(PG_slab, &(page)->flags) #define PageSwapCache(page) test_bit(PG_swap_cache, &(page)->flags) #define PageReserved(page) test_bit(PG_reserved, &(page)->flags) @@ -210,9 +214,6 @@ typedef struct page { #define PageClearSwapCache(page) clear_bit(PG_swap_cache, &(page)->flags) #define PageTestandClearSwapCache(page) test_and_clear_bit(PG_swap_cache, &(page)->flags) -#define PageSwapEntry(page) test_bit(PG_swap_entry, &(page)->flags) -#define SetPageSwapEntry(page) set_bit(PG_swap_entry, &(page)->flags) -#define ClearPageSwapEntry(page) clear_bit(PG_swap_entry, &(page)->flags) #ifdef CONFIG_HIGHMEM #define PageHighMem(page) test_bit(PG_highmem, &(page)->flags) @@ -312,7 +313,7 @@ extern struct page * FASTCALL(__alloc_pages(zonelist_t *zonelist, unsigned long extern struct page * alloc_pages_node(int nid, int gfp_mask, unsigned long order); #ifndef CONFIG_DISCONTIGMEM -extern inline struct page * alloc_pages(int gfp_mask, unsigned long order) +static inline struct page * alloc_pages(int gfp_mask, unsigned long order) { /* temporary check. */ if (contig_page_data.node_zonelists[gfp_mask].gfp_mask != (gfp_mask)) @@ -331,7 +332,7 @@ extern struct page * alloc_pages(int gfp_mask, unsigned long order); #define alloc_page(gfp_mask) \ alloc_pages(gfp_mask, 0) -extern inline unsigned long __get_free_pages (int gfp_mask, unsigned long order) +static inline unsigned long __get_free_pages (int gfp_mask, unsigned long order) { struct page * page; @@ -347,7 +348,7 @@ extern inline unsigned long __get_free_pages (int gfp_mask, unsigned long order) #define __get_dma_pages(gfp_mask, order) \ __get_free_pages((gfp_mask) | GFP_DMA,(order)) -extern inline unsigned long get_zeroed_page(int gfp_mask) +static inline unsigned long get_zeroed_page(int gfp_mask) { unsigned long page; @@ -367,7 +368,7 @@ extern inline unsigned long get_zeroed_page(int gfp_mask) */ extern void FASTCALL(__free_pages_ok(struct page * page, unsigned long order)); -extern inline void __free_pages(struct page *page, unsigned long order) +static inline void __free_pages(struct page *page, unsigned long order) { if (!put_page_testzero(page)) return; @@ -376,7 +377,7 @@ extern inline void __free_pages(struct page *page, unsigned long order) #define __free_page(page) __free_pages(page, 0) -extern inline void free_pages(unsigned long addr, unsigned long order) +static inline void free_pages(unsigned long addr, unsigned long order) { unsigned long map_nr; @@ -433,7 +434,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, unsigned long len, unsigned long prot, unsigned long flag, unsigned long pgoff); -extern inline unsigned long do_mmap(struct file *file, unsigned long addr, +static inline unsigned long do_mmap(struct file *file, unsigned long addr, unsigned long len, unsigned long prot, unsigned long flag, unsigned long offset) { @@ -454,7 +455,7 @@ struct zone_t; /* filemap.c */ extern void remove_inode_page(struct page *); extern unsigned long page_unuse(struct page *); -extern int shrink_mmap(int, int, zone_t *); +extern int shrink_mmap(int, int); extern void truncate_inode_pages(struct address_space *, loff_t); /* generic vm_area_ops exported for stackable file systems */ diff --git a/include/linux/module.h b/include/linux/module.h index 7507d6add..39d3e5560 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -190,6 +190,17 @@ const char __module_parm_desc_##var[] \ __attribute__((section(".modinfo"))) = \ "parm_desc_" __MODULE_STRING(var) "=" desc +/* + * MODULE_DEVICE_TABLE exports information about devices + * currently supported by this module. A device type, such as PCI, + * is a C-like identifier passed as the first arg to this macro. + * The second macro arg is the variable containing the device + * information being made public. + * + * The following is a list of known device types (arg 1), + * and the C types which are to be passed as arg 2. + * pci - struct pci_device_id - List of PCI ids supported by this module + */ #define MODULE_DEVICE_TABLE(type,name) \ const struct type##_device_id * __module_##type##_device_table = name /* not put to .modinfo section to avoid section type conflicts */ diff --git a/include/linux/mount.h b/include/linux/mount.h index ddd2cad4d..fcec95647 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -10,24 +10,40 @@ */ #ifndef _LINUX_MOUNT_H #define _LINUX_MOUNT_H +#ifdef __KERNEL__ struct vfsmount { - kdev_t mnt_dev; /* Device this applies to */ + struct dentry *mnt_mountpoint; /* dentry of mountpoint */ + struct dentry *mnt_root; /* root of the mounted tree */ + struct vfsmount *mnt_parent; /* fs we are mounted on */ + struct list_head mnt_instances; /* other vfsmounts of the same fs */ + struct list_head mnt_clash; /* those who are mounted on (other */ + /* instances) of the same dentry */ + struct super_block *mnt_sb; /* pointer to superblock */ + struct list_head mnt_mounts; /* list of children, anchored here */ + struct list_head mnt_child; /* and going through their mnt_child */ + atomic_t mnt_count; + char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ char *mnt_dirname; /* Name of directory mounted on */ - struct super_block *mnt_sb; /* pointer to superblock */ struct list_head mnt_list; }; -/* MOUNT_REWRITE: fill these */ static inline struct vfsmount *mntget(struct vfsmount *mnt) { + if (mnt) + atomic_inc(&mnt->mnt_count); return mnt; } static inline void mntput(struct vfsmount *mnt) { + if (mnt) { + if (atomic_dec_and_test(&mnt->mnt_count)) + BUG(); + } } +#endif #endif /* _LINUX_MOUNT_H */ diff --git a/include/linux/net.h b/include/linux/net.h index 16d0859cc..2a122307b 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -18,6 +18,7 @@ #ifndef _LINUX_NET_H #define _LINUX_NET_H +#include <linux/config.h> #include <linux/socket.h> #include <linux/wait.h> @@ -141,7 +142,7 @@ extern int net_ratelimit(void); extern unsigned long net_random(void); extern void net_srandom(unsigned long); -#ifndef __SMP__ +#ifndef CONFIG_SMP #define SOCKOPS_WRAPPED(name) name #define SOCKOPS_WRAP(name, fam) #else diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index bb19b0807..b2e1ac568 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -210,7 +210,7 @@ struct net_device * (i.e. as seen by users in the "Space.c" file). It is the name * the interface. */ - char *name; + char name[IFNAMSIZ]; /* * I/O specific fields diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 178eb4c06..1836dda48 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h @@ -51,7 +51,10 @@ enum ip_conntrack_status { IPS_EXPECTED = 0x01, /* We've seen packets both ways: bit 1 set. Can be set, not unset. */ - IPS_SEEN_REPLY = 0x02 + IPS_SEEN_REPLY = 0x02, + + /* Packet seen leaving box: bit 2 set. Can be set, not unset. */ + IPS_CONFIRMED = 0x04 }; struct ip_conntrack_expect @@ -88,7 +91,7 @@ struct ip_conntrack struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; /* Have we seen traffic both ways yet? (bitset) */ - unsigned int status; + volatile unsigned int status; /* Timer function; drops refcnt when it goes off. */ struct timer_list timeout; diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h index 9cb49afaf..4631db1ee 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_core.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h @@ -20,8 +20,9 @@ extern struct ip_conntrack_protocol *find_proto(u_int8_t protocol); extern struct ip_conntrack_protocol *__find_proto(u_int8_t protocol); extern struct list_head protocol_list; -/* Returns TRUE if it dealt with ICMP, and filled in skb->nfct */ -int icmp_error_track(struct sk_buff *skb); +/* Returns conntrack if it dealt with ICMP, and filled in skb->nfct */ +extern struct ip_conntrack *icmp_error_track(struct sk_buff *skb, + enum ip_conntrack_info *ctinfo); extern int get_tuple(const struct iphdr *iph, size_t len, struct ip_conntrack_tuple *tuple, struct ip_conntrack_protocol *protocol); @@ -31,6 +32,9 @@ struct ip_conntrack_tuple_hash * ip_conntrack_find_get(const struct ip_conntrack_tuple *tuple, const struct ip_conntrack *ignored_conntrack); +/* Confirm a connection */ +void ip_conntrack_confirm(struct ip_conntrack *ct); + extern unsigned int ip_conntrack_htable_size; extern struct list_head *ip_conntrack_hash; extern struct list_head expect_list; diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 20361b064..a2431cd72 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h @@ -346,6 +346,9 @@ struct ipt_match unsigned int matchinfosize, unsigned int hook_mask); + /* Called when entry of this type deleted. */ + void (*destroy)(void *matchinfo, unsigned int matchinfosize); + /* Set this to THIS_MODULE if you are a module, otherwise NULL */ struct module *me; }; @@ -375,6 +378,9 @@ struct ipt_target unsigned int targinfosize, unsigned int hook_mask); + /* Called when entry of this type deleted. */ + void (*destroy)(void *targinfo, unsigned int targinfosize); + /* Set this to THIS_MODULE if you are a module, otherwise NULL */ struct module *me; }; diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 653e6045b..0c84b76c4 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -175,7 +175,7 @@ extern int nfs_lock(struct file *, int, struct file_lock *); /* * linux/fs/nfs/write.c */ -extern int nfs_writepage(struct file *file, struct dentry *, struct page *); +extern int nfs_writepage(struct file *file, struct page *); extern int nfs_flush_incompatible(struct file *file, struct page *page); extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); /* @@ -232,7 +232,7 @@ nfs_wb_file(struct inode *inode, struct file *file) /* * linux/fs/nfs/read.c */ -extern int nfs_readpage(struct dentry *, struct page *); +extern int nfs_readpage(struct file *, struct page *); extern int nfs_pagein_inode(struct inode *, unsigned long, unsigned int); extern int nfs_pagein_timeout(struct inode *); diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 45f6dd0e0..06a21296f 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h @@ -62,6 +62,7 @@ struct svc_export { struct svc_export * ex_parent; struct svc_client * ex_client; int ex_flags; + struct vfsmount * ex_mnt; struct dentry * ex_dentry; kdev_t ex_dev; ino_t ex_ino; diff --git a/include/linux/ntfs_fs_sb.h b/include/linux/ntfs_fs_sb.h index 898ef7105..4b958337f 100644 --- a/include/linux/ntfs_fs_sb.h +++ b/include/linux/ntfs_fs_sb.h @@ -15,7 +15,10 @@ struct ntfs_sb_info{ ntfs_u32 at_standard_information; ntfs_u32 at_attribute_list; ntfs_u32 at_file_name; + ntfs_u32 at_volume_version; ntfs_u32 at_security_descriptor; + ntfs_u32 at_volume_name; + ntfs_u32 at_volume_information; ntfs_u32 at_data; ntfs_u32 at_index_root; ntfs_u32 at_index_allocation; diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 813dd78ea..a88cbc9b8 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -80,6 +80,7 @@ extern void lock_page(struct page *page); extern void __add_page_to_hash_queue(struct page * page, struct page **p); extern void add_to_page_cache(struct page * page, struct address_space *mapping, unsigned long index); +extern void add_to_page_cache_locked(struct page * page, struct address_space *mapping, unsigned long index); extern inline void add_page_to_hash_queue(struct page * page, struct inode * inode, unsigned long index) { diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index e5c5b723b..bfdf6c03a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -333,6 +333,7 @@ #define PCI_DEVICE_ID_SI_5571 0x5571 #define PCI_DEVICE_ID_SI_5591 0x5591 #define PCI_DEVICE_ID_SI_5597 0x5597 +#define PCI_DEVICE_ID_SI_5598 0x5598 #define PCI_DEVICE_ID_SI_5600 0x5600 #define PCI_DEVICE_ID_SI_6306 0x6306 #define PCI_DEVICE_ID_SI_6326 0x6326 diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index dfcba46fe..52a9d5b5a 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -1,6 +1,7 @@ #ifndef _LINUX_PIPE_FS_I_H #define _LINUX_PIPE_FS_I_H +#define PIPEFS_MAGIC 0x50495045 struct pipe_inode_info { wait_queue_head_t wait; char *base; diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h index fc39f2658..037c989ff 100644 --- a/include/linux/ppp_channel.h +++ b/include/linux/ppp_channel.h @@ -22,6 +22,7 @@ #include <linux/list.h> #include <linux/skbuff.h> #include <linux/poll.h> +#include <asm/atomic.h> struct ppp_channel; @@ -31,6 +32,7 @@ struct ppp_channel_ops { int (*start_xmit)(struct ppp_channel *, struct sk_buff *); /* Handle an ioctl call that has come in via /dev/ppp. */ int (*ioctl)(struct ppp_channel *, unsigned int, unsigned long); + }; struct ppp_channel { diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index f92195a3e..b7621b293 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -96,7 +96,7 @@ extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent); extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); -extern struct super_block *proc_super_blocks; +extern struct vfsmount *proc_mnt; extern struct super_block *proc_read_super(struct super_block *,void *,int); extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *); diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 14ad1b7ca..3506c1ce1 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -14,6 +14,8 @@ #if defined(CONFIG_QUOTA) +#include <linux/smp_lock.h> + /* * declaration of quota_function calls in kernel. */ @@ -94,8 +96,10 @@ extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr) int error = -EDQUOT; if (dentry->d_inode->i_sb->dq_op) { + lock_kernel(); dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1); error = dentry->d_inode->i_sb->dq_op->transfer(dentry, iattr); + unlock_kernel(); } else { error = notify_change(dentry, iattr); } diff --git a/include/linux/sched.h b/include/linux/sched.h index d249961e3..2bfe015dd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -203,7 +203,7 @@ struct mm_struct { unsigned long start_code, end_code, start_data, end_data; unsigned long start_brk, brk, start_stack; unsigned long arg_start, arg_end, env_start, env_end; - unsigned long min_flt, maj_flt, rss, total_vm, locked_vm; + unsigned long rss, total_vm, locked_vm; unsigned long def_flags; unsigned long cpu_vm_mask; unsigned long swap_cnt; /* number of pages to swap on next pass */ @@ -225,7 +225,7 @@ struct mm_struct { 0, 0, 0, 0, \ 0, 0, 0, \ 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, \ + 0, 0, 0, \ 0, 0, 0, 0, NULL } struct signal_struct { @@ -310,7 +310,6 @@ struct task_struct { /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; - int hog:1; /* process credentials */ uid_t uid,euid,suid,fsuid; gid_t gid,egid,sgid,fsgid; @@ -346,8 +345,8 @@ struct task_struct { /* Thread group tracking */ u32 parent_exec_id; u32 self_exec_id; -/* Protection of fields allocatio/deallocation */ - struct semaphore exit_sem; +/* Protection of (de-)allocation: mm, files, fs, tty */ + spinlock_t alloc_lock; }; /* @@ -418,7 +417,7 @@ struct task_struct { blocked: {{0}}, \ sigqueue: NULL, \ sigqueue_tail: &tsk.sigqueue, \ - exit_sem: __MUTEX_INITIALIZER(tsk.exit_sem) \ + alloc_lock: SPIN_LOCK_UNLOCKED \ } @@ -442,7 +441,7 @@ extern struct task_struct *pidhash[PIDHASH_SZ]; #define pid_hashfn(x) ((((x) >> 8) ^ (x)) & (PIDHASH_SZ - 1)) -extern __inline__ void hash_pid(struct task_struct *p) +static inline void hash_pid(struct task_struct *p) { struct task_struct **htable = &pidhash[pid_hashfn(p->pid)]; @@ -452,14 +451,14 @@ extern __inline__ void hash_pid(struct task_struct *p) p->pidhash_pprev = htable; } -extern __inline__ void unhash_pid(struct task_struct *p) +static inline void unhash_pid(struct task_struct *p) { if(p->pidhash_next) p->pidhash_next->pidhash_pprev = p->pidhash_pprev; *p->pidhash_pprev = p->pidhash_next; } -extern __inline__ struct task_struct *find_task_by_pid(int pid) +static inline struct task_struct *find_task_by_pid(int pid) { struct task_struct *p, **htable = &pidhash[pid_hashfn(pid)]; @@ -527,7 +526,7 @@ extern int kill_proc(pid_t, int, int); extern int do_sigaction(int, const struct k_sigaction *, struct k_sigaction *); extern int do_sigaltstack(const stack_t *, stack_t *, unsigned long); -extern inline int signal_pending(struct task_struct *p) +static inline int signal_pending(struct task_struct *p) { return (p->sigpending != 0); } @@ -595,7 +594,7 @@ extern void free_irq(unsigned int, void *); * These will be removed, but in the mean time, when the SECURE_NOROOT * flag is set, uids don't grant privilege. */ -extern inline int suser(void) +static inline int suser(void) { if (!issecure(SECURE_NOROOT) && current->euid == 0) { current->flags |= PF_SUPERPRIV; @@ -604,7 +603,7 @@ extern inline int suser(void) return 0; } -extern inline int fsuser(void) +static inline int fsuser(void) { if (!issecure(SECURE_NOROOT) && current->fsuid == 0) { current->flags |= PF_SUPERPRIV; @@ -619,7 +618,7 @@ extern inline int fsuser(void) * fsuser(). See include/linux/capability.h for defined capabilities. */ -extern inline int capable(int cap) +static inline int capable(int cap) { #if 1 /* ok now */ if (cap_raised(current->cap_effective, cap)) @@ -709,7 +708,7 @@ extern void daemonize(void); extern int do_execve(char *, char **, char **, struct pt_regs *); extern int do_fork(unsigned long, unsigned long, struct pt_regs *); -extern inline void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) +static inline void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) { unsigned long flags; @@ -718,7 +717,7 @@ extern inline void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) wq_write_unlock_irqrestore(&q->lock, flags); } -extern inline void add_wait_queue_exclusive(wait_queue_head_t *q, +static inline void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait) { unsigned long flags; @@ -728,7 +727,7 @@ extern inline void add_wait_queue_exclusive(wait_queue_head_t *q, wq_write_unlock_irqrestore(&q->lock, flags); } -extern inline void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) +static inline void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) { unsigned long flags; @@ -822,12 +821,12 @@ static inline void del_from_runqueue(struct task_struct * p) p->run_list.next = NULL; } -extern inline int task_on_runqueue(struct task_struct *p) +static inline int task_on_runqueue(struct task_struct *p) { return (p->run_list.next != NULL); } -extern inline void unhash_process(struct task_struct *p) +static inline void unhash_process(struct task_struct *p) { if (task_on_runqueue(p)) BUG(); write_lock_irq(&tasklist_lock); @@ -837,19 +836,14 @@ extern inline void unhash_process(struct task_struct *p) write_unlock_irq(&tasklist_lock); } -static inline int task_lock(struct task_struct *p) +static inline void task_lock(struct task_struct *p) { - down(&p->exit_sem); - if (p->p_pptr) - return 1; - /* He's dead, Jim. You take his wallet, I'll take the tricorder... */ - up(&p->exit_sem); - return 0; + spin_lock(&p->alloc_lock); } static inline void task_unlock(struct task_struct *p) { - up(&p->exit_sem); + spin_unlock(&p->alloc_lock); } #endif /* __KERNEL__ */ diff --git a/include/linux/socket.h b/include/linux/socket.h index e5d06dde0..3401ce5df 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -155,6 +155,7 @@ struct ucred { #define AF_ATMSVC 20 /* ATM SVCs */ #define AF_SNA 22 /* Linux SNA Project (nutters!) */ #define AF_IRDA 23 /* IRDA sockets */ +#define AF_PPPOX 24 /* PPPoX sockets */ #define AF_MAX 32 /* For now.. */ /* Protocol families, same as address families. */ @@ -183,7 +184,7 @@ struct ucred { #define PF_ATMSVC AF_ATMSVC #define PF_SNA AF_SNA #define PF_IRDA AF_IRDA - +#define PF_PPPOX AF_PPPOX #define PF_MAX AF_MAX /* Maximum queue length specifiable by listen. */ diff --git a/include/linux/string.h b/include/linux/string.h index 88eb21c28..e23d4989e 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -9,34 +9,72 @@ extern "C" { #endif extern char * ___strtok; +extern char * strpbrk(const char *,const char *); +extern char * strtok(char *,const char *); +extern char * strsep(char **,const char *); +extern __kernel_size_t strspn(const char *,const char *); + + +/* + * Include machine specific inline routines + */ +#include <asm/string.h> + +#ifndef __HAVE_ARCH_STRCPY extern char * strcpy(char *,const char *); +#endif +#ifndef __HAVE_ARCH_STRNCPY extern char * strncpy(char *,const char *, __kernel_size_t); +#endif +#ifndef __HAVE_ARCH_STRCAT extern char * strcat(char *, const char *); +#endif +#ifndef __HAVE_ARCH_STRNCAT extern char * strncat(char *, const char *, __kernel_size_t); +#endif +#ifndef __HAVE_ARCH_STRCMP +extern int strcmp(const char *,const char *); +#endif +#ifndef __HAVE_ARCH_STRNCMP +extern int strncmp(const char *,const char *,__kernel_size_t); +#endif +#ifndef __HAVE_ARCH_STRNICMP +extern int strnicmp(const char *, const char *, __kernel_size_t); +#endif +#ifndef __HAVE_ARCH_STRCHR extern char * strchr(const char *,int); +#endif +#ifndef __HAVE_ARCH_STRRCHR extern char * strrchr(const char *,int); -extern char * strpbrk(const char *,const char *); -extern char * strtok(char *,const char *); -extern char * strsep(char **,const char *); +#endif +#ifndef __HAVE_ARCH_STRSTR extern char * strstr(const char *,const char *); +#endif +#ifndef __HAVE_ARCH_STRLEN extern __kernel_size_t strlen(const char *); +#endif +#ifndef __HAVE_ARCH_STRNLEN extern __kernel_size_t strnlen(const char *,__kernel_size_t); -extern __kernel_size_t strspn(const char *,const char *); -extern int strcmp(const char *,const char *); -extern int strncmp(const char *,const char *,__kernel_size_t); -extern int strnicmp(const char *, const char *, __kernel_size_t); +#endif +#ifndef __HAVE_ARCH_MEMSET extern void * memset(void *,int,__kernel_size_t); +#endif +#ifndef __HAVE_ARCH_MEMCPY extern void * memcpy(void *,const void *,__kernel_size_t); +#endif +#ifndef __HAVE_ARCH_MEMMOVE extern void * memmove(void *,const void *,__kernel_size_t); +#endif +#ifndef __HAVE_ARCH_MEMSCAN extern void * memscan(void *,int,__kernel_size_t); +#endif +#ifndef __HAVE_ARCH_MEMCMP extern int memcmp(const void *,const void *,__kernel_size_t); +#endif +#ifndef __HAVE_ARCH_MEMCHR extern void * memchr(const void *,int,__kernel_size_t); - -/* - * Include machine specific inline routines - */ -#include <asm/string.h> +#endif #ifdef __cplusplus } diff --git a/include/linux/swap.h b/include/linux/swap.h index 5d5f97cdb..9226ce0a5 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -80,14 +80,13 @@ struct sysinfo; struct zone_t; /* linux/ipc/shm.c */ -extern int shm_swap (int, int, zone_t *); +extern int shm_swap(int, int); /* linux/mm/swap.c */ -extern void swap_setup (void); +extern void swap_setup(void); /* linux/mm/vmscan.c */ -extern int try_to_free_pages(unsigned int gfp_mask, zone_t *zone); -extern int swap_out(unsigned int gfp_mask, int priority); +extern int try_to_free_pages(unsigned int gfp_mask); /* linux/mm/page_io.c */ extern void rw_swap_page(int, struct page *, int); @@ -121,7 +120,6 @@ extern void get_swaphandle_info(swp_entry_t, unsigned long *, kdev_t *, struct inode **); extern int swap_duplicate(swp_entry_t); extern int swap_count(struct page *); -extern swp_entry_t acquire_swap_entry(struct page *page); extern int valid_swaphandles(swp_entry_t, unsigned long *); #define get_swap_page() __get_swap_page(1) extern void __swap_free(swp_entry_t, unsigned short); @@ -173,13 +171,18 @@ do { \ spin_unlock(&pagemap_lru_lock); \ } while (0) +#define __lru_cache_del(page) \ +do { \ + list_del(&(page)->lru); \ + nr_lru_pages--; \ +} while (0) + #define lru_cache_del(page) \ do { \ if (!PageLocked(page)) \ BUG(); \ spin_lock(&pagemap_lru_lock); \ - list_del(&(page)->lru); \ - nr_lru_pages--; \ + __lru_cache_del(page); \ spin_unlock(&pagemap_lru_lock); \ } while (0) diff --git a/include/linux/timer.h b/include/linux/timer.h index e6eb00da0..2de8050ea 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -2,6 +2,7 @@ #define _LINUX_TIMER_H #include <linux/config.h> +#include <linux/list.h> /* * Old-style timers. Please don't use for any new code. @@ -47,8 +48,7 @@ extern struct timer_struct timer_table[32]; * to distinguish between the different invocations. */ struct timer_list { - struct timer_list *next; /* MUST be first element */ - struct timer_list *prev; + struct list_head list; unsigned long expires; unsigned long data; void (*function)(unsigned long); @@ -56,7 +56,7 @@ struct timer_list { }; extern void add_timer(struct timer_list * timer); -extern int del_timer(struct timer_list * timer); +extern int del_timer(struct timer_list * timer); /* * mod_timer is a more efficient way to update the expire field of an @@ -67,18 +67,17 @@ int mod_timer(struct timer_list *timer, unsigned long expires); extern void it_real_fn(unsigned long); -extern inline void init_timer(struct timer_list * timer) +static inline void init_timer(struct timer_list * timer) { - timer->next = NULL; - timer->prev = NULL; + timer->list.next = timer->list.prev = NULL; #ifdef CONFIG_SMP timer->running = 0; #endif } -extern inline int timer_pending(const struct timer_list * timer) +static inline int timer_pending (const struct timer_list * timer) { - return timer->prev != NULL; + return timer->list.next != NULL; } #ifdef CONFIG_SMP diff --git a/include/linux/usb.h b/include/linux/usb.h index e67e96bdc..a7c8fb324 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -82,18 +82,19 @@ #define USB_PID_OUT 0xe1 #define USB_PID_ACK 0xd2 #define USB_PID_DATA0 0xc3 -#define USB_PID_UNDEF_4 0xb4 +#define USB_PID_PING 0xb4 /* USB 2.0 */ #define USB_PID_SOF 0xa5 -#define USB_PID_UNDEF_6 0x96 -#define USB_PID_UNDEF_7 0x87 -#define USB_PID_UNDEF_8 0x78 +#define USB_PID_NYET 0x96 /* USB 2.0 */ +#define USB_PID_DATA2 0x87 /* USB 2.0 */ +#define USB_PID_SPLIT 0x78 /* USB 2.0 */ #define USB_PID_IN 0x69 #define USB_PID_NAK 0x5a #define USB_PID_DATA1 0x4b -#define USB_PID_PREAMBLE 0x3c +#define USB_PID_PREAMBLE 0x3c /* Token mode */ +#define USB_PID_ERR 0x3c /* USB 2.0: handshake mode */ #define USB_PID_SETUP 0x2d #define USB_PID_STALL 0x1e -#define USB_PID_UNDEF_F 0x0f +#define USB_PID_MDATA 0x0f /* USB 2.0 */ /* * Standard requests @@ -134,43 +135,6 @@ #define USB_MAJOR 180 -/* for 2.2-kernels */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) - -static __inline__ void list_add_tail(struct list_head *new, struct list_head *head) -{ - __list_add(new, head->prev, head); -} -#define LIST_HEAD_INIT(name) { &(name), &(name) } - -typedef struct wait_queue wait_queue_t; - -typedef struct wait_queue *wait_queue_head_t; -#define DECLARE_WAITQUEUE(wait, current) \ - struct wait_queue wait = { current, NULL } -#define DECLARE_WAIT_QUEUE_HEAD(wait)\ - wait_queue_head_t wait - -#define init_waitqueue_head(x) *x=NULL -#define init_MUTEX(x) *(x)=MUTEX -#define DECLARE_MUTEX(name) struct semaphore name=MUTEX -#define DECLARE_MUTEX_LOCKED(name) struct semaphore name=MUTEX_LOCKED - - -#define __set_current_state(state_value) \ - do { current->state = state_value; } while (0) -#ifdef CONFIG_SMP -#define set_current_state(state_value) \ - set_mb(current->state, state_value) -#else -#define set_current_state(state_value) \ - __set_current_state(state_value) -#endif - -#endif // 2.2.x - - static __inline__ void wait_ms(unsigned int ms) { if(!in_interrupt()) { @@ -594,12 +558,6 @@ extern void usb_release_bandwidth(struct usb_device *, int); extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void *data, __u16 size, int timeout); -extern int usb_request_irq(struct usb_device *, unsigned int, usb_device_irq, int, void *, void **); -extern int usb_release_irq(struct usb_device *dev, void *handle, unsigned int pipe); - -extern void *usb_request_bulk(struct usb_device *, unsigned int, usb_device_irq, void *, int, void *); -extern int usb_terminate_bulk(struct usb_device *, void *); - extern void usb_init_root_hub(struct usb_device *dev); extern int usb_root_hub_string(int id, int serial, char *type, __u8 *data, int len); extern void usb_connect(struct usb_device *dev); diff --git a/include/net/atmclip.h b/include/net/atmclip.h index a568dd753..28d0584c4 100644 --- a/include/net/atmclip.h +++ b/include/net/atmclip.h @@ -48,7 +48,6 @@ struct atmarp_entry { struct clip_priv { - char name[8]; /* interface name */ int number; /* for convenience ... */ spinlock_t xoff_lock; /* ensures that pop is atomic (SMP) */ struct net_device_stats stats; diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h index 67cc761c8..af897c754 100644 --- a/include/net/irda/irlan_common.h +++ b/include/net/irda/irlan_common.h @@ -164,7 +164,6 @@ struct irlan_cb { queue_t q; /* Must be first */ int magic; - char ifname[9]; struct net_device dev; /* Ethernet device structure*/ struct enet_statistics stats; diff --git a/include/net/sock.h b/include/net/sock.h index afeb31bea..c0451c111 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -66,6 +66,11 @@ #endif #endif +#if defined(CONFIG_PPPOE) || defined(CONFIG_PPPOE_MODULE) +#include <linux/if_pppox.h> +#include <linux/ppp_channel.h> /* struct ppp_channel */ +#endif + #if defined(CONFIG_IPX) || defined(CONFIG_IPX_MODULE) #if defined(CONFIG_SPX) || defined(CONFIG_SPX_MODULE) #include <net/spx.h> @@ -102,6 +107,7 @@ struct atm_vcc; struct unix_opt { struct unix_address *addr; struct dentry * dentry; + struct vfsmount * mnt; struct semaphore readsem; struct sock * other; struct sock ** list; @@ -204,6 +210,28 @@ struct inet_opt }; #endif +#if defined(CONFIG_PPPOE) || defined (CONFIG_PPPOE_MODULE) +struct pppoe_opt +{ + struct net_device *dev; /* device associated with socket*/ + struct pppoe_addr pa; /* what this socket is bound to*/ + struct sockaddr_pppox relay; /* what socket data will be + relayed to (PPPoE relaying) */ +}; + +struct pppox_opt +{ + struct ppp_channel chan; + struct sock *sk; + struct pppox_opt *next; /* for hash table */ + union { + struct pppoe_opt pppoe; + } proto; +}; +#define pppoe_dev proto.pppoe.dev +#define pppoe_pa proto.pppoe.pa +#define pppoe_relay proto.pppoe.relay +#endif /* This defines a selective acknowledgement block. */ struct tcp_sack_block { @@ -584,6 +612,9 @@ struct sock { #if defined(CONFIG_ROSE) || defined(CONFIG_ROSE_MODULE) rose_cb *rose; #endif +#if defined(CONFIG_PPPOE) || defined(CONFIG_PPPOE_MODULE) + struct pppox_opt *pppox; +#endif #ifdef CONFIG_NETLINK struct netlink_opt *af_netlink; #endif diff --git a/include/net/tcp.h b/include/net/tcp.h index aeae81501..65fb19289 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1079,7 +1079,7 @@ static __inline__ int tcp_snd_test(struct tcp_opt *tp, struct sk_buff *skb, static __inline__ void tcp_check_probe_timer(struct sock *sk, struct tcp_opt *tp) { - if (!tp->packets_out && !tp->probe_timer.prev) + if (!tp->packets_out && !timer_pending(&tp->probe_timer)) tcp_reset_xmit_timer(sk, TCP_TIME_PROBE0, tp->rto); } @@ -1505,13 +1505,13 @@ static inline int tcp_timer_is_set(struct sock *sk, int what) switch (what) { case TCP_TIME_RETRANS: - ret = tp->retransmit_timer.prev != NULL; + ret = timer_pending(&tp->retransmit_timer); break; case TCP_TIME_DACK: - ret = tp->delack_timer.prev != NULL; + ret = timer_pending(&tp->delack_timer); break; case TCP_TIME_PROBE0: - ret = tp->probe_timer.prev != NULL; + ret = timer_pending(&tp->probe_timer); break; default: ret = 0; |