diff options
Diffstat (limited to 'include')
211 files changed, 4357 insertions, 1334 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h index 4e8d0c410..a509f6c74 100644 --- a/include/asm-alpha/atomic.h +++ b/include/asm-alpha/atomic.h @@ -66,8 +66,8 @@ static __inline__ long atomic_add_return(int i, atomic_t * v) long temp, result; __asm__ __volatile__( "1: ldl_l %0,%1\n" + " addl %0,%3,%2\n" " addl %0,%3,%0\n" - " mov %0,%2\n" " stl_c %0,%1\n" " beq %0,2f\n" " mb\n" @@ -84,8 +84,8 @@ static __inline__ long atomic_sub_return(int i, atomic_t * v) long temp, result; __asm__ __volatile__( "1: ldl_l %0,%1\n" + " subl %0,%3,%2\n" " subl %0,%3,%0\n" - " mov %0,%2\n" " stl_c %0,%1\n" " beq %0,2f\n" " mb\n" diff --git a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h index 70d6ce775..7714bf2df 100644 --- a/include/asm-alpha/compiler.h +++ b/include/asm-alpha/compiler.h @@ -72,4 +72,13 @@ __asm__("stw %1,%0" : "=m"(mem) : "r"(val)) #endif +/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented + a mechanism by which the user can annotate likely branch directions and + expect the blocks to be reordered appropriately. Define __builtin_expect + to nothing for earlier compilers. */ + +#if __GNUC__ == 2 && __GNUC_MINOR__ < 96 +#define __builtin_expect(x, expected_value) (x) +#endif + #endif /* __ALPHA_COMPILER_H */ diff --git a/include/asm-alpha/module.h b/include/asm-alpha/module.h new file mode 100644 index 000000000..6e0efe9ac --- /dev/null +++ b/include/asm-alpha/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_ALPHA_MODULE_H +#define _ASM_ALPHA_MODULE_H +/* + * This file contains the alpha architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_ALPHA_MODULE_H */ diff --git a/include/asm-alpha/param.h b/include/asm-alpha/param.h index 768c92e02..a398a3009 100644 --- a/include/asm-alpha/param.h +++ b/include/asm-alpha/param.h @@ -30,4 +30,8 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ +#ifdef __KERNEL__ +# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ +#endif + #endif /* _ASM_ALPHA_PARAM_H */ diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index 5c4373d3b..54341fff1 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h @@ -301,9 +301,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define swp_entry_to_pte(x) ((pte_t) { (x).val }) -#define module_map vmalloc -#define module_unmap vfree - /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ #define PageSkip(page) (0) #define kern_addr_valid(addr) (1) diff --git a/include/asm-alpha/semaphore-helper.h b/include/asm-alpha/semaphore-helper.h deleted file mode 100644 index 52d8fb5f4..000000000 --- a/include/asm-alpha/semaphore-helper.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef _ALPHA_SEMAPHORE_HELPER_H -#define _ALPHA_SEMAPHORE_HELPER_H - -/* - * SMP- and interrupt-safe semaphores helper functions. - * - * (C) Copyright 1996 Linus Torvalds - * (C) Copyright 1999 Richard Henderson - */ - -/* - * These two _must_ execute atomically wrt each other. - * - * This is trivially done with load_locked/store_cond, - * which we have. Let the rest of the losers suck eggs. - */ - -static inline void -wake_one_more(struct semaphore * sem) -{ - atomic_inc(&sem->waking); -} - -static inline int -waking_non_zero(struct semaphore *sem) -{ - long ret, tmp; - - /* An atomic conditional decrement. */ - __asm__ __volatile__( - "1: ldl_l %1,%2\n" - " blt %1,2f\n" - " subl %1,1,%0\n" - " stl_c %0,%2\n" - " beq %0,3f\n" - "2:\n" - ".subsection 2\n" - "3: br 1b\n" - ".previous" - : "=r"(ret), "=r"(tmp), "=m"(sem->waking.counter) - : "0"(0)); - - return ret > 0; -} - - -/* - * waking_non_zero_interruptible: - * 1 got the lock - * 0 go to sleep - * -EINTR interrupted - * - * We must undo the sem->count down_interruptible decrement - * simultaneously and atomicly with the sem->waking adjustment, - * otherwise we can race with wake_one_more. - * - * This is accomplished by doing a 64-bit ll/sc on the 2 32-bit words. - */ - -static inline int -waking_non_zero_interruptible(struct semaphore *sem, struct task_struct *tsk) -{ - long ret, tmp, tmp2, tmp3; - - /* "Equivalent" C. Note that we have to do this all without - (taken) branches in order to be a valid ll/sc sequence. - - do { - tmp = ldq_l; - ret = 0; - if (tmp >= 0) { - tmp += 0xffffffff00000000; - ret = 1; - } - else if (pending) { - // Since -1 + 1 carries into the high word, we have - // to be more careful adding 1 here. - tmp = (tmp & 0xffffffff00000000) - | ((tmp + 1) & 0x00000000ffffffff; - ret = -EINTR; - } - else { - break; // ideally. we don't actually break - // since this is a predicate we don't - // have, and is more trouble to build - // than to elide the noop stq_c. - } - tmp = stq_c = tmp; - } while (tmp == 0); - */ - - __asm__ __volatile__( - "1: ldq_l %1,%4\n" - " lda %0,0\n" - " cmovne %5,%6,%0\n" - " addq %1,1,%2\n" - " and %1,%7,%3\n" - " andnot %2,%7,%2\n" - " cmovge %1,1,%0\n" - " or %3,%2,%2\n" - " addq %1,%7,%3\n" - " cmovne %5,%2,%1\n" - " cmovge %2,%3,%1\n" - " stq_c %1,%4\n" - " beq %1,3f\n" - "2:\n" - ".subsection 2\n" - "3: br 1b\n" - ".previous" - : "=&r"(ret), "=&r"(tmp), "=&r"(tmp2), "=&r"(tmp3), "=m"(*sem) - : "r"(signal_pending(tsk)), "r"(-EINTR), - "r"(0xffffffff00000000)); - - return ret; -} - -/* - * waking_non_zero_trylock is unused. we do everything in - * down_trylock and let non-ll/sc hosts bounce around. - */ - -static inline int -waking_non_zero_trylock(struct semaphore *sem) -{ - return 0; -} - -#endif diff --git a/include/asm-alpha/semaphore.h b/include/asm-alpha/semaphore.h index 38bc05c6e..0e4a1e3a6 100644 --- a/include/asm-alpha/semaphore.h +++ b/include/asm-alpha/semaphore.h @@ -11,11 +11,16 @@ #include <asm/current.h> #include <asm/system.h> #include <asm/atomic.h> +#include <asm/compiler.h> /* __builtin_expect */ + +#define DEBUG_SEMAPHORE 0 +#define DEBUG_RW_SEMAPHORE 0 struct semaphore { /* Careful, inline assembly knows about the position of these two. */ - atomic_t count; + atomic_t count __attribute__((aligned(8))); atomic_t waking; /* biased by -1 */ + wait_queue_head_t wait; #if WAITQUEUE_DEBUG long __magic; @@ -42,7 +47,7 @@ struct semaphore { #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) -extern inline void sema_init(struct semaphore *sem, int val) +static inline void sema_init(struct semaphore *sem, int val) { /* * Logically, @@ -68,103 +73,33 @@ static inline void init_MUTEX_LOCKED (struct semaphore *sem) sema_init(sem, 0); } - -extern void __down(struct semaphore * sem); -extern int __down_interruptible(struct semaphore * sem); -extern int __down_trylock(struct semaphore * sem); -extern void __up(struct semaphore * sem); - -/* All have custom assembly linkages. */ -extern void __down_failed(struct semaphore * sem); -extern void __down_failed_interruptible(struct semaphore * sem); -extern void __down_failed_trylock(struct semaphore * sem); -extern void __up_wakeup(struct semaphore * sem); +extern void down(struct semaphore *); +extern void __down_failed(struct semaphore *); +extern int down_interruptible(struct semaphore *); +extern int __down_failed_interruptible(struct semaphore *); +extern int down_trylock(struct semaphore *); +extern void up(struct semaphore *); +extern void __up_wakeup(struct semaphore *); /* - * Whee. Hidden out of line code is fun. The contention cases are - * handled out of line in kernel/sched.c; arch/alpha/lib/semaphore.S - * takes care of making sure we can call it without clobbering regs. + * Hidden out of line code is fun, but extremely messy. Rely on newer + * compilers to do a respectable job with this. The contention cases + * are handled out of line in arch/alpha/kernel/semaphore.c. */ -extern inline void down(struct semaphore * sem) +static inline void __down(struct semaphore *sem) { - /* Given that we have to use particular hard registers to - communicate with __down_failed anyway, reuse them in - the atomic operation as well. - - __down_failed takes the semaphore address in $24, and - it's return address in $28. The pv is loaded as usual. - The gp is clobbered (in the module case) as usual. */ - - /* This little bit of silliness is to get the GP loaded for - a function that ordinarily wouldn't. Otherwise we could - have it done by the macro directly, which can be optimized - the linker. */ - register void *pv __asm__("$27"); - -#if WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif - - pv = __down_failed; - __asm__ __volatile__ ( - "/* semaphore down operation */\n" - "1: ldl_l $24,%1\n" - " subl $24,1,$28\n" - " subl $24,1,$24\n" - " stl_c $28,%1\n" - " beq $28,2f\n" - " blt $24,3f\n" - "4: mb\n" - ".subsection 2\n" - "2: br 1b\n" - "3: lda $24,%1\n" - " jsr $28,($27),__down_failed\n" - " ldgp $29,0($28)\n" - " br 4b\n" - ".previous" - : "=r"(pv) - : "m"(sem->count), "r"(pv) - : "$24", "$28", "memory"); + long count = atomic_dec_return(&sem->count); + if (__builtin_expect(count < 0, 0)) + __down_failed(sem); } -extern inline int down_interruptible(struct semaphore * sem) +static inline int __down_interruptible(struct semaphore *sem) { - /* __down_failed_interruptible takes the semaphore address in $24, - and it's return address in $28. The pv is loaded as usual. - The gp is clobbered (in the module case) as usual. The return - value is in $24. */ - - register int ret __asm__("$24"); - register void *pv __asm__("$27"); - -#if WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif - - pv = __down_failed_interruptible; - __asm__ __volatile__ ( - "/* semaphore down interruptible operation */\n" - "1: ldl_l $24,%2\n" - " subl $24,1,$28\n" - " subl $24,1,$24\n" - " stl_c $28,%2\n" - " beq $28,2f\n" - " blt $24,3f\n" - " mov $31,%0\n" - "4: mb\n" - ".subsection 2\n" - "2: br 1b\n" - "3: lda $24,%2\n" - " jsr $28,($27),__down_failed_interruptible\n" - " ldgp $29,0($28)\n" - " br 4b\n" - ".previous" - : "=r"(ret), "=r"(pv) - : "m"(sem->count), "r"(pv) - : "$28", "memory"); - - return ret; + long count = atomic_dec_return(&sem->count); + if (__builtin_expect(count < 0, 0)) + return __down_failed_interruptible(sem); + return 0; } /* @@ -174,7 +109,7 @@ extern inline int down_interruptible(struct semaphore * sem) * Do this by using ll/sc on the pair of 32-bit words. */ -extern inline int down_trylock(struct semaphore * sem) +static inline int __down_trylock(struct semaphore * sem) { long ret, tmp, tmp2, sub; @@ -182,25 +117,21 @@ extern inline int down_trylock(struct semaphore * sem) (taken) branches in order to be a valid ll/sc sequence. do { - tmp = ldq_l; - sub = 0x0000000100000000; - ret = ((int)tmp <= 0); // count =< 0 ? - if ((int)tmp >= 0) sub = 0; // count >= 0 ? - // note that if count=0 subq overflows to the high - // longword (i.e waking) - ret &= ((long)tmp < 0); // waking < 0 ? - sub += 1; - if (ret) - break; - tmp -= sub; - tmp = stq_c = tmp; + tmp = ldq_l; + sub = 0x0000000100000000; + ret = ((int)tmp <= 0); // count <= 0 ? + // Note that if count=0, the decrement overflows into + // waking, so cancel the 1 loaded above. Also cancel + // it if the lock was already free. + if ((int)tmp >= 0) sub = 0; // count >= 0 ? + ret &= ((long)tmp < 0); // waking < 0 ? + sub += 1; + if (ret) break; + tmp -= sub; + tmp = stq_c = tmp; } while (tmp == 0); */ -#if WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif - __asm__ __volatile__( "1: ldq_l %1,%4\n" " lda %3,1\n" @@ -215,7 +146,7 @@ extern inline int down_trylock(struct semaphore * sem) " subq %1,%3,%1\n" " stq_c %1,%4\n" " beq %1,3f\n" - "2:\n" + "2: mb\n" ".subsection 2\n" "3: br 1b\n" ".previous" @@ -226,45 +157,70 @@ extern inline int down_trylock(struct semaphore * sem) return ret; } -extern inline void up(struct semaphore * sem) +static inline void __up(struct semaphore *sem) { - /* Given that we have to use particular hard registers to - communicate with __up_wakeup anyway, reuse them in - the atomic operation as well. + long ret, tmp, tmp2, tmp3; - __up_wakeup takes the semaphore address in $24, and - it's return address in $28. The pv is loaded as usual. - The gp is clobbered (in the module case) as usual. */ + /* We must manipulate count and waking simultaneously and atomically. + Otherwise we have races between up and __down_failed_interruptible + waking up on a signal. - register void *pv __asm__("$27"); + "Equivalent" C. Note that we have to do this all without + (taken) branches in order to be a valid ll/sc sequence. -#if WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif - - pv = __up_wakeup; - __asm__ __volatile__ ( - "/* semaphore up operation */\n" + do { + tmp = ldq_l; + ret = (int)tmp + 1; // count += 1; + tmp2 = tmp & 0xffffffff00000000; // extract waking + if (ret <= 0) // still sleepers? + tmp2 += 0x0000000100000000; // waking += 1; + tmp = ret & 0x00000000ffffffff; // insert count + tmp |= tmp2; // insert waking; + tmp = stq_c = tmp; + } while (tmp == 0); + */ + + __asm__ __volatile__( " mb\n" - "1: ldl_l $24,%1\n" - " addl $24,1,$28\n" - " addl $24,1,$24\n" - " stl_c $28,%1\n" - " beq $28,2f\n" - " ble $24,3f\n" - "4:\n" + "1: ldq_l %1,%4\n" + " addl %1,1,%0\n" + " zapnot %1,0xf0,%2\n" + " addq %2,%5,%3\n" + " cmovle %0,%3,%2\n" + " zapnot %0,0x0f,%1\n" + " bis %1,%2,%1\n" + " stq_c %1,%4\n" + " beq %1,3f\n" + "2:\n" ".subsection 2\n" - "2: br 1b\n" - "3: lda $24,%1\n" - " jsr $28,($27),__up_wakeup\n" - " ldgp $29,0($28)\n" - " br 4b\n" + "3: br 1b\n" ".previous" - : "=r"(pv) - : "m"(sem->count), "r"(pv) - : "$24", "$28", "memory"); + : "=&r"(ret), "=&r"(tmp), "=&r"(tmp2), "=&r"(tmp3) + : "m"(*sem), "r"(0x0000000100000000) + : "memory"); + + if (__builtin_expect(ret <= 0, 0)) + __up_wakeup(sem); } +#if !WAITQUEUE_DEBUG && !DEBUG_SEMAPHORE +extern inline void down(struct semaphore *sem) +{ + __down(sem); +} +extern inline int down_interruptible(struct semaphore *sem) +{ + return __down_interruptible(sem); +} +extern inline int down_trylock(struct semaphore *sem) +{ + return __down_trylock(sem); +} +extern inline void up(struct semaphore *sem) +{ + __up(sem); +} +#endif /* rw mutexes (should that be mutices? =) -- throw rw * spinlocks and semaphores together, and this is what we @@ -297,7 +253,7 @@ extern inline void up(struct semaphore * sem) #define RW_LOCK_BIAS 0x01000000 struct rw_semaphore { - int count; + atomic_t count; /* bit 0 means read bias granted; bit 1 means write bias granted. */ unsigned granted; @@ -317,7 +273,7 @@ struct rw_semaphore { #endif #define __RWSEM_INITIALIZER(name,count) \ - { (count), 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ + { ATOMIC_INIT(count), 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ __WAIT_QUEUE_HEAD_INITIALIZER((name).write_bias_wait) \ __SEM_DEBUG_INIT(name) __RWSEM_DEBUG_INIT } @@ -331,9 +287,9 @@ struct rw_semaphore { #define DECLARE_RWSEM_WRITE_LOCKED(name) \ __DECLARE_RWSEM_GENERIC(name, 0) -extern inline void init_rwsem(struct rw_semaphore *sem) +static inline void init_rwsem(struct rw_semaphore *sem) { - sem->count = RW_LOCK_BIAS; + atomic_set (&sem->count, RW_LOCK_BIAS); sem->granted = 0; init_waitqueue_head(&sem->wait); init_waitqueue_head(&sem->write_bias_wait); @@ -344,213 +300,73 @@ extern inline void init_rwsem(struct rw_semaphore *sem) #endif } -/* All have custom assembly linkages. */ -extern void __down_read_failed(struct rw_semaphore *sem); -extern void __down_write_failed(struct rw_semaphore *sem); -extern void __rwsem_wake(struct rw_semaphore *sem, unsigned long readers); +extern void down_read(struct rw_semaphore *); +extern void down_write(struct rw_semaphore *); +extern void up_read(struct rw_semaphore *); +extern void up_write(struct rw_semaphore *); +extern void __down_read_failed(struct rw_semaphore *, int); +extern void __down_write_failed(struct rw_semaphore *, int); +extern void __rwsem_wake(struct rw_semaphore *, int); -extern inline void down_read(struct rw_semaphore *sem) +static inline void __down_read(struct rw_semaphore *sem) { - /* Given that we have to use particular hard registers to - communicate with __down_read_failed anyway, reuse them in - the atomic operation as well. + long count = atomic_dec_return(&sem->count); + if (__builtin_expect(count < 0, 0)) + __down_read_failed(sem, count); +} - __down_read_failed takes the semaphore address in $24, the count - we read in $25, and it's return address in $28. The pv is loaded - as usual. The gp is clobbered (in the module case) as usual. */ +static inline void __down_write(struct rw_semaphore *sem) +{ + long count = atomic_sub_return(RW_LOCK_BIAS, &sem->count); + if (__builtin_expect(count != 0, 0)) + __down_write_failed(sem, count); +} - /* This little bit of silliness is to get the GP loaded for - a function that ordinarily wouldn't. Otherwise we could - have it done by the macro directly, which can be optimized - the linker. */ - register void *pv __asm__("$27"); +/* When a reader does a release, the only significant case is when there + was a writer waiting, and we've bumped the count to 0, then we must + wake the writer up. */ -#if WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif +static inline void __up_read(struct rw_semaphore *sem) +{ + long count; + mb(); + count = atomic_inc_return(&sem->count); + if (__builtin_expect(count == 0, 0)) + __rwsem_wake(sem, 0); +} - pv = __down_read_failed; - __asm__ __volatile__( - "/* semaphore down_read operation */\n" - "1: ldl_l $24,%1\n" - " subl $24,1,$28\n" - " subl $24,1,$25\n" - " stl_c $28,%1\n" - " beq $28,2f\n" - " blt $25,3f\n" - "4: mb\n" - ".subsection 2\n" - "2: br 1b\n" - "3: lda $24,%1\n" - " jsr $28,($27),__down_read_failed\n" - " ldgp $29,0($28)\n" - " br 4b\n" - ".previous" - : "=r"(pv) - : "m"(sem->count), "r"(pv) - : "$24", "$25", "$28", "memory"); +/* Releasing the writer is easy -- just release it and wake up + any sleepers. */ -#if WAITQUEUE_DEBUG - if (sem->granted & 2) - BUG(); - if (atomic_read(&sem->writers)) - BUG(); - atomic_inc(&sem->readers); -#endif +static inline void __up_write(struct rw_semaphore *sem) +{ + long count, wake; + mb(); + count = atomic_add_return(RW_LOCK_BIAS, &sem->count); + + /* Only do the wake if we were, but are no longer, negative. */ + wake = ((int)(count - RW_LOCK_BIAS) < 0) && count >= 0; + if (__builtin_expect(wake, 0)) + __rwsem_wake(sem, count); } +#if !WAITQUEUE_DEBUG && !DEBUG_RW_SEMAPHORE +extern inline void down_read(struct rw_semaphore *sem) +{ + __down_read(sem); +} extern inline void down_write(struct rw_semaphore *sem) { - /* Given that we have to use particular hard registers to - communicate with __down_write_failed anyway, reuse them in - the atomic operation as well. - - __down_write_failed takes the semaphore address in $24, the count - we read in $25, and it's return address in $28. The pv is loaded - as usual. The gp is clobbered (in the module case) as usual. */ - - /* This little bit of silliness is to get the GP loaded for - a function that ordinarily wouldn't. Otherwise we could - have it done by the macro directly, which can be optimized - the linker. */ - register void *pv __asm__("$27"); - -#if WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif - - pv = __down_write_failed; - __asm__ __volatile__( - "/* semaphore down_write operation */\n" - "1: ldl_l $24,%1\n" - " ldah $28,%3($24)\n" - " ldah $25,%3($24)\n" - " stl_c $28,%1\n" - " beq $28,2f\n" - " bne $25,3f\n" - "4: mb\n" - ".subsection 2\n" - "2: br 1b\n" - "3: lda $24,%1\n" - " jsr $28,($27),__down_write_failed\n" - " ldgp $29,0($28)\n" - " br 4b\n" - ".previous" - : "=r"(pv) - : "m"(sem->count), "r"(pv), "i"(-(RW_LOCK_BIAS >> 16)) - : "$24", "$25", "$28", "memory"); - -#if WAITQUEUE_DEBUG - if (atomic_read(&sem->writers)) - BUG(); - if (atomic_read(&sem->readers)) - BUG(); - if (sem->granted & 3) - BUG(); - atomic_inc(&sem->writers); -#endif + __down_write(sem); } - -/* When a reader does a release, the only significant case is when - there was a writer waiting, and we've * bumped the count to 0: we must -wake the writer up. */ - extern inline void up_read(struct rw_semaphore *sem) { - /* Given that we have to use particular hard registers to - communicate with __rwsem_wake anyway, reuse them in - the atomic operation as well. - - __rwsem_wake takes the semaphore address in $24, the - number of waiting readers in $25, and it's return address - in $28. The pv is loaded as usual. The gp is clobbered - (in the module case) as usual. */ - - register void *pv __asm__("$27"); - -#if WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); - if (sem->granted & 2) - BUG(); - if (atomic_read(&sem->writers)) - BUG(); - atomic_dec(&sem->readers); -#endif - - pv = __rwsem_wake; - __asm__ __volatile__( - "/* semaphore up_read operation */\n" - " mb\n" - "1: ldl_l $24,%1\n" - " addl $24,1,$28\n" - " addl $24,1,$24\n" - " stl_c $28,%1\n" - " beq $28,2f\n" - " beq $24,3f\n" - "4:\n" - ".subsection 2\n" - "2: br 1b\n" - "3: lda $24,%1\n" - " mov 0,$25\n" - " jsr $28,($27),__rwsem_wake\n" - " ldgp $29,0($28)\n" - " br 4b\n" - ".previous" - : "=r"(pv) - : "m"(sem->count), "r"(pv) - : "$24", "$25", "$28", "memory"); + __up_read(sem); } - -/* releasing the writer is easy -- just release it and - * wake up any sleepers. - */ extern inline void up_write(struct rw_semaphore *sem) { - /* Given that we have to use particular hard registers to - communicate with __rwsem_wake anyway, reuse them in - the atomic operation as well. - - __rwsem_wake takes the semaphore address in $24, the - number of waiting readers in $25, and it's return address - in $28. The pv is loaded as usual. The gp is clobbered - (in the module case) as usual. */ - - register void *pv __asm__("$27"); - -#if WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); - if (sem->granted & 3) - BUG(); - if (atomic_read(&sem->readers)) - BUG(); - if (atomic_read(&sem->writers) != 1) - BUG(); - atomic_dec(&sem->writers); -#endif - - pv = __rwsem_wake; - __asm__ __volatile__( - "/* semaphore up_write operation */\n" - " mb\n" - "1: ldl_l $24,%1\n" - " ldah $28,%3($24)\n" - " stl_c $28,%1\n" - " beq $28,2f\n" - " blt $24,3f\n" - "4:\n" - ".subsection 2\n" - "2: br 1b\n" - "3: ldah $25,%3($24)\n" - /* Only do the wake if we're no longer negative. */ - " blt $25,4b\n" - " lda $24,%1\n" - " jsr $28,($27),__rwsem_wake\n" - " ldgp $29,0($28)\n" - " br 4b\n" - ".previous" - : "=r"(pv) - : "m"(sem->count), "r"(pv), "i"(RW_LOCK_BIAS >> 16) - : "$24", "$25", "$28", "memory"); + __up_write(sem); } +#endif #endif diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h index 64e05d17b..e1d809880 100644 --- a/include/asm-alpha/spinlock.h +++ b/include/asm-alpha/spinlock.h @@ -80,7 +80,7 @@ static inline void spin_lock(spinlock_t * lock) " blbs %0,2b\n" " br 1b\n" ".previous" - : "=r" (tmp), "=m" (lock->lock) + : "=&r" (tmp), "=m" (lock->lock) : "m"(lock->lock) : "memory"); } diff --git a/include/asm-alpha/xor.h b/include/asm-alpha/xor.h new file mode 100644 index 000000000..e11477f33 --- /dev/null +++ b/include/asm-alpha/xor.h @@ -0,0 +1,855 @@ +/* + * include/asm-alpha/xor.h + * + * Optimized RAID-5 checksumming functions for alpha EV5 and EV6 + * + * 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, or (at your option) + * any later version. + * + * You should have received a copy of the GNU General Public License + * (for example /usr/src/linux/COPYING); if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +extern void xor_alpha_2(unsigned long, unsigned long *, unsigned long *); +extern void xor_alpha_3(unsigned long, unsigned long *, unsigned long *, + unsigned long *); +extern void xor_alpha_4(unsigned long, unsigned long *, unsigned long *, + unsigned long *, unsigned long *); +extern void xor_alpha_5(unsigned long, unsigned long *, unsigned long *, + unsigned long *, unsigned long *, unsigned long *); + +extern void xor_alpha_prefetch_2(unsigned long, unsigned long *, + unsigned long *); +extern void xor_alpha_prefetch_3(unsigned long, unsigned long *, + unsigned long *, unsigned long *); +extern void xor_alpha_prefetch_4(unsigned long, unsigned long *, + unsigned long *, unsigned long *, + unsigned long *); +extern void xor_alpha_prefetch_5(unsigned long, unsigned long *, + unsigned long *, unsigned long *, + unsigned long *, unsigned long *); + +asm(" + .text + .align 3 + .ent xor_alpha_2 +xor_alpha_2: + .prologue 0 + srl $16, 6, $16 + .align 4 +2: + ldq $0,0($17) + ldq $1,0($18) + ldq $2,8($17) + ldq $3,8($18) + + ldq $4,16($17) + ldq $5,16($18) + ldq $6,24($17) + ldq $7,24($18) + + ldq $19,32($17) + ldq $20,32($18) + ldq $21,40($17) + ldq $22,40($18) + + ldq $23,48($17) + ldq $24,48($18) + ldq $25,56($17) + xor $0,$1,$0 # 7 cycles from $1 load + + ldq $27,56($18) + xor $2,$3,$2 + stq $0,0($17) + xor $4,$5,$4 + + stq $2,8($17) + xor $6,$7,$6 + stq $4,16($17) + xor $19,$20,$19 + + stq $6,24($17) + xor $21,$22,$21 + stq $19,32($17) + xor $23,$24,$23 + + stq $21,40($17) + xor $25,$27,$25 + stq $23,48($17) + subq $16,1,$16 + + stq $25,56($17) + addq $17,64,$17 + addq $18,64,$18 + bgt $16,2b + + ret + .end xor_alpha_2 + + .align 3 + .ent xor_alpha_3 +xor_alpha_3: + .prologue 0 + srl $16, 6, $16 + .align 4 +3: + ldq $0,0($17) + ldq $1,0($18) + ldq $2,0($19) + ldq $3,8($17) + + ldq $4,8($18) + ldq $6,16($17) + ldq $7,16($18) + ldq $21,24($17) + + ldq $22,24($18) + ldq $24,32($17) + ldq $25,32($18) + ldq $5,8($19) + + ldq $20,16($19) + ldq $23,24($19) + ldq $27,32($19) + nop + + xor $0,$1,$1 # 8 cycles from $0 load + xor $3,$4,$4 # 6 cycles from $4 load + xor $6,$7,$7 # 6 cycles from $7 load + xor $21,$22,$22 # 5 cycles from $22 load + + xor $1,$2,$2 # 9 cycles from $2 load + xor $24,$25,$25 # 5 cycles from $25 load + stq $2,0($17) + xor $4,$5,$5 # 6 cycles from $5 load + + stq $5,8($17) + xor $7,$20,$20 # 7 cycles from $20 load + stq $20,16($17) + xor $22,$23,$23 # 7 cycles from $23 load + + stq $23,24($17) + xor $25,$27,$27 # 7 cycles from $27 load + stq $27,32($17) + nop + + ldq $0,40($17) + ldq $1,40($18) + ldq $3,48($17) + ldq $4,48($18) + + ldq $6,56($17) + ldq $7,56($18) + ldq $2,40($19) + ldq $5,48($19) + + ldq $20,56($19) + xor $0,$1,$1 # 4 cycles from $1 load + xor $3,$4,$4 # 5 cycles from $4 load + xor $6,$7,$7 # 5 cycles from $7 load + + xor $1,$2,$2 # 4 cycles from $2 load + xor $4,$5,$5 # 5 cycles from $5 load + stq $2,40($17) + xor $7,$20,$20 # 4 cycles from $20 load + + stq $5,48($17) + subq $16,1,$16 + stq $20,56($17) + addq $19,64,$19 + + addq $18,64,$18 + addq $17,64,$17 + bgt $16,3b + ret + .end xor_alpha_3 + + .align 3 + .ent xor_alpha_4 +xor_alpha_4: + .prologue 0 + srl $16, 6, $16 + .align 4 +4: + ldq $0,0($17) + ldq $1,0($18) + ldq $2,0($19) + ldq $3,0($20) + + ldq $4,8($17) + ldq $5,8($18) + ldq $6,8($19) + ldq $7,8($20) + + ldq $21,16($17) + ldq $22,16($18) + ldq $23,16($19) + ldq $24,16($20) + + ldq $25,24($17) + xor $0,$1,$1 # 6 cycles from $1 load + ldq $27,24($18) + xor $2,$3,$3 # 6 cycles from $3 load + + ldq $0,24($19) + xor $1,$3,$3 + ldq $1,24($20) + xor $4,$5,$5 # 7 cycles from $5 load + + stq $3,0($17) + xor $6,$7,$7 + xor $21,$22,$22 # 7 cycles from $22 load + xor $5,$7,$7 + + stq $7,8($17) + xor $23,$24,$24 # 7 cycles from $24 load + ldq $2,32($17) + xor $22,$24,$24 + + ldq $3,32($18) + ldq $4,32($19) + ldq $5,32($20) + xor $25,$27,$27 # 8 cycles from $27 load + + ldq $6,40($17) + ldq $7,40($18) + ldq $21,40($19) + ldq $22,40($20) + + stq $24,16($17) + xor $0,$1,$1 # 9 cycles from $1 load + xor $2,$3,$3 # 5 cycles from $3 load + xor $27,$1,$1 + + stq $1,24($17) + xor $4,$5,$5 # 5 cycles from $5 load + ldq $23,48($17) + ldq $24,48($18) + + ldq $25,48($19) + xor $3,$5,$5 + ldq $27,48($20) + ldq $0,56($17) + + ldq $1,56($18) + ldq $2,56($19) + xor $6,$7,$7 # 8 cycles from $6 load + ldq $3,56($20) + + stq $5,32($17) + xor $21,$22,$22 # 8 cycles from $22 load + xor $7,$22,$22 + xor $23,$24,$24 # 5 cycles from $24 load + + stq $22,40($17) + xor $25,$27,$27 # 5 cycles from $27 load + xor $24,$27,$27 + xor $0,$1,$1 # 5 cycles from $1 load + + stq $27,48($17) + xor $2,$3,$3 # 4 cycles from $3 load + xor $1,$3,$3 + subq $16,1,$16 + + stq $3,56($17) + addq $20,64,$20 + addq $19,64,$19 + addq $18,64,$18 + + addq $17,64,$17 + bgt $16,4b + ret + .end xor_alpha_4 + + .align 3 + .ent xor_alpha_5 +xor_alpha_5: + .prologue 0 + srl $16, 6, $16 + .align 4 +5: + ldq $0,0($17) + ldq $1,0($18) + ldq $2,0($19) + ldq $3,0($20) + + ldq $4,0($21) + ldq $5,8($17) + ldq $6,8($18) + ldq $7,8($19) + + ldq $22,8($20) + ldq $23,8($21) + ldq $24,16($17) + ldq $25,16($18) + + ldq $27,16($19) + xor $0,$1,$1 # 6 cycles from $1 load + ldq $28,16($20) + xor $2,$3,$3 # 6 cycles from $3 load + + ldq $0,16($21) + xor $1,$3,$3 + ldq $1,24($17) + xor $3,$4,$4 # 7 cycles from $4 load + + stq $4,0($17) + xor $5,$6,$6 # 7 cycles from $6 load + xor $7,$22,$22 # 7 cycles from $22 load + xor $6,$23,$23 # 7 cycles from $23 load + + ldq $2,24($18) + xor $22,$23,$23 + ldq $3,24($19) + xor $24,$25,$25 # 8 cycles from $25 load + + stq $23,8($17) + xor $25,$27,$27 # 8 cycles from $27 load + ldq $4,24($20) + xor $28,$0,$0 # 7 cycles from $0 load + + ldq $5,24($21) + xor $27,$0,$0 + ldq $6,32($17) + ldq $7,32($18) + + stq $0,16($17) + xor $1,$2,$2 # 6 cycles from $2 load + ldq $22,32($19) + xor $3,$4,$4 # 4 cycles from $4 load + + ldq $23,32($20) + xor $2,$4,$4 + ldq $24,32($21) + ldq $25,40($17) + + ldq $27,40($18) + ldq $28,40($19) + ldq $0,40($20) + xor $4,$5,$5 # 7 cycles from $5 load + + stq $5,24($17) + xor $6,$7,$7 # 7 cycles from $7 load + ldq $1,40($21) + ldq $2,48($17) + + ldq $3,48($18) + xor $7,$22,$22 # 7 cycles from $22 load + ldq $4,48($19) + xor $23,$24,$24 # 6 cycles from $24 load + + ldq $5,48($20) + xor $22,$24,$24 + ldq $6,48($21) + xor $25,$27,$27 # 7 cycles from $27 load + + stq $24,32($17) + xor $27,$28,$28 # 8 cycles from $28 load + ldq $7,56($17) + xor $0,$1,$1 # 6 cycles from $1 load + + ldq $22,56($18) + ldq $23,56($19) + ldq $24,56($20) + ldq $25,56($21) + + xor $28,$1,$1 + xor $2,$3,$3 # 9 cycles from $3 load + xor $3,$4,$4 # 9 cycles from $4 load + xor $5,$6,$6 # 8 cycles from $6 load + + stq $1,40($17) + xor $4,$6,$6 + xor $7,$22,$22 # 7 cycles from $22 load + xor $23,$24,$24 # 6 cycles from $24 load + + stq $6,48($17) + xor $22,$24,$24 + subq $16,1,$16 + xor $24,$25,$25 # 8 cycles from $25 load + + stq $25,56($17) + addq $21,64,$21 + addq $20,64,$20 + addq $19,64,$19 + + addq $18,64,$18 + addq $17,64,$17 + bgt $16,5b + ret + .end xor_alpha_5 + + .align 3 + .ent xor_alpha_prefetch_2 +xor_alpha_prefetch_2: + .prologue 0 + srl $16, 6, $16 + + ldq $31, 0($17) + ldq $31, 0($18) + + ldq $31, 64($17) + ldq $31, 64($18) + + ldq $31, 128($17) + ldq $31, 128($18) + + ldq $31, 192($17) + ldq $31, 192($18) + .align 4 +2: + ldq $0,0($17) + ldq $1,0($18) + ldq $2,8($17) + ldq $3,8($18) + + ldq $4,16($17) + ldq $5,16($18) + ldq $6,24($17) + ldq $7,24($18) + + ldq $19,32($17) + ldq $20,32($18) + ldq $21,40($17) + ldq $22,40($18) + + ldq $23,48($17) + ldq $24,48($18) + ldq $25,56($17) + ldq $27,56($18) + + ldq $31,256($17) + xor $0,$1,$0 # 8 cycles from $1 load + ldq $31,256($18) + xor $2,$3,$2 + + stq $0,0($17) + xor $4,$5,$4 + stq $2,8($17) + xor $6,$7,$6 + + stq $4,16($17) + xor $19,$20,$19 + stq $6,24($17) + xor $21,$22,$21 + + stq $19,32($17) + xor $23,$24,$23 + stq $21,40($17) + xor $25,$27,$25 + + stq $23,48($17) + subq $16,1,$16 + stq $25,56($17) + addq $17,64,$17 + + addq $18,64,$18 + bgt $16,2b + ret + .end xor_alpha_prefetch_2 + + .align 3 + .ent xor_alpha_prefetch_3 +xor_alpha_prefetch_3: + .prologue 0 + srl $16, 6, $16 + + ldq $31, 0($17) + ldq $31, 0($18) + ldq $31, 0($19) + + ldq $31, 64($17) + ldq $31, 64($18) + ldq $31, 64($19) + + ldq $31, 128($17) + ldq $31, 128($18) + ldq $31, 128($19) + + ldq $31, 192($17) + ldq $31, 192($18) + ldq $31, 192($19) + .align 4 +3: + ldq $0,0($17) + ldq $1,0($18) + ldq $2,0($19) + ldq $3,8($17) + + ldq $4,8($18) + ldq $6,16($17) + ldq $7,16($18) + ldq $21,24($17) + + ldq $22,24($18) + ldq $24,32($17) + ldq $25,32($18) + ldq $5,8($19) + + ldq $20,16($19) + ldq $23,24($19) + ldq $27,32($19) + nop + + xor $0,$1,$1 # 8 cycles from $0 load + xor $3,$4,$4 # 7 cycles from $4 load + xor $6,$7,$7 # 6 cycles from $7 load + xor $21,$22,$22 # 5 cycles from $22 load + + xor $1,$2,$2 # 9 cycles from $2 load + xor $24,$25,$25 # 5 cycles from $25 load + stq $2,0($17) + xor $4,$5,$5 # 6 cycles from $5 load + + stq $5,8($17) + xor $7,$20,$20 # 7 cycles from $20 load + stq $20,16($17) + xor $22,$23,$23 # 7 cycles from $23 load + + stq $23,24($17) + xor $25,$27,$27 # 7 cycles from $27 load + stq $27,32($17) + nop + + ldq $0,40($17) + ldq $1,40($18) + ldq $3,48($17) + ldq $4,48($18) + + ldq $6,56($17) + ldq $7,56($18) + ldq $2,40($19) + ldq $5,48($19) + + ldq $20,56($19) + ldq $31,256($17) + ldq $31,256($18) + ldq $31,256($19) + + xor $0,$1,$1 # 6 cycles from $1 load + xor $3,$4,$4 # 5 cycles from $4 load + xor $6,$7,$7 # 5 cycles from $7 load + xor $1,$2,$2 # 4 cycles from $2 load + + xor $4,$5,$5 # 5 cycles from $5 load + xor $7,$20,$20 # 4 cycles from $20 load + stq $2,40($17) + subq $16,1,$16 + + stq $5,48($17) + addq $19,64,$19 + stq $20,56($17) + addq $18,64,$18 + + addq $17,64,$17 + bgt $16,3b + ret + .end xor_alpha_prefetch_3 + + .align 3 + .ent xor_alpha_prefetch_4 +xor_alpha_prefetch_4: + .prologue 0 + srl $16, 6, $16 + + ldq $31, 0($17) + ldq $31, 0($18) + ldq $31, 0($19) + ldq $31, 0($20) + + ldq $31, 64($17) + ldq $31, 64($18) + ldq $31, 64($19) + ldq $31, 64($20) + + ldq $31, 128($17) + ldq $31, 128($18) + ldq $31, 128($19) + ldq $31, 128($20) + + ldq $31, 192($17) + ldq $31, 192($18) + ldq $31, 192($19) + ldq $31, 192($20) + .align 4 +4: + ldq $0,0($17) + ldq $1,0($18) + ldq $2,0($19) + ldq $3,0($20) + + ldq $4,8($17) + ldq $5,8($18) + ldq $6,8($19) + ldq $7,8($20) + + ldq $21,16($17) + ldq $22,16($18) + ldq $23,16($19) + ldq $24,16($20) + + ldq $25,24($17) + xor $0,$1,$1 # 6 cycles from $1 load + ldq $27,24($18) + xor $2,$3,$3 # 6 cycles from $3 load + + ldq $0,24($19) + xor $1,$3,$3 + ldq $1,24($20) + xor $4,$5,$5 # 7 cycles from $5 load + + stq $3,0($17) + xor $6,$7,$7 + xor $21,$22,$22 # 7 cycles from $22 load + xor $5,$7,$7 + + stq $7,8($17) + xor $23,$24,$24 # 7 cycles from $24 load + ldq $2,32($17) + xor $22,$24,$24 + + ldq $3,32($18) + ldq $4,32($19) + ldq $5,32($20) + xor $25,$27,$27 # 8 cycles from $27 load + + ldq $6,40($17) + ldq $7,40($18) + ldq $21,40($19) + ldq $22,40($20) + + stq $24,16($17) + xor $0,$1,$1 # 9 cycles from $1 load + xor $2,$3,$3 # 5 cycles from $3 load + xor $27,$1,$1 + + stq $1,24($17) + xor $4,$5,$5 # 5 cycles from $5 load + ldq $23,48($17) + xor $3,$5,$5 + + ldq $24,48($18) + ldq $25,48($19) + ldq $27,48($20) + ldq $0,56($17) + + ldq $1,56($18) + ldq $2,56($19) + ldq $3,56($20) + xor $6,$7,$7 # 8 cycles from $6 load + + ldq $31,256($17) + xor $21,$22,$22 # 8 cycles from $22 load + ldq $31,256($18) + xor $7,$22,$22 + + ldq $31,256($19) + xor $23,$24,$24 # 6 cycles from $24 load + ldq $31,256($20) + xor $25,$27,$27 # 6 cycles from $27 load + + stq $5,32($17) + xor $24,$27,$27 + xor $0,$1,$1 # 7 cycles from $1 load + xor $2,$3,$3 # 6 cycles from $3 load + + stq $22,40($17) + xor $1,$3,$3 + stq $27,48($17) + subq $16,1,$16 + + stq $3,56($17) + addq $20,64,$20 + addq $19,64,$19 + addq $18,64,$18 + + addq $17,64,$17 + bgt $16,4b + ret + .end xor_alpha_prefetch_4 + + .align 3 + .ent xor_alpha_prefetch_5 +xor_alpha_prefetch_5: + .prologue 0 + srl $16, 6, $16 + + ldq $31, 0($17) + ldq $31, 0($18) + ldq $31, 0($19) + ldq $31, 0($20) + ldq $31, 0($21) + + ldq $31, 64($17) + ldq $31, 64($18) + ldq $31, 64($19) + ldq $31, 64($20) + ldq $31, 64($21) + + ldq $31, 128($17) + ldq $31, 128($18) + ldq $31, 128($19) + ldq $31, 128($20) + ldq $31, 128($21) + + ldq $31, 192($17) + ldq $31, 192($18) + ldq $31, 192($19) + ldq $31, 192($20) + ldq $31, 192($21) + .align 4 +5: + ldq $0,0($17) + ldq $1,0($18) + ldq $2,0($19) + ldq $3,0($20) + + ldq $4,0($21) + ldq $5,8($17) + ldq $6,8($18) + ldq $7,8($19) + + ldq $22,8($20) + ldq $23,8($21) + ldq $24,16($17) + ldq $25,16($18) + + ldq $27,16($19) + xor $0,$1,$1 # 6 cycles from $1 load + ldq $28,16($20) + xor $2,$3,$3 # 6 cycles from $3 load + + ldq $0,16($21) + xor $1,$3,$3 + ldq $1,24($17) + xor $3,$4,$4 # 7 cycles from $4 load + + stq $4,0($17) + xor $5,$6,$6 # 7 cycles from $6 load + xor $7,$22,$22 # 7 cycles from $22 load + xor $6,$23,$23 # 7 cycles from $23 load + + ldq $2,24($18) + xor $22,$23,$23 + ldq $3,24($19) + xor $24,$25,$25 # 8 cycles from $25 load + + stq $23,8($17) + xor $25,$27,$27 # 8 cycles from $27 load + ldq $4,24($20) + xor $28,$0,$0 # 7 cycles from $0 load + + ldq $5,24($21) + xor $27,$0,$0 + ldq $6,32($17) + ldq $7,32($18) + + stq $0,16($17) + xor $1,$2,$2 # 6 cycles from $2 load + ldq $22,32($19) + xor $3,$4,$4 # 4 cycles from $4 load + + ldq $23,32($20) + xor $2,$4,$4 + ldq $24,32($21) + ldq $25,40($17) + + ldq $27,40($18) + ldq $28,40($19) + ldq $0,40($20) + xor $4,$5,$5 # 7 cycles from $5 load + + stq $5,24($17) + xor $6,$7,$7 # 7 cycles from $7 load + ldq $1,40($21) + ldq $2,48($17) + + ldq $3,48($18) + xor $7,$22,$22 # 7 cycles from $22 load + ldq $4,48($19) + xor $23,$24,$24 # 6 cycles from $24 load + + ldq $5,48($20) + xor $22,$24,$24 + ldq $6,48($21) + xor $25,$27,$27 # 7 cycles from $27 load + + stq $24,32($17) + xor $27,$28,$28 # 8 cycles from $28 load + ldq $7,56($17) + xor $0,$1,$1 # 6 cycles from $1 load + + ldq $22,56($18) + ldq $23,56($19) + ldq $24,56($20) + ldq $25,56($21) + + ldq $31,256($17) + xor $28,$1,$1 + ldq $31,256($18) + xor $2,$3,$3 # 9 cycles from $3 load + + ldq $31,256($19) + xor $3,$4,$4 # 9 cycles from $4 load + ldq $31,256($20) + xor $5,$6,$6 # 8 cycles from $6 load + + stq $1,40($17) + xor $4,$6,$6 + xor $7,$22,$22 # 7 cycles from $22 load + xor $23,$24,$24 # 6 cycles from $24 load + + stq $6,48($17) + xor $22,$24,$24 + ldq $31,256($21) + xor $24,$25,$25 # 8 cycles from $25 load + + stq $25,56($17) + subq $16,1,$16 + addq $21,64,$21 + addq $20,64,$20 + + addq $19,64,$19 + addq $18,64,$18 + addq $17,64,$17 + bgt $16,5b + + ret + .end xor_alpha_prefetch_5 +"); + +static struct xor_block_template xor_block_alpha = { + name: "alpha", + do_2: xor_alpha_2, + do_3: xor_alpha_3, + do_4: xor_alpha_4, + do_5: xor_alpha_5, +}; + +static struct xor_block_template xor_block_alpha_prefetch = { + name: "alpha prefetch", + do_2: xor_alpha_prefetch_2, + do_3: xor_alpha_prefetch_3, + do_4: xor_alpha_prefetch_4, + do_5: xor_alpha_prefetch_5, +}; + +/* For grins, also test the generic routines. */ +#include <asm-generic/xor.h> + +#undef XOR_TRY_TEMPLATES +#define XOR_TRY_TEMPLATES \ + do { \ + xor_speed(&xor_block_8regs); \ + xor_speed(&xor_block_32regs); \ + xor_speed(&xor_block_alpha); \ + xor_speed(&xor_block_alpha_prefetch); \ + } while (0) + +/* Force the use of alpha_prefetch if EV6, as it is significantly + faster in the cold cache case. */ +#define XOR_SELECT_TEMPLATE(FASTEST) \ + (implver() == IMPLVER_EV6 ? &xor_block_alpha_prefetch : FASTEST) diff --git a/include/asm-arm/module.h b/include/asm-arm/module.h new file mode 100644 index 000000000..3199b3bc5 --- /dev/null +++ b/include/asm-arm/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_ARM_MODULE_H +#define _ASM_ARM_MODULE_H +/* + * This file contains the arm architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_ARM_MODULE_H */ diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 09c7421cc..008fdde99 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -176,9 +176,6 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define swp_entry_to_pte(swp) ((pte_t) { (swp).val }) -#define module_map vmalloc -#define module_unmap vfree - /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ /* FIXME: this is not correct */ #define kern_addr_valid(addr) (1) diff --git a/include/asm-arm/xor.h b/include/asm-arm/xor.h new file mode 100644 index 000000000..c82eb12a5 --- /dev/null +++ b/include/asm-arm/xor.h @@ -0,0 +1 @@ +#include <asm-generic/xor.h> diff --git a/include/asm-generic/xor.h b/include/asm-generic/xor.h new file mode 100644 index 000000000..ebda0f96c --- /dev/null +++ b/include/asm-generic/xor.h @@ -0,0 +1,322 @@ +/* + * include/asm-generic/xor.h + * + * Generic optimized RAID-5 checksumming functions. + * + * 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, or (at your option) + * any later version. + * + * You should have received a copy of the GNU General Public License + * (for example /usr/src/linux/COPYING); if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +static void +xor_8regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) +{ + long lines = bytes / (sizeof (long)) / 8; + + do { + p1[0] ^= p2[0]; + p1[1] ^= p2[1]; + p1[2] ^= p2[2]; + p1[3] ^= p2[3]; + p1[4] ^= p2[4]; + p1[5] ^= p2[5]; + p1[6] ^= p2[6]; + p1[7] ^= p2[7]; + p1 += 8; + p2 += 8; + } while (--lines > 0); +} + +static void +xor_8regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3) +{ + long lines = bytes / (sizeof (long)) / 8; + + do { + p1[0] ^= p2[0] ^ p3[0]; + p1[1] ^= p2[1] ^ p3[1]; + p1[2] ^= p2[2] ^ p3[2]; + p1[3] ^= p2[3] ^ p3[3]; + p1[4] ^= p2[4] ^ p3[4]; + p1[5] ^= p2[5] ^ p3[5]; + p1[6] ^= p2[6] ^ p3[6]; + p1[7] ^= p2[7] ^ p3[7]; + p1 += 8; + p2 += 8; + p3 += 8; + } while (--lines > 0); +} + +static void +xor_8regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4) +{ + long lines = bytes / (sizeof (long)) / 8; + + do { + p1[0] ^= p2[0] ^ p3[0] ^ p4[0]; + p1[1] ^= p2[1] ^ p3[1] ^ p4[1]; + p1[2] ^= p2[2] ^ p3[2] ^ p4[2]; + p1[3] ^= p2[3] ^ p3[3] ^ p4[3]; + p1[4] ^= p2[4] ^ p3[4] ^ p4[4]; + p1[5] ^= p2[5] ^ p3[5] ^ p4[5]; + p1[6] ^= p2[6] ^ p3[6] ^ p4[6]; + p1[7] ^= p2[7] ^ p3[7] ^ p4[7]; + p1 += 8; + p2 += 8; + p3 += 8; + p4 += 8; + } while (--lines > 0); +} + +static void +xor_8regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4, unsigned long *p5) +{ + long lines = bytes / (sizeof (long)) / 8; + + do { + p1[0] ^= p2[0] ^ p3[0] ^ p4[0] ^ p5[0]; + p1[1] ^= p2[1] ^ p3[1] ^ p4[1] ^ p5[1]; + p1[2] ^= p2[2] ^ p3[2] ^ p4[2] ^ p5[2]; + p1[3] ^= p2[3] ^ p3[3] ^ p4[3] ^ p5[3]; + p1[4] ^= p2[4] ^ p3[4] ^ p4[4] ^ p5[4]; + p1[5] ^= p2[5] ^ p3[5] ^ p4[5] ^ p5[5]; + p1[6] ^= p2[6] ^ p3[6] ^ p4[6] ^ p5[6]; + p1[7] ^= p2[7] ^ p3[7] ^ p4[7] ^ p5[7]; + p1 += 8; + p2 += 8; + p3 += 8; + p4 += 8; + p5 += 8; + } while (--lines > 0); +} + +static void +xor_32regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) +{ + long lines = bytes / (sizeof (long)) / 8; + + do { + register long d0, d1, d2, d3, d4, d5, d6, d7; + d0 = p1[0]; /* Pull the stuff into registers */ + d1 = p1[1]; /* ... in bursts, if possible. */ + d2 = p1[2]; + d3 = p1[3]; + d4 = p1[4]; + d5 = p1[5]; + d6 = p1[6]; + d7 = p1[7]; + d0 ^= p2[0]; + d1 ^= p2[1]; + d2 ^= p2[2]; + d3 ^= p2[3]; + d4 ^= p2[4]; + d5 ^= p2[5]; + d6 ^= p2[6]; + d7 ^= p2[7]; + p1[0] = d0; /* Store the result (in burts) */ + p1[1] = d1; + p1[2] = d2; + p1[3] = d3; + p1[4] = d4; + p1[5] = d5; + p1[6] = d6; + p1[7] = d7; + p1 += 8; + p2 += 8; + } while (--lines > 0); +} + +static void +xor_32regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3) +{ + long lines = bytes / (sizeof (long)) / 8; + + do { + register long d0, d1, d2, d3, d4, d5, d6, d7; + d0 = p1[0]; /* Pull the stuff into registers */ + d1 = p1[1]; /* ... in bursts, if possible. */ + d2 = p1[2]; + d3 = p1[3]; + d4 = p1[4]; + d5 = p1[5]; + d6 = p1[6]; + d7 = p1[7]; + d0 ^= p2[0]; + d1 ^= p2[1]; + d2 ^= p2[2]; + d3 ^= p2[3]; + d4 ^= p2[4]; + d5 ^= p2[5]; + d6 ^= p2[6]; + d7 ^= p2[7]; + d0 ^= p3[0]; + d1 ^= p3[1]; + d2 ^= p3[2]; + d3 ^= p3[3]; + d4 ^= p3[4]; + d5 ^= p3[5]; + d6 ^= p3[6]; + d7 ^= p3[7]; + p1[0] = d0; /* Store the result (in burts) */ + p1[1] = d1; + p1[2] = d2; + p1[3] = d3; + p1[4] = d4; + p1[5] = d5; + p1[6] = d6; + p1[7] = d7; + p1 += 8; + p2 += 8; + p3 += 8; + } while (--lines > 0); +} + +static void +xor_32regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4) +{ + long lines = bytes / (sizeof (long)) / 8; + + do { + register long d0, d1, d2, d3, d4, d5, d6, d7; + d0 = p1[0]; /* Pull the stuff into registers */ + d1 = p1[1]; /* ... in bursts, if possible. */ + d2 = p1[2]; + d3 = p1[3]; + d4 = p1[4]; + d5 = p1[5]; + d6 = p1[6]; + d7 = p1[7]; + d0 ^= p2[0]; + d1 ^= p2[1]; + d2 ^= p2[2]; + d3 ^= p2[3]; + d4 ^= p2[4]; + d5 ^= p2[5]; + d6 ^= p2[6]; + d7 ^= p2[7]; + d0 ^= p3[0]; + d1 ^= p3[1]; + d2 ^= p3[2]; + d3 ^= p3[3]; + d4 ^= p3[4]; + d5 ^= p3[5]; + d6 ^= p3[6]; + d7 ^= p3[7]; + d0 ^= p4[0]; + d1 ^= p4[1]; + d2 ^= p4[2]; + d3 ^= p4[3]; + d4 ^= p4[4]; + d5 ^= p4[5]; + d6 ^= p4[6]; + d7 ^= p4[7]; + p1[0] = d0; /* Store the result (in burts) */ + p1[1] = d1; + p1[2] = d2; + p1[3] = d3; + p1[4] = d4; + p1[5] = d5; + p1[6] = d6; + p1[7] = d7; + p1 += 8; + p2 += 8; + p3 += 8; + p4 += 8; + } while (--lines > 0); +} + +static void +xor_32regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4, unsigned long *p5) +{ + long lines = bytes / (sizeof (long)) / 8; + + do { + register long d0, d1, d2, d3, d4, d5, d6, d7; + d0 = p1[0]; /* Pull the stuff into registers */ + d1 = p1[1]; /* ... in bursts, if possible. */ + d2 = p1[2]; + d3 = p1[3]; + d4 = p1[4]; + d5 = p1[5]; + d6 = p1[6]; + d7 = p1[7]; + d0 ^= p2[0]; + d1 ^= p2[1]; + d2 ^= p2[2]; + d3 ^= p2[3]; + d4 ^= p2[4]; + d5 ^= p2[5]; + d6 ^= p2[6]; + d7 ^= p2[7]; + d0 ^= p3[0]; + d1 ^= p3[1]; + d2 ^= p3[2]; + d3 ^= p3[3]; + d4 ^= p3[4]; + d5 ^= p3[5]; + d6 ^= p3[6]; + d7 ^= p3[7]; + d0 ^= p4[0]; + d1 ^= p4[1]; + d2 ^= p4[2]; + d3 ^= p4[3]; + d4 ^= p4[4]; + d5 ^= p4[5]; + d6 ^= p4[6]; + d7 ^= p4[7]; + d0 ^= p5[0]; + d1 ^= p5[1]; + d2 ^= p5[2]; + d3 ^= p5[3]; + d4 ^= p5[4]; + d5 ^= p5[5]; + d6 ^= p5[6]; + d7 ^= p5[7]; + p1[0] = d0; /* Store the result (in burts) */ + p1[1] = d1; + p1[2] = d2; + p1[3] = d3; + p1[4] = d4; + p1[5] = d5; + p1[6] = d6; + p1[7] = d7; + p1 += 8; + p2 += 8; + p3 += 8; + p4 += 8; + p5 += 8; + } while (--lines > 0); +} + +static struct xor_block_template xor_block_8regs = { + name: "8regs", + do_2: xor_8regs_2, + do_3: xor_8regs_3, + do_4: xor_8regs_4, + do_5: xor_8regs_5, +}; + +static struct xor_block_template xor_block_32regs = { + name: "32regs", + do_2: xor_32regs_2, + do_3: xor_32regs_3, + do_4: xor_32regs_4, + do_5: xor_32regs_5, +}; + +#define XOR_TRY_TEMPLATES \ + do { \ + xor_speed(&xor_block_8regs); \ + xor_speed(&xor_block_32regs); \ + } while (0) diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index 4b95d09cd..4e77e5d8a 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h @@ -147,200 +147,6 @@ static void __init check_popad(void) } /* - * B step AMD K6 before B 9730xxxx have hardware bugs that can cause - * misexecution of code under Linux. Owners of such processors should - * contact AMD for precise details and a CPU swap. - * - * See http://www.mygale.com/~poulot/k6bug.html - * http://www.amd.com/K6/k6docs/revgd.html - * - * The following test is erm.. interesting. AMD neglected to up - * the chip setting when fixing the bug but they also tweaked some - * performance at the same time.. - */ - -extern void vide(void); -__asm__(".align 4\nvide: ret"); - -static void __init check_amd_k6(void) -{ - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && - boot_cpu_data.x86 == 5 && - boot_cpu_data.x86_model == 6 && - boot_cpu_data.x86_mask == 1) - { - int n; - void (*f_vide)(void); - unsigned long d, d2; - - printk(KERN_INFO "AMD K6 stepping B detected - "); - -#define K6_BUG_LOOP 1000000 - - /* - * It looks like AMD fixed the 2.6.2 bug and improved indirect - * calls at the same time. - */ - - n = K6_BUG_LOOP; - f_vide = vide; - rdtscl(d); - while (n--) - f_vide(); - rdtscl(d2); - d = d2-d; - - /* Knock these two lines out if it debugs out ok */ - printk(KERN_INFO "K6 BUG %ld %d (Report these if test report is incorrect)\n", d, 20*K6_BUG_LOOP); - printk(KERN_INFO "AMD K6 stepping B detected - "); - /* -- cut here -- */ - if (d > 20*K6_BUG_LOOP) - printk("system stability may be impaired when more than 32 MB are used.\n"); - else - printk("probably OK (after B9730xxxx).\n"); - printk(KERN_INFO "Please see http://www.mygale.com/~poulot/k6bug.html\n"); - } -} - -/* - * All current models of Pentium and Pentium with MMX technology CPUs - * have the F0 0F bug, which lets nonpriviledged users lock up the system: - */ - -#ifndef CONFIG_M686 -extern void trap_init_f00f_bug(void); - -static void __init check_pentium_f00f(void) -{ - /* - * Pentium and Pentium MMX - */ - boot_cpu_data.f00f_bug = 0; - if (boot_cpu_data.x86 == 5 && boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { - printk(KERN_INFO "Intel Pentium with F0 0F bug - workaround enabled.\n"); - boot_cpu_data.f00f_bug = 1; - trap_init_f00f_bug(); - } -} -#endif - -/* - * Perform the Cyrix 5/2 test. A Cyrix won't change - * the flags, while other 486 chips will. - */ - -static inline int test_cyrix_52div(void) -{ - unsigned int test; - - __asm__ __volatile__( - "sahf\n\t" /* clear flags (%eax = 0x0005) */ - "div %b2\n\t" /* divide 5 by 2 */ - "lahf" /* store flags into %ah */ - : "=a" (test) - : "0" (5), "q" (2) - : "cc"); - - /* AH is 0x02 on Cyrix after the divide.. */ - return (unsigned char) (test >> 8) == 0x02; -} - -/* - * Fix cpuid problems with Cyrix CPU's: - * -- on the Cx686(L) the cpuid is disabled on power up. - * -- braindamaged BIOS disable cpuid on the Cx686MX. - */ - -extern unsigned char Cx86_dir0_msb; /* exported HACK from cyrix_model() */ - -static void __init check_cx686_cpuid(void) -{ - if (boot_cpu_data.cpuid_level == -1 && - ((Cx86_dir0_msb == 5) || (Cx86_dir0_msb == 3))) { - int eax, dummy; - unsigned char ccr3, ccr4; - __u32 old_cap; - - cli(); - ccr3 = getCx86(CX86_CCR3); - setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ - ccr4 = getCx86(CX86_CCR4); - setCx86(CX86_CCR4, ccr4 | 0x80); /* enable cpuid */ - setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ - sti(); - - /* we have up to level 1 available on the Cx6x86(L|MX) */ - boot_cpu_data.cpuid_level = 1; - /* Need to preserve some externally computed capabilities */ - old_cap = boot_cpu_data.x86_capability & X86_FEATURE_MTRR; - cpuid(1, &eax, &dummy, &dummy, - &boot_cpu_data.x86_capability); - boot_cpu_data.x86_capability |= old_cap; - - boot_cpu_data.x86 = (eax >> 8) & 15; - /* - * we already have a cooked step/rev number from DIR1 - * so we don't use the cpuid-provided ones. - */ - } -} - -/* - * Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old - * BIOSes for compatability with DOS games. This makes the udelay loop - * work correctly, and improves performance. - */ - -extern void calibrate_delay(void) __init; - -static void __init check_cx686_slop(void) -{ - if (Cx86_dir0_msb == 3) { - unsigned char ccr3, ccr5; - - cli(); - ccr3 = getCx86(CX86_CCR3); - setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ - ccr5 = getCx86(CX86_CCR5); - if (ccr5 & 2) - setCx86(CX86_CCR5, ccr5 & 0xfd); /* reset SLOP */ - setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ - sti(); - - if (ccr5 & 2) { /* possible wrong calibration done */ - printk(KERN_INFO "Recalibrating delay loop with SLOP bit reset\n"); - calibrate_delay(); - boot_cpu_data.loops_per_sec = loops_per_sec; - } - } -} - -/* - * Cyrix CPUs without cpuid or with cpuid not yet enabled can be detected - * by the fact that they preserve the flags across the division of 5/2. - * PII and PPro exhibit this behavior too, but they have cpuid available. - */ - -static void __init check_cyrix_cpu(void) -{ - if ((boot_cpu_data.cpuid_level == -1) && (boot_cpu_data.x86 == 4) - && test_cyrix_52div()) { - - strcpy(boot_cpu_data.x86_vendor_id, "CyrixInstead"); - } -} - -/* - * In setup.c's cyrix_model() we have set the boot_cpu_data.coma_bug - * on certain processors that we know contain this bug and now we - * enable the workaround for it. - */ - -static void __init check_cyrix_coma(void) -{ -} - -/* * Check whether we are able to run this kernel safely on SMP. * * - In order to run on a i386, we need to be compiled for i386 @@ -391,7 +197,7 @@ static void __init check_config(void) */ #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_GOOD_APIC) if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL - && boot_cpu_data.x86_capability & X86_FEATURE_APIC + && test_bit(X86_FEATURE_APIC, &boot_cpu_data.x86_capability) && boot_cpu_data.x86 == 5 && boot_cpu_data.x86_model == 2 && (boot_cpu_data.x86_mask < 6 || boot_cpu_data.x86_mask == 11)) @@ -409,10 +215,7 @@ static void __init check_config(void) static void __init check_bugs(void) { - check_cyrix_cpu(); identify_cpu(&boot_cpu_data); - check_cx686_cpuid(); - check_cx686_slop(); #ifndef CONFIG_SMP printk("CPU: "); print_cpu_info(&boot_cpu_data); @@ -421,10 +224,5 @@ static void __init check_bugs(void) check_fpu(); check_hlt(); check_popad(); - check_amd_k6(); -#ifndef CONFIG_M686 - check_pentium_f00f(); -#endif - check_cyrix_coma(); system_utsname.machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); } diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h new file mode 100644 index 000000000..598edbdaf --- /dev/null +++ b/include/asm-i386/cpufeature.h @@ -0,0 +1,73 @@ +/* + * cpufeature.h + * + * Defines x86 CPU feature bits + */ + +#ifndef __ASM_I386_CPUFEATURE_H +#define __ASM_I386_CPUFEATURE_H + +/* Sample usage: CPU_FEATURE_P(cpu.x86_capability, FPU) */ +#define CPU_FEATURE_P(CAP, FEATURE) test_bit(CAP, X86_FEATURE_##FEATURE ##_BIT) + +#define NCAPINTS 4 /* Currently we have 4 32-bit words worth of info */ + +/* Intel-defined CPU features, CPUID level 0x00000001, word 0 */ +#define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */ +#define X86_FEATURE_VME (0*32+ 1) /* Virtual Mode Extensions */ +#define X86_FEATURE_DE (0*32+ 2) /* Debugging Extensions */ +#define X86_FEATURE_PSE (0*32+ 3) /* Page Size Extensions */ +#define X86_FEATURE_TSC (0*32+ 4) /* Time Stamp Counter */ +#define X86_FEATURE_MSR (0*32+ 5) /* Model-Specific Registers, RDMSR, WRMSR */ +#define X86_FEATURE_PAE (0*32+ 6) /* Physical Address Extensions */ +#define X86_FEATURE_MCE (0*32+ 7) /* Machine Check Architecture */ +#define X86_FEATURE_CX8 (0*32+ 8) /* CMPXCHG8 instruction */ +#define X86_FEATURE_APIC (0*32+ 9) /* Onboard APIC */ +#define X86_FEATURE_SEP (0*32+11) /* SYSENTER/SYSEXIT */ +#define X86_FEATURE_MTRR (0*32+12) /* Memory Type Range Registers */ +#define X86_FEATURE_PGE (0*32+13) /* Page Global Enable */ +#define X86_FEATURE_MCA (0*32+14) /* Machine Check Architecture */ +#define X86_FEATURE_CMOV (0*32+15) /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */ +#define X86_FEATURE_PAT (0*32+16) /* Page Attribute Table */ +#define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */ +#define X86_FEATURE_PN (0*32+18) /* Processor serial number */ +#define X86_FEATURE_CLFLSH (0*32+19) /* Supports the CLFLUSH instruction */ +#define X86_FEATURE_DTES (0*32+21) /* Debug Trace Store */ +#define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */ +#define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */ +#define X86_FEATURE_FXSR (0*32+24) /* FXSAVE and FXRSTOR instructions (fast save and restore */ + /* of FPU context), and CR4.OSFXSR available */ +#define X86_FEATURE_XMM (0*32+25) /* Streaming SIMD Extensions */ +#define X86_FEATURE_XMM2 (0*32+26) /* Streaming SIMD Extensions-2 */ +#define X86_FEATURE_SELFSNOOP (0*32+27) /* CPU self snoop */ +#define X86_FEATURE_ACC (0*32+29) /* Automatic clock control */ +#define X86_FEATURE_IA64 (0*32+30) /* IA-64 processor */ + +/* AMD-defined CPU features, CPUID level 0x80000001, word 1 */ +/* Don't duplicate feature flags which are redundant with Intel! */ +#define X86_FEATURE_SYSCALL (1*32+11) /* SYSCALL/SYSRET */ +#define X86_FEATURE_MMXEXT (1*32+22) /* AMD MMX extensions */ +#define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */ +#define X86_FEATURE_3DNOWEXT (1*32+30) /* AMD 3DNow! extensions */ +#define X86_FEATURE_3DNOW (1*32+31) /* 3DNow! */ + +/* Transmeta-defined CPU features, CPUID level 0x80860001, word 2 */ +#define X86_FEATURE_RECOVERY (2*32+ 0) /* CPU in recovery mode */ +#define X86_FEATURE_LONGRUN (2*32+ 1) /* Longrun power control */ +#define X86_FEATURE_LRTI (2*32+ 3) /* LongRun table interface */ + +/* Other features, Linux-defined mapping, word 3 */ +/* This range is used for feature bits which conflict or are synthesized */ +#define X86_FEATURE_CXMMX (3*32+ 0) /* Cyrix MMX extensions */ +#define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */ +#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ +#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ + +#endif /* __ASM_I386_CPUFEATURE_H */ + +/* + * Local Variables: + * mode:c + * comment-column:42 + * End: + */ diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index 55ffacff1..c8d826232 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h @@ -8,6 +8,8 @@ #include <asm/ptrace.h> #include <asm/user.h> +#include <linux/utsname.h> + typedef unsigned long elf_greg_t; #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) @@ -84,7 +86,7 @@ typedef struct user_fxsr_struct elf_fpxregset_t; instruction set this CPU supports. This could be done in user space, but it's not easy, and we've already done it here. */ -#define ELF_HWCAP (boot_cpu_data.x86_capability) +#define ELF_HWCAP (boot_cpu_data.x86_capability[0]) /* This yields a string that ld.so will use to load implementation specific libraries for optimization. This is more specific in @@ -93,7 +95,7 @@ typedef struct user_fxsr_struct elf_fpxregset_t; For the moment, we have only optimizations for the Intel generations, but that could change... */ -#define ELF_PLATFORM ("i386\0i486\0i586\0i686"+(((boot_cpu_data.x86>6?6:boot_cpu_data.x86)-3)*5)) +#define ELF_PLATFORM (system_utsname.machine) #ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) diff --git a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h index 8370b7eb6..dfff7fad0 100644 --- a/include/asm-i386/highmem.h +++ b/include/asm-i386/highmem.h @@ -53,19 +53,19 @@ extern void kmap_init(void) __init; #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) -extern unsigned long FASTCALL(kmap_high(struct page *page)); +extern void * FASTCALL(kmap_high(struct page *page)); extern void FASTCALL(kunmap_high(struct page *page)); -extern inline unsigned long kmap(struct page *page) +static inline void *kmap(struct page *page) { if (in_interrupt()) BUG(); if (page < highmem_start_page) - return (unsigned long) page_address(page); + return page_address(page); return kmap_high(page); } -extern inline void kunmap(struct page *page) +static inline void kunmap(struct page *page) { if (in_interrupt()) BUG(); @@ -80,13 +80,13 @@ extern inline void kunmap(struct page *page) * be used in IRQ contexts, so in some (very limited) cases we need * it. */ -extern inline unsigned long kmap_atomic(struct page *page, enum km_type type) +static inline void *kmap_atomic(struct page *page, enum km_type type) { enum fixed_addresses idx; unsigned long vaddr; if (page < highmem_start_page) - return (unsigned long) page_address(page); + return page_address(page); idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); @@ -97,12 +97,13 @@ extern inline unsigned long kmap_atomic(struct page *page, enum km_type type) set_pte(kmap_pte-idx, mk_pte(page, kmap_prot)); __flush_tlb_one(vaddr); - return vaddr; + return (void*) vaddr; } -extern inline void kunmap_atomic(unsigned long vaddr, enum km_type type) +static inline void kunmap_atomic(void *kvaddr, enum km_type type) { #if HIGHMEM_DEBUG + unsigned long vaddr = (unsigned long) kvaddr; enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); if (vaddr < FIXADDR_START) // FIXME diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h index f8ebabe1b..04ba635e5 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-i386/i387.h @@ -30,6 +30,7 @@ extern void restore_fpu( struct task_struct *tsk ); #define clear_fpu( tsk ) do { \ if ( tsk->flags & PF_USEDFPU ) { \ + asm volatile("fwait"); \ tsk->flags &= ~PF_USEDFPU; \ stts(); \ } \ diff --git a/include/asm-i386/module.h b/include/asm-i386/module.h new file mode 100644 index 000000000..61e2fd50e --- /dev/null +++ b/include/asm-i386/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_I386_MODULE_H +#define _ASM_I386_MODULE_H +/* + * This file contains the i386 architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_I386_MODULE_H */ diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 5460e6ccc..1fc0a0b9a 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -340,9 +340,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) #define pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low }) #define swp_entry_to_pte(x) ((pte_t) { (x).val }) -#define module_map vmalloc -#define module_unmap vfree - #endif /* !__ASSEMBLY__ */ /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 76ac26cae..9e8e8c5ef 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -13,6 +13,7 @@ #include <asm/page.h> #include <asm/types.h> #include <asm/sigcontext.h> +#include <asm/cpufeature.h> #include <linux/config.h> #include <linux/threads.h> @@ -37,8 +38,8 @@ struct cpuinfo_x86 { char hlt_works_ok; /* Problems on some 486Dx4's and old 386's */ char hard_math; char rfu; - int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */ - __u32 x86_capability; + int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */ + __u32 x86_capability[NCAPINTS]; char x86_vendor_id[16]; char x86_model_id[64]; int x86_cache_size; /* in KB - valid for CPUS which support this @@ -67,39 +68,6 @@ struct cpuinfo_x86 { * capabilities of CPUs */ -#define X86_FEATURE_FPU 0x00000001 /* onboard FPU */ -#define X86_FEATURE_VME 0x00000002 /* Virtual Mode Extensions */ -#define X86_FEATURE_DE 0x00000004 /* Debugging Extensions */ -#define X86_FEATURE_PSE 0x00000008 /* Page Size Extensions */ -#define X86_FEATURE_TSC 0x00000010 /* Time Stamp Counter */ -#define X86_FEATURE_MSR 0x00000020 /* Model-Specific Registers, RDMSR, WRMSR */ -#define X86_FEATURE_PAE 0x00000040 /* Physical Address Extensions */ -#define X86_FEATURE_MCE 0x00000080 /* Machine Check Exceptions */ -#define X86_FEATURE_CX8 0x00000100 /* CMPXCHG8 instruction */ -#define X86_FEATURE_APIC 0x00000200 /* onboard APIC */ -#define X86_FEATURE_10 0x00000400 -#define X86_FEATURE_SEP 0x00000800 /* Fast System Call */ -#define X86_FEATURE_MTRR 0x00001000 /* Memory Type Range Registers */ -#define X86_FEATURE_PGE 0x00002000 /* Page Global Enable */ -#define X86_FEATURE_MCA 0x00004000 /* Machine Check Architecture */ -#define X86_FEATURE_CMOV 0x00008000 /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */ -#define X86_FEATURE_PAT 0x00010000 /* Page Attribute Table */ -#define X86_FEATURE_PSE36 0x00020000 /* 36-bit PSEs */ -#define X86_FEATURE_PN 0x00040000 -#define X86_FEATURE_19 0x00080000 -#define X86_FEATURE_20 0x00100000 -#define X86_FEATURE_21 0x00200000 -#define X86_FEATURE_22 0x00400000 -#define X86_FEATURE_MMX 0x00800000 /* Multimedia Extensions */ -#define X86_FEATURE_FXSR 0x01000000 /* FXSAVE and FXRSTOR instructions (fast save and restore of FPU context), and CR4.OSFXSR (OS uses these instructions) available */ -#define X86_FEATURE_XMM 0x02000000 /* Streaming SIMD Extensions */ -#define X86_FEATURE_26 0x04000000 -#define X86_FEATURE_27 0x08000000 -#define X86_FEATURE_28 0x10000000 -#define X86_FEATURE_29 0x20000000 -#define X86_FEATURE_30 0x40000000 -#define X86_FEATURE_AMD3D 0x80000000 - extern struct cpuinfo_x86 boot_cpu_data; extern struct tss_struct init_tss[NR_CPUS]; @@ -111,22 +79,15 @@ extern struct cpuinfo_x86 cpu_data[]; #define current_cpu_data boot_cpu_data #endif -#define cpu_has_pge \ - (boot_cpu_data.x86_capability & X86_FEATURE_PGE) -#define cpu_has_pse \ - (boot_cpu_data.x86_capability & X86_FEATURE_PSE) -#define cpu_has_pae \ - (boot_cpu_data.x86_capability & X86_FEATURE_PAE) -#define cpu_has_tsc \ - (boot_cpu_data.x86_capability & X86_FEATURE_TSC) -#define cpu_has_de \ - (boot_cpu_data.x86_capability & X86_FEATURE_DE) -#define cpu_has_vme \ - (boot_cpu_data.x86_capability & X86_FEATURE_VME) -#define cpu_has_fxsr \ - (boot_cpu_data.x86_capability & X86_FEATURE_FXSR) -#define cpu_has_xmm \ - (boot_cpu_data.x86_capability & X86_FEATURE_XMM) +#define cpu_has_pge (test_bit(X86_FEATURE_PGE, boot_cpu_data.x86_capability)) +#define cpu_has_pse (test_bit(X86_FEATURE_PSE, boot_cpu_data.x86_capability)) +#define cpu_has_pae (test_bit(X86_FEATURE_PAE, boot_cpu_data.x86_capability)) +#define cpu_has_tsc (test_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability)) +#define cpu_has_de (test_bit(X86_FEATURE_DE, boot_cpu_data.x86_capability)) +#define cpu_has_vme (test_bit(X86_FEATURE_VME, boot_cpu_data.x86_capability)) +#define cpu_has_fxsr (test_bit(X86_FEATURE_FXSR, boot_cpu_data.x86_capability)) +#define cpu_has_xmm (test_bit(X86_FEATURE_XMM, boot_cpu_data.x86_capability)) +#define cpu_has_fpu (test_bit(X86_FEATURE_FPU, boot_cpu_data.x86_capability)) extern char ignore_irq13; @@ -135,7 +96,28 @@ extern void print_cpu_info(struct cpuinfo_x86 *); extern void dodgy_tsc(void); /* - * Generic CPUID function + * EFLAGS bits + */ +#define X86_EFLAGS_CF 0x00000001 /* Carry Flag */ +#define X86_EFLAGS_PF 0x00000004 /* Parity Flag */ +#define X86_EFLAGS_AF 0x00000010 /* Auxillary carry Flag */ +#define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */ +#define X86_EFLAGS_SF 0x00000080 /* Sign Flag */ +#define X86_EFLAGS_TF 0x00000100 /* Trap Flag */ +#define X86_EFLAGS_IF 0x00000200 /* Interrupt Flag */ +#define X86_EFLAGS_DF 0x00000400 /* Direction Flag */ +#define X86_EFLAGS_OF 0x00000800 /* Overflow Flag */ +#define X86_EFLAGS_IOPL 0x00003000 /* IOPL mask */ +#define X86_EFLAGS_NT 0x00004000 /* Nested Task */ +#define X86_EFLAGS_RF 0x00010000 /* Resume Flag */ +#define X86_EFLAGS_VM 0x00020000 /* Virtual Mode */ +#define X86_EFLAGS_AC 0x00040000 /* Alignment Check */ +#define X86_EFLAGS_VIF 0x00080000 /* Virtual Interrupt Flag */ +#define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */ +#define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */ + +/* + * Generic CPUID function */ extern inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) { @@ -147,6 +129,45 @@ extern inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) : "a" (op)); } +/* + * CPUID functions returning a single datum + */ +extern inline unsigned int cpuid_eax(unsigned int op) +{ + unsigned int eax, ebx, ecx, edx; + + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + return eax; +} +extern inline unsigned int cpuid_ebx(unsigned int op) +{ + unsigned int eax, ebx, ecx, edx; + + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + return ebx; +} +extern inline unsigned int cpuid_ecx(unsigned int op) +{ + unsigned int eax, ebx, ecx, edx; + + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + return ecx; +} +extern inline unsigned int cpuid_edx(unsigned int op) +{ + unsigned int eax, ebx, ecx, edx; + + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + return edx; +} /* * Intel CPU features in CR4 @@ -220,7 +241,11 @@ static inline void clear_in_cr4 (unsigned long mask) /* * Bus types (default is ISA, but people can check others with these..) */ +#ifdef CONFIG_EISA extern int EISA_bus; +#else +#define EISA_bus (0) +#endif extern int MCA_bus; /* from system description table in BIOS. Mostly for MCA use, but @@ -441,4 +466,10 @@ struct microcode { #define MICROCODE_IOCFREE _IO('6',0) /* because it is for P6 */ +/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ +extern inline void rep_nop(void) +{ + __asm__ __volatile__("rep;nop"); +} + #endif /* __ASM_I386_PROCESSOR_H */ diff --git a/include/asm-i386/xor.h b/include/asm-i386/xor.h new file mode 100644 index 000000000..6a2230b8f --- /dev/null +++ b/include/asm-i386/xor.h @@ -0,0 +1,858 @@ +/* + * include/asm-i386/xor.h + * + * Optimized RAID-5 checksumming functions for MMX and SSE. + * + * 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, or (at your option) + * any later version. + * + * You should have received a copy of the GNU General Public License + * (for example /usr/src/linux/COPYING); if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * High-speed RAID5 checksumming functions utilizing MMX instructions. + * Copyright (C) 1998 Ingo Molnar. + */ + +#define FPU_SAVE \ + do { \ + if (!(current->flags & PF_USEDFPU)) \ + __asm__ __volatile__ (" clts;\n"); \ + __asm__ __volatile__ ("fsave %0; fwait": "=m"(fpu_save[0])); \ + } while (0) + +#define FPU_RESTORE \ + do { \ + __asm__ __volatile__ ("frstor %0": : "m"(fpu_save[0])); \ + if (!(current->flags & PF_USEDFPU)) \ + stts(); \ + } while (0) + +#define LD(x,y) " movq 8*("#x")(%1), %%mm"#y" ;\n" +#define ST(x,y) " movq %%mm"#y", 8*("#x")(%1) ;\n" +#define XO1(x,y) " pxor 8*("#x")(%2), %%mm"#y" ;\n" +#define XO2(x,y) " pxor 8*("#x")(%3), %%mm"#y" ;\n" +#define XO3(x,y) " pxor 8*("#x")(%4), %%mm"#y" ;\n" +#define XO4(x,y) " pxor 8*("#x")(%5), %%mm"#y" ;\n" + + +static void +xor_pII_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) +{ + unsigned long lines = bytes >> 7; + char fpu_save[108]; + + FPU_SAVE; + + __asm__ __volatile__ ( +#undef BLOCK +#define BLOCK(i) \ + LD(i,0) \ + LD(i+1,1) \ + LD(i+2,2) \ + LD(i+3,3) \ + XO1(i,0) \ + ST(i,0) \ + XO1(i+1,1) \ + ST(i+1,1) \ + XO1(i+2,2) \ + ST(i+2,2) \ + XO1(i+3,3) \ + ST(i+3,3) + + " .align 32 ;\n" + " 1: ;\n" + + BLOCK(0) + BLOCK(4) + BLOCK(8) + BLOCK(12) + + " addl $128, %1 ;\n" + " addl $128, %2 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2) + : "memory"); + + FPU_RESTORE; +} + +static void +xor_pII_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3) +{ + unsigned long lines = bytes >> 7; + char fpu_save[108]; + + FPU_SAVE; + + __asm__ __volatile__ ( +#undef BLOCK +#define BLOCK(i) \ + LD(i,0) \ + LD(i+1,1) \ + LD(i+2,2) \ + LD(i+3,3) \ + XO1(i,0) \ + XO1(i+1,1) \ + XO1(i+2,2) \ + XO1(i+3,3) \ + XO2(i,0) \ + ST(i,0) \ + XO2(i+1,1) \ + ST(i+1,1) \ + XO2(i+2,2) \ + ST(i+2,2) \ + XO2(i+3,3) \ + ST(i+3,3) + + " .align 32 ;\n" + " 1: ;\n" + + BLOCK(0) + BLOCK(4) + BLOCK(8) + BLOCK(12) + + " addl $128, %1 ;\n" + " addl $128, %2 ;\n" + " addl $128, %3 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2), "r" (p3) + : "memory"); + + FPU_RESTORE; +} + +static void +xor_pII_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4) +{ + unsigned long lines = bytes >> 7; + char fpu_save[108]; + + FPU_SAVE; + + __asm__ __volatile__ ( +#undef BLOCK +#define BLOCK(i) \ + LD(i,0) \ + LD(i+1,1) \ + LD(i+2,2) \ + LD(i+3,3) \ + XO1(i,0) \ + XO1(i+1,1) \ + XO1(i+2,2) \ + XO1(i+3,3) \ + XO2(i,0) \ + XO2(i+1,1) \ + XO2(i+2,2) \ + XO2(i+3,3) \ + XO3(i,0) \ + ST(i,0) \ + XO3(i+1,1) \ + ST(i+1,1) \ + XO3(i+2,2) \ + ST(i+2,2) \ + XO3(i+3,3) \ + ST(i+3,3) + + " .align 32 ;\n" + " 1: ;\n" + + BLOCK(0) + BLOCK(4) + BLOCK(8) + BLOCK(12) + + " addl $128, %1 ;\n" + " addl $128, %2 ;\n" + " addl $128, %3 ;\n" + " addl $128, %4 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2), "r" (p3), "r" (p4) + : "memory"); + + FPU_RESTORE; +} + +static void +xor_pII_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4, unsigned long *p5) +{ + unsigned long lines = bytes >> 7; + char fpu_save[108]; + + FPU_SAVE; + + __asm__ __volatile__ ( +#undef BLOCK +#define BLOCK(i) \ + LD(i,0) \ + LD(i+1,1) \ + LD(i+2,2) \ + LD(i+3,3) \ + XO1(i,0) \ + XO1(i+1,1) \ + XO1(i+2,2) \ + XO1(i+3,3) \ + XO2(i,0) \ + XO2(i+1,1) \ + XO2(i+2,2) \ + XO2(i+3,3) \ + XO3(i,0) \ + XO3(i+1,1) \ + XO3(i+2,2) \ + XO3(i+3,3) \ + XO4(i,0) \ + ST(i,0) \ + XO4(i+1,1) \ + ST(i+1,1) \ + XO4(i+2,2) \ + ST(i+2,2) \ + XO4(i+3,3) \ + ST(i+3,3) + + " .align 32 ;\n" + " 1: ;\n" + + BLOCK(0) + BLOCK(4) + BLOCK(8) + BLOCK(12) + + " addl $128, %1 ;\n" + " addl $128, %2 ;\n" + " addl $128, %3 ;\n" + " addl $128, %4 ;\n" + " addl $128, %5 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "g" (lines), + "r" (p1), "r" (p2), "r" (p3), "r" (p4), "r" (p5) + : "memory"); + + FPU_RESTORE; +} + +#undef LD +#undef XO1 +#undef XO2 +#undef XO3 +#undef XO4 +#undef ST +#undef BLOCK + +static void +xor_p5_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) +{ + unsigned long lines = bytes >> 6; + char fpu_save[108]; + + FPU_SAVE; + + __asm__ __volatile__ ( + " .align 32 ;\n" + " 1: ;\n" + " movq (%1), %%mm0 ;\n" + " movq 8(%1), %%mm1 ;\n" + " pxor (%2), %%mm0 ;\n" + " movq 16(%1), %%mm2 ;\n" + " movq %%mm0, (%1) ;\n" + " pxor 8(%2), %%mm1 ;\n" + " movq 24(%1), %%mm3 ;\n" + " movq %%mm1, 8(%1) ;\n" + " pxor 16(%2), %%mm2 ;\n" + " movq 32(%1), %%mm4 ;\n" + " movq %%mm2, 16(%1) ;\n" + " pxor 24(%2), %%mm3 ;\n" + " movq 40(%1), %%mm5 ;\n" + " movq %%mm3, 24(%1) ;\n" + " pxor 32(%2), %%mm4 ;\n" + " movq 48(%1), %%mm6 ;\n" + " movq %%mm4, 32(%1) ;\n" + " pxor 40(%2), %%mm5 ;\n" + " movq 56(%1), %%mm7 ;\n" + " movq %%mm5, 40(%1) ;\n" + " pxor 48(%2), %%mm6 ;\n" + " pxor 56(%2), %%mm7 ;\n" + " movq %%mm6, 48(%1) ;\n" + " movq %%mm7, 56(%1) ;\n" + + " addl $64, %1 ;\n" + " addl $64, %2 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2) + : "memory"); + + FPU_RESTORE; +} + +static void +xor_p5_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3) +{ + unsigned long lines = bytes >> 6; + char fpu_save[108]; + + FPU_SAVE; + + __asm__ __volatile__ ( + " .align 32,0x90 ;\n" + " 1: ;\n" + " movq (%1), %%mm0 ;\n" + " movq 8(%1), %%mm1 ;\n" + " pxor (%2), %%mm0 ;\n" + " movq 16(%1), %%mm2 ;\n" + " pxor 8(%2), %%mm1 ;\n" + " pxor (%3), %%mm0 ;\n" + " pxor 16(%2), %%mm2 ;\n" + " movq %%mm0, (%1) ;\n" + " pxor 8(%3), %%mm1 ;\n" + " pxor 16(%3), %%mm2 ;\n" + " movq 24(%1), %%mm3 ;\n" + " movq %%mm1, 8(%1) ;\n" + " movq 32(%1), %%mm4 ;\n" + " movq 40(%1), %%mm5 ;\n" + " pxor 24(%2), %%mm3 ;\n" + " movq %%mm2, 16(%1) ;\n" + " pxor 32(%2), %%mm4 ;\n" + " pxor 24(%3), %%mm3 ;\n" + " pxor 40(%2), %%mm5 ;\n" + " movq %%mm3, 24(%1) ;\n" + " pxor 32(%3), %%mm4 ;\n" + " pxor 40(%3), %%mm5 ;\n" + " movq 48(%1), %%mm6 ;\n" + " movq %%mm4, 32(%1) ;\n" + " movq 56(%1), %%mm7 ;\n" + " pxor 48(%2), %%mm6 ;\n" + " movq %%mm5, 40(%1) ;\n" + " pxor 56(%2), %%mm7 ;\n" + " pxor 48(%3), %%mm6 ;\n" + " pxor 56(%3), %%mm7 ;\n" + " movq %%mm6, 48(%1) ;\n" + " movq %%mm7, 56(%1) ;\n" + + " addl $64, %1 ;\n" + " addl $64, %2 ;\n" + " addl $64, %3 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2), "r" (p3) + : "memory" ); + + FPU_RESTORE; +} + +static void +xor_p5_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4) +{ + unsigned long lines = bytes >> 6; + char fpu_save[108]; + + FPU_SAVE; + + __asm__ __volatile__ ( + " .align 32,0x90 ;\n" + " 1: ;\n" + " movq (%1), %%mm0 ;\n" + " movq 8(%1), %%mm1 ;\n" + " pxor (%2), %%mm0 ;\n" + " movq 16(%1), %%mm2 ;\n" + " pxor 8(%2), %%mm1 ;\n" + " pxor (%3), %%mm0 ;\n" + " pxor 16(%2), %%mm2 ;\n" + " pxor 8(%3), %%mm1 ;\n" + " pxor (%4), %%mm0 ;\n" + " movq 24(%1), %%mm3 ;\n" + " pxor 16(%3), %%mm2 ;\n" + " pxor 8(%4), %%mm1 ;\n" + " movq %%mm0, (%1) ;\n" + " movq 32(%1), %%mm4 ;\n" + " pxor 24(%2), %%mm3 ;\n" + " pxor 16(%4), %%mm2 ;\n" + " movq %%mm1, 8(%1) ;\n" + " movq 40(%1), %%mm5 ;\n" + " pxor 32(%2), %%mm4 ;\n" + " pxor 24(%3), %%mm3 ;\n" + " movq %%mm2, 16(%1) ;\n" + " pxor 40(%2), %%mm5 ;\n" + " pxor 32(%3), %%mm4 ;\n" + " pxor 24(%4), %%mm3 ;\n" + " movq %%mm3, 24(%1) ;\n" + " movq 56(%1), %%mm7 ;\n" + " movq 48(%1), %%mm6 ;\n" + " pxor 40(%3), %%mm5 ;\n" + " pxor 32(%4), %%mm4 ;\n" + " pxor 48(%2), %%mm6 ;\n" + " movq %%mm4, 32(%1) ;\n" + " pxor 56(%2), %%mm7 ;\n" + " pxor 40(%4), %%mm5 ;\n" + " pxor 48(%3), %%mm6 ;\n" + " pxor 56(%3), %%mm7 ;\n" + " movq %%mm5, 40(%1) ;\n" + " pxor 48(%4), %%mm6 ;\n" + " pxor 56(%4), %%mm7 ;\n" + " movq %%mm6, 48(%1) ;\n" + " movq %%mm7, 56(%1) ;\n" + + " addl $64, %1 ;\n" + " addl $64, %2 ;\n" + " addl $64, %3 ;\n" + " addl $64, %4 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2), "r" (p3), "r" (p4) + : "memory"); + + FPU_RESTORE; +} + +static void +xor_p5_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4, unsigned long *p5) +{ + unsigned long lines = bytes >> 6; + char fpu_save[108]; + + FPU_SAVE; + + __asm__ __volatile__ ( + " .align 32,0x90 ;\n" + " 1: ;\n" + " movq (%1), %%mm0 ;\n" + " movq 8(%1), %%mm1 ;\n" + " pxor (%2), %%mm0 ;\n" + " pxor 8(%2), %%mm1 ;\n" + " movq 16(%1), %%mm2 ;\n" + " pxor (%3), %%mm0 ;\n" + " pxor 8(%3), %%mm1 ;\n" + " pxor 16(%2), %%mm2 ;\n" + " pxor (%4), %%mm0 ;\n" + " pxor 8(%4), %%mm1 ;\n" + " pxor 16(%3), %%mm2 ;\n" + " movq 24(%1), %%mm3 ;\n" + " pxor (%5), %%mm0 ;\n" + " pxor 8(%5), %%mm1 ;\n" + " movq %%mm0, (%1) ;\n" + " pxor 16(%4), %%mm2 ;\n" + " pxor 24(%2), %%mm3 ;\n" + " movq %%mm1, 8(%1) ;\n" + " pxor 16(%5), %%mm2 ;\n" + " pxor 24(%3), %%mm3 ;\n" + " movq 32(%1), %%mm4 ;\n" + " movq %%mm2, 16(%1) ;\n" + " pxor 24(%4), %%mm3 ;\n" + " pxor 32(%2), %%mm4 ;\n" + " movq 40(%1), %%mm5 ;\n" + " pxor 24(%5), %%mm3 ;\n" + " pxor 32(%3), %%mm4 ;\n" + " pxor 40(%2), %%mm5 ;\n" + " movq %%mm3, 24(%1) ;\n" + " pxor 32(%4), %%mm4 ;\n" + " pxor 40(%3), %%mm5 ;\n" + " movq 48(%1), %%mm6 ;\n" + " movq 56(%1), %%mm7 ;\n" + " pxor 32(%5), %%mm4 ;\n" + " pxor 40(%4), %%mm5 ;\n" + " pxor 48(%2), %%mm6 ;\n" + " pxor 56(%2), %%mm7 ;\n" + " movq %%mm4, 32(%1) ;\n" + " pxor 48(%3), %%mm6 ;\n" + " pxor 56(%3), %%mm7 ;\n" + " pxor 40(%5), %%mm5 ;\n" + " pxor 48(%4), %%mm6 ;\n" + " pxor 56(%4), %%mm7 ;\n" + " movq %%mm5, 40(%1) ;\n" + " pxor 48(%5), %%mm6 ;\n" + " pxor 56(%5), %%mm7 ;\n" + " movq %%mm6, 48(%1) ;\n" + " movq %%mm7, 56(%1) ;\n" + + " addl $64, %1 ;\n" + " addl $64, %2 ;\n" + " addl $64, %3 ;\n" + " addl $64, %4 ;\n" + " addl $64, %5 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "g" (lines), + "r" (p1), "r" (p2), "r" (p3), "r" (p4), "r" (p5) + : "memory"); + + FPU_RESTORE; +} + +static struct xor_block_template xor_block_pII_mmx = { + name: "pII_mmx", + do_2: xor_pII_mmx_2, + do_3: xor_pII_mmx_3, + do_4: xor_pII_mmx_4, + do_5: xor_pII_mmx_5, +}; + +static struct xor_block_template xor_block_p5_mmx = { + name: "p5_mmx", + do_2: xor_p5_mmx_2, + do_3: xor_p5_mmx_3, + do_4: xor_p5_mmx_4, + do_5: xor_p5_mmx_5, +}; + +#undef FPU_SAVE +#undef FPU_RESTORE + +/* + * Cache avoiding checksumming functions utilizing KNI instructions + * Copyright (C) 1999 Zach Brown (with obvious credit due Ingo) + */ + +#define XMMS_SAVE \ + __asm__ __volatile__ ( \ + "movl %%cr0,%0 ;\n\t" \ + "clts ;\n\t" \ + "movups %%xmm0,(%1) ;\n\t" \ + "movups %%xmm1,0x10(%1) ;\n\t" \ + "movups %%xmm2,0x20(%1) ;\n\t" \ + "movups %%xmm3,0x30(%1) ;\n\t" \ + : "=r" (cr0) \ + : "r" (xmm_save) \ + : "memory") + +#define XMMS_RESTORE \ + __asm__ __volatile__ ( \ + "sfence ;\n\t" \ + "movups (%1),%%xmm0 ;\n\t" \ + "movups 0x10(%1),%%xmm1 ;\n\t" \ + "movups 0x20(%1),%%xmm2 ;\n\t" \ + "movups 0x30(%1),%%xmm3 ;\n\t" \ + "movl %0,%%cr0 ;\n\t" \ + : \ + : "r" (cr0), "r" (xmm_save) \ + : "memory") + +#define OFFS(x) "16*("#x")" +#define PF0(x) " prefetcht0 "OFFS(x)"(%1) ;\n" +#define LD(x,y) " movaps "OFFS(x)"(%1), %%xmm"#y" ;\n" +#define ST(x,y) " movaps %%xmm"#y", "OFFS(x)"(%1) ;\n" +#define PF1(x) " prefetchnta "OFFS(x)"(%2) ;\n" +#define PF2(x) " prefetchnta "OFFS(x)"(%3) ;\n" +#define PF3(x) " prefetchnta "OFFS(x)"(%4) ;\n" +#define PF4(x) " prefetchnta "OFFS(x)"(%5) ;\n" +#define PF5(x) " prefetchnta "OFFS(x)"(%6) ;\n" +#define XO1(x,y) " xorps "OFFS(x)"(%2), %%xmm"#y" ;\n" +#define XO2(x,y) " xorps "OFFS(x)"(%3), %%xmm"#y" ;\n" +#define XO3(x,y) " xorps "OFFS(x)"(%4), %%xmm"#y" ;\n" +#define XO4(x,y) " xorps "OFFS(x)"(%5), %%xmm"#y" ;\n" +#define XO5(x,y) " xorps "OFFS(x)"(%6), %%xmm"#y" ;\n" + + +static void +xor_sse_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) +{ + unsigned long lines = bytes >> 8; + char xmm_save[16*4]; + int cr0; + + XMMS_SAVE; + + __asm__ __volatile__ ( +#undef BLOCK +#define BLOCK(i) \ + LD(i,0) \ + LD(i+1,1) \ + PF1(i) \ + PF1(i+2) \ + LD(i+2,2) \ + LD(i+3,3) \ + PF0(i+4) \ + PF0(i+6) \ + XO1(i,0) \ + XO1(i+1,1) \ + XO1(i+2,2) \ + XO1(i+3,3) \ + ST(i,0) \ + ST(i+1,1) \ + ST(i+2,2) \ + ST(i+3,3) \ + + + PF0(0) + PF0(2) + + " .align 32 ;\n" + " 1: ;\n" + + BLOCK(0) + BLOCK(4) + BLOCK(8) + BLOCK(12) + + " addl $256, %1 ;\n" + " addl $256, %2 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2) + : "memory"); + + XMMS_RESTORE; +} + +static void +xor_sse_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3) +{ + unsigned long lines = bytes >> 8; + char xmm_save[16*4]; + int cr0; + + XMMS_SAVE; + + __asm__ __volatile__ ( +#undef BLOCK +#define BLOCK(i) \ + PF1(i) \ + PF1(i+2) \ + LD(i,0) \ + LD(i+1,1) \ + LD(i+2,2) \ + LD(i+3,3) \ + PF2(i) \ + PF2(i+2) \ + PF0(i+4) \ + PF0(i+6) \ + XO1(i,0) \ + XO1(i+1,1) \ + XO1(i+2,2) \ + XO1(i+3,3) \ + XO2(i,0) \ + XO2(i+1,1) \ + XO2(i+2,2) \ + XO2(i+3,3) \ + ST(i,0) \ + ST(i+1,1) \ + ST(i+2,2) \ + ST(i+3,3) \ + + + PF0(0) + PF0(2) + + " .align 32 ;\n" + " 1: ;\n" + + BLOCK(0) + BLOCK(4) + BLOCK(8) + BLOCK(12) + + " addl $256, %1 ;\n" + " addl $256, %2 ;\n" + " addl $256, %3 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r"(p2), "r"(p3) + : "memory" ); + + XMMS_RESTORE; +} + +static void +xor_sse_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4) +{ + unsigned long lines = bytes >> 8; + char xmm_save[16*4]; + int cr0; + + XMMS_SAVE; + + __asm__ __volatile__ ( +#undef BLOCK +#define BLOCK(i) \ + PF1(i) \ + PF1(i+2) \ + LD(i,0) \ + LD(i+1,1) \ + LD(i+2,2) \ + LD(i+3,3) \ + PF2(i) \ + PF2(i+2) \ + XO1(i,0) \ + XO1(i+1,1) \ + XO1(i+2,2) \ + XO1(i+3,3) \ + PF3(i) \ + PF3(i+2) \ + PF0(i+4) \ + PF0(i+6) \ + XO2(i,0) \ + XO2(i+1,1) \ + XO2(i+2,2) \ + XO2(i+3,3) \ + XO3(i,0) \ + XO3(i+1,1) \ + XO3(i+2,2) \ + XO3(i+3,3) \ + ST(i,0) \ + ST(i+1,1) \ + ST(i+2,2) \ + ST(i+3,3) \ + + + PF0(0) + PF0(2) + + " .align 32 ;\n" + " 1: ;\n" + + BLOCK(0) + BLOCK(4) + BLOCK(8) + BLOCK(12) + + " addl $256, %1 ;\n" + " addl $256, %2 ;\n" + " addl $256, %3 ;\n" + " addl $256, %4 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2), "r" (p3), "r" (p4) + : "memory" ); + + XMMS_RESTORE; +} + +static void +xor_sse_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4, unsigned long *p5) +{ + unsigned long lines = bytes >> 8; + char xmm_save[16*4]; + int cr0; + + XMMS_SAVE; + + __asm__ __volatile__ ( +#undef BLOCK +#define BLOCK(i) \ + PF1(i) \ + PF1(i+2) \ + LD(i,0) \ + LD(i+1,1) \ + LD(i+2,2) \ + LD(i+3,3) \ + PF2(i) \ + PF2(i+2) \ + XO1(i,0) \ + XO1(i+1,1) \ + XO1(i+2,2) \ + XO1(i+3,3) \ + PF3(i) \ + PF3(i+2) \ + XO2(i,0) \ + XO2(i+1,1) \ + XO2(i+2,2) \ + XO2(i+3,3) \ + PF4(i) \ + PF4(i+2) \ + PF0(i+4) \ + PF0(i+6) \ + XO3(i,0) \ + XO3(i+1,1) \ + XO3(i+2,2) \ + XO3(i+3,3) \ + XO4(i,0) \ + XO4(i+1,1) \ + XO4(i+2,2) \ + XO4(i+3,3) \ + ST(i,0) \ + ST(i+1,1) \ + ST(i+2,2) \ + ST(i+3,3) \ + + + PF0(0) + PF0(2) + + " .align 32 ;\n" + " 1: ;\n" + + BLOCK(0) + BLOCK(4) + BLOCK(8) + BLOCK(12) + + " addl $256, %1 ;\n" + " addl $256, %2 ;\n" + " addl $256, %3 ;\n" + " addl $256, %4 ;\n" + " addl $256, %5 ;\n" + " decl %0 ;\n" + " jnz 1b ;\n" + : + : "r" (lines), + "r" (p1), "r" (p2), "r" (p3), "r" (p4), "r" (p5) + : "memory"); + + XMMS_RESTORE; +} + +static struct xor_block_template xor_block_pIII_sse = { + name: "pIII_sse", + do_2: xor_sse_2, + do_3: xor_sse_3, + do_4: xor_sse_4, + do_5: xor_sse_5, +}; + +/* Also try the generic routines. */ +#include <asm-generic/xor.h> + +#undef XOR_TRY_TEMPLATES +#define XOR_TRY_TEMPLATES \ + do { \ + xor_speed(&xor_block_8regs); \ + xor_speed(&xor_block_32regs); \ + if (cpu_has_xmm) \ + xor_speed(&xor_block_pIII_sse); \ + if (md_cpu_has_mmx()) { \ + xor_speed(&xor_block_pII_mmx); \ + xor_speed(&xor_block_p5_mmx); \ + } \ + } while (0) + +/* We force the use of the SSE xor block because it can write around L2. + We may also be able to load into the L1 only depending on how the cpu + deals with a load to a line that is being prefetched. */ +#define XOR_SELECT_TEMPLATE(FASTEST) \ + (cpu_has_xmm ? &xor_block_pIII_sse : FASTEST) diff --git a/include/asm-ia64/xor.h b/include/asm-ia64/xor.h new file mode 100644 index 000000000..28aca667c --- /dev/null +++ b/include/asm-ia64/xor.h @@ -0,0 +1,283 @@ +/* + * include/asm-ia64/xor.h + * + * Optimized RAID-5 checksumming functions for IA-64. + * + * 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, or (at your option) + * any later version. + * + * You should have received a copy of the GNU General Public License + * (for example /usr/src/linux/COPYING); if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +extern void xor_ia64_2(unsigned long, unsigned long *, unsigned long *); +extern void xor_ia64_3(unsigned long, unsigned long *, unsigned long *, + unsigned long *); +extern void xor_ia64_4(unsigned long, unsigned long *, unsigned long *, + unsigned long *, unsigned long *); +extern void xor_ia64_5(unsigned long, unsigned long *, unsigned long *, + unsigned long *, unsigned long *, unsigned long *); + +asm (" + .text + + // Assume L2 memory latency of 6 cycles. + + .proc xor_ia64_2 +xor_ia64_2: + .prologue + .fframe 0 + { .mii + .save ar.pfs, r31 + alloc r31 = ar.pfs, 3, 0, 13, 16 + .save ar.lc, r30 + mov r30 = ar.lc + .save pr, r29 + mov r29 = pr + ;; + } + .body + { .mii + mov r8 = in1 + mov ar.ec = 6 + 2 + shr in0 = in0, 3 + ;; + } + { .mmi + adds in0 = -1, in0 + mov r16 = in1 + mov r17 = in2 + ;; + } + { .mii + mov ar.lc = in0 + mov pr.rot = 1 << 16 + ;; + } + .rotr s1[6+1], s2[6+1], d[2] + .rotp p[6+2] +0: { .mmi +(p[0]) ld8.nta s1[0] = [r16], 8 +(p[0]) ld8.nta s2[0] = [r17], 8 +(p[6]) xor d[0] = s1[6], s2[6] + } + { .mfb +(p[6+1]) st8.nta [r8] = d[1], 8 + nop.f 0 + br.ctop.dptk.few 0b + ;; + } + { .mii + mov ar.lc = r30 + mov pr = r29, -1 + } + { .bbb + br.ret.sptk.few rp + } + .endp xor_ia64_2 + + .proc xor_ia64_3 +xor_ia64_3: + .prologue + .fframe 0 + { .mii + .save ar.pfs, r31 + alloc r31 = ar.pfs, 4, 0, 20, 24 + .save ar.lc, r30 + mov r30 = ar.lc + .save pr, r29 + mov r29 = pr + ;; + } + .body + { .mii + mov r8 = in1 + mov ar.ec = 6 + 2 + shr in0 = in0, 3 + ;; + } + { .mmi + adds in0 = -1, in0 + mov r16 = in1 + mov r17 = in2 + ;; + } + { .mii + mov r18 = in3 + mov ar.lc = in0 + mov pr.rot = 1 << 16 + ;; + } + .rotr s1[6+1], s2[6+1], s3[6+1], d[2] + .rotp p[6+2] +0: { .mmi +(p[0]) ld8.nta s1[0] = [r16], 8 +(p[0]) ld8.nta s2[0] = [r17], 8 +(p[6]) xor d[0] = s1[6], s2[6] + ;; + } + { .mmi +(p[0]) ld8.nta s3[0] = [r18], 8 +(p[6+1]) st8.nta [r8] = d[1], 8 +(p[6]) xor d[0] = d[0], s3[6] + } + { .bbb + br.ctop.dptk.few 0b + ;; + } + { .mii + mov ar.lc = r30 + mov pr = r29, -1 + } + { .bbb + br.ret.sptk.few rp + } + .endp xor_ia64_3 + + .proc xor_ia64_4 +xor_ia64_4: + .prologue + .fframe 0 + { .mii + .save ar.pfs, r31 + alloc r31 = ar.pfs, 5, 0, 27, 32 + .save ar.lc, r30 + mov r30 = ar.lc + .save pr, r29 + mov r29 = pr + ;; + } + .body + { .mii + mov r8 = in1 + mov ar.ec = 6 + 2 + shr in0 = in0, 3 + ;; + } + { .mmi + adds in0 = -1, in0 + mov r16 = in1 + mov r17 = in2 + ;; + } + { .mii + mov r18 = in3 + mov ar.lc = in0 + mov pr.rot = 1 << 16 + } + { .mfb + mov r19 = in4 + ;; + } + .rotr s1[6+1], s2[6+1], s3[6+1], s4[6+1], d[2] + .rotp p[6+2] +0: { .mmi +(p[0]) ld8.nta s1[0] = [r16], 8 +(p[0]) ld8.nta s2[0] = [r17], 8 +(p[6]) xor d[0] = s1[6], s2[6] + } + { .mmi +(p[0]) ld8.nta s3[0] = [r18], 8 +(p[0]) ld8.nta s4[0] = [r19], 8 +(p[6]) xor r20 = s3[6], s4[6] + ;; + } + { .mib +(p[6+1]) st8.nta [r8] = d[1], 8 +(p[6]) xor d[0] = d[0], r20 + br.ctop.dptk.few 0b + ;; + } + { .mii + mov ar.lc = r30 + mov pr = r29, -1 + } + { .bbb + br.ret.sptk.few rp + } + .endp xor_ia64_4 + + .proc xor_ia64_5 +xor_ia64_5: + .prologue + .fframe 0 + { .mii + .save ar.pfs, r31 + alloc r31 = ar.pfs, 6, 0, 34, 40 + .save ar.lc, r30 + mov r30 = ar.lc + .save pr, r29 + mov r29 = pr + ;; + } + .body + { .mii + mov r8 = in1 + mov ar.ec = 6 + 2 + shr in0 = in0, 3 + ;; + } + { .mmi + adds in0 = -1, in0 + mov r16 = in1 + mov r17 = in2 + ;; + } + { .mii + mov r18 = in3 + mov ar.lc = in0 + mov pr.rot = 1 << 16 + } + { .mib + mov r19 = in4 + mov r20 = in5 + ;; + } + .rotr s1[6+1], s2[6+1], s3[6+1], s4[6+1], s5[6+1], d[2] + .rotp p[6+2] +0: { .mmi +(p[0]) ld8.nta s1[0] = [r16], 8 +(p[0]) ld8.nta s2[0] = [r17], 8 +(p[6]) xor d[0] = s1[6], s2[6] + } + { .mmi +(p[0]) ld8.nta s3[0] = [r18], 8 +(p[0]) ld8.nta s4[0] = [r19], 8 +(p[6]) xor r21 = s3[6], s4[6] + ;; + } + { .mmi +(p[0]) ld8.nta s5[0] = [r20], 8 +(p[6+1]) st8.nta [r8] = d[1], 8 +(p[6]) xor d[0] = d[0], r21 + ;; + } + { .mfb +(p[6]) xor d[0] = d[0], s5[6] + nop.f 0 + br.ctop.dptk.few 0b + ;; + } + { .mii + mov ar.lc = r30 + mov pr = r29, -1 + } + { .bbb + br.ret.sptk.few rp + } + .endp xor_ia64_5 +"); + +static struct xor_block_template xor_block_ia64 = { + name: "ia64", + do_2: xor_ia64_2, + do_3: xor_ia64_3, + do_4: xor_ia64_4, + do_5: xor_ia64_5, +}; + +#define XOR_TRY_TEMPLATES xor_speed(&xor_block_ia64) diff --git a/include/asm-m68k/module.h b/include/asm-m68k/module.h new file mode 100644 index 000000000..85bf411d5 --- /dev/null +++ b/include/asm-m68k/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_M68K_MODULE_H +#define _ASM_M68K_MODULE_H +/* + * This file contains the m68k architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_M68K_MODULE_H */ diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h index 2e128ff48..655d604d2 100644 --- a/include/asm-m68k/pgtable.h +++ b/include/asm-m68k/pgtable.h @@ -390,9 +390,6 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, #endif /* __ASSEMBLY__ */ -#define module_map vmalloc -#define module_unmap vfree - /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ #define PageSkip(page) (0) #define kern_addr_valid(addr) (1) diff --git a/include/asm-m68k/xor.h b/include/asm-m68k/xor.h new file mode 100644 index 000000000..c82eb12a5 --- /dev/null +++ b/include/asm-m68k/xor.h @@ -0,0 +1 @@ +#include <asm-generic/xor.h> diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h new file mode 100644 index 000000000..272e05e60 --- /dev/null +++ b/include/asm-mips/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_MIPS_MODULE_H +#define _ASM_MIPS_MODULE_H +/* + * This file contains the mips architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_MIPS_MODULE_H */ diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index b1d1f1212..ffee96a42 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -456,9 +456,6 @@ extern void update_mmu_cache(struct vm_area_struct *vma, #define swp_entry_to_pte(x) ((pte_t) { (x).val }) -#define module_map vmalloc -#define module_unmap vfree - /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ #define PageSkip(page) (0) #define kern_addr_valid(addr) (1) diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h index 718e983e6..286b71b70 100644 --- a/include/asm-mips/resource.h +++ b/include/asm-mips/resource.h @@ -1,10 +1,9 @@ -/* $Id: resource.h,v 1.4 2000/01/27 23:45:30 ralf Exp $ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1995, 1996, 1998 by Ralf Baechle + * Copyright (C) 1995, 96, 98, 2000 by Ralf Baechle */ #ifndef _ASM_RESOURCE_H #define _ASM_RESOURCE_H @@ -26,14 +25,14 @@ #define RLIM_NLIMITS 11 /* Number of limit flavors. */ +#ifdef __KERNEL__ + /* * SuS says limits have to be unsigned. * Which makes a ton more sense anyway. */ #define RLIM_INFINITY 0x7fffffffUL -#ifdef __KERNEL__ - #define INIT_RLIMITS \ { \ { RLIM_INFINITY, RLIM_INFINITY }, \ diff --git a/include/asm-mips/xor.h b/include/asm-mips/xor.h new file mode 100644 index 000000000..c82eb12a5 --- /dev/null +++ b/include/asm-mips/xor.h @@ -0,0 +1 @@ +#include <asm-generic/xor.h> diff --git a/include/asm-mips64/module.h b/include/asm-mips64/module.h new file mode 100644 index 000000000..dbc894f7e --- /dev/null +++ b/include/asm-mips64/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_MIPS64_MODULE_H +#define _ASM_MIPS64_MODULE_H +/* + * This file contains the mips64 architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_MIPS64_MODULE_H */ diff --git a/include/asm-mips64/pgtable.h b/include/asm-mips64/pgtable.h index 4874a59e5..af0c7b4c9 100644 --- a/include/asm-mips64/pgtable.h +++ b/include/asm-mips64/pgtable.h @@ -525,9 +525,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define swp_entry_to_pte(x) ((pte_t) { (x).val }) -#define module_map vmalloc -#define module_unmap vfree - /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ #define PageSkip(page) (0) #ifndef CONFIG_DISCONTIGMEM diff --git a/include/asm-mips64/sn/ioc3.h b/include/asm-mips64/sn/ioc3.h index 57a2abbf2..f7d530f30 100644 --- a/include/asm-mips64/sn/ioc3.h +++ b/include/asm-mips64/sn/ioc3.h @@ -1,10 +1,9 @@ -/* $Id: ioc3.h,v 1.1 2000/01/13 00:17:02 ralf Exp $ - * - * Copyright (C) 1999 Ralf Baechle - * This file is part of the Linux driver for the SGI IOC3. +/* + * Copyright (C) 1999, 2000 Ralf Baechle + * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ -#ifndef IOC3_H -#define IOC3_H +#ifndef _IOC3_H +#define _IOC3_H /* SUPERIO uart register map */ typedef volatile struct ioc3_uartregs { @@ -659,4 +658,4 @@ typedef enum ioc3_subdevs_e { #define IOC3_INTA_SUBDEVS IOC3_SDB_ETHER #define IOC3_INTB_SUBDEVS (IOC3_SDB_GENERIC|IOC3_SDB_KBMS|IOC3_SDB_SERIAL|IOC3_SDB_ECPP|IOC3_SDB_RT) -#endif /* IOC3_H */ +#endif /* _IOC3_H */ diff --git a/include/asm-mips64/xor.h b/include/asm-mips64/xor.h new file mode 100644 index 000000000..c82eb12a5 --- /dev/null +++ b/include/asm-mips64/xor.h @@ -0,0 +1 @@ +#include <asm-generic/xor.h> diff --git a/include/asm-ppc/8xx_immap.h b/include/asm-ppc/8xx_immap.h index 0223fe275..d470233e3 100644 --- a/include/asm-ppc/8xx_immap.h +++ b/include/asm-ppc/8xx_immap.h @@ -10,6 +10,7 @@ * a combination that I found difficult to separate into logical * functional files.....but anyone else is welcome to try. -- Dan */ +#ifdef __KERNEL__ #ifndef __IMMAP_8XX__ #define __IMMAP_8XX__ @@ -453,3 +454,4 @@ typedef struct immap { } immap_t; #endif /* __IMMAP_8XX__ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/amigahw.h b/include/asm-ppc/amigahw.h index 491547376..8c98945e7 100644 --- a/include/asm-ppc/amigahw.h +++ b/include/asm-ppc/amigahw.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef __ASMPPC_AMIGAHW_H #define __ASMPPC_AMIGAHW_H @@ -13,3 +14,4 @@ #endif /* __ASMPPC_AMIGAHW_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/amigaints.h b/include/asm-ppc/amigaints.h index c7a50189e..a5e1c4850 100644 --- a/include/asm-ppc/amigaints.h +++ b/include/asm-ppc/amigaints.h @@ -10,6 +10,7 @@ ** Created 10/2/92 by Greg Harp */ +#ifdef __KERNEL__ #ifndef _ASMm68k_AMIGAINTS_H_ #define _ASMm68k_AMIGAINTS_H_ @@ -133,3 +134,4 @@ extern unsigned char cia_set_irq(unsigned int irq, int set); extern unsigned char cia_able_irq(unsigned int irq, int enable); #endif /* asm-m68k/amigaints.h */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/amigappc.h b/include/asm-ppc/amigappc.h index 96e5e8f09..8750af77a 100644 --- a/include/asm-ppc/amigappc.h +++ b/include/asm-ppc/amigappc.h @@ -11,6 +11,7 @@ ** Created: 7/22/97 by Jesper Skov */ +#ifdef __KERNEL__ #ifndef _M68K_AMIGAPPC_H #define _M68K_AMIGAPPC_H @@ -81,3 +82,4 @@ do { \ #define INTLVL_MASK (0x7f) #endif /* _M68k_AMIGAPPC_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/backlight.h b/include/asm-ppc/backlight.h index 79756eca3..2f070ef6f 100644 --- a/include/asm-ppc/backlight.h +++ b/include/asm-ppc/backlight.h @@ -4,6 +4,7 @@ * For now, implementation resides in arch/ppc/kernel/pmac_support.c * */ +#ifdef __KERNEL__ #ifndef __ASM_PPC_BACKLIGHT_H #define __ASM_PPC_BACKLIGHT_H @@ -26,3 +27,4 @@ extern int set_backlight_level(int level); extern int get_backlight_level(void); #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/bitops.h b/include/asm-ppc/bitops.h index b82a9fc21..c31e5c5eb 100644 --- a/include/asm-ppc/bitops.h +++ b/include/asm-ppc/bitops.h @@ -3,6 +3,7 @@ * bitops.h: Bit string operations on the ppc */ +#ifdef __KERNEL__ #ifndef _PPC_BITOPS_H #define _PPC_BITOPS_H @@ -351,3 +352,4 @@ found_middle: #endif /* __KERNEL__ */ #endif /* _PPC_BITOPS_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/board.h b/include/asm-ppc/board.h index 1476a232a..d1d3ba68a 100644 --- a/include/asm-ppc/board.h +++ b/include/asm-ppc/board.h @@ -10,6 +10,7 @@ * */ +#ifdef __KERNEL__ #ifndef __BOARD_H__ #define __BOARD_H__ @@ -40,3 +41,4 @@ extern unsigned char __res[]; #endif #endif /* __BOARD_H__ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/bootinfo.h b/include/asm-ppc/bootinfo.h index af614d798..84e7a7c8f 100644 --- a/include/asm-ppc/bootinfo.h +++ b/include/asm-ppc/bootinfo.h @@ -6,6 +6,7 @@ */ +#ifdef __KERNEL__ #ifndef _PPC_BOOTINFO_H #define _PPC_BOOTINFO_H @@ -33,3 +34,4 @@ struct bi_record { #endif /* _PPC_BOOTINFO_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/byteorder.h b/include/asm-ppc/byteorder.h index 02454f6cf..2da8cfd6c 100644 --- a/include/asm-ppc/byteorder.h +++ b/include/asm-ppc/byteorder.h @@ -7,6 +7,7 @@ #include <asm/types.h> +#ifdef __KERNEL__ #ifdef __GNUC__ extern __inline__ unsigned ld_le16(const volatile unsigned short *addr) @@ -72,11 +73,13 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 value) #define __arch__swab16s(addr) st_le16(addr,*addr) #define __arch__swab32s(addr) st_le32(addr,*addr) -#endif /* __GNUC__ */ - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#ifndef __STRICT_ANSI__ #define __BYTEORDER_HAS_U64__ #endif + +#endif /* __GNUC__ */ +#endif /* __KERNEL__ */ + #include <linux/byteorder/big_endian.h> #endif /* _PPC_BYTEORDER_H */ diff --git a/include/asm-ppc/cache.h b/include/asm-ppc/cache.h index c45fd8409..e4bcdde00 100644 --- a/include/asm-ppc/cache.h +++ b/include/asm-ppc/cache.h @@ -1,6 +1,7 @@ /* * include/asm-ppc/cache.h */ +#ifdef __KERNEL__ #ifndef __ARCH_PPC_CACHE_H #define __ARCH_PPC_CACHE_H @@ -83,3 +84,4 @@ extern void flush_dcache_range(unsigned long start, unsigned long stop); #endif /* CONFIG_8xx */ #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/checksum.h b/include/asm-ppc/checksum.h index e635ff599..48c8ca7b5 100644 --- a/include/asm-ppc/checksum.h +++ b/include/asm-ppc/checksum.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_CHECKSUM_H #define _PPC_CHECKSUM_H @@ -111,3 +112,4 @@ extern unsigned short csum_tcpudp_magic(unsigned long saddr, unsigned int sum); #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/cpm_8260.h b/include/asm-ppc/cpm_8260.h index 427ec1884..b612cf02f 100644 --- a/include/asm-ppc/cpm_8260.h +++ b/include/asm-ppc/cpm_8260.h @@ -8,6 +8,7 @@ * All CPM control and status is available through the MPC8260 internal * memory map. See immap.h for details. */ +#ifdef __KERNEL__ #ifndef __CPM_82XX__ #define __CPM_82XX__ @@ -697,3 +698,4 @@ typedef struct iic { #define BD_IIC_START ((ushort)0x0400) #endif /* __CPM_82XX__ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/current.h b/include/asm-ppc/current.h index 49415ce9f..8d41501ba 100644 --- a/include/asm-ppc/current.h +++ b/include/asm-ppc/current.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_CURRENT_H #define _PPC_CURRENT_H @@ -7,3 +8,4 @@ register struct task_struct *current asm ("r2"); #endif /* !(_PPC_CURRENT_H) */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/dbdma.h b/include/asm-ppc/dbdma.h index 38cd15803..0590cb454 100644 --- a/include/asm-ppc/dbdma.h +++ b/include/asm-ppc/dbdma.h @@ -5,6 +5,7 @@ * Copyright (C) 1996 Paul Mackerras. */ +#ifdef __KERNEL__ #ifndef _ASM_DBDMA_H_ #define _ASM_DBDMA_H_ /* @@ -90,3 +91,4 @@ struct dbdma_cmd { #define DBDMA_ALIGN(x) (((unsigned)(x) + sizeof(struct dbdma_cmd) - 1) \ & -sizeof(struct dbdma_cmd)) #endif /* _ASM_DBDMA_H_ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/delay.h b/include/asm-ppc/delay.h index 239e0d3ac..2116a2f2c 100644 --- a/include/asm-ppc/delay.h +++ b/include/asm-ppc/delay.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_DELAY_H #define _PPC_DELAY_H @@ -31,3 +32,4 @@ extern __inline__ void udelay(unsigned long usecs) } #endif /* defined(_PPC_DELAY_H) */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/dma.h b/include/asm-ppc/dma.h index 5cac2be5e..735d91d1f 100644 --- a/include/asm-ppc/dma.h +++ b/include/asm-ppc/dma.h @@ -6,6 +6,8 @@ * Changes for ppc sound by Christoph Nadig */ +#ifdef __KERNEL__ + #include <linux/config.h> #include <asm/io.h> #include <linux/spinlock.h> @@ -410,3 +412,4 @@ extern int isa_dma_bridge_buggy; #define isa_dma_bridge_buggy (0) #endif #endif /* _ASM_DMA_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h index 75b515e18..6a0e2e874 100644 --- a/include/asm-ppc/elf.h +++ b/include/asm-ppc/elf.h @@ -11,38 +11,41 @@ #define ELF_NVRREG 33 /* includes vscr */ /* - * This is used to ensure we don't load something for the wrong architecture. - */ -#define elf_check_arch(x) ((x)->e_machine == EM_PPC) - -/* * These are used to set parameters in the core dumps. */ #define ELF_ARCH EM_PPC #define ELF_CLASS ELFCLASS32 #define ELF_DATA ELFDATA2MSB -#define USE_ELF_CORE_DUMP -#define ELF_EXEC_PAGESIZE 4096 - -/* This is the location that an ET_DYN program is loaded if exec'ed. Typical - use of this is to invoke "./ld.so someprog" to test out a new version of - the loader. We need to make sure that it is out of the way of the program - that it will "exec", and that there is sufficient room for the brk. */ - -#define ELF_ET_DYN_BASE (0x08000000) - +/* General registers */ typedef unsigned long elf_greg_t; typedef elf_greg_t elf_gregset_t[ELF_NGREG]; +/* Floating point registers */ typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; -#ifdef __KERNEL__ /* Altivec registers */ -typedef vector128 elf_vrreg_t; +typedef __vector128 elf_vrreg_t; typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; -#endif /* __KERNEL__ */ + +#ifdef __KERNEL__ + +/* + * This is used to ensure we don't load something for the wrong architecture. + */ + +#define elf_check_arch(x) ((x)->e_machine == EM_PPC) + +/* This is the location that an ET_DYN program is loaded if exec'ed. Typical + use of this is to invoke "./ld.so someprog" to test out a new version of + the loader. We need to make sure that it is out of the way of the program + that it will "exec", and that there is sufficient room for the brk. */ + +#define ELF_ET_DYN_BASE (0x08000000) + +#define USE_ELF_CORE_DUMP +#define ELF_EXEC_PAGESIZE 4096 #define ELF_CORE_COPY_REGS(gregs, regs) \ memcpy(gregs, regs, \ @@ -65,8 +68,7 @@ typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; #define ELF_PLATFORM (NULL) -#ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) -#endif +#endif /* __KERNEL__ */ #endif diff --git a/include/asm-ppc/feature.h b/include/asm-ppc/feature.h index ca4ca4692..7a33ea8d3 100644 --- a/include/asm-ppc/feature.h +++ b/include/asm-ppc/feature.h @@ -12,6 +12,7 @@ * * */ +#ifdef __KERNEL__ #ifndef __ASM_PPC_FEATURE_H #define __ASM_PPC_FEATURE_H @@ -93,3 +94,4 @@ extern void feature_prepare_for_sleep(void); extern void feature_wake_up(void); #endif /* __ASM_PPC_FEATURE_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h index f12eae65f..f04178736 100644 --- a/include/asm-ppc/floppy.h +++ b/include/asm-ppc/floppy.h @@ -7,6 +7,7 @@ * * Copyright (C) 1995 */ +#ifdef __KERNEL__ #ifndef __ASM_PPC_FLOPPY_H #define __ASM_PPC_FLOPPY_H @@ -54,3 +55,4 @@ static int FDC2 = -1; #define CROSS_64KB(a,s) (0) #endif /* __ASM_PPC_FLOPPY_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/gemini.h b/include/asm-ppc/gemini.h index 7e681e043..ebd01c9b6 100644 --- a/include/asm-ppc/gemini.h +++ b/include/asm-ppc/gemini.h @@ -6,6 +6,7 @@ * "Gemini" boards. * */ +#ifdef __KERNEL__ #ifndef __PPC_GEMINI_H #define __PPC_GEMINI_H @@ -164,3 +165,4 @@ extern void gemini_prom_init(void); extern void gemini_init_l2(void); #endif /* __ASSEMBLY__ */ #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/gemini_serial.h b/include/asm-ppc/gemini_serial.h index 089a0ce60..e4e08467e 100644 --- a/include/asm-ppc/gemini_serial.h +++ b/include/asm-ppc/gemini_serial.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef __ASMPPC_GEMINI_SERIAL_H #define __ASMPPC_GEMINI_SERIAL_H @@ -37,3 +38,4 @@ PU32_SERIAL_PORT_DEFNS #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h index f7c12df77..8a270c8c1 100644 --- a/include/asm-ppc/hardirq.h +++ b/include/asm-ppc/hardirq.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef __ASM_HARDIRQ_H #define __ASM_HARDIRQ_H @@ -99,3 +100,4 @@ extern void synchronize_irq(void); #endif /* CONFIG_SMP */ #endif /* __ASM_HARDIRQ_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h index 428a59d1c..38114e564 100644 --- a/include/asm-ppc/highmem.h +++ b/include/asm-ppc/highmem.h @@ -49,19 +49,19 @@ extern void kmap_init(void) __init; #define KMAP_FIX_BEGIN (0xfe400000UL) -extern unsigned long kmap_high(struct page *page); +extern void *kmap_high(struct page *page); extern void kunmap_high(struct page *page); -extern inline unsigned long kmap(struct page *page) +static inline void *kmap(struct page *page) { if (in_interrupt()) BUG(); if (page < highmem_start_page) - return (unsigned long) page_address(page); + return page_address(page); return kmap_high(page); } -extern inline void kunmap(struct page *page) +static inline void kunmap(struct page *page) { if (in_interrupt()) BUG(); @@ -76,13 +76,13 @@ extern inline void kunmap(struct page *page) * be used in IRQ contexts, so in some (very limited) cases we need * it. */ -extern inline unsigned long kmap_atomic(struct page *page, enum km_type type) +static inline void *kmap_atomic(struct page *page, enum km_type type) { unsigned int idx; unsigned long vaddr; if (page < highmem_start_page) - return (unsigned long) page_address(page); + return page_address(page); idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE; @@ -93,12 +93,13 @@ extern inline unsigned long kmap_atomic(struct page *page, enum km_type type) set_pte(kmap_pte+idx, mk_pte(page, kmap_prot)); flush_hash_page(0, vaddr); - return vaddr; + return (void*) vaddr; } -extern inline void kunmap_atomic(unsigned long vaddr, enum km_type type) +static inline void kunmap_atomic(void *kvaddr, enum km_type type) { #if HIGHMEM_DEBUG + unsigned long vaddr = (unsigned long) kvaddr; unsigned int idx = type + KM_TYPE_NR*smp_processor_id(); if (vaddr < KMAP_FIX_BEGIN) // FIXME diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h index 28a47906c..7d4790171 100644 --- a/include/asm-ppc/hw_irq.h +++ b/include/asm-ppc/hw_irq.h @@ -3,6 +3,7 @@ * * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> */ +#ifdef __KERNEL__ #ifndef _PPC_HW_IRQ_H #define _PPC_HW_IRQ_H @@ -40,3 +41,4 @@ extern atomic_t ppc_n_lost_interrupts; #define mask_and_ack_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->ack) irq_desc[irq].handler->ack(irq);}) #endif /* _PPC_HW_IRQ_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h index 8b50f862b..179bdec67 100644 --- a/include/asm-ppc/ide.h +++ b/include/asm-ppc/ide.h @@ -10,6 +10,8 @@ #ifndef __ASMPPC_IDE_H #define __ASMPPC_IDE_H +#ifdef __KERNEL__ + #include <linux/sched.h> #include <asm/processor.h> @@ -19,8 +21,6 @@ #include <asm/hdreg.h> -#ifdef __KERNEL__ - #include <linux/config.h> #include <linux/hdreg.h> #include <linux/ioport.h> diff --git a/include/asm-ppc/immap_8260.h b/include/asm-ppc/immap_8260.h index 298276363..32eb50b8c 100644 --- a/include/asm-ppc/immap_8260.h +++ b/include/asm-ppc/immap_8260.h @@ -7,6 +7,7 @@ * 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. */ +#ifdef __KERNEL__ #ifndef __IMMAP_82XX__ #define __IMMAP_82XX__ @@ -433,3 +434,4 @@ typedef struct immap { immap_t *immr; #endif /* __IMMAP_82XX__ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/init.h b/include/asm-ppc/init.h index 00a1c79cc..d4976d863 100644 --- a/include/asm-ppc/init.h +++ b/include/asm-ppc/init.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_INIT_H #define _PPC_INIT_H @@ -35,3 +36,4 @@ __argopenfirmware #endif /* _PPC_INIT_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 45b2531a3..03f9db09a 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_IO_H #define _PPC_IO_H @@ -92,7 +93,7 @@ extern __inline__ unsigned int name(unsigned int port) \ "3: li %0,-1\n" \ " b 2b\n" \ ".previous\n" \ - ".section __ex_table,\"ax\"\n" \ + ".section __ex_table,\"a\"\n" \ " .align 2\n" \ " .long 1b,3b\n" \ ".previous" \ @@ -108,7 +109,7 @@ extern __inline__ void name(unsigned int val, unsigned int port) \ op " %0,0,%1\n" \ "1: sync\n" \ "2:\n" \ - ".section __ex_table,\"ax\"\n" \ + ".section __ex_table,\"a\"\n" \ " .align 2\n" \ " .long 1b,2b\n" \ ".previous" \ @@ -347,7 +348,6 @@ extern inline void out_be32(volatile unsigned *addr, int val) __asm__ __volatile__("stw%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); } -#ifdef __KERNEL__ static inline int check_signature(unsigned long io_addr, const unsigned char *signature, int length) { @@ -370,6 +370,5 @@ out: #define dma_cache_wback(_start,_size) do { } while (0) #define dma_cache_wback_inv(_start,_size) do { } while (0) -#endif /* __KERNEL__ */ - #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/ipcbuf.h b/include/asm-ppc/ipcbuf.h index 98c75e646..fab6752c7 100644 --- a/include/asm-ppc/ipcbuf.h +++ b/include/asm-ppc/ipcbuf.h @@ -2,10 +2,28 @@ #define __PPC_IPCBUF_H__ /* - * The ipc64_perm structure for the PPC is identical to kern_ipc_perm - * as we have always had 32-bit UIDs and GIDs in the kernel. + * The ipc64_perm structure for PPC architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 1 32-bit value to fill up for 8-byte alignment + * - 2 miscellaneous 64-bit values (so that this structure matches + * PPC64 ipc64_perm) */ -#define ipc64_perm kern_ipc_perm +struct ipc64_perm +{ + __kernel_key_t key; + __kernel_uid_t uid; + __kernel_gid_t gid; + __kernel_uid_t cuid; + __kernel_gid_t cgid; + __kernel_mode_t mode; + unsigned long seq; + unsigned int __pad2; + unsigned long long __unused1; + unsigned long long __unused2; +}; #endif /* __PPC_IPCBUF_H__ */ diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h index 86647a0e6..c3ae15763 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-ppc/irq.h @@ -1,8 +1,8 @@ -#include <linux/config.h> - +#ifdef __KERNEL__ #ifndef _ASM_IRQ_H #define _ASM_IRQ_H +#include <linux/config.h> #include <asm/machdep.h> /* ppc_md */ extern void disable_irq(unsigned int); @@ -217,3 +217,4 @@ static __inline__ int irq_cannonicalize(int irq) extern unsigned int ppc_lost_interrupts[NR_MASK_WORDS]; #endif /* _ASM_IRQ_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/kgdb.h b/include/asm-ppc/kgdb.h index 51c868b36..7337be058 100644 --- a/include/asm-ppc/kgdb.h +++ b/include/asm-ppc/kgdb.h @@ -6,6 +6,7 @@ * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ +#ifdef __KERNEL__ #ifndef _PPC_KGDB_H #define _PPC_KGDB_H @@ -46,3 +47,4 @@ extern char getDebugChar(void); /* read and return a single char */ #endif /* !(__ASSEMBLY__) */ #endif /* !(_PPC_KGDB_H) */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h index d92d81b20..a1483ed3b 100644 --- a/include/asm-ppc/kmap_types.h +++ b/include/asm-ppc/kmap_types.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _ASM_KMAP_TYPES_H #define _ASM_KMAP_TYPES_H @@ -8,3 +9,4 @@ enum km_type { }; #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/linux_logo.h b/include/asm-ppc/linux_logo.h index 33ad40f64..c35e6db5b 100644 --- a/include/asm-ppc/linux_logo.h +++ b/include/asm-ppc/linux_logo.h @@ -10,6 +10,7 @@ * values have to start from 0x20 * (i.e. linux_logo_{red,green,blue}[0] is color 0x20) */ +#ifdef __KERNEL__ #include <linux/init.h> @@ -39,3 +40,4 @@ extern unsigned char linux_logo16_blue[]; extern unsigned char linux_logo16[]; #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index 709827f29..67111965f 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h @@ -1,4 +1,4 @@ - +#ifdef __KERNEL__ #ifndef _PPC_MACHDEP_H #define _PPC_MACHDEP_H @@ -101,3 +101,4 @@ typedef enum sys_ctrler_kind { extern sys_ctrler_t sys_ctrler; #endif /* _PPC_MACHDEP_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/mbx.h b/include/asm-ppc/mbx.h index 6c84b8955..a3e8f9b32 100644 --- a/include/asm-ppc/mbx.h +++ b/include/asm-ppc/mbx.h @@ -1,4 +1,3 @@ - /* * A collection of structures, addresses, and values associated with * the Motorola MBX boards. This was originally created for the @@ -8,6 +7,7 @@ * * Copyright (c) 1997 Dan Malek (dmalek@jlc.net) */ +#ifdef __KERNEL__ #ifndef __MACH_MBX_DEFS #define __MACH_MBX_DEFS @@ -87,3 +87,4 @@ typedef struct bd_info { */ #define _MACH_8xx (_MACH_mbx) #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/mc146818rtc.h b/include/asm-ppc/mc146818rtc.h index f7a479fff..227018b2f 100644 --- a/include/asm-ppc/mc146818rtc.h +++ b/include/asm-ppc/mc146818rtc.h @@ -1,6 +1,7 @@ /* * Machine dependent access functions for RTC registers. */ +#ifdef __KERNEL__ #ifndef __ASM_PPC_MC146818RTC_H #define __ASM_PPC_MC146818RTC_H @@ -27,3 +28,4 @@ outb_p((val),RTC_PORT(1)); \ #define RTC_IRQ 8 #endif /* __ASM_PPC_MC146818RTC_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/md.h b/include/asm-ppc/md.h index 0ff3e7e92..79c3a22c6 100644 --- a/include/asm-ppc/md.h +++ b/include/asm-ppc/md.h @@ -3,6 +3,7 @@ * */ +#ifdef __KERNEL__ #ifndef __ASM_MD_H #define __ASM_MD_H @@ -11,3 +12,4 @@ #define MD_XORBLOCK_ALIGNMENT sizeof(long) #endif /* __ASM_MD_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/mediabay.h b/include/asm-ppc/mediabay.h index a634d7f20..963555776 100644 --- a/include/asm-ppc/mediabay.h +++ b/include/asm-ppc/mediabay.h @@ -7,13 +7,13 @@ #ifndef _PPC_MEDIABAY_H #define _PPC_MEDIABAY_H +#ifdef __KERNEL__ + #define MB_FD 0 /* media bay contains floppy drive */ #define MB_FD1 1 /* media bay contains floppy drive */ #define MB_CD 3 /* media bay contains ATA drive such as CD */ #define MB_NO 7 /* media bay contains nothing */ -#ifdef __KERNEL__ - void media_bay_init(void); int check_media_bay(struct device_node *which_bay, int what); int check_media_bay_by_base(unsigned long base, int what); diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h index 4a3a42f26..2fe5cfe71 100644 --- a/include/asm-ppc/mmu.h +++ b/include/asm-ppc/mmu.h @@ -2,6 +2,7 @@ * PowerPC memory management structures */ +#ifdef __KERNEL__ #ifndef _PPC_MMU_H_ #define _PPC_MMU_H_ @@ -363,3 +364,4 @@ extern void _tlbia(void); /* invalidate all TLB entries */ #define TLB_G 0x00000001 /* Memory is guarded from prefetch */ #endif /* _PPC_MMU_H_ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h index 414dd1cdc..fed474d14 100644 --- a/include/asm-ppc/mmu_context.h +++ b/include/asm-ppc/mmu_context.h @@ -1,5 +1,6 @@ #include <linux/config.h> +#ifdef __KERNEL__ #ifndef __PPC_MMU_CONTEXT_H #define __PPC_MMU_CONTEXT_H @@ -112,3 +113,4 @@ static inline void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm ((segment < 8) ? ((segment) | (context)<<4) : (segment)) #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/module.h b/include/asm-ppc/module.h new file mode 100644 index 000000000..77133a1cf --- /dev/null +++ b/include/asm-ppc/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_PPC_MODULE_H +#define _ASM_PPC_MODULE_H +/* + * This file contains the PPC architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_PPC_MODULE_H */ diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h index 10d586cad..94a054b57 100644 --- a/include/asm-ppc/mpc8260.h +++ b/include/asm-ppc/mpc8260.h @@ -5,6 +5,7 @@ * file that has to include MPC8260 configuration, they all include * this one and the configuration switching is done here. */ +#ifdef __KERNEL__ #ifndef __CONFIG_8260_DEFS #define __CONFIG_8260_DEFS @@ -40,3 +41,4 @@ extern int request_8xxirq(unsigned int irq, #endif /* CONFIG_8260 */ #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h index db327b76a..2476f7540 100644 --- a/include/asm-ppc/mpc8xx.h +++ b/include/asm-ppc/mpc8xx.h @@ -5,6 +5,7 @@ * file that has to include MPC8xx configuration, they all include * this one and the configuration switching is done here. */ +#ifdef __KERNEL__ #ifndef __CONFIG_8xx_DEFS #define __CONFIG_8xx_DEFS @@ -79,3 +80,4 @@ extern int request_8xxirq(unsigned int irq, void *dev_id); #endif /* CONFIG_8xx */ #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/msgbuf.h b/include/asm-ppc/msgbuf.h index ebfb950a2..3432b9b36 100644 --- a/include/asm-ppc/msgbuf.h +++ b/include/asm-ppc/msgbuf.h @@ -7,7 +7,6 @@ struct msqid64_ds { struct ipc64_perm msg_perm; - unsigned int __unused0; unsigned int __unused1; __kernel_time_t msg_stime; /* last msgsnd time */ unsigned int __unused2; diff --git a/include/asm-ppc/namei.h b/include/asm-ppc/namei.h index cd871903d..0bd54a034 100644 --- a/include/asm-ppc/namei.h +++ b/include/asm-ppc/namei.h @@ -5,6 +5,7 @@ * Included from linux/fs/namei.c */ +#ifdef __KERNEL__ #ifndef __PPC_NAMEI_H #define __PPC_NAMEI_H @@ -16,3 +17,4 @@ #define __emul_prefix() NULL #endif /* __PPC_NAMEI_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/nvram.h b/include/asm-ppc/nvram.h index 144d518b9..7f6fc08b1 100644 --- a/include/asm-ppc/nvram.h +++ b/include/asm-ppc/nvram.h @@ -2,6 +2,7 @@ * PreP compliant NVRAM access */ +#ifdef __KERNEL__ #ifndef _PPC_NVRAM_H #define _PPC_NVRAM_H @@ -64,3 +65,4 @@ struct pmac_machine_location { #define PMAC_NVRAM_GET_OFFSET _IOWR('p', 0x40, int) /* Get NVRAM partition offset */ #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/oak.h b/include/asm-ppc/oak.h index c906f5c4d..63f316401 100644 --- a/include/asm-ppc/oak.h +++ b/include/asm-ppc/oak.h @@ -11,6 +11,7 @@ * */ +#ifdef __KERNEL__ #ifndef __OAK_H__ #define __OAK_H__ @@ -66,3 +67,4 @@ typedef struct board_info { #endif #endif /* __OAK_H__ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index dee0ced3a..d4c104f8d 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h @@ -1,8 +1,3 @@ -#include <linux/config.h> -#ifndef __ASSEMBLY__ -#include <asm/system.h> /* for xmon definition */ -#endif /* ndef __ASSEMBLY__ */ - #ifndef _PPC_PAGE_H #define _PPC_PAGE_H @@ -11,11 +6,14 @@ #define PAGE_SIZE (1UL << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) +#ifdef __KERNEL__ +#include <linux/config.h> + #define PAGE_OFFSET 0xc0000000 #define KERNELBASE PAGE_OFFSET #ifndef __ASSEMBLY__ -#ifdef __KERNEL__ +#include <asm/system.h> /* for xmon definition */ #ifdef CONFIG_XMON #define BUG() do { \ @@ -134,6 +132,6 @@ extern __inline__ int get_order(unsigned long size) return order; } -#endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ #endif /* _PPC_PAGE_H */ diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h index 93d6fc52c..923a3fe60 100644 --- a/include/asm-ppc/param.h +++ b/include/asm-ppc/param.h @@ -20,4 +20,8 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ +#ifdef __KERNEL__ +# define CLOCKS_PER_SEC 100 /* frequency at which times() counts */ +#endif + #endif diff --git a/include/asm-ppc/pci-bridge.h b/include/asm-ppc/pci-bridge.h index 5aa72d3a2..9e5385e51 100644 --- a/include/asm-ppc/pci-bridge.h +++ b/include/asm-ppc/pci-bridge.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _ASM_PCI_BRIDGE_H #define _ASM_PCI_BRIDGE_H @@ -46,3 +47,4 @@ struct bridge_data { }; #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index a9da1b195..1a661f050 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -1,12 +1,12 @@ #ifndef __PPC_PCI_H #define __PPC_PCI_H +#ifdef __KERNEL__ /* Values for the `which' argument to sys_pciconfig_iobase syscall. */ #define IOBASE_BRIDGE_NUMBER 0 #define IOBASE_MEMORY 1 #define IOBASE_IO 2 -#ifdef __KERNEL__ /* Can be used to override the logic in pci_scan_bus for skipping * already-configured bus numbers - to be used for buggy BIOSes diff --git a/include/asm-ppc/pgalloc.h b/include/asm-ppc/pgalloc.h index 6166a1bfb..7da57a6f2 100644 --- a/include/asm-ppc/pgalloc.h +++ b/include/asm-ppc/pgalloc.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_PGALLOC_H #define _PPC_PGALLOC_H @@ -51,33 +52,6 @@ extern unsigned long get_zero_page_fast(void); extern void __bad_pte(pmd_t *pmd); -extern inline void set_pgdir(unsigned long address, pgd_t entry) -{ - struct task_struct * p; - pgd_t *pgd; -#ifdef CONFIG_SMP - int i; -#endif - - read_lock(&tasklist_lock); - for_each_task(p) { - if (!p->mm) - continue; - *pgd_offset(p->mm,address) = entry; - } - read_unlock(&tasklist_lock); -#ifndef CONFIG_SMP - for (pgd = (pgd_t *)pgd_quicklist; pgd; pgd = (pgd_t *)*(unsigned long *)pgd) - pgd[address >> PGDIR_SHIFT] = entry; -#else - /* To pgd_alloc/pgd_free, one holds master kernel lock and so does our callee, so we can - modify pgd caches of other CPUs as well. -jj */ - for (i = 0; i < NR_CPUS; i++) - for (pgd = (pgd_t *)cpu_data[i].pgd_cache; pgd; pgd = (pgd_t *)*(unsigned long *)pgd) - pgd[address >> PGDIR_SHIFT] = entry; -#endif -} - /* We don't use pmd cache, so this is a dummy routine */ extern __inline__ pmd_t *get_pmd_fast(void) { @@ -200,3 +174,4 @@ extern inline pte_t * pte_alloc(pmd_t * pmd, unsigned long address) extern int do_check_pgt_cache(int, int); #endif /* _PPC_PGALLOC_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 27c89e13e..0f4579cd7 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_PGTABLE_H #define _PPC_PGTABLE_H @@ -451,9 +452,6 @@ extern void flush_hash_page(unsigned context, unsigned long va); #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define swp_entry_to_pte(x) ((pte_t) { (x).val }) -#define module_map vmalloc -#define module_unmap vfree - /* CONFIG_APUS */ /* For virtual address to physical address conversion */ extern void cache_clear(__u32 addr, int length); @@ -492,3 +490,4 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size, #endif __ASSEMBLY__ #endif /* _PPC_PGTABLE_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/pnp.h b/include/asm-ppc/pnp.h index 15335ff35..6f6760b30 100644 --- a/include/asm-ppc/pnp.h +++ b/include/asm-ppc/pnp.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ /* 11/02/95 */ /*----------------------------------------------------------------------------*/ /* Plug and Play header definitions */ @@ -641,3 +642,4 @@ typedef union _PnP_TAG_PACKET { #endif /* __ASSEMBLY__ */ #endif /* ndef _PNP_ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/prep_nvram.h b/include/asm-ppc/prep_nvram.h index 2f0f80b5c..82ec21508 100644 --- a/include/asm-ppc/prep_nvram.h +++ b/include/asm-ppc/prep_nvram.h @@ -17,6 +17,7 @@ For enum's: if given in hex then they are bit significant, i.e. only one bit is on for each enum. */ +#ifdef __KERNEL__ #ifndef _PPC_PREP_NVRAM_H #define _PPC_PREP_NVRAM_H @@ -144,3 +145,4 @@ void prep_nvram_write_val(int addr, unsigned char val); #endif /* _PPC_PREP_NVRAM_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index f99eb4abe..cfd49807e 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef __ASM_PPC_PROCESSOR_H #define __ASM_PPC_PROCESSOR_H @@ -727,3 +728,4 @@ void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); #endif /* CONFIG_MACH_SPECIFIC */ #endif /* __ASM_PPC_PROCESSOR_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h index dc98c596d..0c57690ea 100644 --- a/include/asm-ppc/prom.h +++ b/include/asm-ppc/prom.h @@ -4,6 +4,7 @@ * * Copyright (C) 1996 Paul Mackerras. */ +#ifdef __KERNEL__ #ifndef _PPC_PROM_H #define _PPC_PROM_H @@ -98,3 +99,4 @@ extern void map_bootx_text(void); #endif /* _PPC_PROM_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/ptrace.h b/include/asm-ppc/ptrace.h index 93a75bd87..b154187e6 100644 --- a/include/asm-ppc/ptrace.h +++ b/include/asm-ppc/ptrace.h @@ -17,32 +17,26 @@ * the PT_* values below. This simplifies arch/ppc/kernel/ptrace.c. */ -#include <linux/config.h> - #ifndef __ASSEMBLY__ -#ifdef CONFIG_PPC64BRIDGE -#define PPC_REG unsigned long /*long*/ -#else -#define PPC_REG unsigned long -#endif struct pt_regs { - PPC_REG gpr[32]; - PPC_REG nip; - PPC_REG msr; - PPC_REG orig_gpr3; /* Used for restarting system calls */ - PPC_REG ctr; - PPC_REG link; - PPC_REG xer; - PPC_REG ccr; - PPC_REG mq; /* 601 only (not used at present) */ - /* Used on APUS to hold IPL value. */ - PPC_REG trap; /* Reason for being here */ - PPC_REG dar; /* Fault registers */ - PPC_REG dsisr; - PPC_REG result; /* Result of a system call */ + unsigned long gpr[32]; + unsigned long nip; + unsigned long msr; + unsigned long orig_gpr3; /* Used for restarting system calls */ + unsigned long ctr; + unsigned long link; + unsigned long xer; + unsigned long ccr; + unsigned long mq; /* 601 only (not used at present) */ + /* Used on APUS to hold IPL value. */ + unsigned long trap; /* Reason for being here */ + unsigned long dar; /* Fault registers */ + unsigned long dsisr; + unsigned long result; /* Result of a system call */ }; #endif +#ifdef __KERNEL__ #define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */ /* Size of stack frame allocated when calling signal handler. */ @@ -51,6 +45,8 @@ struct pt_regs { #define instruction_pointer(regs) ((regs)->nip) #define user_mode(regs) (((regs)->msr & MSR_PR) != 0) +#endif /* __KERNEL__ */ + /* * Offsets used by 'ptrace' system call interface. * These can't be changed without breaking binary compatibility diff --git a/include/asm-ppc/raven.h b/include/asm-ppc/raven.h index 62f996f66..ee873ff82 100644 --- a/include/asm-ppc/raven.h +++ b/include/asm-ppc/raven.h @@ -8,6 +8,7 @@ * for more details. */ +#ifdef __KERNEL__ #ifndef _ASMPPC_RAVEN_H #define _ASMPPC_RAVEN_H @@ -31,3 +32,4 @@ extern struct hw_interrupt_type raven_pic; extern int raven_init(void); #endif _ASMPPC_RAVEN_H +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/residual.h b/include/asm-ppc/residual.h index c037a4e4a..685c04502 100644 --- a/include/asm-ppc/residual.h +++ b/include/asm-ppc/residual.h @@ -10,6 +10,7 @@ /* i.e. only one bit is on for each enum */ /* Reserved fields must be filled with zeros. */ +#ifdef __KERNEL__ #ifndef _RESIDUAL_ #define _RESIDUAL_ @@ -330,3 +331,4 @@ extern PnP_TAG_PACKET *PnP_find_large_vendor_packet(unsigned char *p, #endif /* __ASSEMBLY__ */ #endif /* ndef _RESIDUAL_ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/rpxclassic.h b/include/asm-ppc/rpxclassic.h index b84a20d12..0583b60fb 100644 --- a/include/asm-ppc/rpxclassic.h +++ b/include/asm-ppc/rpxclassic.h @@ -5,6 +5,7 @@ * * Copyright (c) 1998 Dan Malek (dmalek@jlc.net) */ +#ifdef __KERNEL__ #ifndef __MACH_RPX_DEFS #define __MACH_RPX_DEFS @@ -82,3 +83,4 @@ extern bd_t m8xx_board_info; #define _MACH_8xx (_MACH_classic) #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/rpxlite.h b/include/asm-ppc/rpxlite.h index c0cc7e0a6..1d447082b 100644 --- a/include/asm-ppc/rpxlite.h +++ b/include/asm-ppc/rpxlite.h @@ -5,6 +5,7 @@ * * Copyright (c) 1998 Dan Malek (dmalek@jlc.net) */ +#ifdef __KERNEL__ #ifndef __MACH_RPX_DEFS #define __MACH_RPX_DEFS @@ -65,3 +66,4 @@ extern bd_t m8xx_board_info; #define _MACH_8xx (_MACH_rpxlite) #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/scatterlist.h b/include/asm-ppc/scatterlist.h index f81590716..5c6b01c99 100644 --- a/include/asm-ppc/scatterlist.h +++ b/include/asm-ppc/scatterlist.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_SCATTERLIST_H #define _PPC_SCATTERLIST_H @@ -12,3 +13,4 @@ struct scatterlist { #endif /* !(_PPC_SCATTERLIST_H) */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/semaphore-helper.h b/include/asm-ppc/semaphore-helper.h index 3033272d9..14f2c0e2e 100644 --- a/include/asm-ppc/semaphore-helper.h +++ b/include/asm-ppc/semaphore-helper.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_SEMAPHORE_HELPER_H #define _PPC_SEMAPHORE_HELPER_H @@ -105,3 +106,4 @@ static inline int waking_non_zero_trylock(struct semaphore *sem) } #endif /* _PPC_SEMAPHORE_HELPER_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/sembuf.h b/include/asm-ppc/sembuf.h index 6b6a182a8..d0ab55833 100644 --- a/include/asm-ppc/sembuf.h +++ b/include/asm-ppc/sembuf.h @@ -7,7 +7,6 @@ struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - unsigned int __unused0; unsigned int __unused1; __kernel_time_t sem_otime; /* last semop time */ unsigned int __unused2; diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h index b6b89dc79..60c1a14ff 100644 --- a/include/asm-ppc/serial.h +++ b/include/asm-ppc/serial.h @@ -2,6 +2,7 @@ * include/asm-ppc/serial.h */ +#ifdef __KERNEL__ #include <linux/config.h> #ifdef CONFIG_GEMINI @@ -127,3 +128,4 @@ MCA_SERIAL_PORT_DFNS #endif /* CONFIG_GEMINI */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/setup.h b/include/asm-ppc/setup.h index 2f9164160..cd458c4f1 100644 --- a/include/asm-ppc/setup.h +++ b/include/asm-ppc/setup.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_SETUP_H #define _PPC_SETUP_H @@ -7,3 +8,4 @@ #include <asm-m68k/setup.h> #endif /* _PPC_SETUP_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/shmbuf.h b/include/asm-ppc/shmbuf.h index df84f0b09..ec614e8c6 100644 --- a/include/asm-ppc/shmbuf.h +++ b/include/asm-ppc/shmbuf.h @@ -7,19 +7,19 @@ struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ - unsigned int __unused0; - size_t shm_segsz; /* size of segment (bytes) */ - unsigned long __unused1; + unsigned int __unused1; __kernel_time_t shm_atime; /* last attach time */ - unsigned long __unused2; + unsigned int __unused2; __kernel_time_t shm_dtime; /* last detach time */ - unsigned long __unused3; + unsigned int __unused3; __kernel_time_t shm_ctime; /* last change time */ + unsigned int __unused4; + size_t shm_segsz; /* size of segment (bytes) */ __kernel_pid_t shm_cpid; /* pid of creator */ __kernel_pid_t shm_lpid; /* pid of last operator */ unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused4; unsigned long __unused5; + unsigned long __unused6; }; struct shminfo64 { diff --git a/include/asm-ppc/siginfo.h b/include/asm-ppc/siginfo.h index 3b0bd261d..74a16e0b2 100644 --- a/include/asm-ppc/siginfo.h +++ b/include/asm-ppc/siginfo.h @@ -3,8 +3,6 @@ /* Copied from i386 from alpha. */ -#include <linux/types.h> - typedef union sigval { int sival_int; void *sival_ptr; diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h index f5025a161..4958b3f35 100644 --- a/include/asm-ppc/signal.h +++ b/include/asm-ppc/signal.h @@ -1,7 +1,9 @@ #ifndef _ASMPPC_SIGNAL_H #define _ASMPPC_SIGNAL_H +#ifdef __KERNEL__ #include <linux/types.h> +#endif /* __KERNEL__ */ /* Avoid too many header ordering problems. */ struct siginfo; diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h index abbd0ca0c..4851e13fd 100644 --- a/include/asm-ppc/smp.h +++ b/include/asm-ppc/smp.h @@ -3,6 +3,7 @@ * Taken from asm-sparc/smp.h */ +#ifdef __KERNEL__ #ifndef _PPC_SMP_H #define _PPC_SMP_H @@ -59,3 +60,4 @@ extern struct klock_info_struct klock_info; #endif /* !(CONFIG_SMP) */ #endif /* !(_PPC_SMP_H) */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/smplock.h b/include/asm-ppc/smplock.h index 96565069c..5fdd5733b 100644 --- a/include/asm-ppc/smplock.h +++ b/include/asm-ppc/smplock.h @@ -3,6 +3,7 @@ * * Default SMP lock implementation */ +#ifdef __KERNEL__ #include <linux/interrupt.h> #include <linux/spinlock.h> @@ -49,3 +50,4 @@ extern __inline__ void unlock_kernel(void) if (--current->lock_depth < 0) spin_unlock(&kernel_flag); } +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/softirq.h b/include/asm-ppc/softirq.h index 4eaed0be6..20898d818 100644 --- a/include/asm-ppc/softirq.h +++ b/include/asm-ppc/softirq.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef __ASM_SOFTIRQ_H #define __ASM_SOFTIRQ_H @@ -10,3 +11,4 @@ #define in_softirq() (local_bh_count(smp_processor_id()) != 0) #endif /* __ASM_SOFTIRQ_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h index 292406736..eae7df4a5 100644 --- a/include/asm-ppc/spinlock.h +++ b/include/asm-ppc/spinlock.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef __ASM_SPINLOCK_H #define __ASM_SPINLOCK_H @@ -54,3 +55,4 @@ extern void _write_unlock(rwlock_t *rw); #define read_unlock(rw) _read_unlock(rw) #endif /* __ASM_SPINLOCK_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/stat.h b/include/asm-ppc/stat.h index 204b07e6e..ed382adc8 100644 --- a/include/asm-ppc/stat.h +++ b/include/asm-ppc/stat.h @@ -1,7 +1,9 @@ #ifndef _PPC_STAT_H #define _PPC_STAT_H +#ifdef __KERNEL__ #include <linux/types.h> +#endif /* __KERNEL__ */ struct __old_kernel_stat { unsigned short st_dev; diff --git a/include/asm-ppc/string.h b/include/asm-ppc/string.h index d912a6b5f..557e3ad0e 100644 --- a/include/asm-ppc/string.h +++ b/include/asm-ppc/string.h @@ -1,6 +1,8 @@ #ifndef _PPC_STRING_H_ #define _PPC_STRING_H_ +#ifdef __KERNEL__ + #define __HAVE_ARCH_STRCPY #define __HAVE_ARCH_STRNCPY #define __HAVE_ARCH_STRLEN @@ -26,4 +28,6 @@ extern void * memmove(void *,const void *,__kernel_size_t); extern int memcmp(const void *,const void *,__kernel_size_t); extern void * memchr(const void *,int,__kernel_size_t); +#endif /* __KERNEL__ */ + #endif diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index 523a427a0..571d2c81f 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -3,6 +3,7 @@ * * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> */ +#ifdef __KERNEL__ #ifndef __PPC_SYSTEM_H #define __PPC_SYSTEM_H @@ -224,3 +225,4 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) }) #endif /* __PPC_SYSTEM_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/termbits.h b/include/asm-ppc/termbits.h index 324b62600..52e6d2d52 100644 --- a/include/asm-ppc/termbits.h +++ b/include/asm-ppc/termbits.h @@ -1,8 +1,6 @@ #ifndef _PPC_TERMBITS_H #define _PPC_TERMBITS_H -#include <linux/posix_types.h> - typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h index 1eb0ae9f0..8f43219a8 100644 --- a/include/asm-ppc/time.h +++ b/include/asm-ppc/time.h @@ -6,6 +6,7 @@ * Paul Mackerras' version and mine for PReP and Pmac. */ +#ifdef __KERNEL__ #include <linux/config.h> #include <linux/mc146818rtc.h> @@ -113,3 +114,4 @@ extern __inline__ unsigned binary_tbl(void) { ({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;}) unsigned mulhwu_scale_factor(unsigned, unsigned); +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/timex.h b/include/asm-ppc/timex.h index df7a8749d..485ad0053 100644 --- a/include/asm-ppc/timex.h +++ b/include/asm-ppc/timex.h @@ -3,6 +3,7 @@ * * ppc architecture timex specifications */ +#ifdef __KERNEL__ #ifndef _ASMppc_TIMEX_H #define _ASMppc_TIMEX_H @@ -39,3 +40,4 @@ static inline cycles_t get_cycles(void) } #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/tqm860.h b/include/asm-ppc/tqm860.h index a42b7b277..733dcccdb 100644 --- a/include/asm-ppc/tqm860.h +++ b/include/asm-ppc/tqm860.h @@ -10,6 +10,7 @@ * * Copyright (c) 1999 Wolfgang Denk (wd@denx.de) */ +#ifdef __KERNEL__ #ifndef __MACH_TQM860_DEFS #define __MACH_TQM860_DEFS @@ -63,3 +64,4 @@ typedef struct bd_info { #endif /* __MACH_TQM860_DEFS */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/tqm8xxL.h b/include/asm-ppc/tqm8xxL.h index e51e98080..338396aa6 100644 --- a/include/asm-ppc/tqm8xxL.h +++ b/include/asm-ppc/tqm8xxL.h @@ -10,6 +10,7 @@ * * Copyright (c) 1999 Wolfgang Denk (wd@denx.de) */ +#ifdef __KERNEL__ #ifndef __MACH_TQM8xxL_DEFS #define __MACH_TQM8xxL_DEFS @@ -64,3 +65,4 @@ typedef struct bd_info { #endif /* __MACH_TQM8xxL_DEFS */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h index 4ebbb9e02..6734fa276 100644 --- a/include/asm-ppc/types.h +++ b/include/asm-ppc/types.h @@ -3,8 +3,6 @@ #ifndef __ASSEMBLY__ -typedef unsigned short umode_t; - typedef __signed__ char __s8; typedef unsigned char __u8; @@ -21,7 +19,7 @@ typedef unsigned long long __u64; typedef struct { __u32 u[4]; -} __attribute((aligned(16))) vector128; +} __attribute((aligned(16))) __vector128; #ifdef __KERNEL__ /* @@ -39,11 +37,15 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; +typedef __vector128 vector128; + #define BITS_PER_LONG 32 /* DMA addresses are 32-bits wide */ typedef u32 dma_addr_t; +typedef unsigned short umode_t; + #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h index 628373b15..cd87905b0 100644 --- a/include/asm-ppc/uaccess.h +++ b/include/asm-ppc/uaccess.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_UACCESS_H #define _PPC_UACCESS_H @@ -274,3 +275,4 @@ extern __inline__ int strnlen_user(const char *str, long len) #endif /* __ASSEMBLY__ */ #endif /* _PPC_UACCESS_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/unaligned.h b/include/asm-ppc/unaligned.h index 90a54eae9..797ffd6e4 100644 --- a/include/asm-ppc/unaligned.h +++ b/include/asm-ppc/unaligned.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef __PPC_UNALIGNED_H #define __PPC_UNALIGNED_H @@ -14,3 +15,4 @@ #define put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/uninorth.h b/include/asm-ppc/uninorth.h index eefe4389c..b21cc8931 100644 --- a/include/asm-ppc/uninorth.h +++ b/include/asm-ppc/uninorth.h @@ -3,6 +3,7 @@ * from Apple. This chip is used on "Core99" machines * */ +#ifdef __KERNEL__ /* @@ -79,5 +80,4 @@ */ #define UNI_N_HWINIT_STATE_CPU1_FLAG 0x10000000 - - +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/user.h b/include/asm-ppc/user.h index e3bd611b3..d662b2151 100644 --- a/include/asm-ppc/user.h +++ b/include/asm-ppc/user.h @@ -1,3 +1,4 @@ +#ifdef __KERNEL__ #ifndef _PPC_USER_H #define _PPC_USER_H @@ -50,3 +51,4 @@ struct user { #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) #endif /* _PPC_USER_H */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/vga.h b/include/asm-ppc/vga.h index 69e3d7f9a..c5864734e 100644 --- a/include/asm-ppc/vga.h +++ b/include/asm-ppc/vga.h @@ -4,6 +4,7 @@ * (c) 1998 Martin Mares <mj@ucw.cz> */ +#ifdef __KERNEL__ #ifndef _LINUX_ASM_VGA_H_ #define _LINUX_ASM_VGA_H_ @@ -42,3 +43,4 @@ extern unsigned long vgacon_remap_base; #define vga_writeb(x,y) (*(y) = (x)) #endif +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/walnut.h b/include/asm-ppc/walnut.h index 84499af8a..45a92bbb3 100644 --- a/include/asm-ppc/walnut.h +++ b/include/asm-ppc/walnut.h @@ -11,6 +11,7 @@ * */ +#ifdef __KERNEL__ #ifndef __WALNUT_H__ #define __WALNUT_H__ @@ -26,3 +27,4 @@ extern "C" { #endif #endif /* __WALNUT_H__ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/xor.h b/include/asm-ppc/xor.h new file mode 100644 index 000000000..c82eb12a5 --- /dev/null +++ b/include/asm-ppc/xor.h @@ -0,0 +1 @@ +#include <asm-generic/xor.h> diff --git a/include/asm-s390/module.h b/include/asm-s390/module.h new file mode 100644 index 000000000..173869666 --- /dev/null +++ b/include/asm-s390/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_S390_MODULE_H +#define _ASM_S390_MODULE_H +/* + * This file contains the s390 architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_S390_MODULE_H */ diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index ae4f3b505..6906a875a 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h @@ -405,9 +405,6 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define swp_entry_to_pte(x) ((pte_t) { (x).val }) -#define module_map vmalloc -#define module_unmap vfree - #include <asm-generic/pgtable.h> #endif /* !__ASSEMBLY__ */ diff --git a/include/asm-s390/xor.h b/include/asm-s390/xor.h new file mode 100644 index 000000000..c82eb12a5 --- /dev/null +++ b/include/asm-s390/xor.h @@ -0,0 +1 @@ +#include <asm-generic/xor.h> diff --git a/include/asm-sh/module.h b/include/asm-sh/module.h new file mode 100644 index 000000000..62751b0fa --- /dev/null +++ b/include/asm-sh/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_SH_MODULE_H +#define _ASM_SH_MODULE_H +/* + * This file contains the SH architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_SH_MODULE_H */ diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index 323b7eb7c..2246e5c0d 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h @@ -254,9 +254,6 @@ extern void update_mmu_cache(struct vm_area_struct * vma, #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define swp_entry_to_pte(x) ((pte_t) { (x).val }) -#define module_map vmalloc -#define module_unmap vfree - #include <asm-generic/pgtable.h> #endif /* !__ASSEMBLY__ */ diff --git a/include/asm-sh/xor.h b/include/asm-sh/xor.h new file mode 100644 index 000000000..c82eb12a5 --- /dev/null +++ b/include/asm-sh/xor.h @@ -0,0 +1 @@ +#include <asm-generic/xor.h> diff --git a/include/asm-sparc/bpp.h b/include/asm-sparc/bpp.h index d1b967a00..ad4a84571 100644 --- a/include/asm-sparc/bpp.h +++ b/include/asm-sparc/bpp.h @@ -70,13 +70,4 @@ # define BPP_GP_Select 0x0800 # define BPP_GP_nFault 0x1000 - -/* - * Prototype for the initialization routine. - */ - -#ifdef __KERNEL__ -extern int bpp_init(void); -#endif - #endif diff --git a/include/asm-sparc/ethtool.h b/include/asm-sparc/ethtool.h deleted file mode 100644 index 572db24fb..000000000 --- a/include/asm-sparc/ethtool.h +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id: ethtool.h,v 1.2 2000/01/31 04:59:17 davem Exp $ - * ethtool.h: Defines for SparcLinux ethtool. - * - * Copyright (C) 1998 David S. Miller (davem@redhat.com) - */ - -#ifndef _SPARC_ETHTOOL_H -#define _SPARC_ETHTOOL_H - -/* We do things like this so it does not matter what kernel - * headers you have on your system etc. - */ -#undef SIOCETHTOOL -#define SIOCETHTOOL (SIOCDEVPRIVATE + 0x0f) - -/* This should work for both 32 and 64 bit userland. */ -struct ethtool_cmd { - u32 cmd; - u32 supported; - u16 speed; - u8 duplex; - u8 port; - u8 phy_address; - u8 transceiver; - u8 autoneg; -}; - -/* CMDs currently supported */ -#define SPARC_ETH_GSET 0x00000001 /* Get settings, non-privileged. */ -#define SPARC_ETH_SSET 0x00000002 /* Set settings, privileged. */ - -/* Indicates what features are supported by the interface. */ -#define SUPPORTED_10baseT_Half 0x00000001 -#define SUPPORTED_10baseT_Full 0x00000002 -#define SUPPORTED_100baseT_Half 0x00000004 -#define SUPPORTED_100baseT_Full 0x00000008 -#define SUPPORTED_1000baseT_Half 0x00000010 -#define SUPPORTED_1000baseT_Full 0x00000020 -#define SUPPORTED_Autoneg 0x00000040 -#define SUPPORTED_TP 0x00000080 -#define SUPPORTED_AUI 0x00000100 -#define SUPPORTED_MII 0x00000200 -#define SUPPORTED_FIBRE 0x00000400 - -/* The following are all involved in forcing a particular link - * mode for the device for setting things. When getting the - * devices settings, these indicate the current mode and whether - * it was foced up into this mode or autonegotiated. - */ - -/* The forced speec, 10Mb, 100Mb, gigabit. */ -#define SPEED_10 10 -#define SPEED_100 100 -#define SPEED_1000 1000 - -/* Duplex, half or full. */ -#define DUPLEX_HALF 0x00 -#define DUPLEX_FULL 0x01 - -/* Which connector port. */ -#define PORT_TP 0x00 -#define PORT_AUI 0x01 -#define PORT_MII 0x02 -#define PORT_FIBRE 0x03 - -/* Which tranceiver to use. */ -#define XCVR_INTERNAL 0x00 -#define XCVR_EXTERNAL 0x01 -#define XCVR_DUMMY1 0x02 -#define XCVR_DUMMY2 0x03 -#define XCVR_DUMMY3 0x04 - -/* Enable or disable autonegotiation. If this is set to enable, - * the forced link modes above are completely ignored. - */ -#define AUTONEG_DISABLE 0x00 -#define AUTONEG_ENABLE 0x01 - -#endif /* _SPARC_ETHTOOL_H */ diff --git a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h index 0724061e4..179f1a3cb 100644 --- a/include/asm-sparc/highmem.h +++ b/include/asm-sparc/highmem.h @@ -49,19 +49,19 @@ extern void kmap_init(void) __init; #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) -extern unsigned long kmap_high(struct page *page); +extern void *kmap_high(struct page *page); extern void kunmap_high(struct page *page); -extern inline unsigned long kmap(struct page *page) +static inline void *kmap(struct page *page) { if (in_interrupt()) BUG(); if (page < highmem_start_page) - return (unsigned long) page_address(page); + return page_address(page); return kmap_high(page); } -extern inline void kunmap(struct page *page) +static inline void kunmap(struct page *page) { if (in_interrupt()) BUG(); @@ -76,13 +76,13 @@ extern inline void kunmap(struct page *page) * be used in IRQ contexts, so in some (very limited) cases we need * it. */ -extern inline unsigned long kmap_atomic(struct page *page, enum km_type type) +static inline void *kmap_atomic(struct page *page, enum km_type type) { unsigned long idx; unsigned long vaddr; if (page < highmem_start_page) - return (unsigned long) page_address(page); + return page_address(page); idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = FIX_KMAP_BEGIN + idx * PAGE_SIZE; @@ -106,12 +106,13 @@ extern inline unsigned long kmap_atomic(struct page *page, enum km_type type) flush_tlb_all(); #endif - return vaddr; + return (void*) vaddr; } -extern inline void kunmap_atomic(unsigned long vaddr, enum km_type type) +static inline void kunmap_atomic(void *kvaddr, enum km_type type) { #if HIGHMEM_DEBUG + unsigned long vaddr = (unsigned long) kvaddr; unsigned long idx = type + KM_TYPE_NR*smp_processor_id(); #if 0 diff --git a/include/asm-sparc/module.h b/include/asm-sparc/module.h new file mode 100644 index 000000000..45c02931c --- /dev/null +++ b/include/asm-sparc/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_SPARC_MODULE_H +#define _ASM_SPARC_MODULE_H +/* + * This file contains the sparc architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_SPARC_MODULE_H */ diff --git a/include/asm-sparc/openpromio.h b/include/asm-sparc/openpromio.h index bebb788ac..6e32823ab 100644 --- a/include/asm-sparc/openpromio.h +++ b/include/asm-sparc/openpromio.h @@ -64,11 +64,5 @@ struct opiocdesc #define OPIOCGETNEXT _IOWR('O', 5, int) #define OPIOCGETCHILD _IOWR('O', 6, int) - -#ifdef __KERNEL__ -int openprom_init(void); -#endif - - #endif /* _SPARC_OPENPROMIO_H */ diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 251ff01da..020b68fbb 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.105 2000/10/30 21:01:41 davem Exp $ */ +/* $Id: pgtable.h,v 1.106 2000/11/08 04:49:24 davem Exp $ */ #ifndef _SPARC_PGTABLE_H #define _SPARC_PGTABLE_H @@ -437,8 +437,6 @@ __get_iospace (unsigned long addr) } } -#define module_map vmalloc -#define module_unmap vfree extern unsigned long *sparc_valid_addr_bitmap; /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ diff --git a/include/asm-sparc/xor.h b/include/asm-sparc/xor.h new file mode 100644 index 000000000..f9af76af7 --- /dev/null +++ b/include/asm-sparc/xor.h @@ -0,0 +1,273 @@ +/* + * include/asm-sparc/xor.h + * + * Optimized RAID-5 checksumming functions for 32-bit Sparc. + * + * 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, or (at your option) + * any later version. + * + * You should have received a copy of the GNU General Public License + * (for example /usr/src/linux/COPYING); if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * High speed xor_block operation for RAID4/5 utilizing the + * ldd/std SPARC instructions. + * + * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) + */ + +static void +sparc_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) +{ + int lines = bytes / (sizeof (long)) / 8; + + do { + __asm__ __volatile__(" + ldd [%0 + 0x00], %%g2 + ldd [%0 + 0x08], %%g4 + ldd [%0 + 0x10], %%o0 + ldd [%0 + 0x18], %%o2 + ldd [%1 + 0x00], %%o4 + ldd [%1 + 0x08], %%l0 + ldd [%1 + 0x10], %%l2 + ldd [%1 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + std %%g2, [%0 + 0x00] + std %%g4, [%0 + 0x08] + std %%o0, [%0 + 0x10] + std %%o2, [%0 + 0x18] + " + : + : "r" (p1), "r" (p2) + : "g2", "g3", "g4", "g5", + "o0", "o1", "o2", "o3", "o4", "o5", + "l0", "l1", "l2", "l3", "l4", "l5"); + p1 += 8; + p2 += 8; + } while (--lines > 0); +} + +static void +sparc_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3) +{ + int lines = bytes / (sizeof (long)) / 8; + + do { + __asm__ __volatile__(" + ldd [%0 + 0x00], %%g2 + ldd [%0 + 0x08], %%g4 + ldd [%0 + 0x10], %%o0 + ldd [%0 + 0x18], %%o2 + ldd [%1 + 0x00], %%o4 + ldd [%1 + 0x08], %%l0 + ldd [%1 + 0x10], %%l2 + ldd [%1 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%2 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%2 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%2 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%2 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + std %%g2, [%0 + 0x00] + std %%g4, [%0 + 0x08] + std %%o0, [%0 + 0x10] + std %%o2, [%0 + 0x18] + " + : + : "r" (p1), "r" (p2), "r" (p3) + : "g2", "g3", "g4", "g5", + "o0", "o1", "o2", "o3", "o4", "o5", + "l0", "l1", "l2", "l3", "l4", "l5"); + p1 += 8; + p2 += 8; + p3 += 8; + } while (--lines > 0); +} + +static void +sparc_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4) +{ + int lines = bytes / (sizeof (long)) / 8; + + do { + __asm__ __volatile__(" + ldd [%0 + 0x00], %%g2 + ldd [%0 + 0x08], %%g4 + ldd [%0 + 0x10], %%o0 + ldd [%0 + 0x18], %%o2 + ldd [%1 + 0x00], %%o4 + ldd [%1 + 0x08], %%l0 + ldd [%1 + 0x10], %%l2 + ldd [%1 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%2 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%2 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%2 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%2 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%3 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%3 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%3 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%3 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + std %%g2, [%0 + 0x00] + std %%g4, [%0 + 0x08] + std %%o0, [%0 + 0x10] + std %%o2, [%0 + 0x18] + " + : + : "r" (p1), "r" (p2), "r" (p3), "r" (p4) + : "g2", "g3", "g4", "g5", + "o0", "o1", "o2", "o3", "o4", "o5", + "l0", "l1", "l2", "l3", "l4", "l5"); + p1 += 8; + p2 += 8; + p3 += 8; + p4 += 8; + } while (--lines > 0); +} + +static void +sparc_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4, unsigned long *p5) +{ + int lines = bytes / (sizeof (long)) / 8; + + do { + __asm__ __volatile__(" + ldd [%0 + 0x00], %%g2 + ldd [%0 + 0x08], %%g4 + ldd [%0 + 0x10], %%o0 + ldd [%0 + 0x18], %%o2 + ldd [%1 + 0x00], %%o4 + ldd [%1 + 0x08], %%l0 + ldd [%1 + 0x10], %%l2 + ldd [%1 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%2 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%2 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%2 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%2 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%3 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%3 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%3 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%3 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%4 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%4 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%4 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%4 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + std %%g2, [%0 + 0x00] + std %%g4, [%0 + 0x08] + std %%o0, [%0 + 0x10] + std %%o2, [%0 + 0x18] + " + : + : "r" (p1), "r" (p2), "r" (p3), "r" (p4), "r" (p5) + : "g2", "g3", "g4", "g5", + "o0", "o1", "o2", "o3", "o4", "o5", + "l0", "l1", "l2", "l3", "l4", "l5"); + p1 += 8; + p2 += 8; + p3 += 8; + p4 += 8; + p5 += 8; + } while (--lines > 0); +} + +static struct xor_block_template xor_block_SPARC = { + name: "SPARC", + do_2: sparc_2, + do_3: sparc_3, + do_4: sparc_4, + do_5: sparc_5, +}; + +/* For grins, also test the generic routines. */ +#include <asm-generic/xor.h> + +#undef XOR_TRY_TEMPLATES +#define XOR_TRY_TEMPLATES \ + do { \ + xor_speed(&xor_block_8regs); \ + xor_speed(&xor_block_32regs); \ + xor_speed(&xor_block_SPARC); \ + } while (0) diff --git a/include/asm-sparc64/bpp.h b/include/asm-sparc64/bpp.h index 4b36c9209..eb86015ee 100644 --- a/include/asm-sparc64/bpp.h +++ b/include/asm-sparc64/bpp.h @@ -70,13 +70,4 @@ # define BPP_GP_Select 0x0800 # define BPP_GP_nFault 0x1000 - -/* - * Prototype for the initialization routine. - */ - -#ifdef __KERNEL__ -extern int bpp_init(void); -#endif - #endif diff --git a/include/asm-sparc64/envctrl.h b/include/asm-sparc64/envctrl.h index e16de8fb2..53a665381 100644 --- a/include/asm-sparc64/envctrl.h +++ b/include/asm-sparc64/envctrl.h @@ -1,4 +1,4 @@ -/* $Id: envctrl.h,v 1.2 2000/10/17 16:20:36 davem Exp $ +/* $Id: envctrl.h,v 1.3 2000/11/03 00:37:40 davem Exp $ * * envctrl.h: Definitions for access to the i2c environment * monitoring on Ultrasparc systems. @@ -54,6 +54,8 @@ #define ENVCTRL_RD_ETHERNET_TEMPERATURE _IOR('p', 0x47, int) #define ENVCTRL_RD_MTHRBD_TEMPERATURE _IOR('p', 0x48, int) +#define ENVCTRL_RD_GLOBALADDRESS _IOR('p', 0x49, int) + /* Read return values for a voltage status request. */ #define ENVCTRL_VOLTAGE_POWERSUPPLY_GOOD 0x01 #define ENVCTRL_VOLTAGE_BAD 0x02 diff --git a/include/asm-sparc64/ethtool.h b/include/asm-sparc64/ethtool.h deleted file mode 100644 index 18d86c3de..000000000 --- a/include/asm-sparc64/ethtool.h +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id: ethtool.h,v 1.2 2000/01/31 04:59:19 davem Exp $ - * ethtool.h: Defines for SparcLinux ethtool. - * - * Copyright (C) 1998 David S. Miller (davem@redhat.com) - */ - -#ifndef _SPARC64_ETHTOOL_H -#define _SPARC64_ETHTOOL_H - -/* We do things like this so it does not matter what kernel - * headers you have on your system etc. - */ -#undef SIOCETHTOOL -#define SIOCETHTOOL (SIOCDEVPRIVATE + 0x0f) - -/* This should work for both 32 and 64 bit userland. */ -struct ethtool_cmd { - u32 cmd; - u32 supported; - u16 speed; - u8 duplex; - u8 port; - u8 phy_address; - u8 transceiver; - u8 autoneg; -}; - -/* CMDs currently supported */ -#define SPARC_ETH_GSET 0x00000001 /* Get settings, non-privileged. */ -#define SPARC_ETH_SSET 0x00000002 /* Set settings, privileged. */ - -/* Indicates what features are supported by the interface. */ -#define SUPPORTED_10baseT_Half 0x00000001 -#define SUPPORTED_10baseT_Full 0x00000002 -#define SUPPORTED_100baseT_Half 0x00000004 -#define SUPPORTED_100baseT_Full 0x00000008 -#define SUPPORTED_1000baseT_Half 0x00000010 -#define SUPPORTED_1000baseT_Full 0x00000020 -#define SUPPORTED_Autoneg 0x00000040 -#define SUPPORTED_TP 0x00000080 -#define SUPPORTED_AUI 0x00000100 -#define SUPPORTED_MII 0x00000200 -#define SUPPORTED_FIBRE 0x00000400 - -/* The following are all involved in forcing a particular link - * mode for the device for setting things. When getting the - * devices settings, these indicate the current mode and whether - * it was foced up into this mode or autonegotiated. - */ - -/* The forced speec, 10Mb, 100Mb, gigabit. */ -#define SPEED_10 10 -#define SPEED_100 100 -#define SPEED_1000 1000 - -/* Duplex, half or full. */ -#define DUPLEX_HALF 0x00 -#define DUPLEX_FULL 0x01 - -/* Which connector port. */ -#define PORT_TP 0x00 -#define PORT_AUI 0x01 -#define PORT_MII 0x02 -#define PORT_FIBRE 0x03 - -/* Which tranceiver to use. */ -#define XCVR_INTERNAL 0x00 -#define XCVR_EXTERNAL 0x01 -#define XCVR_DUMMY1 0x02 -#define XCVR_DUMMY2 0x03 -#define XCVR_DUMMY3 0x04 - -/* Enable or disable autonegotiation. If this is set to enable, - * the forced link modes above are completely ignored. - */ -#define AUTONEG_DISABLE 0x00 -#define AUTONEG_ENABLE 0x01 - -#endif /* _SPARC64_ETHTOOL_H */ diff --git a/include/asm-sparc64/module.h b/include/asm-sparc64/module.h new file mode 100644 index 000000000..f44977ec8 --- /dev/null +++ b/include/asm-sparc64/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_SPARC64_MODULE_H +#define _ASM_SPARC64_MODULE_H +/* + * This file contains the sparc64 architecture specific module code. + */ + +extern void * module_map (unsigned long size); +extern void module_unmap (void *addr); +#define module_arch_init(x) (0) + +#endif /* _ASM_SPARC64_MODULE_H */ diff --git a/include/asm-sparc64/openpromio.h b/include/asm-sparc64/openpromio.h index 37420b761..555b3b5b1 100644 --- a/include/asm-sparc64/openpromio.h +++ b/include/asm-sparc64/openpromio.h @@ -64,11 +64,5 @@ struct opiocdesc #define OPIOCGETNEXT _IOWR('O', 5, int) #define OPIOCGETCHILD _IOWR('O', 6, int) - -#ifdef __KERNEL__ -int openprom_init(void); -#endif - - #endif /* _SPARC64_OPENPROMIO_H */ diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index be3dde29c..23603f287 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h @@ -1,4 +1,4 @@ -/* $Id */ +/* $Id: pgalloc.h,v 1.13 2000/11/06 06:59:04 davem Exp $ */ #ifndef _SPARC64_PGALLOC_H #define _SPARC64_PGALLOC_H @@ -21,8 +21,15 @@ /* These operations are unnecessary on the SpitFire since D-CACHE is write-through. */ #define flush_icache_range(start, end) do { } while (0) #define flush_page_to_ram(page) do { } while (0) -extern void __flush_dcache_page(void *addr); -#define flush_dcache_page(page) __flush_dcache_page((page)->virtual) + +extern void __flush_dcache_page(void *addr, int flush_icache); +#define flush_dcache_page(page) \ +do { if ((page)->mapping && !(page)->mapping->i_mmap && !(page)->mapping->i_mmap_shared) \ + set_bit(PG_dcache_dirty, &(page)->flags); \ + else \ + __flush_dcache_page((page)->virtual, \ + (page)->mapping != NULL); \ +} while(0) extern void __flush_dcache_range(unsigned long start, unsigned long end); diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 62c4c4ef4..a01042346 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.132 2000/10/19 00:50:16 davem Exp $ +/* $Id: pgtable.h,v 1.135 2000/11/08 04:49:24 davem Exp $ * pgtable.h: SpitFire page table operations. * * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -19,6 +19,8 @@ #ifndef __ASSEMBLY__ +#define PG_dcache_dirty PG_arch_1 + /* Certain architectures need to do special things when pte's * within a page table are directly modified. Thus, the following * hook is made available. @@ -233,7 +235,7 @@ extern pgd_t swapper_pg_dir[1]; #define mmu_lockarea(vaddr, len) (vaddr) #define mmu_unlockarea(vaddr, len) do { } while(0) -extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte); +extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); #define flush_icache_page(vma, pg) do { } while(0) @@ -284,8 +286,6 @@ __get_iospace (unsigned long addr) return ((sun4u_get_pte (addr) & 0xf0000000) >> 28); } -extern void * module_map (unsigned long size); -extern void module_unmap (void *addr); extern unsigned long *sparc64_valid_addr_bitmap; /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ diff --git a/include/asm-sparc64/xor.h b/include/asm-sparc64/xor.h new file mode 100644 index 000000000..0a3e1e876 --- /dev/null +++ b/include/asm-sparc64/xor.h @@ -0,0 +1,396 @@ +/* + * include/asm-sparc64/xor.h + * + * High speed xor_block operation for RAID4/5 utilizing the + * UltraSparc Visual Instruction Set. + * + * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz) + * + * 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, or (at your option) + * any later version. + * + * You should have received a copy of the GNU General Public License + * (for example /usr/src/linux/COPYING); if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Requirements: + * !(((long)dest | (long)sourceN) & (64 - 1)) && + * !(len & 127) && len >= 256 + * + * It is done in pure assembly, as otherwise gcc makes it a non-leaf + * function, which is not what we want. + */ + +#include <asm/pstate.h> +#include <asm/asi.h> + +extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); +extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, + unsigned long *); +extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *, + unsigned long *, unsigned long *); +extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *, + unsigned long *, unsigned long *, unsigned long *); + +#define _S(x) __S(x) +#define __S(x) #x +#define DEF(x) __asm__(#x " = " _S(x)) + +DEF(FPRS_FEF); +DEF(FPRS_DU); +DEF(ASI_BLK_P); + +/* ??? We set and use %asi instead of using ASI_BLK_P directly because gas + currently does not accept symbolic constants for the ASI specifier. */ + +__asm__ (" + .text + .globl xor_vis_2 + .type xor_vis_2,@function +xor_vis_2: + rd %fprs, %g1 + andcc %g1, FPRS_FEF|FPRS_DU, %g0 + be,pt %icc, 0f + sethi %hi(VISenter), %g1 + jmpl %g1 + %lo(VISenter), %g7 + add %g7, 8, %g7 +0: wr %g0, FPRS_FEF, %fprs + rd %asi, %g1 + wr %g0, ASI_BLK_P, %asi + membar #LoadStore|#StoreLoad|#StoreStore + sub %o0, 128, %o0 + ldda [%o1] %asi, %f0 + ldda [%o2] %asi, %f16 + +2: ldda [%o1 + 64] %asi, %f32 + fxor %f0, %f16, %f16 + fxor %f2, %f18, %f18 + fxor %f4, %f20, %f20 + fxor %f6, %f22, %f22 + fxor %f8, %f24, %f24 + fxor %f10, %f26, %f26 + fxor %f12, %f28, %f28 + fxor %f14, %f30, %f30 + stda %f16, [%o1] %asi + ldda [%o2 + 64] %asi, %f48 + ldda [%o1 + 128] %asi, %f0 + fxor %f32, %f48, %f48 + fxor %f34, %f50, %f50 + add %o1, 128, %o1 + fxor %f36, %f52, %f52 + add %o2, 128, %o2 + fxor %f38, %f54, %f54 + subcc %o0, 128, %o0 + fxor %f40, %f56, %f56 + fxor %f42, %f58, %f58 + fxor %f44, %f60, %f60 + fxor %f46, %f62, %f62 + stda %f48, [%o1 - 64] %asi + bne,pt %xcc, 2b + ldda [%o2] %asi, %f16 + + ldda [%o1 + 64] %asi, %f32 + fxor %f0, %f16, %f16 + fxor %f2, %f18, %f18 + fxor %f4, %f20, %f20 + fxor %f6, %f22, %f22 + fxor %f8, %f24, %f24 + fxor %f10, %f26, %f26 + fxor %f12, %f28, %f28 + fxor %f14, %f30, %f30 + stda %f16, [%o1] %asi + ldda [%o2 + 64] %asi, %f48 + membar #Sync + fxor %f32, %f48, %f48 + fxor %f34, %f50, %f50 + fxor %f36, %f52, %f52 + fxor %f38, %f54, %f54 + fxor %f40, %f56, %f56 + fxor %f42, %f58, %f58 + fxor %f44, %f60, %f60 + fxor %f46, %f62, %f62 + stda %f48, [%o1 + 64] %asi + membar #Sync|#StoreStore|#StoreLoad + wr %g1, %g0, %asi + retl + wr %g0, 0, %fprs + .size xor_vis_2, .-xor_vis_2 + + + .globl xor_vis_3 + .type xor_vis_3,@function +xor_vis_3: + rd %fprs, %g1 + andcc %g1, FPRS_FEF|FPRS_DU, %g0 + be,pt %icc, 0f + sethi %hi(VISenter), %g1 + jmpl %g1 + %lo(VISenter), %g7 + add %g7, 8, %g7 +0: wr %g0, FPRS_FEF, %fprs + rd %asi, %g1 + wr %g0, ASI_BLK_P, %asi + membar #LoadStore|#StoreLoad|#StoreStore + sub %o0, 64, %o0 + ldda [%o1] %asi, %f0 + ldda [%o2] %asi, %f16 + +3: ldda [%o3] %asi, %f32 + fxor %f0, %f16, %f48 + fxor %f2, %f18, %f50 + add %o1, 64, %o1 + fxor %f4, %f20, %f52 + fxor %f6, %f22, %f54 + add %o2, 64, %o2 + fxor %f8, %f24, %f56 + fxor %f10, %f26, %f58 + fxor %f12, %f28, %f60 + fxor %f14, %f30, %f62 + ldda [%o1] %asi, %f0 + fxor %f48, %f32, %f48 + fxor %f50, %f34, %f50 + fxor %f52, %f36, %f52 + fxor %f54, %f38, %f54 + add %o3, 64, %o3 + fxor %f56, %f40, %f56 + fxor %f58, %f42, %f58 + subcc %o0, 64, %o0 + fxor %f60, %f44, %f60 + fxor %f62, %f46, %f62 + stda %f48, [%o1 - 64] %asi + bne,pt %xcc, 3b + ldda [%o2] %asi, %f16 + + ldda [%o3] %asi, %f32 + fxor %f0, %f16, %f48 + fxor %f2, %f18, %f50 + fxor %f4, %f20, %f52 + fxor %f6, %f22, %f54 + fxor %f8, %f24, %f56 + fxor %f10, %f26, %f58 + fxor %f12, %f28, %f60 + fxor %f14, %f30, %f62 + membar #Sync + fxor %f48, %f32, %f48 + fxor %f50, %f34, %f50 + fxor %f52, %f36, %f52 + fxor %f54, %f38, %f54 + fxor %f56, %f40, %f56 + fxor %f58, %f42, %f58 + fxor %f60, %f44, %f60 + fxor %f62, %f46, %f62 + stda %f48, [%o1] %asi + membar #Sync|#StoreStore|#StoreLoad + wr %g1, %g0, %asi + retl + wr %g0, 0, %fprs + .size xor_vis_3, .-xor_vis_3 + + + .globl xor_vis_4 + .type xor_vis_4,@function +xor_vis_4: + rd %fprs, %g1 + andcc %g1, FPRS_FEF|FPRS_DU, %g0 + be,pt %icc, 0f + sethi %hi(VISenter), %g1 + jmpl %g1 + %lo(VISenter), %g7 + add %g7, 8, %g7 +0: wr %g0, FPRS_FEF, %fprs + rd %asi, %g1 + wr %g0, ASI_BLK_P, %asi + membar #LoadStore|#StoreLoad|#StoreStore + sub %o0, 64, %o0 + ldda [%o1] %asi, %f0 + ldda [%o2] %asi, %f16 + +4: ldda [%o3] %asi, %f32 + fxor %f0, %f16, %f16 + fxor %f2, %f18, %f18 + add %o1, 64, %o1 + fxor %f4, %f20, %f20 + fxor %f6, %f22, %f22 + add %o2, 64, %o2 + fxor %f8, %f24, %f24 + fxor %f10, %f26, %f26 + fxor %f12, %f28, %f28 + fxor %f14, %f30, %f30 + ldda [%o4] %asi, %f48 + fxor %f16, %f32, %f32 + fxor %f18, %f34, %f34 + fxor %f20, %f36, %f36 + fxor %f22, %f38, %f38 + add %o3, 64, %o3 + fxor %f24, %f40, %f40 + fxor %f26, %f42, %f42 + fxor %f28, %f44, %f44 + fxor %f30, %f46, %f46 + ldda [%o1] %asi, %f0 + fxor %f32, %f48, %f48 + fxor %f34, %f50, %f50 + fxor %f36, %f52, %f52 + add %o4, 64, %o4 + fxor %f38, %f54, %f54 + fxor %f40, %f56, %f56 + fxor %f42, %f58, %f58 + subcc %o0, 64, %o0 + fxor %f44, %f60, %f60 + fxor %f46, %f62, %f62 + stda %f48, [%o1 - 64] %asi + bne,pt %xcc, 4b + ldda [%o2] %asi, %f16 + + ldda [%o3] %asi, %f32 + fxor %f0, %f16, %f16 + fxor %f2, %f18, %f18 + fxor %f4, %f20, %f20 + fxor %f6, %f22, %f22 + fxor %f8, %f24, %f24 + fxor %f10, %f26, %f26 + fxor %f12, %f28, %f28 + fxor %f14, %f30, %f30 + ldda [%o4] %asi, %f48 + fxor %f16, %f32, %f32 + fxor %f18, %f34, %f34 + fxor %f20, %f36, %f36 + fxor %f22, %f38, %f38 + fxor %f24, %f40, %f40 + fxor %f26, %f42, %f42 + fxor %f28, %f44, %f44 + fxor %f30, %f46, %f46 + membar #Sync + fxor %f32, %f48, %f48 + fxor %f34, %f50, %f50 + fxor %f36, %f52, %f52 + fxor %f38, %f54, %f54 + fxor %f40, %f56, %f56 + fxor %f42, %f58, %f58 + fxor %f44, %f60, %f60 + fxor %f46, %f62, %f62 + stda %f48, [%o1] %asi + membar #Sync|#StoreStore|#StoreLoad + wr %g1, %g0, %asi + retl + wr %g0, 0, %fprs + .size xor_vis_4, .-xor_vis_4 + + + .globl xor_vis_5 + .type xor_vis_5,@function +xor_vis_5: + rd %fprs, %g1 + andcc %g1, FPRS_FEF|FPRS_DU, %g0 + be,pt %icc, 0f + sethi %hi(VISenter), %g1 + jmpl %g1 + %lo(VISenter), %g7 + add %g7, 8, %g7 +0: wr %g0, FPRS_FEF, %fprs + rd %asi, %g1 + wr %g0, ASI_BLK_P, %asi + membar #LoadStore|#StoreLoad|#StoreStore + sub %o0, 64, %o0 + ldda [%o1] %asi, %f0 + ldda [%o2] %asi, %f16 + +5: ldda [%o3] %asi, %f32 + fxor %f0, %f16, %f48 + fxor %f2, %f18, %f50 + add %o1, 64, %o1 + fxor %f4, %f20, %f52 + fxor %f6, %f22, %f54 + add %o2, 64, %o2 + fxor %f8, %f24, %f56 + fxor %f10, %f26, %f58 + fxor %f12, %f28, %f60 + fxor %f14, %f30, %f62 + ldda [%o4] %asi, %f16 + fxor %f48, %f32, %f48 + fxor %f50, %f34, %f50 + fxor %f52, %f36, %f52 + fxor %f54, %f38, %f54 + add %o3, 64, %o3 + fxor %f56, %f40, %f56 + fxor %f58, %f42, %f58 + fxor %f60, %f44, %f60 + fxor %f62, %f46, %f62 + ldda [%o5] %asi, %f32 + fxor %f48, %f16, %f48 + fxor %f50, %f18, %f50 + add %o4, 64, %o4 + fxor %f52, %f20, %f52 + fxor %f54, %f22, %f54 + add %o5, 64, %o5 + fxor %f56, %f24, %f56 + fxor %f58, %f26, %f58 + fxor %f60, %f28, %f60 + fxor %f62, %f30, %f62 + ldda [%o1] %asi, %f0 + fxor %f48, %f32, %f48 + fxor %f50, %f34, %f50 + fxor %f52, %f36, %f52 + fxor %f54, %f38, %f54 + fxor %f56, %f40, %f56 + fxor %f58, %f42, %f58 + subcc %o0, 64, %o0 + fxor %f60, %f44, %f60 + fxor %f62, %f46, %f62 + stda %f48, [%o1 - 64] %asi + bne,pt %xcc, 5b + ldda [%o2] %asi, %f16 + + ldda [%o3] %asi, %f32 + fxor %f0, %f16, %f48 + fxor %f2, %f18, %f50 + fxor %f4, %f20, %f52 + fxor %f6, %f22, %f54 + fxor %f8, %f24, %f56 + fxor %f10, %f26, %f58 + fxor %f12, %f28, %f60 + fxor %f14, %f30, %f62 + ldda [%o4] %asi, %f16 + fxor %f48, %f32, %f48 + fxor %f50, %f34, %f50 + fxor %f52, %f36, %f52 + fxor %f54, %f38, %f54 + fxor %f56, %f40, %f56 + fxor %f58, %f42, %f58 + fxor %f60, %f44, %f60 + fxor %f62, %f46, %f62 + ldda [%o5] %asi, %f32 + fxor %f48, %f16, %f48 + fxor %f50, %f18, %f50 + fxor %f52, %f20, %f52 + fxor %f54, %f22, %f54 + fxor %f56, %f24, %f56 + fxor %f58, %f26, %f58 + fxor %f60, %f28, %f60 + fxor %f62, %f30, %f62 + membar #Sync + fxor %f48, %f32, %f48 + fxor %f50, %f34, %f50 + fxor %f52, %f36, %f52 + fxor %f54, %f38, %f54 + fxor %f56, %f40, %f56 + fxor %f58, %f42, %f58 + fxor %f60, %f44, %f60 + fxor %f62, %f46, %f62 + stda %f48, [%o1] %asi + membar #Sync|#StoreStore|#StoreLoad + wr %g1, %g0, %asi + retl + wr %g0, 0, %fprs + .size xor_vis_5, .-xor_vis_5 +"); + +static struct xor_block_template xor_block_VIS = { + name: "VIS", + do_2: xor_vis_2, + do_3: xor_vis_3, + do_4: xor_vis_4, + do_5: xor_vis_5, +}; + +#define XOR_TRY_TEMPLATES xor_speed(&xor_block_VIS) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 993fd93e7..7a045f033 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -215,6 +215,7 @@ enum { ACPI_FACP = 1, ACPI_DSDT, + ACPI_FACS, ACPI_PM1_ENABLE, ACPI_GPE_ENABLE, ACPI_GPE_LEVEL, diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index 166fa085b..99df46b37 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h @@ -45,6 +45,7 @@ enum chipset_type { INTEL_BX, INTEL_GX, INTEL_I810, + INTEL_I815, INTEL_I840, VIA_GENERIC, VIA_VP3, @@ -226,4 +227,23 @@ extern void agp_backend_release(void); * */ +typedef struct { + void (*free_memory)(agp_memory *); + agp_memory *(*allocate_memory)(size_t, u32); + int (*bind_memory)(agp_memory *, off_t); + int (*unbind_memory)(agp_memory *); + void (*enable)(u32); + int (*acquire)(void); + void (*release)(void); + void (*copy_info)(agp_kern_info *); +} drm_agp_t; + +extern const drm_agp_t *drm_agp_p; + +/* + * Interface between drm and agp code. When agp initializes, it makes + * the above structure available via inter_module_register(), drm might + * use it. Keith Owens <kaos@ocs.com.au> 28 Oct 2000. + */ + #endif /* _AGP_BACKEND_H */ diff --git a/include/linux/blk.h b/include/linux/blk.h index 66bbdcf60..eb4d603e7 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -115,7 +115,6 @@ void end_that_request_last(struct request *req); /* ram disk */ #define DEVICE_NAME "ramdisk" -#define DEVICE_REQUEST rd_request #define DEVICE_NR(device) (MINOR(device)) #define DEVICE_NO_RANDOM diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h index a10ef3086..3ce838219 100644 --- a/include/linux/byteorder/swabb.h +++ b/include/linux/byteorder/swabb.h @@ -37,7 +37,7 @@ __u32 __x = (x); \ ((__u32)( \ (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \ - (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )) \ + (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )); \ }) #define ___constant_swahw32(x) \ diff --git a/include/linux/divert.h b/include/linux/divert.h index 624bc55ed..66e56ec15 100644 --- a/include/linux/divert.h +++ b/include/linux/divert.h @@ -112,6 +112,6 @@ void free_divert_blk(struct net_device *); int divert_ioctl(unsigned int cmd, struct divert_cf *arg); void divert_frame(struct sk_buff *skb); -#endif __KERNEL__ +#endif #endif /* _LINUX_DIVERT_H */ diff --git a/include/linux/dn.h b/include/linux/dn.h index 266dc0f25..c7448158b 100644 --- a/include/linux/dn.h +++ b/include/linux/dn.h @@ -139,23 +139,4 @@ struct dn_addr { #define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int) #define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int) -/* - * An unofficial structure used to set/get routes. - * Be warned, this will probably change as the routing - * evolves. Also this is only for use with the ioctl() - * and the routing will use rtnetlink eventually. - */ -struct dn_fib_rtinfo { - unsigned long flags; /* Flags */ -#define DN_FIB_RTINFO_F_REPLACE 0x0001 /* Replace any existing route */ -#define DN_FIB_RTINFO_F_DEVCOST 0x0002 /* Add cost of device */ - unsigned long timeout; /* Time in seconds route should last */ - unsigned short src; /* Source Address, 0 = any */ - unsigned short dst; /* Destination Address */ - unsigned short nhp; /* Next Hop Address */ - unsigned short hops; /* Hops on path */ - unsigned short cost; /* Cost of path */ - char device[16]; -}; - #endif /* _LINUX_DN_H */ diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h new file mode 100644 index 000000000..384171b3f --- /dev/null +++ b/include/linux/ethtool.h @@ -0,0 +1,97 @@ +/* $Id: ethtool.h,v 1.2 2000/11/12 10:05:57 davem Exp $ + * ethtool.h: Defines for Linux ethtool. + * + * Copyright (C) 1998 David S. Miller (davem@redhat.com) + */ + +#ifndef _LINUX_ETHTOOL_H +#define _LINUX_ETHTOOL_H + + +/* This should work for both 32 and 64 bit userland. */ +struct ethtool_cmd { + u32 cmd; + u32 supported; /* Features this interface supports */ + u32 advertising; /* Features this interface advertises */ + u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ + u8 duplex; /* Duplex, half or full */ + u8 port; /* Which connector port */ + u8 phy_address; + u8 transceiver; /* Which tranceiver to use */ + u8 autoneg; /* Enable or disable autonegotiation */ + u32 maxtxpkt; /* Tx pkts before generating tx int */ + u32 maxrxpkt; /* Rx pkts before generating rx int */ + u32 reserved[4]; +}; + + +/* CMDs currently supported */ +#define ETHTOOL_GSET 0x00000001 /* Get settings, non-privileged. */ +#define ETHTOOL_SSET 0x00000002 /* Set settings, privileged. */ + +/* compatibility with older code */ +#define SPARC_ETH_GSET ETHTOOL_GSET +#define SPARC_ETH_SSET ETHTOOL_SSET + +/* Indicates what features are supported by the interface. */ +#define SUPPORTED_10baseT_Half (1 << 0) +#define SUPPORTED_10baseT_Full (1 << 1) +#define SUPPORTED_100baseT_Half (1 << 2) +#define SUPPORTED_100baseT_Full (1 << 3) +#define SUPPORTED_1000baseT_Half (1 << 4) +#define SUPPORTED_1000baseT_Full (1 << 5) +#define SUPPORTED_Autoneg (1 << 6) +#define SUPPORTED_TP (1 << 7) +#define SUPPORTED_AUI (1 << 8) +#define SUPPORTED_MII (1 << 9) +#define SUPPORTED_FIBRE (1 << 10) + +/* Indicates what features are advertised by the interface. */ +#define ADVERTISED_10baseT_Half (1 << 0) +#define ADVERTISED_10baseT_Full (1 << 1) +#define ADVERTISED_100baseT_Half (1 << 2) +#define ADVERTISED_100baseT_Full (1 << 3) +#define ADVERTISED_1000baseT_Half (1 << 4) +#define ADVERTISED_1000baseT_Full (1 << 5) +#define ADVERTISED_Autoneg (1 << 6) +#define ADVERTISED_TP (1 << 7) +#define ADVERTISED_AUI (1 << 8) +#define ADVERTISED_MII (1 << 9) +#define ADVERTISED_FIBRE (1 << 10) + +/* The following are all involved in forcing a particular link + * mode for the device for setting things. When getting the + * devices settings, these indicate the current mode and whether + * it was foced up into this mode or autonegotiated. + */ + +/* The forced speed, 10Mb, 100Mb, gigabit. */ +#define SPEED_10 10 +#define SPEED_100 100 +#define SPEED_1000 1000 + +/* Duplex, half or full. */ +#define DUPLEX_HALF 0x00 +#define DUPLEX_FULL 0x01 + +/* Which connector port. */ +#define PORT_TP 0x00 +#define PORT_AUI 0x01 +#define PORT_MII 0x02 +#define PORT_FIBRE 0x03 +#define PORT_BNC 0x04 + +/* Which tranceiver to use. */ +#define XCVR_INTERNAL 0x00 +#define XCVR_EXTERNAL 0x01 +#define XCVR_DUMMY1 0x02 +#define XCVR_DUMMY2 0x03 +#define XCVR_DUMMY3 0x04 + +/* Enable or disable autonegotiation. If this is set to enable, + * the forced link modes above are completely ignored. + */ +#define AUTONEG_DISABLE 0x00 +#define AUTONEG_ENABLE 0x01 + +#endif /* _LINUX_ETHTOOL_H */ diff --git a/include/linux/fb.h b/include/linux/fb.h index fa8f9cded..357878b65 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -29,6 +29,9 @@ #define FBIO_FREE 0x4614 #define FBIOGET_GLYPH 0x4615 #define FBIOGET_HWCINFO 0x4616 +#define FBIOPUT_MODEINFO 0x4617 +#define FBIOGET_DISPINFO 0x4618 + #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 72effef4a..470186804 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -546,7 +546,6 @@ struct file_lock { #endif extern struct list_head file_lock_list; -extern struct semaphore file_lock_sem; #include <linux/fcntl.h> @@ -1150,6 +1149,15 @@ static inline struct inode *iget(struct super_block *sb, unsigned long ino) extern void clear_inode(struct inode *); extern struct inode * get_empty_inode(void); +static inline struct inode * new_inode(struct super_block *sb) +{ + struct inode *inode = get_empty_inode(); + if (inode) { + inode->i_sb = sb; + inode->i_dev = sb->s_dev; + } + return inode; +} extern void insert_inode_hash(struct inode *); extern void remove_inode_hash(struct inode *); diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 184407e40..9cac7759a 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -17,50 +17,56 @@ extern struct page * prepare_highmem_swapout(struct page *); extern struct page * replace_with_highmem(struct page *); extern struct buffer_head * create_bounce(int rw, struct buffer_head * bh_orig); + +static inline char *bh_kmap(struct buffer_head *bh) +{ + return kmap(bh->b_page) + bh_offset(bh); +} + +static inline void bh_kunmap(struct buffer_head *bh) +{ + kunmap(bh->b_page); +} + #else /* CONFIG_HIGHMEM */ static inline unsigned int nr_free_highpages(void) { return 0; } #define prepare_highmem_swapout(page) page #define replace_with_highmem(page) page -static __inline__ unsigned long kmap(struct page * page) { - return (unsigned long) page_address(page); -} +static inline void *kmap(struct page *page) { return page_address(page); } #define kunmap(page) do { } while (0) #define kmap_atomic(page,idx) kmap(page) #define kunmap_atomic(page,idx) kunmap(page) +#define bh_kmap(bh) ((bh)->b_data) +#define bh_kunmap(bh) do { } while (0); + #endif /* CONFIG_HIGHMEM */ /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ static inline void clear_user_highpage(struct page *page, unsigned long vaddr) { - unsigned long kaddr; - - kaddr = kmap(page); - clear_user_page((void *)kaddr, vaddr); + clear_user_page(kmap(page), vaddr); kunmap(page); } static inline void clear_highpage(struct page *page) { - unsigned long kaddr; - - kaddr = kmap(page); - clear_page((void *)kaddr); + clear_page(kmap(page)); kunmap(page); } static inline void memclear_highpage(struct page *page, unsigned int offset, unsigned int size) { - unsigned long kaddr; + char *kaddr; if (offset + size > PAGE_SIZE) BUG(); kaddr = kmap(page); - memset((void *)(kaddr + offset), 0, size); + memset(kaddr + offset, 0, size); kunmap(page); } @@ -69,34 +75,34 @@ static inline void memclear_highpage(struct page *page, unsigned int offset, uns */ static inline void memclear_highpage_flush(struct page *page, unsigned int offset, unsigned int size) { - unsigned long kaddr; + char *kaddr; if (offset + size > PAGE_SIZE) BUG(); kaddr = kmap(page); - memset((void *)(kaddr + offset), 0, size); + memset(kaddr + offset, 0, size); flush_page_to_ram(page); kunmap(page); } static inline void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr) { - unsigned long vfrom, vto; + char *vfrom, *vto; vfrom = kmap(from); vto = kmap(to); - copy_user_page((void *)vto, (void *)vfrom, vaddr); + copy_user_page(vto, vfrom, vaddr); kunmap(from); kunmap(to); } static inline void copy_highpage(struct page *to, struct page *from) { - unsigned long vfrom, vto; + char *vfrom, *vto; vfrom = kmap(from); vto = kmap(to); - copy_page((void *)vto, (void *)vfrom); + copy_page(vto, vfrom); kunmap(from); kunmap(to); } diff --git a/include/linux/irda.h b/include/linux/irda.h index d8532c2fc..40aec1c8d 100644 --- a/include/linux/irda.h +++ b/include/linux/irda.h @@ -78,14 +78,17 @@ enum { #define SOL_IRLMP 266 /* Same as SOL_IRDA for now */ #define SOL_IRTTP 266 /* Same as SOL_IRDA for now */ -#define IRLMP_ENUMDEVICES 1 -#define IRLMP_IAS_SET 2 -#define IRLMP_IAS_QUERY 3 -#define IRLMP_HINTS_SET 4 +#define IRLMP_ENUMDEVICES 1 /* Return discovery log */ +#define IRLMP_IAS_SET 2 /* Set an attribute in local IAS */ +#define IRLMP_IAS_QUERY 3 /* Query remote IAS for attribute */ +#define IRLMP_HINTS_SET 4 /* Set hint bits advertised */ #define IRLMP_QOS_SET 5 #define IRLMP_QOS_GET 6 #define IRLMP_MAX_SDU_SIZE 7 -#define IRLMP_IAS_GET 8 +#define IRLMP_IAS_GET 8 /* Get an attribute from local IAS */ +#define IRLMP_IAS_DEL 9 /* Remove attribute from local IAS */ +#define IRLMP_HINT_MASK_SET 10 /* Set discovery filter */ +#define IRLMP_WAITDEVICE 11 /* Wait for a new discovery */ #define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */ @@ -94,6 +97,12 @@ enum { #define IAS_MAX_CLASSNAME 64 #define IAS_MAX_ATTRIBNAME 256 +/* Attribute type needed for struct irda_ias_set */ +#define IAS_MISSING 0 +#define IAS_INTEGER 1 +#define IAS_OCT_SEQ 2 +#define IAS_STRING 3 + #define LSAP_ANY 0xff struct sockaddr_irda { @@ -132,6 +141,7 @@ struct irda_ias_set { __u8 string[IAS_MAX_STRING]; } irda_attrib_string; } attribute; + __u32 daddr; /* Address of device (for some queries only) */ }; /* Some private IOCTL's (max 16) */ diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 7cdd4ff43..51c06aec7 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -1,4 +1,4 @@ -/* $Id: isdn.h,v 1.106 2000/08/10 22:52:46 kai Exp $ +/* $Id: isdn.h,v 1.110 2000/11/01 17:54:01 detabc Exp $ * Main header for the Linux ISDN subsystem (linklevel). * @@ -66,8 +66,7 @@ #undef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE #undef CONFIG_ISDN_WITH_ABC_CONN_ERROR #undef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS -#undef CONFIG_ISDN_WITH_ABC_IPV4_RW_SOCKADDR -#undef CONFIG_ISDN_WITH_ABC_IPV4_RWUDP_SOCKADDR +#undef CONFIG_ISDN_WITH_ABC_IPTABLES_NETFILTER /* New ioctl-codes */ diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 63543da77..471c9af2c 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h @@ -177,16 +177,17 @@ extern int iso_date(char *, int); extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *); extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *); +extern int isofs_name_translate(struct iso_directory_record *, char *, struct inode *); extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inode *); -int get_joliet_filename(struct iso_directory_record *, struct inode *, unsigned char *); +int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct inode *); int get_acorn_filename(struct iso_directory_record *, char *, struct inode *); extern struct dentry *isofs_lookup(struct inode *, struct dentry *); extern int isofs_get_block(struct inode *, long, struct buffer_head *, int); extern int isofs_bmap(struct inode *, int); -extern int isofs_lookup_grandparent(struct inode *, int); +extern struct buffer_head *isofs_bread(struct inode *, unsigned int, unsigned int); extern struct inode_operations isofs_dir_inode_operations; extern struct file_operations isofs_dir_operations; diff --git a/include/linux/kernel.h b/include/linux/kernel.h index aa337fe6c..beb41bfa3 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -45,11 +45,15 @@ #define FASTCALL(x) x #endif +struct semaphore; + extern struct notifier_block *panic_notifier_list; NORET_TYPE void panic(const char * fmt, ...) __attribute__ ((NORET_AND format (printf, 1, 2))); NORET_TYPE void do_exit(long error_code) ATTRIB_NORET; +NORET_TYPE void up_and_exit(struct semaphore *, long) + ATTRIB_NORET; extern unsigned long simple_strtoul(const char *,char **,unsigned int); extern long simple_strtol(const char *,char **,unsigned int); extern int sprintf(char * buf, const char * fmt, ...); diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index 40530168e..acbdea338 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h @@ -1,5 +1,5 @@ /* - * $Id: kernelcapi.h,v 1.7 2000/06/12 09:20:20 kai Exp $ + * $Id: kernelcapi.h,v 1.8 2000/08/22 10:11:00 calle Exp $ * * Kernel CAPI 2.0 Interface for Linux * diff --git a/include/linux/kmod.h b/include/linux/kmod.h index bab128898..44e1ea652 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -1,22 +1,38 @@ +#ifndef __LINUX_KMOD_H__ +#define __LINUX_KMOD_H__ + /* - kmod header -*/ + * include/linux/kmod.h + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ #include <linux/config.h> #include <linux/errno.h> #ifdef CONFIG_KMOD extern int request_module(const char * name); +#else +static inline int request_module(const char * name) { return -ENOSYS; } +#endif + extern int exec_usermodehelper(char *program_path, char *argv[], char *envp[]); +extern int call_usermodehelper(char *path, char *argv[], char *envp[]); + #ifdef CONFIG_HOTPLUG extern char hotplug_path []; -extern int call_usermodehelper(char *path, char *argv[], char *envp[]); -#endif -#else -static inline int request_module(const char * name) { return -ENOSYS; } -static inline int exec_usermodehelper(char *program_path, char *argv[], char *envp[]) -{ - return -EACCES; -} #endif +#endif /* __LINUX_KMOD_H__ */ diff --git a/include/linux/lapb.h b/include/linux/lapb.h index bf1825a6b..2eeb76f2c 100644 --- a/include/linux/lapb.h +++ b/include/linux/lapb.h @@ -28,7 +28,7 @@ struct lapb_register_struct { void (*connect_indication)(void *token, int reason); void (*disconnect_confirmation)(void *token, int reason); void (*disconnect_indication)(void *token, int reason); - void (*data_indication)(void *token, struct sk_buff *skb); + int (*data_indication)(void *token, struct sk_buff *skb); void (*data_transmit)(void *token, struct sk_buff *skb); }; diff --git a/include/linux/mm.h b/include/linux/mm.h index 59355eb8a..70ffe28e4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -181,7 +181,8 @@ typedef struct page { #define PG_skip 10 #define PG_inactive_clean 11 #define PG_highmem 12 - /* bits 21-30 unused */ + /* bits 21-29 unused */ +#define PG_arch_1 30 #define PG_reserved 31 @@ -328,6 +329,10 @@ typedef struct page { * parts of the address space. * * PG_error is set to indicate that an I/O error occurred on this page. + * + * PG_arch_1 is an architecture specific page state bit. The generic + * code guarentees that this bit is cleared for a page when it first + * is entered into the page cache. */ extern mem_map_t * mem_map; @@ -412,8 +417,11 @@ extern void si_meminfo(struct sysinfo * val); extern void swapin_readahead(swp_entry_t); /* mmap.c */ +extern void lock_vma_mappings(struct vm_area_struct *); +extern void unlock_vma_mappings(struct vm_area_struct *); extern void merge_segments(struct mm_struct *, unsigned long, unsigned long); extern void insert_vm_struct(struct mm_struct *, struct vm_area_struct *); +extern void __insert_vm_struct(struct mm_struct *, struct vm_area_struct *); extern void build_mmap_avl(struct mm_struct *); extern void exit_mmap(struct mm_struct *); extern unsigned long get_unmapped_area(unsigned long, unsigned long); @@ -447,8 +455,6 @@ extern void truncate_inode_pages(struct address_space *, loff_t); /* generic vm_area_ops exported for stackable file systems */ extern int filemap_swapout(struct page * page, struct file *file); -extern pte_t filemap_swapin(struct vm_area_struct * vma, - unsigned long offset, unsigned long entry); extern int filemap_sync(struct vm_area_struct * vma, unsigned long address, size_t size, unsigned int flags); extern struct page *filemap_nopage(struct vm_area_struct * area, diff --git a/include/linux/module.h b/include/linux/module.h index 26f383a63..249cb0163 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -9,6 +9,7 @@ #include <linux/config.h> #include <linux/spinlock.h> +#include <linux/list.h> #ifdef __GENKSYMS__ # define _set_ver(sym) sym @@ -78,11 +79,17 @@ struct module unsigned long gp; #endif /* Members past this point are extensions to the basic - module support and are optional. Use mod_opt_member() + module support and are optional. Use mod_member_present() to examine them. */ const struct module_persist *persist_start; const struct module_persist *persist_end; int (*can_unload)(void); + int runsize; /* In modutils, not currently used */ + const char *kallsyms_start; /* All symbols for kernel debugging */ + const char *kallsyms_end; + const char *archdata_start; /* arch specific data for module */ + const char *archdata_end; + const char *kernel_data; /* Reserved for kernel internal use */ }; struct module_info @@ -123,6 +130,10 @@ struct module_info ((unsigned long)(&((struct module *)0L)->member + 1) \ <= (mod)->size_of_struct) +/* Check if an address p with number of entries n is within the body of module m */ +#define mod_bound(p, n, m) ((unsigned long)(p) >= ((unsigned long)(m) + ((m)->size_of_struct)) && \ + (unsigned long)((p)+(n)) <= (unsigned long)(m) + (m)->size) + /* Backwards compatibility definition. */ #define GET_USE_COUNT(module) (atomic_read(&(module)->uc.usecount)) @@ -142,14 +153,34 @@ struct module_info #define __MODULE_STRING_1(x) #x #define __MODULE_STRING(x) __MODULE_STRING_1(x) -/* Find a symbol exported by the kernel or another module */ -#ifdef CONFIG_MODULES -extern unsigned long get_module_symbol(char *, char *); -extern void put_module_symbol(unsigned long); -#else -static inline unsigned long get_module_symbol(char *unused1, char *unused2) { return 0; }; -static inline void put_module_symbol(unsigned long unused) { }; -#endif +/* Generic inter module communication. + * + * NOTE: This interface is intended for small amounts of data that are + * passed between two objects and either or both of the objects + * might be compiled as modules. Do not over use this interface. + * + * If more than two objects need to communicate then you probably + * need a specific interface instead of abusing this generic + * interface. If both objects are *always* built into the kernel + * then a global extern variable is good enough, you do not need + * this interface. + * + * Keith Owens <kaos@ocs.com.au> 28 Oct 2000. + */ + +#define HAVE_INTER_MODULE +extern void inter_module_register(const char *, struct module *, const void *); +extern void inter_module_unregister(const char *); +extern const void *inter_module_get(const char *); +extern const void *inter_module_get_request(const char *, const char *); +extern void inter_module_put(const char *); + +struct inter_module_entry { + struct list_head list; + const char *im_name; + struct module *owner; + const void *userdata; +}; extern int try_inc_mod_count(struct module *mod); @@ -313,4 +344,10 @@ __attribute__((section("__ksymtab"))) = \ #define EXPORT_NO_SYMBOLS #endif /* MODULE */ +#ifdef CONFIG_MODULES +#define SET_MODULE_OWNER(some_struct) do { some_struct->owner = THIS_MODULE; } while (0) +#else +#define SET_MODULE_OWNER(some_struct) do { } while (0) +#endif + #endif /* _LINUX_MODULE_H */ diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 46cb1d94b..c8bdd1cd7 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -92,6 +92,7 @@ struct cfi_private { int numchips; unsigned long chipshift; /* Because they're of the same type */ struct flchip chips[0]; /* per-chip data structure for each chip */ + const char *im_name; /* inter_module name for cmdset_setup */ }; #define MAX_CFI_CHIPS 8 /* Entirely arbitrary to avoid realloc() */ diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 4ca86bc4e..ebb41c973 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -7,7 +7,6 @@ #include <linux/types.h> #include <linux/mtd/mtd.h> -#include <linux/kmod.h> #include <linux/malloc.h> /* The map stuff is very simple. You fill in your struct map_info with @@ -52,6 +51,7 @@ struct map_info { unsigned long map_priv_2; void *fldrv_priv; void (*fldrv_destroy)(struct mtd_info *); + const char *im_name; }; /* @@ -59,20 +59,13 @@ struct map_info { * if anything is recognised. Doesn't register it because the calling * map driver needs to set the 'module' field first. */ -static inline struct mtd_info *do_map_probe(struct map_info *map, char *funcname, char *modname) +static inline struct mtd_info *do_map_probe(struct map_info *map, const char *funcname, const char *modname) { struct mtd_info *(*probe_p)(struct map_info *); struct mtd_info *mtd = NULL; - probe_p = (void *)get_module_symbol(NULL, funcname); - if (!probe_p) { - request_module(modname); - probe_p = (void *)get_module_symbol(NULL, funcname); - } - if (probe_p) { - mtd = (*probe_p)(map); - put_module_symbol((unsigned long)probe_p); - } + if ((probe_p = inter_module_get_request(modname, funcname))) + mtd = (*probe_p)(map); /* map->im_name is set by probe */ return mtd; } @@ -95,7 +88,7 @@ static inline void map_destroy(struct mtd_info *mtd) struct map_info *map = mtd->priv; map->fldrv_destroy(mtd); - put_module_symbol((unsigned long)map->fldrv_destroy); + inter_module_put(map->im_name); kfree(mtd); } diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 32677edae..2c2bfd4d5 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -383,6 +383,9 @@ struct net_device int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); int (*accept_fastpath)(struct net_device *, struct dst_entry*); + /* open/release and usage marking */ + struct module *owner; + /* bridge stuff */ struct net_bridge_port *br_port; diff --git a/include/linux/netfilter_decnet.h b/include/linux/netfilter_decnet.h index 2f8704f02..3064eec9c 100644 --- a/include/linux/netfilter_decnet.h +++ b/include/linux/netfilter_decnet.h @@ -36,4 +36,24 @@ #define NF_DN_ROUTE 6 #define NF_DN_NUMHOOKS 7 +enum nf_dn_hook_priorities { + NF_DN_PRI_FIRST = INT_MIN, + NF_DN_PRI_CONNTRACK = -200, + NF_DN_PRI_MANGLE = -150, + NF_DN_PRI_NAT_DST = -100, + NF_DN_PRI_FILTER = 0, + NF_DN_PRI_NAT_SRC = 100, + NF_DN_PRI_DNRTMSG = 200, + NF_DN_PRI_LAST = INT_MAX, +}; + +struct nf_dn_rtmsg { + int nfdn_ifindex; +}; + +#define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg))) + +#define DNRMG_L1_GROUP 0x01 +#define DNRMG_L2_GROUP 0x02 + #endif /*__LINUX_DECNET_NETFILTER_H*/ diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 41e7d92cc..2afb52e98 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -8,6 +8,7 @@ #define NETLINK_ARPD 8 #define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ #define NETLINK_IP6_FW 13 +#define NETLINK_DNRTMSG 14 /* DECnet routing messages */ #define NETLINK_TAPBASE 16 /* 16 to 31 are ethertap */ #define MAX_LINKS 32 diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 5f6572b22..f6c35dc01 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h @@ -19,7 +19,7 @@ /* * Valid flags for a dirty buffer */ -#define PG_BUSY 0x0001 +#define PG_BUSY 0 struct nfs_page { struct list_head wb_hash, /* Inode */ @@ -38,7 +38,7 @@ struct nfs_page { struct nfs_writeverf wb_verf; /* Commit cookie */ }; -#define NFS_WBACK_BUSY(req) ((req)->wb_flags & PG_BUSY) +#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) extern struct nfs_page *nfs_create_request(struct file *file, struct page *page, @@ -68,10 +68,9 @@ extern spinlock_t nfs_wreq_lock; static __inline__ int nfs_lock_request(struct nfs_page *req) { - if (NFS_WBACK_BUSY(req)) + if (test_and_set_bit(PG_BUSY, &req->wb_flags)) return 0; req->wb_count++; - req->wb_flags |= PG_BUSY; return 1; } @@ -80,10 +79,13 @@ nfs_unlock_request(struct nfs_page *req) { if (!NFS_WBACK_BUSY(req)) { printk(KERN_ERR "NFS: Invalid unlock attempted\n"); - return; + BUG(); } - req->wb_flags &= ~PG_BUSY; - wake_up(&req->wb_wait); + smp_mb__before_clear_bit(); + clear_bit(PG_BUSY, &req->wb_flags); + smp_mb__after_clear_bit(); + if (waitqueue_active(&req->wb_wait)) + wake_up(&req->wb_wait); nfs_release_request(req); } diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 994e0889f..7a89c6525 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -340,6 +340,7 @@ #define PCI_DEVICE_ID_SI_620 0x0620 #define PCI_DEVICE_ID_SI_630 0x0630 #define PCI_DEVICE_ID_SI_630_VGA 0x6300 +#define PCI_DEVICE_ID_SI_730_VGA 0x7300 #define PCI_DEVICE_ID_SI_5107 0x5107 #define PCI_DEVICE_ID_SI_5300 0x5300 #define PCI_DEVICE_ID_SI_5511 0x5511 @@ -1334,3 +1335,8 @@ #define PCI_DEVICE_ID_ARK_STING 0xa091 #define PCI_DEVICE_ID_ARK_STINGARK 0xa099 #define PCI_DEVICE_ID_ARK_2000MT 0xa0a1 + +#define PCI_VENDOR_ID_MICROGATE 0x13c0 +#define PCI_DEVICE_ID_MICROGATE_USC 0x0010 +#define PCI_DEVICE_ID_MICROGATE_SCC 0x0020 +#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030 diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 28bf3daa0..da8f6b3dc 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -67,7 +67,7 @@ struct proc_dir_entry { void *data; read_proc_t *read_proc; write_proc_t *write_proc; - unsigned int count; /* use count */ + atomic_t count; /* use count */ int deleted; /* delete flag */ kdev_t rdev; }; diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index ec87c2ddd..7b184ce94 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h @@ -28,7 +28,6 @@ #include <asm/bitops.h> #include <linux/module.h> #include <linux/hdreg.h> -#include <linux/sysctl.h> #include <linux/proc_fs.h> #include <linux/smp_lock.h> #include <linux/delay.h> @@ -88,5 +87,5 @@ extern void md_print_devices (void); #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } -#endif _MD_H +#endif diff --git a/include/linux/raid/md_compatible.h b/include/linux/raid/md_compatible.h index 1dd422185..35e60bd1a 100644 --- a/include/linux/raid/md_compatible.h +++ b/include/linux/raid/md_compatible.h @@ -31,7 +31,7 @@ /* 001 */ extern __inline__ int md_cpu_has_mmx(void) { - return boot_cpu_data.x86_capability & X86_FEATURE_MMX; + return test_bit(X86_FEATURE_MMX, &boot_cpu_data.x86_capability); } #endif @@ -152,5 +152,5 @@ typedef wait_queue_head_t md_wait_queue_head_t; /* END */ -#endif _MD_COMPATIBLE_H +#endif diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index ce998195c..41d729e16 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -365,5 +365,5 @@ do { \ __wait_event_lock_irq(wq, condition, lock); \ } while (0) -#endif _MD_K_H +#endif diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 0c6e1a368..d6bb37a81 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h @@ -168,5 +168,5 @@ static inline __u64 md_event(mdp_super_t *sb) { return (ev<<32)| sb->events_lo; } -#endif _MD_P_H +#endif diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h index 9478513f9..c96b0e404 100644 --- a/include/linux/raid/md_u.h +++ b/include/linux/raid/md_u.h @@ -111,5 +111,5 @@ typedef struct mdu_param_s int max_fault; /* unused for now */ } mdu_param_t; -#endif _MD_U_H +#endif diff --git a/include/linux/raid/xor.h b/include/linux/raid/xor.h index c8034b759..0e6950a7b 100644 --- a/include/linux/raid/xor.h +++ b/include/linux/raid/xor.h @@ -3,10 +3,21 @@ #include <linux/raid/md.h> -#define MAX_XOR_BLOCKS 4 +#define MAX_XOR_BLOCKS 5 -extern void calibrate_xor_block(void); -extern void (*xor_block)(unsigned int count, - struct buffer_head **bh_ptr); +extern void xor_block(unsigned int count, struct buffer_head **bh_ptr); + +struct xor_block_template { + struct xor_block_template *next; + const char *name; + int speed; + void (*do_2)(unsigned long, unsigned long *, unsigned long *); + void (*do_3)(unsigned long, unsigned long *, unsigned long *, + unsigned long *); + void (*do_4)(unsigned long, unsigned long *, unsigned long *, + unsigned long *, unsigned long *); + void (*do_5)(unsigned long, unsigned long *, unsigned long *, + unsigned long *, unsigned long *, unsigned long *); +}; #endif diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 40738af95..0c7cab0de 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -139,6 +139,7 @@ enum #define RTPROT_MRT 10 /* Merit MRT */ #define RTPROT_ZEBRA 11 /* Zebra */ #define RTPROT_BIRD 12 /* BIRD */ +#define RTPROT_DNROUTED 13 /* DECnet routing daemon */ /* rtm_scope diff --git a/include/linux/sched.h b/include/linux/sched.h index 9385c9ea8..a58b23c86 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -85,7 +85,6 @@ extern int last_pid; #define TASK_UNINTERRUPTIBLE 2 #define TASK_ZOMBIE 4 #define TASK_STOPPED 8 -#define TASK_EXCLUSIVE 32 #define __set_task_state(tsk, state_value) \ do { (tsk)->state = (state_value); } while (0) @@ -150,6 +149,8 @@ extern void update_one_process(struct task_struct *p, unsigned long user, extern signed long FASTCALL(schedule_timeout(signed long timeout)); asmlinkage void schedule(void); +extern void schedule_task(struct tq_struct *task); + /* * The default fd array needs to be at least BITS_PER_LONG, * as this is the granularity returned by copy_fdset(). @@ -533,8 +534,8 @@ extern unsigned long prof_shift; #define CURRENT_TIME (xtime.tv_sec) -extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode)); -extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode)); +extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, unsigned int wq_mode)); +extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, unsigned int wq_mode)); extern void FASTCALL(sleep_on(wait_queue_head_t *q)); extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q, signed long timeout)); @@ -543,12 +544,12 @@ extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout)); extern void FASTCALL(wake_up_process(struct task_struct * tsk)); -#define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE | TASK_EXCLUSIVE) -#define wake_up_all(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE) -#define wake_up_sync(x) __wake_up_sync((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE | TASK_EXCLUSIVE) -#define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE | TASK_EXCLUSIVE) -#define wake_up_interruptible_all(x) __wake_up((x),TASK_INTERRUPTIBLE) -#define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE | TASK_EXCLUSIVE) +#define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE,WQ_FLAG_EXCLUSIVE) +#define wake_up_all(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE,0) +#define wake_up_sync(x) __wake_up_sync((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE,WQ_FLAG_EXCLUSIVE) +#define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE,WQ_FLAG_EXCLUSIVE) +#define wake_up_interruptible_all(x) __wake_up((x),TASK_INTERRUPTIBLE,0) +#define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE,WQ_FLAG_EXCLUSIVE) extern int in_group_p(gid_t); extern int in_egroup_p(gid_t); diff --git a/include/linux/sisfb.h b/include/linux/sisfb.h index cfc8ce704..2f5be6474 100644 --- a/include/linux/sisfb.h +++ b/include/linux/sisfb.h @@ -1,17 +1,91 @@ #ifndef _LINUX_SISFB #define _LINUX_SISFB +/* CRT2 connection */ +#define MASK_DISPTYPE_CRT2 0x04 /* Connect CRT2 */ +#define MASK_DISPTYPE_LCD 0x02 /* Connect LCD */ +#define MASK_DISPTYPE_TV 0x01 /* Connect TV */ +#define MASK_DISPTYPE_DISP2 (MASK_DISPTYPE_LCD | MASK_DISPTYPE_TV | MASK_DISPTYPE_CRT2) + +#define DISPTYPE_CRT1 0x00000008L +#define DISPTYPE_CRT2 0x00000004L +#define DISPTYPE_LCD 0x00000002L +#define DISPTYPE_TV 0x00000001L +#define DISPTYPE_DISP1 DISPTYPE_CRT1 +#define DISPTYPE_DISP2 (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV) +#define DISPMODE_SINGLE 0x00000020L +#define DISPMODE_MIRROR 0x00000010L +#define DISPMODE_DUALVIEW 0x00000040L + +#define HASVB_NONE 0 +#define HASVB_301 1 +#define HASVB_LVDS 2 +#define HASVB_TRUMPION 3 +#define HASVB_LVDS_CHRONTEL 4 +#define HASVB_LVDS_ALL (HASVB_LVDS | HASVB_TRUMPION | HASVB_LVDS_CHRONTEL) + +enum _TVMODE +{ + TVMODE_NTSC = 0, + TVMODE_PAL, + TVMODE_HIVISION, + TVMODE_TOTAL +}; + +enum _TVPLUGTYPE +{ + TVPLUG_UNKNOWN = 0, + TVPLUG_COMPOSITE, + TVPLUG_SVIDEO, + TVPLUG_SCART, + TVPLUG_TOTAL +}; + +enum CHIPTYPE +{ + SiS_UNKNOWN = 0, + SiS_300, + SiS_540, + SiS_630, + SiS_630S, + SiS_730 +}; + struct sis_memreq { unsigned long offset; unsigned long size; }; +/* Data for AP */ +struct mode_info +{ + int bpp; + int xres; + int yres; + int v_xres; + int v_yres; + int org_x; + int org_y; + unsigned int vrate; +}; + +struct ap_data +{ + struct mode_info minfo; + unsigned long iobase; + unsigned int mem_size; + unsigned long disp_state; + enum CHIPTYPE chip; +}; + + +/* Data for kernel */ struct video_info { /* card parameters */ int chip_id; - int video_size; + unsigned int video_size; unsigned long video_base; char *video_vbase; unsigned long mmio_base; @@ -22,8 +96,17 @@ struct video_info int video_bpp; int video_width; int video_height; - unsigned int refresh_rate; - u8 status; + int video_vwidth; + int video_vheight; + int org_x; + int org_y; + unsigned int refresh_rate; + + /* VB functions */ + unsigned long disp_state; + unsigned char hasVB; + unsigned char TV_type; + unsigned char TV_plug; }; #ifdef __KERNEL__ diff --git a/include/linux/sockios.h b/include/linux/sockios.h index e9fd9e275..33ffddc50 100644 --- a/include/linux/sockios.h +++ b/include/linux/sockios.h @@ -75,6 +75,7 @@ #define SIOCGIFDIVERT 0x8944 /* Frame diversion support */ #define SIOCSIFDIVERT 0x8945 /* Set frame diversion options */ +#define SIOCETHTOOL 0x8946 /* Ethtool interface */ /* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h index ca8ad780d..c7be4cc54 100644 --- a/include/linux/soundcard.h +++ b/include/linux/soundcard.h @@ -76,8 +76,8 @@ */ #ifndef _SIOWR -#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__INCioctlh) && !defined(__Lynx__))) -/* Use already defined ioctl defines if they exist (except with Sun) */ +#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__))) +/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */ #define SIOCPARM_MASK IOCPARM_MASK #define SIOC_VOID IOC_VOID #define SIOC_OUT IOC_OUT @@ -179,7 +179,7 @@ typedef struct seq_event_rec { * Some big endian/little endian handling macros */ -#if defined(_AIX) || defined(AIX) || defined(sparc) || defined(HPPA) || defined(PPC) +#if defined(_AIX) || defined(AIX) || defined(sparc) || defined(__sparc__) || defined(HPPA) || defined(PPC) /* Big endian machines */ # define _PATCHKEY(id) (0xfd00|id) # define AFMT_S16_NE AFMT_S16_BE diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index eb55e776c..5d1f842c8 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h @@ -54,7 +54,7 @@ extern unsigned int nlm_debug; #undef ifdebug #ifdef RPC_DEBUG # define ifdebug(fac) if (rpc_debug & RPCDBG_##fac) -# define dfprintk(fac, args...) do { ifdebug(fac) printk(## args); } while(0) +# define dfprintk(fac, args...) do { ifdebug(fac) printk(args); } while(0) # define RPC_IFDEBUG(x) x #else # define dfprintk(fac, args...) do ; while (0) diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 8b559703a..f3e9ad2be 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -80,8 +80,7 @@ struct rpc_task { unsigned short tk_lock; /* Task lock counter */ unsigned char tk_active : 1,/* Task has been activated */ tk_wakeup : 1;/* Task waiting to wake up */ - volatile unsigned char tk_running : 1,/* Task is running */ - tk_sleeping : 1;/* Task is truly asleep */ + unsigned int tk_runstate; /* Task run status */ #ifdef RPC_DEBUG unsigned short tk_pid; /* debugging aid */ #endif @@ -110,11 +109,26 @@ typedef void (*rpc_action)(struct rpc_task *); #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) -#define RPC_IS_RUNNING(t) ((t)->tk_running) -#define RPC_IS_SLEEPING(t) ((t)->tk_sleeping) #define RPC_IS_ACTIVATED(t) ((t)->tk_active) #define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL) +#define RPC_TASK_SLEEPING 0 +#define RPC_TASK_RUNNING 1 +#define RPC_IS_SLEEPING(t) (test_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate)) +#define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) + +#define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) +#define rpc_clear_running(t) (clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) + +#define rpc_set_sleeping(t) (set_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate)) + +#define rpc_clear_sleeping(t) \ + do { \ + smp_mb__before_clear_bit(); \ + clear_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate); \ + smp_mb__after_clear_bit(); \ + } while(0) + /* * RPC synchronization objects */ diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 450341b74..a733c79f4 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h @@ -1,9 +1,9 @@ /* * SyncLink Multiprotocol Serial Adapter Driver * - * ==FILEDATE 19990810== + * $Id: synclink.h,v 3.2 2000/11/06 22:34:38 paul Exp $ * - * Copyright (C) 1998 by Microgate Corporation + * Copyright (C) 1998-2000 by Microgate Corporation * * Redistribution of this file is permitted under * the terms of the GNU Public License (GPL) @@ -11,6 +11,7 @@ #ifndef _SYNCLINK_H_ #define _SYNCLINK_H_ +#define SYNCLINK_H_VERSION 3.2 #define BOOLEAN int #define TRUE 1 diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index b5155a2b6..07f2c83e9 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -24,8 +24,12 @@ #ifndef _LINUX_SYSCTL_H #define _LINUX_SYSCTL_H +#include <linux/kernel.h> +#include <linux/types.h> #include <linux/list.h> +struct file; + #define CTL_MAXNAME 10 struct __sysctl_args { diff --git a/include/linux/time.h b/include/linux/time.h index 87f334547..8d641efd8 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -12,6 +12,8 @@ struct timespec { }; #endif /* _STRUCT_TIMESPEC */ +#ifdef __KERNEL__ + /* * Change timeval to jiffies, trying to avoid the * most obvious overflows.. @@ -80,6 +82,8 @@ mktime (unsigned int year, unsigned int mon, )*60 + sec; /* finally seconds */ } +#endif /* __KERNEL__ */ + struct timeval { time_t tv_sec; /* seconds */ diff --git a/include/linux/usb.h b/include/linux/usb.h index 428866672..2828238ac 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -350,7 +350,11 @@ struct usb_device_id { struct usb_driver { const char *name; - void * (*probe)(struct usb_device *, unsigned int); + void *(*probe)( + struct usb_device *dev, /* the device */ + unsigned intf, /* what interface */ + const struct usb_device_id *id /* from id_table */ + ); void (*disconnect)(struct usb_device *, void *); struct list_head driver_list; @@ -367,11 +371,6 @@ struct usb_driver { * binding policy can be driven from user mode too */ const struct usb_device_id *id_table; - void *(*bind)( - struct usb_device *dev, /* the device */ - unsigned intf, /* what interface */ - const struct usb_device_id *id /* from id_table */ - ); /* suspend before the bus suspends; * disconnect or resume when the bus resumes */ @@ -601,6 +600,9 @@ extern void usb_scan_devices(void); extern void usb_driver_claim_interface(struct usb_driver *driver, struct usb_interface *iface, void* priv); extern int usb_interface_claimed(struct usb_interface *iface); extern void usb_driver_release_interface(struct usb_driver *driver, struct usb_interface *iface); +const struct usb_device_id *usb_match_id(struct usb_device *dev, + struct usb_interface *interface, + const struct usb_device_id *id); extern struct usb_bus *usb_alloc_bus(struct usb_operations *); extern void usb_free_bus(struct usb_bus *); diff --git a/include/linux/wait.h b/include/linux/wait.h index 8629f3241..6b281ccad 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -44,7 +44,8 @@ extern int printk(const char *fmt, ...); #endif struct __wait_queue { - unsigned int compiler_warning; + unsigned int flags; +#define WQ_FLAG_EXCLUSIVE 0x01 struct task_struct * task; struct list_head task_list; #if WAITQUEUE_DEBUG @@ -109,7 +110,7 @@ typedef struct __wait_queue_head wait_queue_head_t; #endif #define __WAITQUEUE_INITIALIZER(name,task) \ - { 0x1234567, task, { NULL, NULL } __WAITQUEUE_DEBUG_INIT(name)} + { 0x0, task, { NULL, NULL } __WAITQUEUE_DEBUG_INIT(name)} #define DECLARE_WAITQUEUE(name,task) \ wait_queue_t name = __WAITQUEUE_INITIALIZER(name,task) @@ -141,6 +142,7 @@ static inline void init_waitqueue_entry(wait_queue_t *q, if (!q || !p) WQ_BUG(); #endif + q->flags = 0; q->task = p; #if WAITQUEUE_DEBUG q->__magic = (long)&q->__magic; diff --git a/include/linux/wrapper.h b/include/linux/wrapper.h index 36dd17fe4..3c62fdbc8 100644 --- a/include/linux/wrapper.h +++ b/include/linux/wrapper.h @@ -1,13 +1,6 @@ #ifndef _WRAPPER_H_ #define _WRAPPER_H_ -#define vma_set_inode(v,i) ((v)->vm_inode = (i)) -#define vma_get_flags(v) ((v)->vm_flags) -#define vma_get_pgoff(v) ((v)->vm_pgoff) -#define vma_get_start(v) ((v)->vm_start) -#define vma_get_end(v) ((v)->vm_end) -#define vma_get_page_prot(v) ((v)->vm_page_prot) - #define mem_map_reserve(p) set_bit(PG_reserved, &((p)->flags)) #define mem_map_unreserve(p) clear_bit(PG_reserved, &((p)->flags)) diff --git a/include/net/ax25.h b/include/net/ax25.h index 50d4aa889..525786901 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -159,15 +159,13 @@ typedef struct { unsigned short slave_timeout; /* when? */ } ax25_dama_info; -#ifndef _LINUX_SYSCTL_H -#include <linux/sysctl.h> -#endif +struct ctl_table; typedef struct ax25_dev { struct ax25_dev *next; - struct net_device *dev; - struct net_device *forward; - struct ctl_table systable[AX25_MAX_VALUES+1]; + struct net_device *dev; + struct net_device *forward; + struct ctl_table *systable; int values[AX25_MAX_VALUES]; #if defined(CONFIG_AX25_DAMA_SLAVE) || defined(CONFIG_AX25_DAMA_MASTER) ax25_dama_info dama; diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h index 498ea16fd..8b628d2e5 100644 --- a/include/net/dn_nsp.h +++ b/include/net/dn_nsp.h @@ -39,9 +39,27 @@ extern int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb); extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri); extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, int *size, int noblock, int *err); -#define NSP_REASON_NR 1 -#define NSP_REASON_DC 42 -#define NSP_REASON_NL 41 +#define NSP_REASON_OK 0 /* No error */ +#define NSP_REASON_NR 1 /* No resources */ +#define NSP_REASON_UN 2 /* Unrecognised node name */ +#define NSP_REASON_SD 3 /* Node shutting down */ +#define NSP_REASON_ID 4 /* Invalid destination end user */ +#define NSP_REASON_ER 5 /* End user lacks resources */ +#define NSP_REASON_OB 6 /* Object too busy */ +#define NSP_REASON_US 7 /* Unspecified error */ +#define NSP_REASON_TP 8 /* Third-Party abort */ +#define NSP_REASON_EA 9 /* End user has aborted the link */ +#define NSP_REASON_IF 10 /* Invalid node name format */ +#define NSP_REASON_LS 11 /* Local node shutdown */ +#define NSP_REASON_LL 32 /* Node lacks logical-link resources */ +#define NSP_REASON_LE 33 /* End user lacks logical-link resources */ +#define NSP_REASON_UR 34 /* Unacceptable RQSTRID or PASSWORD field */ +#define NSP_REASON_UA 36 /* Unacceptable ACCOUNT field */ +#define NSP_REASON_TM 38 /* End user timed out logical link */ +#define NSP_REASON_NU 39 /* Node unreachable */ +#define NSP_REASON_NL 41 /* No-link message */ +#define NSP_REASON_DC 42 /* Disconnect confirm */ +#define NSP_REASON_IO 43 /* Image data field overflow */ #define NSP_DISCINIT 0x38 #define NSP_DISCCONF 0x48 diff --git a/include/net/irda/discovery.h b/include/net/irda/discovery.h index 90b8abd41..dccf1246c 100644 --- a/include/net/irda/discovery.h +++ b/include/net/irda/discovery.h @@ -44,8 +44,8 @@ /* * The DISCOVERY structure is used for both discovery requests and responses */ -typedef struct { - queue_t q; /* Must be first! */ +typedef struct discovery_t { + irda_queue_t q; /* Must be first! */ __u32 saddr; /* Which link the device was discovered */ __u32 daddr; /* Remote device address */ @@ -59,10 +59,12 @@ typedef struct { int gen_addr_bit; /* Need to generate a new device address? */ int nslots; /* Number of slots to use when discovering */ unsigned long timestamp; /* Time discovered */ + unsigned long first_timestamp; /* First time discovered */ } discovery_t; void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *discovery); void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log); void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force); +struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn, __u16 mask); #endif diff --git a/include/net/irda/ircomm_core.h b/include/net/irda/ircomm_core.h index b555b37e2..3e891c201 100644 --- a/include/net/irda/ircomm_core.h +++ b/include/net/irda/ircomm_core.h @@ -53,7 +53,7 @@ typedef struct { } call_t; struct ircomm_cb { - queue_t queue; + irda_queue_t queue; magic_t magic; notify_t notify; diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 3946ebb98..d66686510 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h @@ -48,7 +48,7 @@ * IrCOMM TTY driver state */ struct ircomm_tty_cb { - queue_t queue; /* Must be first */ + irda_queue_t queue; /* Must be first */ magic_t magic; int state; /* Connect state */ diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h index 3bb5e4e77..8bdfee75a 100644 --- a/include/net/irda/irda.h +++ b/include/net/irda/irda.h @@ -110,8 +110,14 @@ if(!(expr)) { \ typedef enum { FLOW_STOP, FLOW_START } LOCAL_FLOW; +/* A few forward declarations (to make compiler happy) */ +struct tsap_cb; /* in <net/irda/irttp.h> */ +struct lsap_cb; /* in <net/irda/irlmp.h> */ +struct iriap_cb; /* in <net/irda/iriap.h> */ +struct ias_value; /* in <net/irda/irias_object.h> */ +struct discovery_t; /* in <net/irda/discovery.h> */ + /* IrDA Socket */ -struct tsap_cb; struct irda_sock { __u32 saddr; /* my local address */ __u32 daddr; /* peer address */ @@ -137,14 +143,18 @@ struct irda_sock { struct ias_object *ias_obj; /* Our service name + lsap in IAS */ struct iriap_cb *iriap; /* Used to query remote IAS */ - struct ias_value *ias_result; /* Used by getsockopt(IRLMP_IAS_QUERY) */ + struct ias_value *ias_result; /* Result of remote IAS query */ + + hashbin_t *cachelog; /* Result of discovery query */ + struct discovery_t *cachediscovery; /* Result of selective discovery query */ int nslots; /* Number of slots to use for discovery */ int errno; /* status of the IAS query */ struct sock *sk; - wait_queue_head_t ias_wait; /* Wait for LM-IAS answer */ + wait_queue_head_t query_wait; /* Wait for the answer to a query */ + struct timer_list watchdog; /* Timeout for discovery */ LOCAL_FLOW tx_flow; LOCAL_FLOW rx_flow; @@ -166,12 +176,14 @@ typedef union { * (must not exceed 48 bytes, check with struct sk_buff) */ struct irda_skb_cb { - magic_t magic; /* Be sure that we can trust the information */ - __u32 speed; /* The Speed this frame should be sent with */ - __u16 mtt; /* Minimum turn around time */ - int xbofs; /* Number of xbofs required, used by SIR mode */ - __u8 line; /* Used by IrCOMM in IrLPT mode */ - void (*destructor)(struct sk_buff *skb); /* Used for flow control */ + magic_t magic; /* Be sure that we can trust the information */ + __u32 speed; /* The Speed this frame should be sent with */ + __u16 mtt; /* Minimum turn around time */ + __u16 xbofs; /* Number of xbofs required, used by SIR mode */ + void *context; /* May be used by drivers */ + void (*destructor)(struct sk_buff *skb); /* Used for flow control */ + __u16 xbofs_delay; /* Number of xbofs used for generating the mtt */ + __u8 line; /* Used by IrCOMM in IrLPT mode */ }; /* Misc status information */ @@ -232,6 +244,8 @@ typedef struct { void (*disconnect_indication)(void *instance, void *sap, LM_REASON reason, struct sk_buff *); void (*flow_indication)(void *instance, void *sap, LOCAL_FLOW flow); + void (*status_indication)(void *instance, + LINK_STATUS link, LOCK_STATUS lock); void *instance; /* Layer instance pointer */ char name[16]; /* Name of layer */ } notify_t; diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index d6733d60b..ac66f61bd 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h @@ -79,7 +79,7 @@ struct irda_task; typedef int (*IRDA_TASK_CALLBACK) (struct irda_task *task); struct irda_task { - queue_t q; + irda_queue_t q; magic_t magic; IRDA_TASK_STATE state; @@ -111,7 +111,7 @@ typedef struct { /* Dongle registration info */ struct dongle_reg { - queue_t q; /* Must be first */ + irda_queue_t q; /* Must be first */ IRDA_DONGLE type; void (*open)(dongle_t *dongle, struct qos_info *qos); diff --git a/include/net/irda/iriap.h b/include/net/irda/iriap.h index cd0dff5a9..8aed55b1c 100644 --- a/include/net/irda/iriap.h +++ b/include/net/irda/iriap.h @@ -58,7 +58,7 @@ typedef void (*CONFIRM_CALLBACK)(int result, __u16 obj_id, struct ias_value *value, void *priv); struct iriap_cb { - queue_t q; /* Must be first */ + irda_queue_t q; /* Must be first */ magic_t magic; /* Magic cookie */ int mode; /* Client or server */ diff --git a/include/net/irda/irias_object.h b/include/net/irda/irias_object.h index cfa8e28ed..ff6b0b7b9 100644 --- a/include/net/irda/irias_object.h +++ b/include/net/irda/irias_object.h @@ -34,11 +34,15 @@ #define IAS_OCT_SEQ 2 #define IAS_STRING 3 +/* Object ownership of attributes (user or kernel) */ +#define IAS_KERNEL_ATTR 0 +#define IAS_USER_ATTR 1 + /* * LM-IAS Object */ struct ias_object { - queue_t q; /* Must be first! */ + irda_queue_t q; /* Must be first! */ magic_t magic; char *name; @@ -51,6 +55,7 @@ struct ias_object { */ struct ias_value { __u8 type; /* Value description */ + __u8 owner; /* Managed from user/kernel space */ int charset; /* Only used by string type */ int len; @@ -66,7 +71,7 @@ struct ias_value { * Attributes used by LM-IAS objects */ struct ias_attrib { - queue_t q; /* Must be first! */ + irda_queue_t q; /* Must be first! */ int magic; char *name; /* Attribute name */ @@ -78,12 +83,15 @@ char *strdup(char *str); struct ias_object *irias_new_object(char *name, int id); void irias_insert_object(struct ias_object *obj); int irias_delete_object(struct ias_object *obj); +int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib); void __irias_delete_object(struct ias_object *obj); -void irias_add_integer_attrib(struct ias_object *obj, char *name, int value); -void irias_add_string_attrib(struct ias_object *obj, char *name, char *value); +void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, + int user); +void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, + int user); void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, - int len); + int len, int user); int irias_object_change_attribute(char *obj_name, char *attrib_name, struct ias_value *new_value); struct ias_object *irias_find_object(char *name); diff --git a/include/net/irda/irlan_client.h b/include/net/irda/irlan_client.h index 62ea6157a..2aab19e90 100644 --- a/include/net/irda/irlan_client.h +++ b/include/net/irda/irlan_client.h @@ -34,7 +34,7 @@ #include <net/irda/irlan_event.h> void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout); -void irlan_client_discovery_indication(discovery_t *); +void irlan_client_discovery_indication(discovery_t *, void *); void irlan_client_wakeup(struct irlan_cb *self, __u32 saddr, __u32 daddr); void irlan_client_open_ctrl_tsap( struct irlan_cb *self); diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h index 9ed6a9c36..02ecaf8e3 100644 --- a/include/net/irda/irlan_common.h +++ b/include/net/irda/irlan_common.h @@ -161,28 +161,26 @@ struct irlan_provider_cb { * IrLAN control block */ struct irlan_cb { - queue_t q; /* Must be first */ + irda_queue_t q; /* Must be first */ int magic; struct net_device dev; /* Ethernet device structure*/ struct net_device_stats stats; - __u32 saddr; /* Source device address */ - __u32 daddr; /* Destination device address */ - int netdev_registered; - int notify_irmanager; + __u32 saddr; /* Source device address */ + __u32 daddr; /* Destination device address */ + int disconnect_reason; /* Why we got disconnected */ - int media; /* Media type */ - __u8 version[2]; /* IrLAN version */ + int media; /* Media type */ + __u8 version[2]; /* IrLAN version */ - struct tsap_cb *tsap_data; + struct tsap_cb *tsap_data; /* Data TSAP */ - int master; /* Master instance? */ - int use_udata; /* Use Unit Data transfers */ + int use_udata; /* Use Unit Data transfers */ - __u8 stsap_sel_data; /* Source data TSAP selector */ - __u8 dtsap_sel_data; /* Destination data TSAP selector */ - __u8 dtsap_sel_ctrl; /* Destination ctrl TSAP selector */ + __u8 stsap_sel_data; /* Source data TSAP selector */ + __u8 dtsap_sel_data; /* Destination data TSAP selector */ + __u8 dtsap_sel_ctrl; /* Destination ctrl TSAP selector */ struct irlan_client_cb client; /* Client specific fields */ struct irlan_provider_cb provider; /* Provider specific fields */ @@ -190,10 +188,11 @@ struct irlan_cb { __u32 max_sdu_size; __u8 max_header_size; + wait_queue_head_t open_wait; struct timer_list watchdog_timer; }; -struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr, int netdev); +struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr); void irlan_close(struct irlan_cb *self); void irlan_close_tsaps(struct irlan_cb *self); void irlan_mod_inc_use_count(void); diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h index 36c1c03fd..3c1b95f50 100644 --- a/include/net/irda/irlap.h +++ b/include/net/irda/irlap.h @@ -81,7 +81,7 @@ #define irda_incomp (*self->decompressor.cp->incomp) struct irda_compressor { - queue_t q; + irda_queue_t q; struct compressor *cp; void *state; /* Not used by IrDA */ @@ -90,7 +90,7 @@ struct irda_compressor { /* Main structure of IrLAP */ struct irlap_cb { - queue_t q; /* Must be first */ + irda_queue_t q; /* Must be first */ magic_t magic; struct net_device *netdev; @@ -214,7 +214,7 @@ void irlap_unitdata_indication(struct irlap_cb *, struct sk_buff *); void irlap_disconnect_request(struct irlap_cb *); void irlap_disconnect_indication(struct irlap_cb *, LAP_REASON reason); -void irlap_status_indication(int quality_of_link); +void irlap_status_indication(struct irlap_cb *, int quality_of_link); void irlap_test_request(__u8 *info, int len); diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h index 9c9fab54d..0fe946693 100644 --- a/include/net/irda/irlmp.h +++ b/include/net/irda/irlmp.h @@ -71,22 +71,23 @@ typedef enum { S_END, } SERVICE; -typedef void (*DISCOVERY_CALLBACK1) (discovery_t *); -typedef void (*DISCOVERY_CALLBACK2) (hashbin_t *); +typedef void (*DISCOVERY_CALLBACK1) (discovery_t *, void *); +typedef void (*DISCOVERY_CALLBACK2) (hashbin_t *, void *); typedef struct { - queue_t queue; /* Must be first */ + irda_queue_t queue; /* Must be first */ __u16 hints; /* Hint bits */ } irlmp_service_t; typedef struct { - queue_t queue; /* Must be first */ + irda_queue_t queue; /* Must be first */ __u16 hint_mask; - DISCOVERY_CALLBACK1 callback1; - DISCOVERY_CALLBACK2 callback2; + DISCOVERY_CALLBACK1 disco_callback; /* Selective discovery */ + DISCOVERY_CALLBACK1 expir_callback; /* Selective expiration */ + void *priv; /* Used to identify client */ } irlmp_client_t; struct lap_cb; /* Forward decl. */ @@ -95,7 +96,7 @@ struct lap_cb; /* Forward decl. */ * Information about each logical LSAP connection */ struct lsap_cb { - queue_t queue; /* Must be first */ + irda_queue_t queue; /* Must be first */ magic_t magic; int connected; @@ -121,7 +122,7 @@ struct lsap_cb { * Information about each registred IrLAP layer */ struct lap_cb { - queue_t queue; /* Must be first */ + irda_queue_t queue; /* Must be first */ magic_t magic; int reason; /* LAP disconnect reason */ @@ -174,10 +175,10 @@ struct irlmp_cb { hashbin_t *clients; hashbin_t *services; - hashbin_t *cachelog; - int running; + hashbin_t *cachelog; /* Current discovery log */ + spinlock_t log_lock; /* discovery log spinlock */ - spinlock_t lock; + int running; __u16_host_order hints; /* Hint bits */ }; @@ -191,11 +192,12 @@ void irlmp_close_lsap( struct lsap_cb *self); __u16 irlmp_service_to_hint(int service); __u32 irlmp_register_service(__u16 hints); int irlmp_unregister_service(__u32 handle); -__u32 irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 callback1, - DISCOVERY_CALLBACK2 callback2); +__u32 irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb, + DISCOVERY_CALLBACK1 expir_clb, void *priv); int irlmp_unregister_client(__u32 handle); int irlmp_update_client(__u32 handle, __u16 hint_mask, - DISCOVERY_CALLBACK1, DISCOVERY_CALLBACK2); + DISCOVERY_CALLBACK1 disco_clb, + DISCOVERY_CALLBACK1 expir_clb, void *priv); void irlmp_register_link(struct irlap_cb *, __u32 saddr, notify_t *); void irlmp_unregister_link(__u32 saddr); @@ -214,8 +216,10 @@ int irlmp_disconnect_request(struct lsap_cb *, struct sk_buff *userdata); void irlmp_discovery_confirm(hashbin_t *discovery_log); void irlmp_discovery_request(int nslots); +struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask); void irlmp_do_discovery(int nslots); discovery_t *irlmp_get_discovery_response(void); +void irlmp_discovery_expiry(discovery_t *expiry); int irlmp_data_request(struct lsap_cb *, struct sk_buff *); void irlmp_data_indication(struct lsap_cb *, struct sk_buff *); @@ -229,7 +233,7 @@ void irlmp_connless_data_indication(struct lsap_cb *, struct sk_buff *); #endif /* CONFIG_IRDA_ULTRA */ void irlmp_status_request(void); -void irlmp_status_indication(LINK_STATUS link, LOCK_STATUS lock); +void irlmp_status_indication(struct lap_cb *, LINK_STATUS link, LOCK_STATUS lock); int irlmp_slsap_inuse(__u8 slsap); __u8 irlmp_find_free_slsap(void); @@ -248,9 +252,12 @@ static inline hashbin_t *irlmp_get_cachelog(void) { return irlmp->cachelog; } static inline int irlmp_get_lap_tx_queue_len(struct lsap_cb *self) { - ASSERT(self != NULL, return 0;); - ASSERT(self->lap != NULL, return 0;); - ASSERT(self->lap->irlap != NULL, return 0;); + if (self == NULL) + return 0; + if (self->lap == NULL) + return 0; + if (self->lap->irlap == NULL) + return 0; return IRLAP_GET_TX_QUEUE_LEN(self->lap->irlap); } diff --git a/include/net/irda/irmod.h b/include/net/irda/irmod.h index ae61c8682..f2ccb854c 100644 --- a/include/net/irda/irmod.h +++ b/include/net/irda/irmod.h @@ -69,7 +69,7 @@ typedef void (*TODO_CALLBACK)( void *self, __u32 param); * addtional information */ struct irda_event { - queue_t q; /* Must be first */ + irda_queue_t q; /* Must be first */ struct irmanager_event event; }; @@ -78,7 +78,7 @@ struct irda_event { * Funtions with needs to be called with a process context */ struct irda_todo { - queue_t q; /* Must be first */ + irda_queue_t q; /* Must be first */ void *self; TODO_CALLBACK callback; @@ -94,8 +94,8 @@ struct irda_cb { int in_use; - queue_t *event_queue; /* Events queued for the irmanager */ - queue_t *todo_queue; /* Todo list */ + irda_queue_t *event_queue; /* Events queued for the irmanager */ + irda_queue_t *todo_queue; /* Todo list */ }; int irmod_init_module(void); diff --git a/include/net/irda/irqueue.h b/include/net/irda/irqueue.h index 3b5bfd492..f7c1ba659 100644 --- a/include/net/irda/irqueue.h +++ b/include/net/irda/irqueue.h @@ -30,8 +30,8 @@ #include <linux/types.h> #include <linux/spinlock.h> -#ifndef QUEUE_H -#define QUEUE_H +#ifndef IRDA_QUEUE_H +#define IRDA_QUEUE_H #define NAME_SIZE 32 @@ -62,39 +62,40 @@ typedef void (*FREE_FUNC)(void *arg); */ #define GET_HASHBIN(x) ( x & HASHBIN_MASK ) -struct irqueue { - struct irqueue *q_next; - struct irqueue *q_prev; +struct irda_queue { + struct irda_queue *q_next; + struct irda_queue *q_prev; char q_name[NAME_SIZE]; __u32 q_hash; }; -typedef struct irqueue queue_t; +typedef struct irda_queue irda_queue_t; typedef struct hashbin_t { __u32 magic; int hb_type; int hb_size; spinlock_t hb_mutex[HASHBIN_SIZE] ALIGN; - queue_t *hb_queue[HASHBIN_SIZE] ALIGN; + irda_queue_t *hb_queue[HASHBIN_SIZE] ALIGN; - queue_t* hb_current; + irda_queue_t* hb_current; } hashbin_t; hashbin_t *hashbin_new(int type); int hashbin_delete(hashbin_t* hashbin, FREE_FUNC func); int hashbin_clear(hashbin_t* hashbin, FREE_FUNC free_func); -void hashbin_insert(hashbin_t* hashbin, queue_t* entry, __u32 hashv, +void hashbin_insert(hashbin_t* hashbin, irda_queue_t* entry, __u32 hashv, char* name); void* hashbin_find(hashbin_t* hashbin, __u32 hashv, char* name); void* hashbin_remove(hashbin_t* hashbin, __u32 hashv, char* name); void* hashbin_remove_first(hashbin_t *hashbin); -queue_t *hashbin_get_first(hashbin_t *hashbin); -queue_t *hashbin_get_next(hashbin_t *hashbin); +void* hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry); +irda_queue_t *hashbin_get_first(hashbin_t *hashbin); +irda_queue_t *hashbin_get_next(hashbin_t *hashbin); -void enqueue_last(queue_t **queue, queue_t* element); -void enqueue_first(queue_t **queue, queue_t* element); -queue_t *dequeue_first(queue_t **queue); +void enqueue_last(irda_queue_t **queue, irda_queue_t* element); +void enqueue_first(irda_queue_t **queue, irda_queue_t* element); +irda_queue_t *dequeue_first(irda_queue_t **queue); #define HASHBIN_GET_SIZE(hashbin) hashbin->hb_size diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h index 2b2547fa2..a3193d758 100644 --- a/include/net/irda/irttp.h +++ b/include/net/irda/irttp.h @@ -63,7 +63,7 @@ * connection. */ struct tsap_cb { - queue_t q; /* Must be first */ + irda_queue_t q; /* Must be first */ magic_t magic; /* Just in case */ __u8 stsap_sel; /* Source TSAP */ @@ -129,6 +129,8 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *skb, int priority); void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow); +void irttp_status_indication(void *instance, + LINK_STATUS link, LOCK_STATUS lock); struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance); static __inline __u32 irttp_get_saddr(struct tsap_cb *self) diff --git a/include/net/irda/irtty.h b/include/net/irda/irtty.h index f96976bc3..c6c54e1ad 100644 --- a/include/net/irda/irtty.h +++ b/include/net/irda/irtty.h @@ -45,7 +45,7 @@ struct irtty_info { #define IRTTY_IOC_MAXNR 2 struct irtty_cb { - queue_t q; /* Must be first */ + irda_queue_t q; /* Must be first */ magic_t magic; struct net_device *netdev; /* Yes! we are some kind of netdevice */ diff --git a/include/net/irda/qos.h b/include/net/irda/qos.h index e88f0a3bd..d95f7ead9 100644 --- a/include/net/irda/qos.h +++ b/include/net/irda/qos.h @@ -86,6 +86,9 @@ struct qos_info { #endif }; +extern int sysctl_max_baud_rate; +extern int sysctl_max_inactive_time; + extern __u32 baud_rates[]; extern __u32 data_sizes[]; extern __u32 min_turn_times[]; @@ -100,15 +103,7 @@ __u32 irlap_requested_line_capacity(struct qos_info *qos); __u32 irlap_min_turn_time_in_bytes(__u32 speed, __u32 min_turn_time); int msb_index(__u16 byte); -int value_index(__u32 value, __u32 *array); -__u32 byte_value(__u8 byte, __u32 *array); -__u32 index_value(int index, __u32 *array); - void irda_qos_bits_to_value(struct qos_info *qos); #endif - - - - diff --git a/include/net/irda/timer.h b/include/net/irda/timer.h index af843bee3..f2cc642ec 100644 --- a/include/net/irda/timer.h +++ b/include/net/irda/timer.h @@ -76,12 +76,14 @@ inline void irlap_start_wd_timer(struct irlap_cb *self, int timeout); inline void irlap_start_backoff_timer(struct irlap_cb *self, int timeout); void irlap_start_mbusy_timer(struct irlap_cb *); +void irlap_stop_mbusy_timer(struct irlap_cb *); struct lsap_cb; struct lap_cb; inline void irlmp_start_watchdog_timer(struct lsap_cb *, int timeout); inline void irlmp_start_discovery_timer(struct irlmp_cb *, int timeout); inline void irlmp_start_idle_timer(struct lap_cb *, int timeout); +inline void irlmp_stop_idle_timer(struct lap_cb *self); #endif diff --git a/include/net/x25.h b/include/net/x25.h index fc3d83ee4..257618d44 100644 --- a/include/net/x25.h +++ b/include/net/x25.h @@ -169,6 +169,7 @@ extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); /* x25_in.c */ extern int x25_process_rx_frame(struct sock *, struct sk_buff *); +extern int x25_backlog_rcv(struct sock *, struct sk_buff *); /* x25_link.c */ extern void x25_link_control(struct sk_buff *, struct x25_neigh *, unsigned short); @@ -220,5 +221,8 @@ extern unsigned long x25_display_timer(struct sock *); /* sysctl_net_x25.c */ extern void x25_register_sysctl(void); extern void x25_unregister_sysctl(void); - +struct x25_skb_cb { + unsigned flags; +}; +#define X25_SKB_CB(s) ((struct x25_skb_cb *) ((s)->cb)) #endif |