diff options
Diffstat (limited to 'arch/alpha/include/asm')
82 files changed, 715 insertions, 3180 deletions
diff --git a/arch/alpha/include/asm/8253pit.h b/arch/alpha/include/asm/8253pit.h deleted file mode 100644 index a71c9c1455a..00000000000 --- a/arch/alpha/include/asm/8253pit.h +++ /dev/null @@ -1,3 +0,0 @@ -/* - * 8253/8254 Programmable Interval Timer - */ diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index e423defed91..96e54bed508 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild @@ -1,10 +1,9 @@ -include include/asm-generic/Kbuild.asm -header-y += compiler.h -header-y += console.h -header-y += fpu.h -header-y += gentrap.h -header-y += pal.h -header-y += reg.h -header-y += regdef.h -header-y += sysinfo.h + +generic-y += clkdev.h +generic-y += cputime.h +generic-y += exec.h +generic-y += hash.h +generic-y += mcs_spinlock.h +generic-y += preempt.h +generic-y += trace_clock.h diff --git a/arch/alpha/include/asm/a.out.h b/arch/alpha/include/asm/a.out.h index acdc681231c..9abbd245530 100644 --- a/arch/alpha/include/asm/a.out.h +++ b/arch/alpha/include/asm/a.out.h @@ -1,94 +1,8 @@  #ifndef __ALPHA_A_OUT_H__  #define __ALPHA_A_OUT_H__ -#include <linux/types.h> +#include <uapi/asm/a.out.h> -/* - * OSF/1 ECOFF header structs.  ECOFF files consist of: - * 	- a file header (struct filehdr), - *	- an a.out header (struct aouthdr), - *	- one or more section headers (struct scnhdr).  - *	  The filhdr's "f_nscns" field contains the - *	  number of section headers. - */ - -struct filehdr -{ -	/* OSF/1 "file" header */ -	__u16 f_magic, f_nscns; -	__u32 f_timdat; -	__u64 f_symptr; -	__u32 f_nsyms; -	__u16 f_opthdr, f_flags; -}; - -struct aouthdr -{ -	__u64 info;		/* after that it looks quite normal.. */ -	__u64 tsize; -	__u64 dsize; -	__u64 bsize; -	__u64 entry; -	__u64 text_start;	/* with a few additions that actually make sense */ -	__u64 data_start; -	__u64 bss_start; -	__u32 gprmask, fprmask;	/* bitmask of general & floating point regs used in binary */ -	__u64 gpvalue; -}; - -struct scnhdr -{ -	char	s_name[8]; -	__u64	s_paddr; -	__u64	s_vaddr; -	__u64	s_size; -	__u64	s_scnptr; -	__u64	s_relptr; -	__u64	s_lnnoptr; -	__u16	s_nreloc; -	__u16	s_nlnno; -	__u32	s_flags; -}; - -struct exec -{ -	/* OSF/1 "file" header */ -	struct filehdr		fh; -	struct aouthdr		ah; -}; - -/* - * Define's so that the kernel exec code can access the a.out header - * fields... - */ -#define	a_info		ah.info -#define	a_text		ah.tsize -#define a_data		ah.dsize -#define a_bss		ah.bsize -#define a_entry		ah.entry -#define a_textstart	ah.text_start -#define	a_datastart	ah.data_start -#define	a_bssstart	ah.bss_start -#define	a_gprmask	ah.gprmask -#define a_fprmask	ah.fprmask -#define a_gpvalue	ah.gpvalue - -#define N_TXTADDR(x) ((x).a_textstart) -#define N_DATADDR(x) ((x).a_datastart) -#define N_BSSADDR(x) ((x).a_bssstart) -#define N_DRSIZE(x) 0 -#define N_TRSIZE(x) 0 -#define N_SYMSIZE(x) 0 - -#define AOUTHSZ		sizeof(struct aouthdr) -#define SCNHSZ		sizeof(struct scnhdr) -#define SCNROUND	16 - -#define N_TXTOFF(x) \ -  ((long) N_MAGIC(x) == ZMAGIC ? 0 : \ -   (sizeof(struct exec) + (x).fh.f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1)) - -#ifdef __KERNEL__  /* Assume that start addresses below 4G belong to a TASO application.     Unfortunately, there is no proper bit in the exec header to check. @@ -98,5 +12,4 @@ struct exec  	set_personality (((BFPM->taso || EX.ah.entry < 0x100000000L \  			   ? ADDR_LIMIT_32BIT : 0) | PER_OSF4)) -#endif /* __KERNEL__ */  #endif /* __A_OUT_GNU_H__ */ diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h index e756d04b6cd..ed60a1ee1ed 100644 --- a/arch/alpha/include/asm/atomic.h +++ b/arch/alpha/include/asm/atomic.h @@ -3,7 +3,7 @@  #include <linux/types.h>  #include <asm/barrier.h> -#include <asm/system.h> +#include <asm/cmpxchg.h>  /*   * Atomic operations that C can't guarantee us.  Useful for @@ -14,8 +14,8 @@   */ -#define ATOMIC_INIT(i)		( (atomic_t) { (i) } ) -#define ATOMIC64_INIT(i)	( (atomic64_t) { (i) } ) +#define ATOMIC_INIT(i)		{ (i) } +#define ATOMIC64_INIT(i)	{ (i) }  #define atomic_read(v)		(*(volatile int *)&(v)->counter)  #define atomic64_read(v)	(*(volatile long *)&(v)->counter) @@ -176,30 +176,36 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)  #define atomic_xchg(v, new) (xchg(&((v)->counter), new))  /** - * atomic_add_unless - add unless the number is a given value + * __atomic_add_unless - add unless the number is a given value   * @v: pointer of type atomic_t   * @a: the amount to add to v...   * @u: ...unless v is equal to u.   *   * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. + * Returns the old value of @v.   */ -static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) +static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)  { -	int c, old; -	c = atomic_read(v); -	for (;;) { -		if (unlikely(c == (u))) -			break; -		old = atomic_cmpxchg((v), c, c + (a)); -		if (likely(old == c)) -			break; -		c = old; -	} -	return c != (u); +	int c, new, old; +	smp_mb(); +	__asm__ __volatile__( +	"1:	ldl_l	%[old],%[mem]\n" +	"	cmpeq	%[old],%[u],%[c]\n" +	"	addl	%[old],%[a],%[new]\n" +	"	bne	%[c],2f\n" +	"	stl_c	%[new],%[mem]\n" +	"	beq	%[new],3f\n" +	"2:\n" +	".subsection 2\n" +	"3:	br	1b\n" +	".previous" +	: [old] "=&r"(old), [new] "=&r"(new), [c] "=&r"(c) +	: [mem] "m"(*v), [a] "rI"(a), [u] "rI"((long)u) +	: "memory"); +	smp_mb(); +	return old;  } -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)  /**   * atomic64_add_unless - add unless the number is a given value @@ -208,21 +214,56 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)   * @u: ...unless v is equal to u.   *   * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. + * Returns true iff @v was not @u.   */  static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)  { -	long c, old; -	c = atomic64_read(v); -	for (;;) { -		if (unlikely(c == (u))) -			break; -		old = atomic64_cmpxchg((v), c, c + (a)); -		if (likely(old == c)) -			break; -		c = old; -	} -	return c != (u); +	long c, tmp; +	smp_mb(); +	__asm__ __volatile__( +	"1:	ldq_l	%[tmp],%[mem]\n" +	"	cmpeq	%[tmp],%[u],%[c]\n" +	"	addq	%[tmp],%[a],%[tmp]\n" +	"	bne	%[c],2f\n" +	"	stq_c	%[tmp],%[mem]\n" +	"	beq	%[tmp],3f\n" +	"2:\n" +	".subsection 2\n" +	"3:	br	1b\n" +	".previous" +	: [tmp] "=&r"(tmp), [c] "=&r"(c) +	: [mem] "m"(*v), [a] "rI"(a), [u] "rI"(u) +	: "memory"); +	smp_mb(); +	return !c; +} + +/* + * atomic64_dec_if_positive - decrement by 1 if old value positive + * @v: pointer of type atomic_t + * + * The function returns the old value of *v minus 1, even if + * the atomic variable, v, was not decremented. + */ +static inline long atomic64_dec_if_positive(atomic64_t *v) +{ +	long old, tmp; +	smp_mb(); +	__asm__ __volatile__( +	"1:	ldq_l	%[old],%[mem]\n" +	"	subq	%[old],1,%[tmp]\n" +	"	ble	%[old],2f\n" +	"	stq_c	%[tmp],%[mem]\n" +	"	beq	%[tmp],3f\n" +	"2:\n" +	".subsection 2\n" +	"3:	br	1b\n" +	".previous" +	: [old] "=&r"(old), [tmp] "=&r"(tmp) +	: [mem] "m"(*v) +	: "memory"); +	smp_mb(); +	return old - 1;  }  #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) @@ -251,10 +292,4 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)  #define atomic_dec(v) atomic_sub(1,(v))  #define atomic64_dec(v) atomic64_sub(1,(v)) -#define smp_mb__before_atomic_dec()	smp_mb() -#define smp_mb__after_atomic_dec()	smp_mb() -#define smp_mb__before_atomic_inc()	smp_mb() -#define smp_mb__after_atomic_inc()	smp_mb() - -#include <asm-generic/atomic-long.h>  #endif /* _ALPHA_ATOMIC_H */ diff --git a/arch/alpha/include/asm/auxvec.h b/arch/alpha/include/asm/auxvec.h deleted file mode 100644 index e96fe880e31..00000000000 --- a/arch/alpha/include/asm/auxvec.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __ASM_ALPHA_AUXVEC_H -#define __ASM_ALPHA_AUXVEC_H - -/* Reserve these numbers for any future use of a VDSO.  */ -#if 0 -#define AT_SYSINFO		32 -#define AT_SYSINFO_EHDR		33 -#endif - -/* More complete cache descriptions than AT_[DIU]CACHEBSIZE.  If the -   value is -1, then the cache doesn't exist.  Otherwise: - -      bit 0-3:	  Cache set-associativity; 0 means fully associative. -      bit 4-7:	  Log2 of cacheline size. -      bit 8-31:	  Size of the entire cache >> 8. -      bit 32-63:  Reserved. -*/ - -#define AT_L1I_CACHESHAPE	34 -#define AT_L1D_CACHESHAPE	35 -#define AT_L2_CACHESHAPE	36 -#define AT_L3_CACHESHAPE	37 - -#endif /* __ASM_ALPHA_AUXVEC_H */ diff --git a/arch/alpha/include/asm/barrier.h b/arch/alpha/include/asm/barrier.h index ce8860a0b32..3832bdb794f 100644 --- a/arch/alpha/include/asm/barrier.h +++ b/arch/alpha/include/asm/barrier.h @@ -3,33 +3,18 @@  #include <asm/compiler.h> -#define mb() \ -__asm__ __volatile__("mb": : :"memory") +#define mb()	__asm__ __volatile__("mb": : :"memory") +#define rmb()	__asm__ __volatile__("mb": : :"memory") +#define wmb()	__asm__ __volatile__("wmb": : :"memory") -#define rmb() \ -__asm__ __volatile__("mb": : :"memory") - -#define wmb() \ -__asm__ __volatile__("wmb": : :"memory") - -#define read_barrier_depends() \ -__asm__ __volatile__("mb": : :"memory") +#define read_barrier_depends() __asm__ __volatile__("mb": : :"memory")  #ifdef CONFIG_SMP  #define __ASM_SMP_MB	"\tmb\n" -#define smp_mb()	mb() -#define smp_rmb()	rmb() -#define smp_wmb()	wmb() -#define smp_read_barrier_depends()	read_barrier_depends()  #else  #define __ASM_SMP_MB -#define smp_mb()	barrier() -#define smp_rmb()	barrier() -#define smp_wmb()	barrier() -#define smp_read_barrier_depends()	do { } while (0)  #endif -#define set_mb(var, value) \ -do { var = value; mb(); } while (0) +#include <asm-generic/barrier.h>  #endif		/* __BARRIER_H */ diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h index adfab8a21df..4bdfbd444e6 100644 --- a/arch/alpha/include/asm/bitops.h +++ b/arch/alpha/include/asm/bitops.h @@ -53,9 +53,6 @@ __set_bit(unsigned long nr, volatile void * addr)  	*m |= 1 << (nr & 31);  } -#define smp_mb__before_clear_bit()	smp_mb() -#define smp_mb__after_clear_bit()	smp_mb() -  static inline void  clear_bit(unsigned long nr, volatile void * addr)  { @@ -454,12 +451,9 @@ sched_find_first_bit(const unsigned long b[2])  	return __ffs(tmp) + ofs;  } -#include <asm-generic/bitops/ext2-non-atomic.h> - -#define ext2_set_bit_atomic(l,n,a)   test_and_set_bit(n,a) -#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a) +#include <asm-generic/bitops/le.h> -#include <asm-generic/bitops/minix.h> +#include <asm-generic/bitops/ext2-atomic-setbit.h>  #endif /* __KERNEL__ */ diff --git a/arch/alpha/include/asm/bitsperlong.h b/arch/alpha/include/asm/bitsperlong.h deleted file mode 100644 index ad57f786820..00000000000 --- a/arch/alpha/include/asm/bitsperlong.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __ASM_ALPHA_BITSPERLONG_H -#define __ASM_ALPHA_BITSPERLONG_H - -#define __BITS_PER_LONG 64 - -#include <asm-generic/bitsperlong.h> - -#endif /* __ASM_ALPHA_BITSPERLONG_H */ diff --git a/arch/alpha/include/asm/byteorder.h b/arch/alpha/include/asm/byteorder.h deleted file mode 100644 index 73683093202..00000000000 --- a/arch/alpha/include/asm/byteorder.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ALPHA_BYTEORDER_H -#define _ALPHA_BYTEORDER_H - -#include <linux/byteorder/little_endian.h> - -#endif /* _ALPHA_BYTEORDER_H */ diff --git a/arch/alpha/include/asm/cacheflush.h b/arch/alpha/include/asm/cacheflush.h index 012f1243b1c..a9cb6aa447a 100644 --- a/arch/alpha/include/asm/cacheflush.h +++ b/arch/alpha/include/asm/cacheflush.h @@ -63,7 +63,7 @@ extern void flush_icache_user_range(struct vm_area_struct *vma,  		struct page *page, unsigned long addr, int len);  #endif -/* This is used only in do_no_page and do_swap_page.  */ +/* This is used only in __do_fault and do_swap_page.  */  #define flush_icache_page(vma, page) \    flush_icache_user_range((vma), (page), 0, 0) diff --git a/arch/alpha/include/asm/cmpxchg.h b/arch/alpha/include/asm/cmpxchg.h new file mode 100644 index 00000000000..429e8cd0d78 --- /dev/null +++ b/arch/alpha/include/asm/cmpxchg.h @@ -0,0 +1,71 @@ +#ifndef _ALPHA_CMPXCHG_H +#define _ALPHA_CMPXCHG_H + +/* + * Atomic exchange routines. + */ + +#define __ASM__MB +#define ____xchg(type, args...)		__xchg ## type ## _local(args) +#define ____cmpxchg(type, args...)	__cmpxchg ## type ## _local(args) +#include <asm/xchg.h> + +#define xchg_local(ptr, x)						\ +({									\ +	__typeof__(*(ptr)) _x_ = (x);					\ +	(__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_,	\ +				       sizeof(*(ptr)));			\ +}) + +#define cmpxchg_local(ptr, o, n)					\ +({									\ +	__typeof__(*(ptr)) _o_ = (o);					\ +	__typeof__(*(ptr)) _n_ = (n);					\ +	(__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_,	\ +					  (unsigned long)_n_,		\ +					  sizeof(*(ptr)));		\ +}) + +#define cmpxchg64_local(ptr, o, n)					\ +({									\ +	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\ +	cmpxchg_local((ptr), (o), (n));					\ +}) + +#ifdef CONFIG_SMP +#undef __ASM__MB +#define __ASM__MB	"\tmb\n" +#endif +#undef ____xchg +#undef ____cmpxchg +#define ____xchg(type, args...)		__xchg ##type(args) +#define ____cmpxchg(type, args...)	__cmpxchg ##type(args) +#include <asm/xchg.h> + +#define xchg(ptr, x)							\ +({									\ +	__typeof__(*(ptr)) _x_ = (x);					\ +	(__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_,		\ +				 sizeof(*(ptr)));			\ +}) + +#define cmpxchg(ptr, o, n)						\ +({									\ +	__typeof__(*(ptr)) _o_ = (o);					\ +	__typeof__(*(ptr)) _n_ = (n);					\ +	(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,	\ +				    (unsigned long)_n_,	sizeof(*(ptr)));\ +}) + +#define cmpxchg64(ptr, o, n)						\ +({									\ +	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\ +	cmpxchg((ptr), (o), (n));					\ +}) + +#undef __ASM__MB +#undef ____cmpxchg + +#define __HAVE_ARCH_CMPXCHG 1 + +#endif /* _ALPHA_CMPXCHG_H */ diff --git a/arch/alpha/include/asm/compiler.h b/arch/alpha/include/asm/compiler.h index da6bb199839..a7720b96bcc 100644 --- a/arch/alpha/include/asm/compiler.h +++ b/arch/alpha/include/asm/compiler.h @@ -1,119 +1,8 @@  #ifndef __ALPHA_COMPILER_H  #define __ALPHA_COMPILER_H -/*  - * Herein are macros we use when describing various patterns we want to GCC. - * In all cases we can get better schedules out of the compiler if we hide - * as little as possible inside inline assembly.  However, we want to be - * able to know what we'll get out before giving up inline assembly.  Thus - * these tests and macros. - */ +#include <uapi/asm/compiler.h> -#if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 -# define __kernel_insbl(val, shift)	__builtin_alpha_insbl(val, shift) -# define __kernel_inswl(val, shift)	__builtin_alpha_inswl(val, shift) -# define __kernel_insql(val, shift)	__builtin_alpha_insql(val, shift) -# define __kernel_inslh(val, shift)	__builtin_alpha_inslh(val, shift) -# define __kernel_extbl(val, shift)	__builtin_alpha_extbl(val, shift) -# define __kernel_extwl(val, shift)	__builtin_alpha_extwl(val, shift) -# define __kernel_cmpbge(a, b)		__builtin_alpha_cmpbge(a, b) -#else -# define __kernel_insbl(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("insbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_inswl(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("inswl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_insql(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("insql %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_inslh(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("inslh %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_extbl(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("extbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_extwl(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("extwl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_cmpbge(a, b)						\ -  ({ unsigned long __kir;						\ -     __asm__("cmpbge %r2,%1,%0" : "=r"(__kir) : "rI"(b), "rJ"(a));	\ -     __kir; }) -#endif - -#ifdef __alpha_cix__ -# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 -#  define __kernel_cttz(x)		__builtin_ctzl(x) -#  define __kernel_ctlz(x)		__builtin_clzl(x) -#  define __kernel_ctpop(x)		__builtin_popcountl(x) -# else -#  define __kernel_cttz(x)						\ -   ({ unsigned long __kir;						\ -      __asm__("cttz %1,%0" : "=r"(__kir) : "r"(x));			\ -      __kir; }) -#  define __kernel_ctlz(x)						\ -   ({ unsigned long __kir;						\ -      __asm__("ctlz %1,%0" : "=r"(__kir) : "r"(x));			\ -      __kir; }) -#  define __kernel_ctpop(x)						\ -   ({ unsigned long __kir;						\ -      __asm__("ctpop %1,%0" : "=r"(__kir) : "r"(x));			\ -      __kir; }) -# endif -#else -# define __kernel_cttz(x)						\ -  ({ unsigned long __kir;						\ -     __asm__(".arch ev67; cttz %1,%0" : "=r"(__kir) : "r"(x));		\ -     __kir; }) -# define __kernel_ctlz(x)						\ -  ({ unsigned long __kir;						\ -     __asm__(".arch ev67; ctlz %1,%0" : "=r"(__kir) : "r"(x));		\ -     __kir; }) -# define __kernel_ctpop(x)						\ -  ({ unsigned long __kir;						\ -     __asm__(".arch ev67; ctpop %1,%0" : "=r"(__kir) : "r"(x));		\ -     __kir; }) -#endif - - -/*  - * Beginning with EGCS 1.1, GCC defines __alpha_bwx__ when the BWX  - * extension is enabled.  Previous versions did not define anything - * we could test during compilation -- too bad, so sad. - */ - -#if defined(__alpha_bwx__) -#define __kernel_ldbu(mem)	(mem) -#define __kernel_ldwu(mem)	(mem) -#define __kernel_stb(val,mem)	((mem) = (val)) -#define __kernel_stw(val,mem)	((mem) = (val)) -#else -#define __kernel_ldbu(mem)				\ -  ({ unsigned char __kir;				\ -     __asm__(".arch ev56;				\ -	      ldbu %0,%1" : "=r"(__kir) : "m"(mem));	\ -     __kir; }) -#define __kernel_ldwu(mem)				\ -  ({ unsigned short __kir;				\ -     __asm__(".arch ev56;				\ -	      ldwu %0,%1" : "=r"(__kir) : "m"(mem));	\ -     __kir; }) -#define __kernel_stb(val,mem)				\ -  __asm__(".arch ev56;					\ -	   stb %1,%0" : "=m"(mem) : "r"(val)) -#define __kernel_stw(val,mem)				\ -  __asm__(".arch ev56;					\ -	   stw %1,%0" : "=m"(mem) : "r"(val)) -#endif - -#ifdef __KERNEL__  /* Some idiots over in <linux/compiler.h> thought inline should imply     always_inline.  This breaks stuff.  We'll include this file whenever     we run into such problems.  */ @@ -125,6 +14,4 @@  #undef __always_inline  #define __always_inline		inline __attribute__((always_inline)) -#endif /* __KERNEL__ */ -  #endif /* __ALPHA_COMPILER_H */ diff --git a/arch/alpha/include/asm/console.h b/arch/alpha/include/asm/console.h index a3ce4e62249..f2b584fe099 100644 --- a/arch/alpha/include/asm/console.h +++ b/arch/alpha/include/asm/console.h @@ -1,52 +1,8 @@  #ifndef __AXP_CONSOLE_H  #define __AXP_CONSOLE_H -/* - * Console callback routine numbers - */ -#define CCB_GETC		0x01 -#define CCB_PUTS		0x02 -#define CCB_RESET_TERM		0x03 -#define CCB_SET_TERM_INT	0x04 -#define CCB_SET_TERM_CTL	0x05 -#define CCB_PROCESS_KEYCODE	0x06 -#define CCB_OPEN_CONSOLE	0x07 -#define CCB_CLOSE_CONSOLE	0x08 +#include <uapi/asm/console.h> -#define CCB_OPEN		0x10 -#define CCB_CLOSE		0x11 -#define CCB_IOCTL		0x12 -#define CCB_READ		0x13 -#define CCB_WRITE		0x14 - -#define CCB_SET_ENV		0x20 -#define CCB_RESET_ENV		0x21 -#define CCB_GET_ENV		0x22 -#define CCB_SAVE_ENV		0x23 - -#define CCB_PSWITCH		0x30 -#define CCB_BIOS_EMUL		0x32 - -/* - * Environment variable numbers - */ -#define ENV_AUTO_ACTION		0x01 -#define ENV_BOOT_DEV		0x02 -#define ENV_BOOTDEF_DEV		0x03 -#define ENV_BOOTED_DEV		0x04 -#define ENV_BOOT_FILE		0x05 -#define ENV_BOOTED_FILE		0x06 -#define ENV_BOOT_OSFLAGS	0x07 -#define ENV_BOOTED_OSFLAGS	0x08 -#define ENV_BOOT_RESET		0x09 -#define ENV_DUMP_DEV		0x0A -#define ENV_ENABLE_AUDIT	0x0B -#define ENV_LICENSE		0x0C -#define ENV_CHAR_SET		0x0D -#define ENV_LANGUAGE		0x0E -#define ENV_TTY_DEV		0x0F - -#ifdef __KERNEL__  #ifndef __ASSEMBLY__  extern long callback_puts(long unit, const char *s, long length);  extern long callback_getc(long unit); @@ -70,6 +26,4 @@ struct hwrpb_struct;  extern int callback_init_done;  extern void * callback_init(void *);  #endif /* __ASSEMBLY__ */ -#endif /* __KERNEL__ */ -  #endif /* __AXP_CONSOLE_H */ diff --git a/arch/alpha/include/asm/core_lca.h b/arch/alpha/include/asm/core_lca.h index f7cb4b46095..8ee6c516279 100644 --- a/arch/alpha/include/asm/core_lca.h +++ b/arch/alpha/include/asm/core_lca.h @@ -1,8 +1,8 @@  #ifndef __ALPHA_LCA__H__  #define __ALPHA_LCA__H__ -#include <asm/system.h>  #include <asm/compiler.h> +#include <asm/mce.h>  /*   * Low Cost Alpha (LCA) definitions (these apply to 21066 and 21068, diff --git a/arch/alpha/include/asm/core_mcpcia.h b/arch/alpha/include/asm/core_mcpcia.h index 9f67a056b46..ad44bef29fb 100644 --- a/arch/alpha/include/asm/core_mcpcia.h +++ b/arch/alpha/include/asm/core_mcpcia.h @@ -7,6 +7,7 @@  #include <linux/types.h>  #include <asm/compiler.h> +#include <asm/mce.h>  /*   * MCPCIA is the internal name for a core logic chipset which provides diff --git a/arch/alpha/include/asm/core_t2.h b/arch/alpha/include/asm/core_t2.h index 91b46801b29..ade9d92e68b 100644 --- a/arch/alpha/include/asm/core_t2.h +++ b/arch/alpha/include/asm/core_t2.h @@ -7,7 +7,6 @@  #include <linux/types.h>  #include <linux/spinlock.h>  #include <asm/compiler.h> -#include <asm/system.h>  /*   * T2 is the internal name for the core logic chipset which provides diff --git a/arch/alpha/include/asm/cputime.h b/arch/alpha/include/asm/cputime.h deleted file mode 100644 index 19577fd9323..00000000000 --- a/arch/alpha/include/asm/cputime.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ALPHA_CPUTIME_H -#define __ALPHA_CPUTIME_H - -#include <asm-generic/cputime.h> - -#endif /* __ALPHA_CPUTIME_H */ diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h index 4567aca6fdd..dfa32f06132 100644 --- a/arch/alpha/include/asm/dma-mapping.h +++ b/arch/alpha/include/asm/dma-mapping.h @@ -12,16 +12,22 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)  #include <asm-generic/dma-mapping-common.h> -static inline void *dma_alloc_coherent(struct device *dev, size_t size, -				       dma_addr_t *dma_handle, gfp_t gfp) +#define dma_alloc_coherent(d,s,h,f)	dma_alloc_attrs(d,s,h,f,NULL) + +static inline void *dma_alloc_attrs(struct device *dev, size_t size, +				    dma_addr_t *dma_handle, gfp_t gfp, +				    struct dma_attrs *attrs)  { -	return get_dma_ops(dev)->alloc_coherent(dev, size, dma_handle, gfp); +	return get_dma_ops(dev)->alloc(dev, size, dma_handle, gfp, attrs);  } -static inline void dma_free_coherent(struct device *dev, size_t size, -				     void *vaddr, dma_addr_t dma_handle) +#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) + +static inline void dma_free_attrs(struct device *dev, size_t size, +				  void *vaddr, dma_addr_t dma_handle, +				  struct dma_attrs *attrs)  { -	get_dma_ops(dev)->free_coherent(dev, size, vaddr, dma_handle); +	get_dma_ops(dev)->free(dev, size, vaddr, dma_handle, attrs);  }  static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) diff --git a/arch/alpha/include/asm/elf.h b/arch/alpha/include/asm/elf.h index 9baae8afe8a..968d9991f5e 100644 --- a/arch/alpha/include/asm/elf.h +++ b/arch/alpha/include/asm/elf.h @@ -2,6 +2,7 @@  #define __ASM_ALPHA_ELF_H  #include <asm/auxvec.h> +#include <asm/special_insns.h>  /* Special values for the st_other field in the symbol table.  */ @@ -101,7 +102,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];  #define ELF_PLAT_INIT(_r, load_addr)	_r->r0 = 0 -/* The registers are layed out in pt_regs for PAL and syscall +/* The registers are laid out in pt_regs for PAL and syscall     convenience.  Re-order them for the linear elf_gregset_t.  */  struct pt_regs; diff --git a/arch/alpha/include/asm/errno.h b/arch/alpha/include/asm/errno.h deleted file mode 100644 index 98099bda937..00000000000 --- a/arch/alpha/include/asm/errno.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef _ALPHA_ERRNO_H -#define _ALPHA_ERRNO_H - -#include <asm-generic/errno-base.h> - -#undef	EAGAIN			/* 11 in errno-base.h */ - -#define	EDEADLK		11	/* Resource deadlock would occur */ - -#define	EAGAIN		35	/* Try again */ -#define	EWOULDBLOCK	EAGAIN	/* Operation would block */ -#define	EINPROGRESS	36	/* Operation now in progress */ -#define	EALREADY	37	/* Operation already in progress */ -#define	ENOTSOCK	38	/* Socket operation on non-socket */ -#define	EDESTADDRREQ	39	/* Destination address required */ -#define	EMSGSIZE	40	/* Message too long */ -#define	EPROTOTYPE	41	/* Protocol wrong type for socket */ -#define	ENOPROTOOPT	42	/* Protocol not available */ -#define	EPROTONOSUPPORT	43	/* Protocol not supported */ -#define	ESOCKTNOSUPPORT	44	/* Socket type not supported */ -#define	EOPNOTSUPP	45	/* Operation not supported on transport endpoint */ -#define	EPFNOSUPPORT	46	/* Protocol family not supported */ -#define	EAFNOSUPPORT	47	/* Address family not supported by protocol */ -#define	EADDRINUSE	48	/* Address already in use */ -#define	EADDRNOTAVAIL	49	/* Cannot assign requested address */ -#define	ENETDOWN	50	/* Network is down */ -#define	ENETUNREACH	51	/* Network is unreachable */ -#define	ENETRESET	52	/* Network dropped connection because of reset */ -#define	ECONNABORTED	53	/* Software caused connection abort */ -#define	ECONNRESET	54	/* Connection reset by peer */ -#define	ENOBUFS		55	/* No buffer space available */ -#define	EISCONN		56	/* Transport endpoint is already connected */ -#define	ENOTCONN	57	/* Transport endpoint is not connected */ -#define	ESHUTDOWN	58	/* Cannot send after transport endpoint shutdown */ -#define	ETOOMANYREFS	59	/* Too many references: cannot splice */ -#define	ETIMEDOUT	60	/* Connection timed out */ -#define	ECONNREFUSED	61	/* Connection refused */ -#define	ELOOP		62	/* Too many symbolic links encountered */ -#define	ENAMETOOLONG	63	/* File name too long */ -#define	EHOSTDOWN	64	/* Host is down */ -#define	EHOSTUNREACH	65	/* No route to host */ -#define	ENOTEMPTY	66	/* Directory not empty */ - -#define	EUSERS		68	/* Too many users */ -#define	EDQUOT		69	/* Quota exceeded */ -#define	ESTALE		70	/* Stale NFS file handle */ -#define	EREMOTE		71	/* Object is remote */ - -#define	ENOLCK		77	/* No record locks available */ -#define	ENOSYS		78	/* Function not implemented */ - -#define	ENOMSG		80	/* No message of desired type */ -#define	EIDRM		81	/* Identifier removed */ -#define	ENOSR		82	/* Out of streams resources */ -#define	ETIME		83	/* Timer expired */ -#define	EBADMSG		84	/* Not a data message */ -#define	EPROTO		85	/* Protocol error */ -#define	ENODATA		86	/* No data available */ -#define	ENOSTR		87	/* Device not a stream */ - -#define	ENOPKG		92	/* Package not installed */ - -#define	EILSEQ		116	/* Illegal byte sequence */ - -/* The following are just random noise.. */ -#define	ECHRNG		88	/* Channel number out of range */ -#define	EL2NSYNC	89	/* Level 2 not synchronized */ -#define	EL3HLT		90	/* Level 3 halted */ -#define	EL3RST		91	/* Level 3 reset */ - -#define	ELNRNG		93	/* Link number out of range */ -#define	EUNATCH		94	/* Protocol driver not attached */ -#define	ENOCSI		95	/* No CSI structure available */ -#define	EL2HLT		96	/* Level 2 halted */ -#define	EBADE		97	/* Invalid exchange */ -#define	EBADR		98	/* Invalid request descriptor */ -#define	EXFULL		99	/* Exchange full */ -#define	ENOANO		100	/* No anode */ -#define	EBADRQC		101	/* Invalid request code */ -#define	EBADSLT		102	/* Invalid slot */ - -#define	EDEADLOCK	EDEADLK - -#define	EBFONT		104	/* Bad font file format */ -#define	ENONET		105	/* Machine is not on the network */ -#define	ENOLINK		106	/* Link has been severed */ -#define	EADV		107	/* Advertise error */ -#define	ESRMNT		108	/* Srmount error */ -#define	ECOMM		109	/* Communication error on send */ -#define	EMULTIHOP	110	/* Multihop attempted */ -#define	EDOTDOT		111	/* RFS specific error */ -#define	EOVERFLOW	112	/* Value too large for defined data type */ -#define	ENOTUNIQ	113	/* Name not unique on network */ -#define	EBADFD		114	/* File descriptor in bad state */ -#define	EREMCHG		115	/* Remote address changed */ - -#define	EUCLEAN		117	/* Structure needs cleaning */ -#define	ENOTNAM		118	/* Not a XENIX named type file */ -#define	ENAVAIL		119	/* No XENIX semaphores available */ -#define	EISNAM		120	/* Is a named type file */ -#define	EREMOTEIO	121	/* Remote I/O error */ - -#define	ELIBACC		122	/* Can not access a needed shared library */ -#define	ELIBBAD		123	/* Accessing a corrupted shared library */ -#define	ELIBSCN		124	/* .lib section in a.out corrupted */ -#define	ELIBMAX		125	/* Attempting to link in too many shared libraries */ -#define	ELIBEXEC	126	/* Cannot exec a shared library directly */ -#define	ERESTART	127	/* Interrupted system call should be restarted */ -#define	ESTRPIPE	128	/* Streams pipe error */ - -#define ENOMEDIUM	129	/* No medium found */ -#define EMEDIUMTYPE	130	/* Wrong medium type */ -#define	ECANCELED	131	/* Operation Cancelled */ -#define	ENOKEY		132	/* Required key not available */ -#define	EKEYEXPIRED	133	/* Key has expired */ -#define	EKEYREVOKED	134	/* Key has been revoked */ -#define	EKEYREJECTED	135	/* Key was rejected by service */ - -/* for robust mutexes */ -#define	EOWNERDEAD	136	/* Owner died */ -#define	ENOTRECOVERABLE	137	/* State not recoverable */ - -#define	ERFKILL		138	/* Operation not possible due to RF-kill */ - -#endif diff --git a/arch/alpha/include/asm/fcntl.h b/arch/alpha/include/asm/fcntl.h deleted file mode 100644 index 70145cbb21c..00000000000 --- a/arch/alpha/include/asm/fcntl.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ALPHA_FCNTL_H -#define _ALPHA_FCNTL_H - -#define O_CREAT		 01000	/* not fcntl */ -#define O_TRUNC		 02000	/* not fcntl */ -#define O_EXCL		 04000	/* not fcntl */ -#define O_NOCTTY	010000	/* not fcntl */ - -#define O_NONBLOCK	 00004 -#define O_APPEND	 00010 -#define O_DSYNC		040000	/* used to be O_SYNC, see below */ -#define O_DIRECTORY	0100000	/* must be a directory */ -#define O_NOFOLLOW	0200000 /* don't follow links */ -#define O_LARGEFILE	0400000 /* will be set by the kernel on every open */ -#define O_DIRECT	02000000 /* direct disk access - should check with OSF/1 */ -#define O_NOATIME	04000000 -#define O_CLOEXEC	010000000 /* set close_on_exec */ -/* - * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using - * the O_SYNC flag.  We continue to use the existing numerical value - * for O_DSYNC semantics now, but using the correct symbolic name for it. - * This new value is used to request true Posix O_SYNC semantics.  It is - * defined in this strange way to make sure applications compiled against - * new headers get at least O_DSYNC semantics on older kernels. - * - * This has the nice side-effect that we can simply test for O_DSYNC - * wherever we do not care if O_DSYNC or O_SYNC is used. - * - * Note: __O_SYNC must never be used directly. - */ -#define __O_SYNC	020000000 -#define O_SYNC		(__O_SYNC|O_DSYNC) - -#define F_GETLK		7 -#define F_SETLK		8 -#define F_SETLKW	9 - -#define F_SETOWN	5	/*  for sockets. */ -#define F_GETOWN	6	/*  for sockets. */ -#define F_SETSIG	10	/*  for sockets. */ -#define F_GETSIG	11	/*  for sockets. */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK		1 -#define F_WRLCK		2 -#define F_UNLCK		8 - -/* for old implementation of bsd flock () */ -#define F_EXLCK		16	/* or 3 */ -#define F_SHLCK		32	/* or 4 */ - -#define F_INPROGRESS	64 - -#include <asm-generic/fcntl.h> - -#endif diff --git a/arch/alpha/include/asm/floppy.h b/arch/alpha/include/asm/floppy.h index 0be50413b2b..bae97eb19d2 100644 --- a/arch/alpha/include/asm/floppy.h +++ b/arch/alpha/include/asm/floppy.h @@ -26,8 +26,8 @@  #define fd_disable_irq()        disable_irq(FLOPPY_IRQ)  #define fd_cacheflush(addr,size) /* nothing */  #define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt,\ -					    IRQF_DISABLED, "floppy", NULL) -#define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL); +					    0, "floppy", NULL) +#define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL)  #ifdef CONFIG_PCI diff --git a/arch/alpha/include/asm/fpu.h b/arch/alpha/include/asm/fpu.h index ecb17a72acc..71c20956b90 100644 --- a/arch/alpha/include/asm/fpu.h +++ b/arch/alpha/include/asm/fpu.h @@ -1,124 +1,8 @@  #ifndef __ASM_ALPHA_FPU_H  #define __ASM_ALPHA_FPU_H -/* - * Alpha floating-point control register defines: - */ -#define FPCR_DNOD	(1UL<<47)	/* denorm INV trap disable */ -#define FPCR_DNZ	(1UL<<48)	/* denorms to zero */ -#define FPCR_INVD	(1UL<<49)	/* invalid op disable (opt.) */ -#define FPCR_DZED	(1UL<<50)	/* division by zero disable (opt.) */ -#define FPCR_OVFD	(1UL<<51)	/* overflow disable (optional) */ -#define FPCR_INV	(1UL<<52)	/* invalid operation */ -#define FPCR_DZE	(1UL<<53)	/* division by zero */ -#define FPCR_OVF	(1UL<<54)	/* overflow */ -#define FPCR_UNF	(1UL<<55)	/* underflow */ -#define FPCR_INE	(1UL<<56)	/* inexact */ -#define FPCR_IOV	(1UL<<57)	/* integer overflow */ -#define FPCR_UNDZ	(1UL<<60)	/* underflow to zero (opt.) */ -#define FPCR_UNFD	(1UL<<61)	/* underflow disable (opt.) */ -#define FPCR_INED	(1UL<<62)	/* inexact disable (opt.) */ -#define FPCR_SUM	(1UL<<63)	/* summary bit */ - -#define FPCR_DYN_SHIFT	58		/* first dynamic rounding mode bit */ -#define FPCR_DYN_CHOPPED (0x0UL << FPCR_DYN_SHIFT)	/* towards 0 */ -#define FPCR_DYN_MINUS	 (0x1UL << FPCR_DYN_SHIFT)	/* towards -INF */ -#define FPCR_DYN_NORMAL	 (0x2UL << FPCR_DYN_SHIFT)	/* towards nearest */ -#define FPCR_DYN_PLUS	 (0x3UL << FPCR_DYN_SHIFT)	/* towards +INF */ -#define FPCR_DYN_MASK	 (0x3UL << FPCR_DYN_SHIFT) - -#define FPCR_MASK	0xffff800000000000L - -/* - * IEEE trap enables are implemented in software.  These per-thread - * bits are stored in the "ieee_state" field of "struct thread_info". - * Thus, the bits are defined so as not to conflict with the - * floating-point enable bit (which is architected).  On top of that, - * we want to make these bits compatible with OSF/1 so - * ieee_set_fp_control() etc. can be implemented easily and - * compatibly.  The corresponding definitions are in - * /usr/include/machine/fpu.h under OSF/1. - */ -#define IEEE_TRAP_ENABLE_INV	(1UL<<1)	/* invalid op */ -#define IEEE_TRAP_ENABLE_DZE	(1UL<<2)	/* division by zero */ -#define IEEE_TRAP_ENABLE_OVF	(1UL<<3)	/* overflow */ -#define IEEE_TRAP_ENABLE_UNF	(1UL<<4)	/* underflow */ -#define IEEE_TRAP_ENABLE_INE	(1UL<<5)	/* inexact */ -#define IEEE_TRAP_ENABLE_DNO	(1UL<<6)	/* denorm */ -#define IEEE_TRAP_ENABLE_MASK	(IEEE_TRAP_ENABLE_INV | IEEE_TRAP_ENABLE_DZE |\ -				 IEEE_TRAP_ENABLE_OVF | IEEE_TRAP_ENABLE_UNF |\ -				 IEEE_TRAP_ENABLE_INE | IEEE_TRAP_ENABLE_DNO) - -/* Denorm and Underflow flushing */ -#define IEEE_MAP_DMZ		(1UL<<12)	/* Map denorm inputs to zero */ -#define IEEE_MAP_UMZ		(1UL<<13)	/* Map underflowed outputs to zero */ - -#define IEEE_MAP_MASK		(IEEE_MAP_DMZ | IEEE_MAP_UMZ) - -/* status bits coming from fpcr: */ -#define IEEE_STATUS_INV		(1UL<<17) -#define IEEE_STATUS_DZE		(1UL<<18) -#define IEEE_STATUS_OVF		(1UL<<19) -#define IEEE_STATUS_UNF		(1UL<<20) -#define IEEE_STATUS_INE		(1UL<<21) -#define IEEE_STATUS_DNO		(1UL<<22) - -#define IEEE_STATUS_MASK	(IEEE_STATUS_INV | IEEE_STATUS_DZE |	\ -				 IEEE_STATUS_OVF | IEEE_STATUS_UNF |	\ -				 IEEE_STATUS_INE | IEEE_STATUS_DNO) - -#define IEEE_SW_MASK		(IEEE_TRAP_ENABLE_MASK |		\ -				 IEEE_STATUS_MASK | IEEE_MAP_MASK) - -#define IEEE_CURRENT_RM_SHIFT	32 -#define IEEE_CURRENT_RM_MASK	(3UL<<IEEE_CURRENT_RM_SHIFT) - -#define IEEE_STATUS_TO_EXCSUM_SHIFT	16 - -#define IEEE_INHERIT    (1UL<<63)	/* inherit on thread create? */ - -/* - * Convert the software IEEE trap enable and status bits into the - * hardware fpcr format.  - * - * Digital Unix engineers receive my thanks for not defining the - * software bits identical to the hardware bits.  The chip designers - * receive my thanks for making all the not-implemented fpcr bits - * RAZ forcing us to use system calls to read/write this value. - */ - -static inline unsigned long -ieee_swcr_to_fpcr(unsigned long sw) -{ -	unsigned long fp; -	fp = (sw & IEEE_STATUS_MASK) << 35; -	fp |= (sw & IEEE_MAP_DMZ) << 36; -	fp |= (sw & IEEE_STATUS_MASK ? FPCR_SUM : 0); -	fp |= (~sw & (IEEE_TRAP_ENABLE_INV -		      | IEEE_TRAP_ENABLE_DZE -		      | IEEE_TRAP_ENABLE_OVF)) << 48; -	fp |= (~sw & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE)) << 57; -	fp |= (sw & IEEE_MAP_UMZ ? FPCR_UNDZ | FPCR_UNFD : 0); -	fp |= (~sw & IEEE_TRAP_ENABLE_DNO) << 41; -	return fp; -} - -static inline unsigned long -ieee_fpcr_to_swcr(unsigned long fp) -{ -	unsigned long sw; -	sw = (fp >> 35) & IEEE_STATUS_MASK; -	sw |= (fp >> 36) & IEEE_MAP_DMZ; -	sw |= (~fp >> 48) & (IEEE_TRAP_ENABLE_INV -			     | IEEE_TRAP_ENABLE_DZE -			     | IEEE_TRAP_ENABLE_OVF); -	sw |= (~fp >> 57) & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE); -	sw |= (fp >> 47) & IEEE_MAP_UMZ; -	sw |= (~fp >> 41) & IEEE_TRAP_ENABLE_DNO; -	return sw; -} - -#ifdef __KERNEL__ +#include <asm/special_insns.h> +#include <uapi/asm/fpu.h>  /* The following two functions don't need trapb/excb instructions     around the mf_fpcr/mt_fpcr instructions because (a) the kernel @@ -188,6 +72,4 @@ extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);  extern unsigned long alpha_read_fp_reg_s (unsigned long reg);  extern void alpha_write_fp_reg_s (unsigned long reg, unsigned long val); -#endif /* __KERNEL__ */ -  #endif /* __ASM_ALPHA_FPU_H */ diff --git a/arch/alpha/include/asm/futex.h b/arch/alpha/include/asm/futex.h index 945de222ab9..f939794363a 100644 --- a/arch/alpha/include/asm/futex.h +++ b/arch/alpha/include/asm/futex.h @@ -29,7 +29,7 @@  	:	"r" (uaddr), "r"(oparg)				\  	:	"memory") -static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)  {  	int op = (encoded_op >> 28) & 7;  	int cmp = (encoded_op >> 24) & 15; @@ -39,7 +39,7 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)  	if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))  		oparg = 1 << oparg; -	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) +	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))  		return -EFAULT;  	pagefault_disable(); @@ -81,21 +81,23 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)  }  static inline int -futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) +futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, +			      u32 oldval, u32 newval)  { -	int prev, cmp; +	int ret = 0, cmp; +	u32 prev; -	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) +	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))  		return -EFAULT;  	__asm__ __volatile__ (  		__ASM_SMP_MB -	"1:	ldl_l	%0,0(%2)\n" -	"	cmpeq	%0,%3,%1\n" -	"	beq	%1,3f\n" -	"	mov	%4,%1\n" -	"2:	stl_c	%1,0(%2)\n" -	"	beq	%1,4f\n" +	"1:	ldl_l	%1,0(%3)\n" +	"	cmpeq	%1,%4,%2\n" +	"	beq	%2,3f\n" +	"	mov	%5,%2\n" +	"2:	stl_c	%2,0(%3)\n" +	"	beq	%2,4f\n"  	"3:	.subsection 2\n"  	"4:	br	1b\n"  	"	.previous\n" @@ -105,11 +107,12 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)  	"	.long	2b-.\n"  	"	lda	$31,3b-2b(%0)\n"  	"	.previous\n" -	:	"=&r"(prev), "=&r"(cmp) -	:	"r"(uaddr), "r"((long)oldval), "r"(newval) +	:	"+r"(ret), "=&r"(prev), "=&r"(cmp) +	:	"r"(uaddr), "r"((long)(int)oldval), "r"(newval)  	:	"memory"); -	return prev; +	*uval = prev; +	return ret;  }  #endif /* __KERNEL__ */ diff --git a/arch/alpha/include/asm/gentrap.h b/arch/alpha/include/asm/gentrap.h deleted file mode 100644 index ae50cc3192c..00000000000 --- a/arch/alpha/include/asm/gentrap.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _ASMAXP_GENTRAP_H -#define _ASMAXP_GENTRAP_H - -/* - * Definitions for gentrap causes.  They are generated by user-level - * programs and therefore should be compatible with the corresponding - * OSF/1 definitions. - */ -#define GEN_INTOVF	-1	/* integer overflow */ -#define GEN_INTDIV	-2	/* integer division by zero */ -#define GEN_FLTOVF	-3	/* fp overflow */ -#define GEN_FLTDIV	-4	/* fp division by zero */ -#define GEN_FLTUND	-5	/* fp underflow */ -#define GEN_FLTINV	-6	/* invalid fp operand */ -#define GEN_FLTINE	-7	/* inexact fp operand */ -#define GEN_DECOVF	-8	/* decimal overflow (for COBOL??) */ -#define GEN_DECDIV	-9	/* decimal division by zero */ -#define GEN_DECINV	-10	/* invalid decimal operand */ -#define GEN_ROPRAND	-11	/* reserved operand */ -#define GEN_ASSERTERR	-12	/* assertion error */ -#define GEN_NULPTRERR	-13	/* null pointer error */ -#define GEN_STKOVF	-14	/* stack overflow */ -#define GEN_STRLENERR	-15	/* string length error */ -#define GEN_SUBSTRERR	-16	/* substring error */ -#define GEN_RANGERR	-17	/* range error */ -#define GEN_SUBRNG	-18 -#define GEN_SUBRNG1	-19	  -#define GEN_SUBRNG2	-20 -#define GEN_SUBRNG3	-21	/* these report range errors for */ -#define GEN_SUBRNG4	-22	/* subscripting (indexing) at levels 0..7 */ -#define GEN_SUBRNG5	-23 -#define GEN_SUBRNG6	-24 -#define GEN_SUBRNG7	-25 - -/* the remaining codes (-26..-1023) are reserved. */ - -#endif /* _ASMAXP_GENTRAP_H */ diff --git a/arch/alpha/include/asm/gpio.h b/arch/alpha/include/asm/gpio.h new file mode 100644 index 00000000000..b3799d88ffc --- /dev/null +++ b/arch/alpha/include/asm/gpio.h @@ -0,0 +1,4 @@ +#ifndef __LINUX_GPIO_H +#warning Include linux/gpio.h instead of asm/gpio.h +#include <linux/gpio.h> +#endif diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index eda9b909aa0..5ebab5895ed 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h @@ -6,7 +6,6 @@  #include <linux/kernel.h>  #include <linux/mm.h>  #include <asm/compiler.h> -#include <asm/system.h>  #include <asm/pgtable.h>  #include <asm/machvec.h>  #include <asm/hwrpb.h> @@ -37,8 +36,9 @@   */  extern inline void __set_hae(unsigned long new_hae)  { -	unsigned long flags; -	local_irq_save(flags); +	unsigned long flags = swpipl(IPL_MAX); + +	barrier();  	alpha_mv.hae_cache = new_hae;  	*alpha_mv.hae_register = new_hae; @@ -46,7 +46,8 @@ extern inline void __set_hae(unsigned long new_hae)  	/* Re-read to make sure it was written.  */  	new_hae = *alpha_mv.hae_register; -	local_irq_restore(flags); +	setipl(flags); +	barrier();  }  extern inline void set_hae(unsigned long new_hae) @@ -488,6 +489,11 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)  }  #endif +#define ioread16be(p) be16_to_cpu(ioread16(p)) +#define ioread32be(p) be32_to_cpu(ioread32(p)) +#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p)) +#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p)) +  #define inb_p		inb  #define inw_p		inw  #define inl_p		inl diff --git a/arch/alpha/include/asm/ioctl.h b/arch/alpha/include/asm/ioctl.h deleted file mode 100644 index fc63727f417..00000000000 --- a/arch/alpha/include/asm/ioctl.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef _ALPHA_IOCTL_H -#define _ALPHA_IOCTL_H - -/* - * The original linux ioctl numbering scheme was just a general - * "anything goes" setup, where more or less random numbers were - * assigned.  Sorry, I was clueless when I started out on this. - * - * On the alpha, we'll try to clean it up a bit, using a more sane - * ioctl numbering, and also trying to be compatible with OSF/1 in - * the process. I'd like to clean it up for the i386 as well, but - * it's so painful recognizing both the new and the old numbers.. - */ - -#define _IOC_NRBITS	8 -#define _IOC_TYPEBITS	8 -#define _IOC_SIZEBITS	13 -#define _IOC_DIRBITS	3 - -#define _IOC_NRMASK	((1 << _IOC_NRBITS)-1) -#define _IOC_TYPEMASK	((1 << _IOC_TYPEBITS)-1) -#define _IOC_SIZEMASK	((1 << _IOC_SIZEBITS)-1) -#define _IOC_DIRMASK	((1 << _IOC_DIRBITS)-1) - -#define _IOC_NRSHIFT	0 -#define _IOC_TYPESHIFT	(_IOC_NRSHIFT+_IOC_NRBITS) -#define _IOC_SIZESHIFT	(_IOC_TYPESHIFT+_IOC_TYPEBITS) -#define _IOC_DIRSHIFT	(_IOC_SIZESHIFT+_IOC_SIZEBITS) - -/* - * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit. - * And this turns out useful to catch old ioctl numbers in header - * files for us. - */ -#define _IOC_NONE	1U -#define _IOC_READ	2U -#define _IOC_WRITE	4U - -#define _IOC(dir,type,nr,size)			\ -	((unsigned int)				\ -	 (((dir)  << _IOC_DIRSHIFT) |		\ -	  ((type) << _IOC_TYPESHIFT) |		\ -	  ((nr)   << _IOC_NRSHIFT) |		\ -	  ((size) << _IOC_SIZESHIFT))) - -/* used to create numbers */ -#define _IO(type,nr)		_IOC(_IOC_NONE,(type),(nr),0) -#define _IOR(type,nr,size)	_IOC(_IOC_READ,(type),(nr),sizeof(size)) -#define _IOW(type,nr,size)	_IOC(_IOC_WRITE,(type),(nr),sizeof(size)) -#define _IOWR(type,nr,size)	_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) - -/* used to decode them.. */ -#define _IOC_DIR(nr)		(((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) -#define _IOC_TYPE(nr)		(((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) -#define _IOC_NR(nr)		(((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) -#define _IOC_SIZE(nr)		(((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) - -/* ...and for the drivers/sound files... */ - -#define IOC_IN		(_IOC_WRITE << _IOC_DIRSHIFT) -#define IOC_OUT		(_IOC_READ << _IOC_DIRSHIFT) -#define IOC_INOUT	((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) -#define IOCSIZE_MASK	(_IOC_SIZEMASK << _IOC_SIZESHIFT) -#define IOCSIZE_SHIFT	(_IOC_SIZESHIFT) - -#endif /* _ALPHA_IOCTL_H */ diff --git a/arch/alpha/include/asm/ioctls.h b/arch/alpha/include/asm/ioctls.h deleted file mode 100644 index 59617c3c2be..00000000000 --- a/arch/alpha/include/asm/ioctls.h +++ /dev/null @@ -1,112 +0,0 @@ -#ifndef _ASM_ALPHA_IOCTLS_H -#define _ASM_ALPHA_IOCTLS_H - -#include <asm/ioctl.h> - -#define FIOCLEX		_IO('f', 1) -#define FIONCLEX	_IO('f', 2) -#define FIOASYNC	_IOW('f', 125, int) -#define FIONBIO		_IOW('f', 126, int) -#define FIONREAD	_IOR('f', 127, int) -#define TIOCINQ		FIONREAD -#define FIOQSIZE	_IOR('f', 128, loff_t) - -#define TIOCGETP	_IOR('t', 8, struct sgttyb) -#define TIOCSETP	_IOW('t', 9, struct sgttyb) -#define TIOCSETN	_IOW('t', 10, struct sgttyb)	/* TIOCSETP wo flush */ - -#define TIOCSETC	_IOW('t', 17, struct tchars) -#define TIOCGETC	_IOR('t', 18, struct tchars) -#define TCGETS		_IOR('t', 19, struct termios) -#define TCSETS		_IOW('t', 20, struct termios) -#define TCSETSW		_IOW('t', 21, struct termios) -#define TCSETSF		_IOW('t', 22, struct termios) - -#define TCGETA		_IOR('t', 23, struct termio) -#define TCSETA		_IOW('t', 24, struct termio) -#define TCSETAW		_IOW('t', 25, struct termio) -#define TCSETAF		_IOW('t', 28, struct termio) - -#define TCSBRK		_IO('t', 29) -#define TCXONC		_IO('t', 30) -#define TCFLSH		_IO('t', 31) - -#define TIOCSWINSZ	_IOW('t', 103, struct winsize) -#define TIOCGWINSZ	_IOR('t', 104, struct winsize) -#define	TIOCSTART	_IO('t', 110)		/* start output, like ^Q */ -#define	TIOCSTOP	_IO('t', 111)		/* stop output, like ^S */ -#define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */ - -#define TIOCGLTC	_IOR('t', 116, struct ltchars) -#define TIOCSLTC	_IOW('t', 117, struct ltchars) -#define TIOCSPGRP	_IOW('t', 118, int) -#define TIOCGPGRP	_IOR('t', 119, int) - -#define TIOCEXCL	0x540C -#define TIOCNXCL	0x540D -#define TIOCSCTTY	0x540E - -#define TIOCSTI		0x5412 -#define TIOCMGET	0x5415 -#define TIOCMBIS	0x5416 -#define TIOCMBIC	0x5417 -#define TIOCMSET	0x5418 -# define TIOCM_LE	0x001 -# define TIOCM_DTR	0x002 -# define TIOCM_RTS	0x004 -# define TIOCM_ST	0x008 -# define TIOCM_SR	0x010 -# define TIOCM_CTS	0x020 -# define TIOCM_CAR	0x040 -# define TIOCM_RNG	0x080 -# define TIOCM_DSR	0x100 -# define TIOCM_CD	TIOCM_CAR -# define TIOCM_RI	TIOCM_RNG -# define TIOCM_OUT1	0x2000 -# define TIOCM_OUT2	0x4000 -# define TIOCM_LOOP	0x8000 - -#define TIOCGSOFTCAR	0x5419 -#define TIOCSSOFTCAR	0x541A -#define TIOCLINUX	0x541C -#define TIOCCONS	0x541D -#define TIOCGSERIAL	0x541E -#define TIOCSSERIAL	0x541F -#define TIOCPKT		0x5420 -# define TIOCPKT_DATA		 0 -# define TIOCPKT_FLUSHREAD	 1 -# define TIOCPKT_FLUSHWRITE	 2 -# define TIOCPKT_STOP		 4 -# define TIOCPKT_START		 8 -# define TIOCPKT_NOSTOP		16 -# define TIOCPKT_DOSTOP		32 -# define TIOCPKT_IOCTL		64 - - -#define TIOCNOTTY	0x5422 -#define TIOCSETD	0x5423 -#define TIOCGETD	0x5424 -#define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */ -#define TIOCSBRK	0x5427  /* BSD compatibility */ -#define TIOCCBRK	0x5428  /* BSD compatibility */ -#define TIOCGSID	0x5429  /* Return the session ID of FD */ -#define TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ -#define TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */ -#define TIOCSIG		_IOW('T',0x36, int)  /* Generate signal on Pty slave */ - -#define TIOCSERCONFIG	0x5453 -#define TIOCSERGWILD	0x5454 -#define TIOCSERSWILD	0x5455 -#define TIOCGLCKTRMIOS	0x5456 -#define TIOCSLCKTRMIOS	0x5457 -#define TIOCSERGSTRUCT	0x5458 /* For debugging only */ -#define TIOCSERGETLSR   0x5459 /* Get line status register */ -  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -# define TIOCSER_TEMT    0x01	/* Transmitter physically empty */ -#define TIOCSERGETMULTI 0x545A /* Get multiport config  */ -#define TIOCSERSETMULTI 0x545B /* Set multiport config */ - -#define TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */ -#define TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */ - -#endif /* _ASM_ALPHA_IOCTLS_H */ diff --git a/arch/alpha/include/asm/ipcbuf.h b/arch/alpha/include/asm/ipcbuf.h deleted file mode 100644 index d9c0e1a5070..00000000000 --- a/arch/alpha/include/asm/ipcbuf.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _ALPHA_IPCBUF_H -#define _ALPHA_IPCBUF_H - -/*  - * The ipc64_perm structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 32-bit seq - * - 2 miscellaneous 64-bit values - */ - -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 short	seq; -	unsigned short	__pad1; -	unsigned long	__unused1; -	unsigned long	__unused2; -}; - -#endif /* _ALPHA_IPCBUF_H */ diff --git a/arch/alpha/include/asm/irqflags.h b/arch/alpha/include/asm/irqflags.h index 299bbc7e9d7..ffb1726484a 100644 --- a/arch/alpha/include/asm/irqflags.h +++ b/arch/alpha/include/asm/irqflags.h @@ -1,7 +1,7 @@  #ifndef __ALPHA_IRQFLAGS_H  #define __ALPHA_IRQFLAGS_H -#include <asm/system.h> +#include <asm/pal.h>  #define IPL_MIN		0  #define IPL_SW0		1 diff --git a/arch/alpha/include/asm/linkage.h b/arch/alpha/include/asm/linkage.h index 291c2d01c44..7cfd06e8c93 100644 --- a/arch/alpha/include/asm/linkage.h +++ b/arch/alpha/include/asm/linkage.h @@ -1,6 +1,8 @@  #ifndef __ASM_LINKAGE_H  #define __ASM_LINKAGE_H -/* Nothing to see here... */ +#define cond_syscall(x)  asm(".weak\t" #x "\n" #x " = sys_ni_syscall") +#define SYSCALL_ALIAS(alias, name)					\ +	asm ( #alias " = " #name "\n\t.globl " #alias)  #endif diff --git a/arch/alpha/include/asm/local.h b/arch/alpha/include/asm/local.h index b9e3e331837..9c94b845604 100644 --- a/arch/alpha/include/asm/local.h +++ b/arch/alpha/include/asm/local.h @@ -2,7 +2,7 @@  #define _ALPHA_LOCAL_H  #include <linux/percpu.h> -#include <asm/atomic.h> +#include <linux/atomic.h>  typedef struct  { diff --git a/arch/alpha/include/asm/machvec.h b/arch/alpha/include/asm/machvec.h index 13cd4274381..75cb3641ed2 100644 --- a/arch/alpha/include/asm/machvec.h +++ b/arch/alpha/include/asm/machvec.h @@ -33,6 +33,7 @@ struct alpha_machine_vector  	int nr_irqs;  	int rtc_port; +	int rtc_boot_cpu_only;  	unsigned int max_asn;  	unsigned long max_isa_dma_address;  	unsigned long irq_probe_mask; @@ -90,14 +91,11 @@ struct alpha_machine_vector  	void (*kill_arch)(int);  	u8 (*pci_swizzle)(struct pci_dev *, u8 *); -	int (*pci_map_irq)(struct pci_dev *, u8, u8); +	int (*pci_map_irq)(const struct pci_dev *, u8, u8);  	struct pci_ops *pci_ops;  	struct _alpha_agp_info *(*agp_info)(void); -	unsigned int (*rtc_get_time)(struct rtc_time *); -	int (*rtc_set_time)(struct rtc_time *); -  	const char *vector_name;  	/* NUMA information */ @@ -126,13 +124,19 @@ extern struct alpha_machine_vector alpha_mv;  #ifdef CONFIG_ALPHA_GENERIC  extern int alpha_using_srm; +extern int alpha_using_qemu;  #else -#ifdef CONFIG_ALPHA_SRM -#define alpha_using_srm 1 -#else -#define alpha_using_srm 0 -#endif +# ifdef CONFIG_ALPHA_SRM +#  define alpha_using_srm 1 +# else +#  define alpha_using_srm 0 +# endif +# ifdef CONFIG_ALPHA_QEMU +#  define alpha_using_qemu 1 +# else +#  define alpha_using_qemu 0 +# endif  #endif /* GENERIC */ -#endif +#endif /* __KERNEL__ */  #endif /* __ALPHA_MACHVEC_H */ diff --git a/arch/alpha/include/asm/mce.h b/arch/alpha/include/asm/mce.h new file mode 100644 index 00000000000..660285b9aca --- /dev/null +++ b/arch/alpha/include/asm/mce.h @@ -0,0 +1,83 @@ +#ifndef __ALPHA_MCE_H +#define __ALPHA_MCE_H + +/* + * This is the logout header that should be common to all platforms + * (assuming they are running OSF/1 PALcode, I guess). + */ +struct el_common { +	unsigned int	size;		/* size in bytes of logout area */ +	unsigned int	sbz1	: 30;	/* should be zero */ +	unsigned int	err2	:  1;	/* second error */ +	unsigned int	retry	:  1;	/* retry flag */ +	unsigned int	proc_offset;	/* processor-specific offset */ +	unsigned int	sys_offset;	/* system-specific offset */ +	unsigned int	code;		/* machine check code */ +	unsigned int	frame_rev;	/* frame revision */ +}; + +/* Machine Check Frame for uncorrectable errors (Large format) + *      --- This is used to log uncorrectable errors such as + *          double bit ECC errors. + *      --- These errors are detected by both processor and systems. + */ +struct el_common_EV5_uncorrectable_mcheck { +        unsigned long   shadow[8];        /* Shadow reg. 8-14, 25           */ +        unsigned long   paltemp[24];      /* PAL TEMP REGS.                 */ +        unsigned long   exc_addr;         /* Address of excepting instruction*/ +        unsigned long   exc_sum;          /* Summary of arithmetic traps.   */ +        unsigned long   exc_mask;         /* Exception mask (from exc_sum). */ +        unsigned long   pal_base;         /* Base address for PALcode.      */ +        unsigned long   isr;              /* Interrupt Status Reg.          */ +        unsigned long   icsr;             /* CURRENT SETUP OF EV5 IBOX      */ +        unsigned long   ic_perr_stat;     /* I-CACHE Reg. <11> set Data parity +                                                         <12> set TAG parity*/ +        unsigned long   dc_perr_stat;     /* D-CACHE error Reg. Bits set to 1: +                                                     <2> Data error in bank 0 +                                                     <3> Data error in bank 1 +                                                     <4> Tag error in bank 0 +                                                     <5> Tag error in bank 1 */ +        unsigned long   va;               /* Effective VA of fault or miss. */ +        unsigned long   mm_stat;          /* Holds the reason for D-stream  +                                             fault or D-cache parity errors */ +        unsigned long   sc_addr;          /* Address that was being accessed +                                             when EV5 detected Secondary cache +                                             failure.                 */ +        unsigned long   sc_stat;          /* Helps determine if the error was +                                             TAG/Data parity(Secondary Cache)*/ +        unsigned long   bc_tag_addr;      /* Contents of EV5 BC_TAG_ADDR    */ +        unsigned long   ei_addr;          /* Physical address of any transfer +                                             that is logged in EV5 EI_STAT */ +        unsigned long   fill_syndrome;    /* For correcting ECC errors.     */ +        unsigned long   ei_stat;          /* Helps identify reason of any  +                                             processor uncorrectable error +                                             at its external interface.     */ +        unsigned long   ld_lock;          /* Contents of EV5 LD_LOCK register*/ +}; + +struct el_common_EV6_mcheck { +	unsigned int FrameSize;		/* Bytes, including this field */ +	unsigned int FrameFlags;	/* <31> = Retry, <30> = Second Error */ +	unsigned int CpuOffset;		/* Offset to CPU-specific info */ +	unsigned int SystemOffset;	/* Offset to system-specific info */ +	unsigned int MCHK_Code; +	unsigned int MCHK_Frame_Rev; +	unsigned long I_STAT;		/* EV6 Internal Processor Registers */ +	unsigned long DC_STAT;		/* (See the 21264 Spec) */ +	unsigned long C_ADDR; +	unsigned long DC1_SYNDROME; +	unsigned long DC0_SYNDROME; +	unsigned long C_STAT; +	unsigned long C_STS; +	unsigned long MM_STAT; +	unsigned long EXC_ADDR; +	unsigned long IER_CM; +	unsigned long ISUM; +	unsigned long RESERVED0; +	unsigned long PAL_BASE; +	unsigned long I_CTL; +	unsigned long PCTX; +}; + + +#endif /* __ALPHA_MCE_H */ diff --git a/arch/alpha/include/asm/mman.h b/arch/alpha/include/asm/mman.h deleted file mode 100644 index 99c56d47879..00000000000 --- a/arch/alpha/include/asm/mman.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALPHA_MMAN_H__ -#define __ALPHA_MMAN_H__ - -#define PROT_READ	0x1		/* page can be read */ -#define PROT_WRITE	0x2		/* page can be written */ -#define PROT_EXEC	0x4		/* page can be executed */ -#define PROT_SEM	0x8		/* page may be used for atomic ops */ -#define PROT_NONE	0x0		/* page can not be accessed */ -#define PROT_GROWSDOWN	0x01000000	/* mprotect flag: extend change to start of growsdown vma */ -#define PROT_GROWSUP	0x02000000	/* mprotect flag: extend change to end of growsup vma */ - -#define MAP_SHARED	0x01		/* Share changes */ -#define MAP_PRIVATE	0x02		/* Changes are private */ -#define MAP_TYPE	0x0f		/* Mask for type of mapping (OSF/1 is _wrong_) */ -#define MAP_FIXED	0x100		/* Interpret addr exactly */ -#define MAP_ANONYMOUS	0x10		/* don't use a file */ - -/* not used by linux, but here to make sure we don't clash with OSF/1 defines */ -#define _MAP_HASSEMAPHORE 0x0200 -#define _MAP_INHERIT	0x0400 -#define _MAP_UNALIGNED	0x0800 - -/* These are linux-specific */ -#define MAP_GROWSDOWN	0x01000		/* stack-like segment */ -#define MAP_DENYWRITE	0x02000		/* ETXTBSY */ -#define MAP_EXECUTABLE	0x04000		/* mark it as an executable */ -#define MAP_LOCKED	0x08000		/* lock the mapping */ -#define MAP_NORESERVE	0x10000		/* don't check for reservations */ -#define MAP_POPULATE	0x20000		/* populate (prefault) pagetables */ -#define MAP_NONBLOCK	0x40000		/* do not block on IO */ -#define MAP_STACK	0x80000		/* give out an address that is best suited for process/thread stacks */ -#define MAP_HUGETLB	0x100000	/* create a huge page mapping */ - -#define MS_ASYNC	1		/* sync memory asynchronously */ -#define MS_SYNC		2		/* synchronous memory sync */ -#define MS_INVALIDATE	4		/* invalidate the caches */ - -#define MCL_CURRENT	 8192		/* lock all currently mapped pages */ -#define MCL_FUTURE	16384		/* lock all additions to address space */ - -#define MADV_NORMAL	0		/* no further special treatment */ -#define MADV_RANDOM	1		/* expect random page references */ -#define MADV_SEQUENTIAL	2		/* expect sequential page references */ -#define MADV_WILLNEED	3		/* will need these pages */ -#define	MADV_SPACEAVAIL	5		/* ensure resources are available */ -#define MADV_DONTNEED	6		/* don't need these pages */ - -/* common/generic parameters */ -#define MADV_REMOVE	9		/* remove these pages & resources */ -#define MADV_DONTFORK	10		/* don't inherit across fork */ -#define MADV_DOFORK	11		/* do inherit across fork */ - -#define MADV_MERGEABLE   12		/* KSM may merge identical pages */ -#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */ - -/* compatibility flags */ -#define MAP_FILE	0 - -#endif /* __ALPHA_MMAN_H__ */ diff --git a/arch/alpha/include/asm/mmu_context.h b/arch/alpha/include/asm/mmu_context.h index 86c08a02d23..4c51c05333c 100644 --- a/arch/alpha/include/asm/mmu_context.h +++ b/arch/alpha/include/asm/mmu_context.h @@ -7,7 +7,6 @@   * Copyright (C) 1996, Linus Torvalds   */ -#include <asm/system.h>  #include <asm/machvec.h>  #include <asm/compiler.h>  #include <asm-generic/mm_hooks.h> diff --git a/arch/alpha/include/asm/mmzone.h b/arch/alpha/include/asm/mmzone.h index 8af56ce346a..14ce27bccd2 100644 --- a/arch/alpha/include/asm/mmzone.h +++ b/arch/alpha/include/asm/mmzone.h @@ -56,7 +56,6 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)   * Given a kernel address, find the home node of the underlying memory.   */  #define kvaddr_to_nid(kaddr)	pa_to_nid(__pa(kaddr)) -#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)  /*   * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory @@ -67,13 +66,11 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)      ((unsigned long)__va(NODE_DATA(kvaddr_to_nid(kaddr))->node_start_pfn  \  			 << PAGE_SHIFT)) -/* XXX: FIXME -- wli */ +/* XXX: FIXME -- nyc */  #define kern_addr_valid(kaddr)	(0)  #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define VALID_PAGE(page)	(((page) - mem_map) < max_mapnr) -  #define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> 32))  #define pgd_page(pgd)		(pfn_to_page(pgd_val(pgd) >> 32))  #define pte_pfn(pte)		(pte_val(pte) >> 32) diff --git a/arch/alpha/include/asm/module.h b/arch/alpha/include/asm/module.h index 7b63743c534..9cd13b55155 100644 --- a/arch/alpha/include/asm/module.h +++ b/arch/alpha/include/asm/module.h @@ -1,19 +1,13 @@  #ifndef _ALPHA_MODULE_H  #define _ALPHA_MODULE_H +#include <asm-generic/module.h> +  struct mod_arch_specific  {  	unsigned int gotsecindex;  }; -#define Elf_Sym Elf64_Sym -#define Elf_Shdr Elf64_Shdr -#define Elf_Ehdr Elf64_Ehdr -#define Elf_Phdr Elf64_Phdr -#define Elf_Dyn Elf64_Dyn -#define Elf_Rel Elf64_Rel -#define Elf_Rela Elf64_Rela -  #define ARCH_SHF_SMALL SHF_ALPHA_GPREL  #ifdef MODULE diff --git a/arch/alpha/include/asm/msgbuf.h b/arch/alpha/include/asm/msgbuf.h deleted file mode 100644 index 98496501a2b..00000000000 --- a/arch/alpha/include/asm/msgbuf.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _ALPHA_MSGBUF_H -#define _ALPHA_MSGBUF_H - -/*  - * The msqid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct msqid64_ds { -	struct ipc64_perm msg_perm; -	__kernel_time_t msg_stime;	/* last msgsnd time */ -	__kernel_time_t msg_rtime;	/* last msgrcv time */ -	__kernel_time_t msg_ctime;	/* last change time */ -	unsigned long  msg_cbytes;	/* current number of bytes on queue */ -	unsigned long  msg_qnum;	/* number of messages in queue */ -	unsigned long  msg_qbytes;	/* max number of bytes on queue */ -	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */ -	__kernel_pid_t msg_lrpid;	/* last receive pid */ -	unsigned long  __unused1; -	unsigned long  __unused2; -}; - -#endif /* _ALPHA_MSGBUF_H */ diff --git a/arch/alpha/include/asm/pal.h b/arch/alpha/include/asm/pal.h index 9b4ba0d6f00..5422a47646f 100644 --- a/arch/alpha/include/asm/pal.h +++ b/arch/alpha/include/asm/pal.h @@ -1,51 +1,186 @@  #ifndef __ALPHA_PAL_H  #define __ALPHA_PAL_H -/* - * Common PAL-code - */ -#define PAL_halt	  0 -#define PAL_cflush	  1 -#define PAL_draina	  2 -#define PAL_bpt		128 -#define PAL_bugchk	129 -#define PAL_chmk	131 -#define PAL_callsys	131 -#define PAL_imb		134 -#define PAL_rduniq	158 -#define PAL_wruniq	159 -#define PAL_gentrap	170 -#define PAL_nphalt	190 +#include <uapi/asm/pal.h> + +#ifndef __ASSEMBLY__ + +extern void halt(void) __attribute__((noreturn)); +#define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt)) + +#define imb() \ +__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") + +#define draina() \ +__asm__ __volatile__ ("call_pal %0 #draina" : : "i" (PAL_draina) : "memory") + +#define __CALL_PAL_R0(NAME, TYPE)				\ +extern inline TYPE NAME(void)					\ +{								\ +	register TYPE __r0 __asm__("$0");			\ +	__asm__ __volatile__(					\ +		"call_pal %1 # " #NAME				\ +		:"=r" (__r0)					\ +		:"i" (PAL_ ## NAME)				\ +		:"$1", "$16", "$22", "$23", "$24", "$25");	\ +	return __r0;						\ +} + +#define __CALL_PAL_W1(NAME, TYPE0)				\ +extern inline void NAME(TYPE0 arg0)				\ +{								\ +	register TYPE0 __r16 __asm__("$16") = arg0;		\ +	__asm__ __volatile__(					\ +		"call_pal %1 # "#NAME				\ +		: "=r"(__r16)					\ +		: "i"(PAL_ ## NAME), "0"(__r16)			\ +		: "$1", "$22", "$23", "$24", "$25");		\ +} + +#define __CALL_PAL_W2(NAME, TYPE0, TYPE1)			\ +extern inline void NAME(TYPE0 arg0, TYPE1 arg1)			\ +{								\ +	register TYPE0 __r16 __asm__("$16") = arg0;		\ +	register TYPE1 __r17 __asm__("$17") = arg1;		\ +	__asm__ __volatile__(					\ +		"call_pal %2 # "#NAME				\ +		: "=r"(__r16), "=r"(__r17)			\ +		: "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17)	\ +		: "$1", "$22", "$23", "$24", "$25");		\ +} + +#define __CALL_PAL_RW1(NAME, RTYPE, TYPE0)			\ +extern inline RTYPE NAME(TYPE0 arg0)				\ +{								\ +	register RTYPE __r0 __asm__("$0");			\ +	register TYPE0 __r16 __asm__("$16") = arg0;		\ +	__asm__ __volatile__(					\ +		"call_pal %2 # "#NAME				\ +		: "=r"(__r16), "=r"(__r0)			\ +		: "i"(PAL_ ## NAME), "0"(__r16)			\ +		: "$1", "$22", "$23", "$24", "$25");		\ +	return __r0;						\ +} + +#define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1)		\ +extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1)		\ +{								\ +	register RTYPE __r0 __asm__("$0");			\ +	register TYPE0 __r16 __asm__("$16") = arg0;		\ +	register TYPE1 __r17 __asm__("$17") = arg1;		\ +	__asm__ __volatile__(					\ +		"call_pal %3 # "#NAME				\ +		: "=r"(__r16), "=r"(__r17), "=r"(__r0)		\ +		: "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17)	\ +		: "$1", "$22", "$23", "$24", "$25");		\ +	return __r0;						\ +} + +__CALL_PAL_W1(cflush, unsigned long); +__CALL_PAL_R0(rdmces, unsigned long); +__CALL_PAL_R0(rdps, unsigned long); +__CALL_PAL_R0(rdusp, unsigned long); +__CALL_PAL_RW1(swpipl, unsigned long, unsigned long); +__CALL_PAL_R0(whami, unsigned long); +__CALL_PAL_W2(wrent, void*, unsigned long); +__CALL_PAL_W1(wripir, unsigned long); +__CALL_PAL_W1(wrkgp, unsigned long); +__CALL_PAL_W1(wrmces, unsigned long); +__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long); +__CALL_PAL_W1(wrusp, unsigned long); +__CALL_PAL_W1(wrvptptr, unsigned long); +__CALL_PAL_RW1(wtint, unsigned long, unsigned long);  /* - * VMS specific PAL-code + * TB routines..   */ -#define PAL_swppal	10 -#define PAL_mfpr_vptb	41 +#define __tbi(nr,arg,arg1...)					\ +({								\ +	register unsigned long __r16 __asm__("$16") = (nr);	\ +	register unsigned long __r17 __asm__("$17"); arg;	\ +	__asm__ __volatile__(					\ +		"call_pal %3 #__tbi"				\ +		:"=r" (__r16),"=r" (__r17)			\ +		:"0" (__r16),"i" (PAL_tbi) ,##arg1		\ +		:"$0", "$1", "$22", "$23", "$24", "$25");	\ +}) + +#define tbi(x,y)	__tbi(x,__r17=(y),"1" (__r17)) +#define tbisi(x)	__tbi(1,__r17=(x),"1" (__r17)) +#define tbisd(x)	__tbi(2,__r17=(x),"1" (__r17)) +#define tbis(x)		__tbi(3,__r17=(x),"1" (__r17)) +#define tbiap()		__tbi(-1, /* no second argument */) +#define tbia()		__tbi(-2, /* no second argument */)  /* - * OSF specific PAL-code + * QEMU Cserv routines..   */ -#define PAL_cserve	 9 -#define PAL_wripir	13 -#define PAL_rdmces	16 -#define PAL_wrmces	17 -#define PAL_wrfen	43 -#define PAL_wrvptptr	45 -#define PAL_jtopal	46 -#define PAL_swpctx	48 -#define PAL_wrval	49 -#define PAL_rdval	50 -#define PAL_tbi		51 -#define PAL_wrent	52 -#define PAL_swpipl	53 -#define PAL_rdps	54 -#define PAL_wrkgp	55 -#define PAL_wrusp	56 -#define PAL_wrperfmon	57 -#define PAL_rdusp	58 -#define PAL_whami	60 -#define PAL_retsys	61 -#define PAL_rti		63 +static inline unsigned long +qemu_get_walltime(void) +{ +	register unsigned long v0 __asm__("$0"); +	register unsigned long a0 __asm__("$16") = 3; + +	asm("call_pal %2 # cserve get_time" +	    : "=r"(v0), "+r"(a0) +	    : "i"(PAL_cserve) +	    : "$17", "$18", "$19", "$20", "$21"); + +	return v0; +} + +static inline unsigned long +qemu_get_alarm(void) +{ +	register unsigned long v0 __asm__("$0"); +	register unsigned long a0 __asm__("$16") = 4; + +	asm("call_pal %2 # cserve get_alarm" +	    : "=r"(v0), "+r"(a0) +	    : "i"(PAL_cserve) +	    : "$17", "$18", "$19", "$20", "$21"); + +	return v0; +} + +static inline void +qemu_set_alarm_rel(unsigned long expire) +{ +	register unsigned long a0 __asm__("$16") = 5; +	register unsigned long a1 __asm__("$17") = expire; + +	asm volatile("call_pal %2 # cserve set_alarm_rel" +		     : "+r"(a0), "+r"(a1) +		     : "i"(PAL_cserve) +		     : "$0", "$18", "$19", "$20", "$21"); +} + +static inline void +qemu_set_alarm_abs(unsigned long expire) +{ +	register unsigned long a0 __asm__("$16") = 6; +	register unsigned long a1 __asm__("$17") = expire; + +	asm volatile("call_pal %2 # cserve set_alarm_abs" +		     : "+r"(a0), "+r"(a1) +		     : "i"(PAL_cserve) +		     : "$0", "$18", "$19", "$20", "$21"); +} + +static inline unsigned long +qemu_get_vmtime(void) +{ +	register unsigned long v0 __asm__("$0"); +	register unsigned long a0 __asm__("$16") = 7; + +	asm("call_pal %2 # cserve get_time" +	    : "=r"(v0), "+r"(a0) +	    : "i"(PAL_cserve) +	    : "$17", "$18", "$19", "$20", "$21"); + +	return v0; +} + +#endif /* !__ASSEMBLY__ */  #endif /* __ALPHA_PAL_H */ diff --git a/arch/alpha/include/asm/param.h b/arch/alpha/include/asm/param.h index e691ecfedb2..a5b68b268bc 100644 --- a/arch/alpha/include/asm/param.h +++ b/arch/alpha/include/asm/param.h @@ -1,27 +1,11 @@  #ifndef _ASM_ALPHA_PARAM_H  #define _ASM_ALPHA_PARAM_H -/* ??? Gross.  I don't want to parameterize this, and supposedly the -   hardware ignores reprogramming.  We also need userland buy-in to the  -   change in HZ, since this is visible in the wait4 resources etc.  */ +#include <uapi/asm/param.h> -#ifdef __KERNEL__ -#define HZ		CONFIG_HZ -#define USER_HZ		HZ -#else -#define HZ		1024 -#endif - -#define EXEC_PAGESIZE	8192 - -#ifndef NOGROUP -#define NOGROUP		(-1) -#endif - -#define MAXHOSTNAMELEN	64	/* max length of hostname */ - -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC	HZ	/* frequency at which times() counts */ -#endif +# undef HZ +# define HZ		CONFIG_HZ +# define USER_HZ	1024 +# define CLOCKS_PER_SEC	USER_HZ	/* frequency at which times() counts */  #endif /* _ASM_ALPHA_PARAM_H */ diff --git a/arch/alpha/include/asm/parport.h b/arch/alpha/include/asm/parport.h index c5ee7cbb2fc..6abd0af11f1 100644 --- a/arch/alpha/include/asm/parport.h +++ b/arch/alpha/include/asm/parport.h @@ -9,8 +9,8 @@  #ifndef _ASM_AXP_PARPORT_H  #define _ASM_AXP_PARPORT_H 1 -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) +static int parport_pc_find_isa_ports (int autoirq, int autodma); +static int parport_pc_find_nonpci_ports (int autoirq, int autodma)  {  	return parport_pc_find_isa_ports (autoirq, autodma);  } diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h index 28d0497fd3c..f7f680f7457 100644 --- a/arch/alpha/include/asm/pci.h +++ b/arch/alpha/include/asm/pci.h @@ -7,6 +7,7 @@  #include <linux/dma-mapping.h>  #include <asm/scatterlist.h>  #include <asm/machvec.h> +#include <asm-generic/pci-bridge.h>  /*   * The following structure is used to manage multiple PCI busses. @@ -58,11 +59,6 @@ struct pci_controller {  extern void pcibios_set_master(struct pci_dev *dev); -extern inline void pcibios_penalize_isa_irq(int irq, int active) -{ -	/* We don't do dynamic PCI IRQ allocation */ -} -  /* IOMMU controls.  */  /* The PCI address space does not equal the physical memory address space. @@ -99,12 +95,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)  	return channel ? 15 : 14;  } -extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *, -				    struct resource *); - -extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, -				    struct pci_bus_region *region); -  #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index  static inline int pci_proc_domain(struct pci_bus *bus) diff --git a/arch/alpha/include/asm/perf_event.h b/arch/alpha/include/asm/perf_event.h index fe792ca818f..5996e7a6757 100644 --- a/arch/alpha/include/asm/perf_event.h +++ b/arch/alpha/include/asm/perf_event.h @@ -1,10 +1,4 @@  #ifndef __ASM_ALPHA_PERF_EVENT_H  #define __ASM_ALPHA_PERF_EVENT_H -#ifdef CONFIG_PERF_EVENTS -extern void init_hw_perf_events(void); -#else -static inline void init_hw_perf_events(void)    { } -#endif -  #endif /* __ASM_ALPHA_PERF_EVENT_H */ diff --git a/arch/alpha/include/asm/pgalloc.h b/arch/alpha/include/asm/pgalloc.h index bc2a0daf2d9..aab14a019c2 100644 --- a/arch/alpha/include/asm/pgalloc.h +++ b/arch/alpha/include/asm/pgalloc.h @@ -72,7 +72,10 @@ pte_alloc_one(struct mm_struct *mm, unsigned long address)  	if (!pte)  		return NULL;  	page = virt_to_page(pte); -	pgtable_page_ctor(page); +	if (!pgtable_page_ctor(page)) { +		__free_page(page); +		return NULL; +	}  	return page;  } diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h index de98a732683..d8f9b7e8923 100644 --- a/arch/alpha/include/asm/pgtable.h +++ b/arch/alpha/include/asm/pgtable.h @@ -15,6 +15,7 @@  #include <asm/page.h>  #include <asm/processor.h>	/* For TASK_SIZE */  #include <asm/machvec.h> +#include <asm/setup.h>  struct mm_struct;  struct vm_area_struct; @@ -353,9 +354,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)  #define kern_addr_valid(addr)	(1)  #endif -#define io_remap_pfn_range(vma, start, pfn, size, prot)	\ -		remap_pfn_range(vma, start, pfn, size, prot) -  #define pte_ERROR(e) \  	printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))  #define pmd_ERROR(e) \ diff --git a/arch/alpha/include/asm/poll.h b/arch/alpha/include/asm/poll.h deleted file mode 100644 index c98509d3149..00000000000 --- a/arch/alpha/include/asm/poll.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/poll.h> diff --git a/arch/alpha/include/asm/posix_types.h b/arch/alpha/include/asm/posix_types.h deleted file mode 100644 index db167413300..00000000000 --- a/arch/alpha/include/asm/posix_types.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef _ALPHA_POSIX_TYPES_H -#define _ALPHA_POSIX_TYPES_H - -/* - * This file is generally used by user-level software, so you need to - * be a little careful about namespace pollution etc.  Also, we cannot - * assume GCC is being used. - */ - -typedef unsigned int	__kernel_ino_t; -typedef unsigned int	__kernel_mode_t; -typedef unsigned int	__kernel_nlink_t; -typedef long		__kernel_off_t; -typedef long long	__kernel_loff_t; -typedef int		__kernel_pid_t; -typedef int		__kernel_ipc_pid_t; -typedef unsigned int	__kernel_uid_t; -typedef unsigned int	__kernel_gid_t; -typedef unsigned long	__kernel_size_t; -typedef long		__kernel_ssize_t; -typedef long		__kernel_ptrdiff_t; -typedef long		__kernel_time_t; -typedef long		__kernel_suseconds_t; -typedef long		__kernel_clock_t; -typedef int		__kernel_daddr_t; -typedef char *		__kernel_caddr_t; -typedef unsigned long	__kernel_sigset_t;	/* at least 32 bits */ -typedef unsigned short	__kernel_uid16_t; -typedef unsigned short	__kernel_gid16_t; -typedef int		__kernel_clockid_t; -typedef int		__kernel_timer_t; - -typedef struct { -	int	val[2]; -} __kernel_fsid_t; - -typedef __kernel_uid_t __kernel_old_uid_t; -typedef __kernel_gid_t __kernel_old_gid_t; -typedef __kernel_uid_t __kernel_uid32_t; -typedef __kernel_gid_t __kernel_gid32_t; - -typedef unsigned int	__kernel_old_dev_t; - -#ifdef __KERNEL__ - -#ifndef __GNUC__ - -#define	__FD_SET(d, set)	((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -#define	__FD_CLR(d, set)	((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -#define	__FD_ISSET(d, set)	(((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) -#define	__FD_ZERO(set)	\ -  ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set))) - -#else /* __GNUC__ */ - -/* With GNU C, use inline functions instead so args are evaluated only once: */ - -#undef __FD_SET -static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) -{ -	unsigned long _tmp = fd / __NFDBITS; -	unsigned long _rem = fd % __NFDBITS; -	fdsetp->fds_bits[_tmp] |= (1UL<<_rem); -} - -#undef __FD_CLR -static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) -{ -	unsigned long _tmp = fd / __NFDBITS; -	unsigned long _rem = fd % __NFDBITS; -	fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); -} - -#undef __FD_ISSET -static __inline__ int __FD_ISSET(unsigned long fd, const __kernel_fd_set *p) -{  -	unsigned long _tmp = fd / __NFDBITS; -	unsigned long _rem = fd % __NFDBITS; -	return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0; -} - -/* - * This will unroll the loop for the normal constant case (8 ints, - * for a 256-bit fd_set) - */ -#undef __FD_ZERO -static __inline__ void __FD_ZERO(__kernel_fd_set *p) -{ -	unsigned long *tmp = p->fds_bits; -	int i; - -	if (__builtin_constant_p(__FDSET_LONGS)) { -		switch (__FDSET_LONGS) { -		      case 16: -			tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; -			tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; -			tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0; -			tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0; -			return; - -		      case 8: -			tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; -			tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; -			return; - -		      case 4: -			tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; -			return; -		} -	} -	i = __FDSET_LONGS; -	while (i) { -		i--; -		*tmp = 0; -		tmp++; -	} -} - -#endif /* __GNUC__ */ - -#endif /* __KERNEL__ */ - -#endif /* _ALPHA_POSIX_TYPES_H */ diff --git a/arch/alpha/include/asm/processor.h b/arch/alpha/include/asm/processor.h index 94afe585930..6cb7fe85c4b 100644 --- a/arch/alpha/include/asm/processor.h +++ b/arch/alpha/include/asm/processor.h @@ -49,12 +49,6 @@ extern void start_thread(struct pt_regs *, unsigned long, unsigned long);  /* Free all resources held by a thread. */  extern void release_thread(struct task_struct *); -/* Prepare to copy thread state - unlazy all lazy status */ -#define prepare_to_copy(tsk)	do { } while (0) - -/* Create a kernel thread without removing it from tasklists.  */ -extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); -  unsigned long get_wchan(struct task_struct *p);  #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) diff --git a/arch/alpha/include/asm/ptrace.h b/arch/alpha/include/asm/ptrace.h index 65cf3e28e2f..9047c2fe8f2 100644 --- a/arch/alpha/include/asm/ptrace.h +++ b/arch/alpha/include/asm/ptrace.h @@ -1,84 +1,27 @@  #ifndef _ASMAXP_PTRACE_H  #define _ASMAXP_PTRACE_H +#include <uapi/asm/ptrace.h> -/* - * This struct defines the way the registers are stored on the - * kernel stack during a system call or other kernel entry - * - * NOTE! I want to minimize the overhead of system calls, so this - * struct has as little information as possible.  I does not have - * - *  - floating point regs: the kernel doesn't change those - *  - r9-15: saved by the C compiler - * - * This makes "fork()" and "exec()" a bit more complex, but should - * give us low system call latency. - */ - -struct pt_regs { -	unsigned long r0; -	unsigned long r1; -	unsigned long r2; -	unsigned long r3; -	unsigned long r4; -	unsigned long r5; -	unsigned long r6; -	unsigned long r7; -	unsigned long r8; -	unsigned long r19; -	unsigned long r20; -	unsigned long r21; -	unsigned long r22; -	unsigned long r23; -	unsigned long r24; -	unsigned long r25; -	unsigned long r26; -	unsigned long r27; -	unsigned long r28; -	unsigned long hae; -/* JRP - These are the values provided to a0-a2 by PALcode */ -	unsigned long trap_a0; -	unsigned long trap_a1; -	unsigned long trap_a2; -/* These are saved by PAL-code: */ -	unsigned long ps; -	unsigned long pc; -	unsigned long gp; -	unsigned long r16; -	unsigned long r17; -	unsigned long r18; -}; - -/* - * This is the extended stack used by signal handlers and the context - * switcher: it's pushed after the normal "struct pt_regs". - */ -struct switch_stack { -	unsigned long r9; -	unsigned long r10; -	unsigned long r11; -	unsigned long r12; -	unsigned long r13; -	unsigned long r14; -	unsigned long r15; -	unsigned long r26; -	unsigned long fp[32];	/* fp[31] is fpcr */ -}; - -#ifdef __KERNEL__  #define arch_has_single_step()		(1)  #define user_mode(regs) (((regs)->ps & 8) != 0)  #define instruction_pointer(regs) ((regs)->pc)  #define profile_pc(regs) instruction_pointer(regs) -extern void show_regs(struct pt_regs *); +#define current_user_stack_pointer() rdusp()  #define task_pt_regs(task) \    ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1) -#define force_successful_syscall_return() (task_pt_regs(current)->r0 = 0) +#define current_pt_regs() \ +  ((struct pt_regs *) ((char *)current_thread_info() + 2*PAGE_SIZE) - 1) +#define signal_pt_regs current_pt_regs -#endif +#define force_successful_syscall_return() (current_pt_regs()->r0 = 0) + +static inline unsigned long regs_return_value(struct pt_regs *regs) +{ +	return regs->r0; +}  #endif diff --git a/arch/alpha/include/asm/reg.h b/arch/alpha/include/asm/reg.h deleted file mode 100644 index 86ff916fb06..00000000000 --- a/arch/alpha/include/asm/reg.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef __reg_h__ -#define __reg_h__ - -/* - * Exception frame offsets. - */ -#define EF_V0		0 -#define EF_T0		1 -#define EF_T1		2 -#define EF_T2		3 -#define EF_T3		4 -#define EF_T4		5 -#define EF_T5		6 -#define EF_T6		7 -#define EF_T7		8 -#define EF_S0		9 -#define EF_S1		10 -#define EF_S2		11 -#define EF_S3		12 -#define EF_S4		13 -#define EF_S5		14 -#define EF_S6		15 -#define EF_A3		16 -#define EF_A4		17 -#define EF_A5		18 -#define EF_T8		19 -#define EF_T9		20 -#define EF_T10		21 -#define EF_T11		22 -#define EF_RA		23 -#define EF_T12		24 -#define EF_AT		25 -#define EF_SP		26 -#define EF_PS		27 -#define EF_PC		28 -#define EF_GP		29 -#define EF_A0		30 -#define EF_A1		31 -#define EF_A2		32 - -#define EF_SIZE		(33*8) -#define HWEF_SIZE	(6*8)		/* size of PAL frame (PS-A2) */ - -#define EF_SSIZE	(EF_SIZE - HWEF_SIZE) - -/* - * Map register number into core file offset. - */ -#define CORE_REG(reg, ubase) \ -	(((unsigned long *)((unsigned long)(ubase)))[reg]) - -#endif /* __reg_h__ */ diff --git a/arch/alpha/include/asm/regdef.h b/arch/alpha/include/asm/regdef.h deleted file mode 100644 index 142df9c4f8b..00000000000 --- a/arch/alpha/include/asm/regdef.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __alpha_regdef_h__ -#define __alpha_regdef_h__ - -#define v0	$0	/* function return value */ - -#define t0	$1	/* temporary registers (caller-saved) */ -#define t1	$2 -#define t2	$3 -#define t3	$4 -#define t4	$5 -#define t5	$6 -#define t6	$7 -#define t7	$8 - -#define	s0	$9	/* saved-registers (callee-saved registers) */ -#define	s1	$10 -#define	s2	$11 -#define	s3	$12 -#define	s4	$13 -#define	s5	$14 -#define	s6	$15 -#define	fp	s6	/* frame-pointer (s6 in frame-less procedures) */ - -#define a0	$16	/* argument registers (caller-saved) */ -#define a1	$17 -#define a2	$18 -#define a3	$19 -#define a4	$20 -#define a5	$21 - -#define t8	$22	/* more temps (caller-saved) */ -#define t9	$23 -#define t10	$24 -#define t11	$25 -#define ra	$26	/* return address register */ -#define t12	$27 - -#define pv	t12	/* procedure-variable register */ -#define AT	$at	/* assembler temporary */ -#define gp	$29	/* global pointer */ -#define sp	$30	/* stack pointer */ -#define zero	$31	/* reads as zero, writes are noops */ - -#endif /* __alpha_regdef_h__ */ diff --git a/arch/alpha/include/asm/resource.h b/arch/alpha/include/asm/resource.h deleted file mode 100644 index c10874ff597..00000000000 --- a/arch/alpha/include/asm/resource.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _ALPHA_RESOURCE_H -#define _ALPHA_RESOURCE_H - -/* - * Alpha/Linux-specific ordering of these four resource limit IDs, - * the rest comes from the generic header: - */ -#define RLIMIT_NOFILE		6	/* max number of open files */ -#define RLIMIT_AS		7	/* address space limit */ -#define RLIMIT_NPROC		8	/* max number of processes */ -#define RLIMIT_MEMLOCK		9	/* max locked-in-memory address space */ - -/* - * SuS says limits have to be unsigned.  Fine, it's unsigned, but - * we retain the old value for compatibility, especially with DU.  - * When you run into the 2^63 barrier, you call me. - */ -#define RLIM_INFINITY		0x7ffffffffffffffful - -#include <asm-generic/resource.h> - -#endif /* _ALPHA_RESOURCE_H */ diff --git a/arch/alpha/include/asm/rtc.h b/arch/alpha/include/asm/rtc.h index 1f7fba671ae..f71c3b0ed36 100644 --- a/arch/alpha/include/asm/rtc.h +++ b/arch/alpha/include/asm/rtc.h @@ -1,16 +1 @@ -#ifndef _ALPHA_RTC_H -#define _ALPHA_RTC_H - -#if defined(CONFIG_ALPHA_GENERIC) -# define get_rtc_time		alpha_mv.rtc_get_time -# define set_rtc_time		alpha_mv.rtc_set_time -#else -# if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP) -#  define get_rtc_time		marvel_get_rtc_time -#  define set_rtc_time		marvel_set_rtc_time -# endif -#endif -  #include <asm-generic/rtc.h> - -#endif diff --git a/arch/alpha/include/asm/rwsem.h b/arch/alpha/include/asm/rwsem.h index 1570c0b5433..a83bbea62c6 100644 --- a/arch/alpha/include/asm/rwsem.h +++ b/arch/alpha/include/asm/rwsem.h @@ -13,44 +13,13 @@  #ifdef __KERNEL__  #include <linux/compiler.h> -#include <linux/list.h> -#include <linux/spinlock.h> -struct rwsem_waiter; - -extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); -extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); -extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *); -extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); - -/* - * the semaphore definition - */ -struct rw_semaphore { -	long			count;  #define RWSEM_UNLOCKED_VALUE		0x0000000000000000L  #define RWSEM_ACTIVE_BIAS		0x0000000000000001L  #define RWSEM_ACTIVE_MASK		0x00000000ffffffffL  #define RWSEM_WAITING_BIAS		(-0x0000000100000000L)  #define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS  #define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) -	spinlock_t		wait_lock; -	struct list_head	wait_list; -}; - -#define __RWSEM_INITIALIZER(name) \ -	{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ -	LIST_HEAD_INIT((name).wait_list) } - -#define DECLARE_RWSEM(name) \ -	struct rw_semaphore name = __RWSEM_INITIALIZER(name) - -static inline void init_rwsem(struct rw_semaphore *sem) -{ -	sem->count = RWSEM_UNLOCKED_VALUE; -	spin_lock_init(&sem->wait_lock); -	INIT_LIST_HEAD(&sem->wait_list); -}  static inline void __down_read(struct rw_semaphore *sem)  { @@ -250,10 +219,5 @@ static inline long rwsem_atomic_update(long val, struct rw_semaphore *sem)  #endif  } -static inline int rwsem_is_locked(struct rw_semaphore *sem) -{ -	return (sem->count != 0); -} -  #endif /* __KERNEL__ */  #endif /* _ALPHA_RWSEM_H */ diff --git a/arch/alpha/include/asm/sembuf.h b/arch/alpha/include/asm/sembuf.h deleted file mode 100644 index 7b38b153478..00000000000 --- a/arch/alpha/include/asm/sembuf.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _ALPHA_SEMBUF_H -#define _ALPHA_SEMBUF_H - -/*  - * The semid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct semid64_ds { -	struct ipc64_perm sem_perm;		/* permissions .. see ipc.h */ -	__kernel_time_t	sem_otime;		/* last semop time */ -	__kernel_time_t	sem_ctime;		/* last change time */ -	unsigned long	sem_nsems;		/* no. of semaphores in array */ -	unsigned long	__unused1; -	unsigned long	__unused2; -}; - -#endif /* _ALPHA_SEMBUF_H */ diff --git a/arch/alpha/include/asm/setup.h b/arch/alpha/include/asm/setup.h deleted file mode 100644 index 2e023a4aa31..00000000000 --- a/arch/alpha/include/asm/setup.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ALPHA_SETUP_H -#define __ALPHA_SETUP_H - -#define COMMAND_LINE_SIZE	256 - -#endif diff --git a/arch/alpha/include/asm/shmbuf.h b/arch/alpha/include/asm/shmbuf.h deleted file mode 100644 index 37ee84f0508..00000000000 --- a/arch/alpha/include/asm/shmbuf.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _ALPHA_SHMBUF_H -#define _ALPHA_SHMBUF_H - -/*  - * The shmid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct shmid64_ds { -	struct ipc64_perm	shm_perm;	/* operation perms */ -	size_t			shm_segsz;	/* size of segment (bytes) */ -	__kernel_time_t		shm_atime;	/* last attach time */ -	__kernel_time_t		shm_dtime;	/* last detach time */ -	__kernel_time_t		shm_ctime;	/* last change time */ -	__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		__unused1; -	unsigned long		__unused2; -}; - -struct shminfo64 { -	unsigned long	shmmax; -	unsigned long	shmmin; -	unsigned long	shmmni; -	unsigned long	shmseg; -	unsigned long	shmall; -	unsigned long	__unused1; -	unsigned long	__unused2; -	unsigned long	__unused3; -	unsigned long	__unused4; -}; - -#endif /* _ALPHA_SHMBUF_H */ diff --git a/arch/alpha/include/asm/sigcontext.h b/arch/alpha/include/asm/sigcontext.h deleted file mode 100644 index 323cdb02619..00000000000 --- a/arch/alpha/include/asm/sigcontext.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef _ASMAXP_SIGCONTEXT_H -#define _ASMAXP_SIGCONTEXT_H - -struct sigcontext { -	/* -	 * What should we have here? I'd probably better use the same -	 * stack layout as OSF/1, just in case we ever want to try -	 * running their binaries..  -	 * -	 * This is the basic layout, but I don't know if we'll ever -	 * actually fill in all the values.. -	 */ -	 long		sc_onstack; -	 long		sc_mask; -	 long		sc_pc; -	 long		sc_ps; -	 long		sc_regs[32]; -	 long		sc_ownedfp; -	 long		sc_fpregs[32]; -	 unsigned long	sc_fpcr; -	 unsigned long	sc_fp_control; -	 unsigned long	sc_reserved1, sc_reserved2; -	 unsigned long	sc_ssize; -	 char *		sc_sbase; -	 unsigned long	sc_traparg_a0; -	 unsigned long	sc_traparg_a1; -	 unsigned long	sc_traparg_a2; -	 unsigned long	sc_fp_trap_pc; -	 unsigned long	sc_fp_trigger_sum; -	 unsigned long	sc_fp_trigger_inst; -}; - - -#endif diff --git a/arch/alpha/include/asm/siginfo.h b/arch/alpha/include/asm/siginfo.h deleted file mode 100644 index 9822362a842..00000000000 --- a/arch/alpha/include/asm/siginfo.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _ALPHA_SIGINFO_H -#define _ALPHA_SIGINFO_H - -#define __ARCH_SI_PREAMBLE_SIZE		(4 * sizeof(int)) -#define __ARCH_SI_TRAPNO - -#include <asm-generic/siginfo.h> - -#endif diff --git a/arch/alpha/include/asm/signal.h b/arch/alpha/include/asm/signal.h index a9388300abb..963f0494dca 100644 --- a/arch/alpha/include/asm/signal.h +++ b/arch/alpha/include/asm/signal.h @@ -1,12 +1,8 @@  #ifndef _ASMAXP_SIGNAL_H  #define _ASMAXP_SIGNAL_H -#include <linux/types.h> +#include <uapi/asm/signal.h> -/* Avoid too many header ordering problems.  */ -struct siginfo; - -#ifdef __KERNEL__  /* Digital Unix defines 64 signals.  Most things should be clean enough     to redefine this at will, if care is taken to make libc match.  */ @@ -20,153 +16,12 @@ typedef struct {  	unsigned long sig[_NSIG_WORDS];  } sigset_t; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -#define NSIG		32 -typedef unsigned long sigset_t; - -#endif /* __KERNEL__ */ - - -/* - * Linux/AXP has different signal numbers that Linux/i386: I'm trying - * to make it OSF/1 binary compatible, at least for normal binaries. - */ -#define SIGHUP		 1 -#define SIGINT		 2 -#define SIGQUIT		 3 -#define SIGILL		 4 -#define SIGTRAP		 5 -#define SIGABRT		 6 -#define SIGEMT		 7 -#define SIGFPE		 8 -#define SIGKILL		 9 -#define SIGBUS		10 -#define SIGSEGV		11 -#define SIGSYS		12 -#define SIGPIPE		13 -#define SIGALRM		14 -#define SIGTERM		15 -#define SIGURG		16 -#define SIGSTOP		17 -#define SIGTSTP		18 -#define SIGCONT		19 -#define SIGCHLD		20 -#define SIGTTIN		21 -#define SIGTTOU		22 -#define SIGIO		23 -#define SIGXCPU		24 -#define SIGXFSZ		25 -#define SIGVTALRM	26 -#define SIGPROF		27 -#define SIGWINCH	28 -#define SIGINFO		29 -#define SIGUSR1		30 -#define SIGUSR2		31 - -#define SIGPOLL	SIGIO -#define SIGPWR	SIGINFO -#define SIGIOT	SIGABRT - -/* These should not be considered constants from userland.  */ -#define SIGRTMIN	32 -#define SIGRTMAX	_NSIG - -/* - * SA_FLAGS values: - * - * SA_ONSTACK indicates that a registered stack_t will be used. - * SA_RESTART flag to get restarting signals (which were the default long ago) - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. - * SA_RESETHAND clears the handler when the signal is delivered. - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. - * SA_NODEFER prevents the current signal from being masked in the handler. - * - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single - * Unix names RESETHAND and NODEFER respectively. - */ - -#define SA_ONSTACK	0x00000001 -#define SA_RESTART	0x00000002 -#define SA_NOCLDSTOP	0x00000004 -#define SA_NODEFER	0x00000008 -#define SA_RESETHAND	0x00000010 -#define SA_NOCLDWAIT	0x00000020 -#define SA_SIGINFO	0x00000040 - -#define SA_ONESHOT	SA_RESETHAND -#define SA_NOMASK	SA_NODEFER - -/*  - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 - -#define MINSIGSTKSZ	4096 -#define SIGSTKSZ	16384 - -#define SIG_BLOCK          1	/* for blocking signals */ -#define SIG_UNBLOCK        2	/* for unblocking signals */ -#define SIG_SETMASK        3	/* for setting the signal mask */ - -#include <asm-generic/signal-defs.h> - -#ifdef __KERNEL__  struct osf_sigaction {  	__sighandler_t	sa_handler;  	old_sigset_t	sa_mask;  	int		sa_flags;  }; -struct sigaction { -	__sighandler_t	sa_handler; -	unsigned long	sa_flags; -	sigset_t	sa_mask;	/* mask last for extensibility */ -}; - -struct k_sigaction { -	struct sigaction sa; -	__sigrestore_t ka_restorer; -}; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -struct sigaction { -	union { -	  __sighandler_t	_sa_handler; -	  void (*_sa_sigaction)(int, struct siginfo *, void *); -	} _u; -	sigset_t	sa_mask; -	int		sa_flags; -}; - -#define sa_handler	_u._sa_handler -#define sa_sigaction	_u._sa_sigaction - -#endif /* __KERNEL__ */ - -typedef struct sigaltstack { -	void __user *ss_sp; -	int ss_flags; -	size_t ss_size; -} stack_t; - -/* sigstack(2) is deprecated, and will be withdrawn in a future version -   of the X/Open CAE Specification.  Use sigaltstack instead.  It is only -   implemented here for OSF/1 compatibility.  */ - -struct sigstack { -	void __user *ss_sp; -	int ss_onstack; -}; - -#ifdef __KERNEL__ +#define __ARCH_HAS_KA_RESTORER  #include <asm/sigcontext.h> - -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - -#endif -  #endif diff --git a/arch/alpha/include/asm/smp.h b/arch/alpha/include/asm/smp.h index 3f390e8cc0b..c46e714aa3e 100644 --- a/arch/alpha/include/asm/smp.h +++ b/arch/alpha/include/asm/smp.h @@ -39,8 +39,6 @@ struct cpuinfo_alpha {  extern struct cpuinfo_alpha cpu_data[NR_CPUS]; -#define PROC_CHANGE_PENALTY     20 -  #define hard_smp_processor_id()	__hard_smp_processor_id()  #define raw_smp_processor_id()	(current_thread_info()->cpu) diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h index 06edfefc337..8d806d80ed2 100644 --- a/arch/alpha/include/asm/socket.h +++ b/arch/alpha/include/asm/socket.h @@ -1,77 +1,10 @@  #ifndef _ASM_SOCKET_H  #define _ASM_SOCKET_H -#include <asm/sockios.h> - -/* For setsockopt(2) */ -/* - * Note: we only bother about making the SOL_SOCKET options - * same as OSF/1, as that's all that "normal" programs are - * likely to set.  We don't necessarily want to be binary - * compatible with _everything_.  - */ -#define SOL_SOCKET	0xffff - -#define SO_DEBUG	0x0001 -#define SO_REUSEADDR	0x0004 -#define SO_KEEPALIVE	0x0008 -#define SO_DONTROUTE	0x0010 -#define SO_BROADCAST	0x0020 -#define SO_LINGER	0x0080 -#define SO_OOBINLINE	0x0100 -/* To add :#define SO_REUSEPORT 0x0200 */ - -#define SO_TYPE		0x1008 -#define SO_ERROR	0x1007 -#define SO_SNDBUF	0x1001 -#define SO_RCVBUF	0x1002 -#define SO_SNDBUFFORCE	0x100a -#define SO_RCVBUFFORCE	0x100b -#define	SO_RCVLOWAT	0x1010 -#define	SO_SNDLOWAT	0x1011 -#define	SO_RCVTIMEO	0x1012 -#define	SO_SNDTIMEO	0x1013 -#define SO_ACCEPTCONN	0x1014 -#define SO_PROTOCOL	0x1028 -#define SO_DOMAIN	0x1029 - -/* linux-specific, might as well be the same as on i386 */ -#define SO_NO_CHECK	11 -#define SO_PRIORITY	12 -#define SO_BSDCOMPAT	14 - -#define SO_PASSCRED	17 -#define SO_PEERCRED	18 -#define SO_BINDTODEVICE 25 - -/* Socket filtering */ -#define SO_ATTACH_FILTER        26 -#define SO_DETACH_FILTER        27 - -#define SO_PEERNAME		28 -#define SO_TIMESTAMP		29 -#define SCM_TIMESTAMP		SO_TIMESTAMP - -#define SO_PEERSEC		30 -#define SO_PASSSEC		34 -#define SO_TIMESTAMPNS		35 -#define SCM_TIMESTAMPNS		SO_TIMESTAMPNS - -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define SO_SECURITY_AUTHENTICATION		19 -#define SO_SECURITY_ENCRYPTION_TRANSPORT	20 -#define SO_SECURITY_ENCRYPTION_NETWORK		21 - -#define SO_MARK			36 - -#define SO_TIMESTAMPING		37 -#define SCM_TIMESTAMPING	SO_TIMESTAMPING - -#define SO_RXQ_OVFL             40 +#include <uapi/asm/socket.h>  /* O_NONBLOCK clashes with the bits used for socket types.  Therefore we   * have to define SOCK_NONBLOCK to a different value here.   */  #define SOCK_NONBLOCK	0x40000000 -  #endif /* _ASM_SOCKET_H */ diff --git a/arch/alpha/include/asm/sockios.h b/arch/alpha/include/asm/sockios.h deleted file mode 100644 index 7932c7ab4a4..00000000000 --- a/arch/alpha/include/asm/sockios.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _ASM_ALPHA_SOCKIOS_H -#define _ASM_ALPHA_SOCKIOS_H - -/* Socket-level I/O control calls. */ - -#define FIOGETOWN	_IOR('f', 123, int) -#define FIOSETOWN 	_IOW('f', 124, int) - -#define SIOCATMARK	_IOR('s', 7, int) -#define SIOCSPGRP	_IOW('s', 8, pid_t) -#define SIOCGPGRP	_IOR('s', 9, pid_t) - -#define SIOCGSTAMP	0x8906		/* Get stamp (timeval) */ -#define SIOCGSTAMPNS	0x8907		/* Get stamp (timespec) */ - -#endif /* _ASM_ALPHA_SOCKIOS_H */ diff --git a/arch/alpha/include/asm/special_insns.h b/arch/alpha/include/asm/special_insns.h new file mode 100644 index 00000000000..88d3452b21f --- /dev/null +++ b/arch/alpha/include/asm/special_insns.h @@ -0,0 +1,41 @@ +#ifndef __ALPHA_SPECIAL_INSNS_H +#define __ALPHA_SPECIAL_INSNS_H + +enum implver_enum { +	IMPLVER_EV4, +	IMPLVER_EV5, +	IMPLVER_EV6 +}; + +#ifdef CONFIG_ALPHA_GENERIC +#define implver()				\ +({ unsigned long __implver;			\ +   __asm__ ("implver %0" : "=r"(__implver));	\ +   (enum implver_enum) __implver; }) +#else +/* Try to eliminate some dead code.  */ +#ifdef CONFIG_ALPHA_EV4 +#define implver() IMPLVER_EV4 +#endif +#ifdef CONFIG_ALPHA_EV5 +#define implver() IMPLVER_EV5 +#endif +#if defined(CONFIG_ALPHA_EV6) +#define implver() IMPLVER_EV6 +#endif +#endif + +enum amask_enum { +	AMASK_BWX = (1UL << 0), +	AMASK_FIX = (1UL << 1), +	AMASK_CIX = (1UL << 2), +	AMASK_MAX = (1UL << 8), +	AMASK_PRECISE_TRAP = (1UL << 9), +}; + +#define amask(mask)						\ +({ unsigned long __amask, __input = (mask);			\ +   __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input));	\ +   __amask; }) + +#endif /* __ALPHA_SPECIAL_INSNS_H */ diff --git a/arch/alpha/include/asm/spinlock.h b/arch/alpha/include/asm/spinlock.h index d0faca1e992..37b570d0120 100644 --- a/arch/alpha/include/asm/spinlock.h +++ b/arch/alpha/include/asm/spinlock.h @@ -1,7 +1,6 @@  #ifndef _ALPHA_SPINLOCK_H  #define _ALPHA_SPINLOCK_H -#include <asm/system.h>  #include <linux/kernel.h>  #include <asm/current.h> @@ -169,8 +168,4 @@ static inline void arch_write_unlock(arch_rwlock_t * lock)  #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)  #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) -#define arch_spin_relax(lock)	cpu_relax() -#define arch_read_relax(lock)	cpu_relax() -#define arch_write_relax(lock)	cpu_relax() -  #endif /* _ALPHA_SPINLOCK_H */ diff --git a/arch/alpha/include/asm/stat.h b/arch/alpha/include/asm/stat.h deleted file mode 100644 index 07ad3e6b3f3..00000000000 --- a/arch/alpha/include/asm/stat.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _ALPHA_STAT_H -#define _ALPHA_STAT_H - -struct stat { -	unsigned int	st_dev; -	unsigned int	st_ino; -	unsigned int	st_mode; -	unsigned int	st_nlink; -	unsigned int	st_uid; -	unsigned int	st_gid; -	unsigned int	st_rdev; -	long		st_size; -	unsigned long	st_atime; -	unsigned long	st_mtime; -	unsigned long	st_ctime; -	unsigned int	st_blksize; -	unsigned int	st_blocks; -	unsigned int	st_flags; -	unsigned int	st_gen; -}; - -/* The stat64 structure increases the size of dev_t, blkcnt_t, adds -   nanosecond resolution times, and padding for expansion.  */ - -struct stat64 { -	unsigned long	st_dev; -	unsigned long	st_ino; -	unsigned long	st_rdev; -	long		st_size; -	unsigned long	st_blocks; - -	unsigned int	st_mode; -	unsigned int	st_uid; -	unsigned int	st_gid; -	unsigned int	st_blksize; -	unsigned int	st_nlink; -	unsigned int	__pad0; - -	unsigned long	st_atime; -	unsigned long 	st_atime_nsec;  -	unsigned long	st_mtime; -	unsigned long	st_mtime_nsec; -	unsigned long	st_ctime; -	unsigned long   st_ctime_nsec; -  	long		__unused[3]; -}; - -#endif diff --git a/arch/alpha/include/asm/statfs.h b/arch/alpha/include/asm/statfs.h deleted file mode 100644 index ccd2e186bfd..00000000000 --- a/arch/alpha/include/asm/statfs.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _ALPHA_STATFS_H -#define _ALPHA_STATFS_H - -#include <linux/types.h> - -/* Alpha is the only 64-bit platform with 32-bit statfs. And doesn't -   even seem to implement statfs64 */ -#define __statfs_word __u32 - -#include <asm-generic/statfs.h> - -#endif diff --git a/arch/alpha/include/asm/string.h b/arch/alpha/include/asm/string.h index b02b8a28294..c2911f59170 100644 --- a/arch/alpha/include/asm/string.h +++ b/arch/alpha/include/asm/string.h @@ -22,15 +22,27 @@ extern void * __memcpy(void *, const void *, size_t);  #define __HAVE_ARCH_MEMSET  extern void * __constant_c_memset(void *, unsigned long, size_t); +extern void * ___memset(void *, int, size_t);  extern void * __memset(void *, int, size_t);  extern void * memset(void *, int, size_t); -#define memset(s, c, n)							    \ -(__builtin_constant_p(c)						    \ - ? (__builtin_constant_p(n) && (c) == 0					    \ -    ? __builtin_memset((s),0,(n)) 					    \ -    : __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n))) \ - : __memset((s),(c),(n))) +/* For gcc 3.x, we cannot have the inline function named "memset" because +   the __builtin_memset will attempt to resolve to the inline as well, +   leading to a "sorry" about unimplemented recursive inlining.  */ +extern inline void *__memset(void *s, int c, size_t n) +{ +	if (__builtin_constant_p(c)) { +		if (__builtin_constant_p(n)) { +			return __builtin_memset(s, c, n); +		} else { +			unsigned long c8 = (c & 0xff) * 0x0101010101010101UL; +			return __constant_c_memset(s, c8, n); +		} +	} +	return ___memset(s, c, n); +} + +#define memset __memset  #define __HAVE_ARCH_STRCPY  extern char * strcpy(char *,const char *); diff --git a/arch/alpha/include/asm/swab.h b/arch/alpha/include/asm/swab.h deleted file mode 100644 index 4d682b16c7c..00000000000 --- a/arch/alpha/include/asm/swab.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _ALPHA_SWAB_H -#define _ALPHA_SWAB_H - -#include <linux/types.h> -#include <linux/compiler.h> -#include <asm/compiler.h> - -#ifdef __GNUC__ - -static inline __attribute_const__ __u32 __arch_swab32(__u32 x) -{ -	/* -	 * Unfortunately, we can't use the 6 instruction sequence -	 * on ev6 since the latency of the UNPKBW is 3, which is -	 * pretty hard to hide.  Just in case a future implementation -	 * has a lower latency, here's the sequence (also by Mike Burrows) -	 * -	 * UNPKBW a0, v0       v0: 00AA00BB00CC00DD -	 * SLL v0, 24, a0      a0: BB00CC00DD000000 -	 * BIS v0, a0, a0      a0: BBAACCBBDDCC00DD -	 * EXTWL a0, 6, v0     v0: 000000000000BBAA -	 * ZAP a0, 0xf3, a0    a0: 00000000DDCC0000 -	 * ADDL a0, v0, v0     v0: ssssssssDDCCBBAA -	 */ - -	__u64 t0, t1, t2, t3; - -	t0 = __kernel_inslh(x, 7);	/* t0 : 0000000000AABBCC */ -	t1 = __kernel_inswl(x, 3);	/* t1 : 000000CCDD000000 */ -	t1 |= t0;			/* t1 : 000000CCDDAABBCC */ -	t2 = t1 >> 16;			/* t2 : 0000000000CCDDAA */ -	t0 = t1 & 0xFF00FF00;		/* t0 : 00000000DD00BB00 */ -	t3 = t2 & 0x00FF00FF;		/* t3 : 0000000000CC00AA */ -	t1 = t0 + t3;			/* t1 : ssssssssDDCCBBAA */ - -	return t1; -} -#define __arch_swab32 __arch_swab32 - -#endif /* __GNUC__ */ - -#endif /* _ALPHA_SWAB_H */ diff --git a/arch/alpha/include/asm/switch_to.h b/arch/alpha/include/asm/switch_to.h new file mode 100644 index 00000000000..44c0d4f2c0b --- /dev/null +++ b/arch/alpha/include/asm/switch_to.h @@ -0,0 +1,14 @@ +#ifndef __ALPHA_SWITCH_TO_H +#define __ALPHA_SWITCH_TO_H + + +struct task_struct; +extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct *); + +#define switch_to(P,N,L)						 \ +  do {									 \ +    (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \ +    check_mmu_context();						 \ +  } while (0) + +#endif /* __ALPHA_SWITCH_TO_H */ diff --git a/arch/alpha/include/asm/sysinfo.h b/arch/alpha/include/asm/sysinfo.h deleted file mode 100644 index 086aba284df..00000000000 --- a/arch/alpha/include/asm/sysinfo.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * include/asm-alpha/sysinfo.h - */ - -#ifndef __ASM_ALPHA_SYSINFO_H -#define __ASM_ALPHA_SYSINFO_H - -/* This defines the subset of the OSF/1 getsysinfo/setsysinfo calls -   that we support.  */ - -#define GSI_UACPROC			8 -#define GSI_IEEE_FP_CONTROL		45 -#define GSI_IEEE_STATE_AT_SIGNAL	46 -#define GSI_PROC_TYPE			60 -#define GSI_GET_HWRPB			101 - -#define SSI_NVPAIRS			1 -#define SSI_IEEE_FP_CONTROL		14 -#define SSI_IEEE_STATE_AT_SIGNAL	15 -#define SSI_IEEE_IGNORE_STATE_AT_SIGNAL	16 -#define SSI_IEEE_RAISE_EXCEPTION	1001	/* linux specific */ - -#define SSIN_UACPROC			6 - -#define UAC_BITMASK			7 -#define UAC_NOPRINT			1 -#define UAC_NOFIX			2 -#define UAC_SIGBUS			4 - - -#ifdef __KERNEL__ - -/* This is the shift that is applied to the UAC bits as stored in the -   per-thread flags.  See thread_info.h.  */ -#define UAC_SHIFT			6 - -#endif - -#endif /* __ASM_ALPHA_SYSINFO_H */ diff --git a/arch/alpha/include/asm/system.h b/arch/alpha/include/asm/system.h deleted file mode 100644 index 9f78e693463..00000000000 --- a/arch/alpha/include/asm/system.h +++ /dev/null @@ -1,354 +0,0 @@ -#ifndef __ALPHA_SYSTEM_H -#define __ALPHA_SYSTEM_H - -#include <asm/pal.h> -#include <asm/page.h> -#include <asm/barrier.h> - -/* - * System defines.. Note that this is included both from .c and .S - * files, so it does only defines, not any C code. - */ - -/* - * We leave one page for the initial stack page, and one page for - * the initial process structure. Also, the console eats 3 MB for - * the initial bootloader (one of which we can reclaim later). - */ -#define BOOT_PCB	0x20000000 -#define BOOT_ADDR	0x20000000 -/* Remove when official MILO sources have ELF support: */ -#define BOOT_SIZE	(16*1024) - -#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS -#define KERNEL_START_PHYS	0x300000 /* Old bootloaders hardcoded this.  */ -#else -#define KERNEL_START_PHYS	0x1000000 /* required: Wildfire/Titan/Marvel */ -#endif - -#define KERNEL_START	(PAGE_OFFSET+KERNEL_START_PHYS) -#define SWAPPER_PGD	KERNEL_START -#define INIT_STACK	(PAGE_OFFSET+KERNEL_START_PHYS+0x02000) -#define EMPTY_PGT	(PAGE_OFFSET+KERNEL_START_PHYS+0x04000) -#define EMPTY_PGE	(PAGE_OFFSET+KERNEL_START_PHYS+0x08000) -#define ZERO_PGE	(PAGE_OFFSET+KERNEL_START_PHYS+0x0A000) - -#define START_ADDR	(PAGE_OFFSET+KERNEL_START_PHYS+0x10000) - -/* - * This is setup by the secondary bootstrap loader.  Because - * the zero page is zeroed out as soon as the vm system is - * initialized, we need to copy things out into a more permanent - * place. - */ -#define PARAM			ZERO_PGE -#define COMMAND_LINE		((char*)(PARAM + 0x0000)) -#define INITRD_START		(*(unsigned long *) (PARAM+0x100)) -#define INITRD_SIZE		(*(unsigned long *) (PARAM+0x108)) - -#ifndef __ASSEMBLY__ -#include <linux/kernel.h> -#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */ - -/* - * This is the logout header that should be common to all platforms - * (assuming they are running OSF/1 PALcode, I guess). - */ -struct el_common { -	unsigned int	size;		/* size in bytes of logout area */ -	unsigned int	sbz1	: 30;	/* should be zero */ -	unsigned int	err2	:  1;	/* second error */ -	unsigned int	retry	:  1;	/* retry flag */ -	unsigned int	proc_offset;	/* processor-specific offset */ -	unsigned int	sys_offset;	/* system-specific offset */ -	unsigned int	code;		/* machine check code */ -	unsigned int	frame_rev;	/* frame revision */ -}; - -/* Machine Check Frame for uncorrectable errors (Large format) - *      --- This is used to log uncorrectable errors such as - *          double bit ECC errors. - *      --- These errors are detected by both processor and systems. - */ -struct el_common_EV5_uncorrectable_mcheck { -        unsigned long   shadow[8];        /* Shadow reg. 8-14, 25           */ -        unsigned long   paltemp[24];      /* PAL TEMP REGS.                 */ -        unsigned long   exc_addr;         /* Address of excepting instruction*/ -        unsigned long   exc_sum;          /* Summary of arithmetic traps.   */ -        unsigned long   exc_mask;         /* Exception mask (from exc_sum). */ -        unsigned long   pal_base;         /* Base address for PALcode.      */ -        unsigned long   isr;              /* Interrupt Status Reg.          */ -        unsigned long   icsr;             /* CURRENT SETUP OF EV5 IBOX      */ -        unsigned long   ic_perr_stat;     /* I-CACHE Reg. <11> set Data parity -                                                         <12> set TAG parity*/ -        unsigned long   dc_perr_stat;     /* D-CACHE error Reg. Bits set to 1: -                                                     <2> Data error in bank 0 -                                                     <3> Data error in bank 1 -                                                     <4> Tag error in bank 0 -                                                     <5> Tag error in bank 1 */ -        unsigned long   va;               /* Effective VA of fault or miss. */ -        unsigned long   mm_stat;          /* Holds the reason for D-stream  -                                             fault or D-cache parity errors */ -        unsigned long   sc_addr;          /* Address that was being accessed -                                             when EV5 detected Secondary cache -                                             failure.                 */ -        unsigned long   sc_stat;          /* Helps determine if the error was -                                             TAG/Data parity(Secondary Cache)*/ -        unsigned long   bc_tag_addr;      /* Contents of EV5 BC_TAG_ADDR    */ -        unsigned long   ei_addr;          /* Physical address of any transfer -                                             that is logged in EV5 EI_STAT */ -        unsigned long   fill_syndrome;    /* For correcting ECC errors.     */ -        unsigned long   ei_stat;          /* Helps identify reason of any  -                                             processor uncorrectable error -                                             at its external interface.     */ -        unsigned long   ld_lock;          /* Contents of EV5 LD_LOCK register*/ -}; - -struct el_common_EV6_mcheck { -	unsigned int FrameSize;		/* Bytes, including this field */ -	unsigned int FrameFlags;	/* <31> = Retry, <30> = Second Error */ -	unsigned int CpuOffset;		/* Offset to CPU-specific info */ -	unsigned int SystemOffset;	/* Offset to system-specific info */ -	unsigned int MCHK_Code; -	unsigned int MCHK_Frame_Rev; -	unsigned long I_STAT;		/* EV6 Internal Processor Registers */ -	unsigned long DC_STAT;		/* (See the 21264 Spec) */ -	unsigned long C_ADDR; -	unsigned long DC1_SYNDROME; -	unsigned long DC0_SYNDROME; -	unsigned long C_STAT; -	unsigned long C_STS; -	unsigned long MM_STAT; -	unsigned long EXC_ADDR; -	unsigned long IER_CM; -	unsigned long ISUM; -	unsigned long RESERVED0; -	unsigned long PAL_BASE; -	unsigned long I_CTL; -	unsigned long PCTX; -}; - -extern void halt(void) __attribute__((noreturn)); -#define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt)) - -#define switch_to(P,N,L)						 \ -  do {									 \ -    (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \ -    check_mmu_context();						 \ -  } while (0) - -struct task_struct; -extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); - -#define imb() \ -__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") - -#define draina() \ -__asm__ __volatile__ ("call_pal %0 #draina" : : "i" (PAL_draina) : "memory") - -enum implver_enum { -	IMPLVER_EV4, -	IMPLVER_EV5, -	IMPLVER_EV6 -}; - -#ifdef CONFIG_ALPHA_GENERIC -#define implver()				\ -({ unsigned long __implver;			\ -   __asm__ ("implver %0" : "=r"(__implver));	\ -   (enum implver_enum) __implver; }) -#else -/* Try to eliminate some dead code.  */ -#ifdef CONFIG_ALPHA_EV4 -#define implver() IMPLVER_EV4 -#endif -#ifdef CONFIG_ALPHA_EV5 -#define implver() IMPLVER_EV5 -#endif -#if defined(CONFIG_ALPHA_EV6) -#define implver() IMPLVER_EV6 -#endif -#endif - -enum amask_enum { -	AMASK_BWX = (1UL << 0), -	AMASK_FIX = (1UL << 1), -	AMASK_CIX = (1UL << 2), -	AMASK_MAX = (1UL << 8), -	AMASK_PRECISE_TRAP = (1UL << 9), -}; - -#define amask(mask)						\ -({ unsigned long __amask, __input = (mask);			\ -   __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input));	\ -   __amask; }) - -#define __CALL_PAL_R0(NAME, TYPE)				\ -extern inline TYPE NAME(void)					\ -{								\ -	register TYPE __r0 __asm__("$0");			\ -	__asm__ __volatile__(					\ -		"call_pal %1 # " #NAME				\ -		:"=r" (__r0)					\ -		:"i" (PAL_ ## NAME)				\ -		:"$1", "$16", "$22", "$23", "$24", "$25");	\ -	return __r0;						\ -} - -#define __CALL_PAL_W1(NAME, TYPE0)				\ -extern inline void NAME(TYPE0 arg0)				\ -{								\ -	register TYPE0 __r16 __asm__("$16") = arg0;		\ -	__asm__ __volatile__(					\ -		"call_pal %1 # "#NAME				\ -		: "=r"(__r16)					\ -		: "i"(PAL_ ## NAME), "0"(__r16)			\ -		: "$1", "$22", "$23", "$24", "$25");		\ -} - -#define __CALL_PAL_W2(NAME, TYPE0, TYPE1)			\ -extern inline void NAME(TYPE0 arg0, TYPE1 arg1)			\ -{								\ -	register TYPE0 __r16 __asm__("$16") = arg0;		\ -	register TYPE1 __r17 __asm__("$17") = arg1;		\ -	__asm__ __volatile__(					\ -		"call_pal %2 # "#NAME				\ -		: "=r"(__r16), "=r"(__r17)			\ -		: "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17)	\ -		: "$1", "$22", "$23", "$24", "$25");		\ -} - -#define __CALL_PAL_RW1(NAME, RTYPE, TYPE0)			\ -extern inline RTYPE NAME(TYPE0 arg0)				\ -{								\ -	register RTYPE __r0 __asm__("$0");			\ -	register TYPE0 __r16 __asm__("$16") = arg0;		\ -	__asm__ __volatile__(					\ -		"call_pal %2 # "#NAME				\ -		: "=r"(__r16), "=r"(__r0)			\ -		: "i"(PAL_ ## NAME), "0"(__r16)			\ -		: "$1", "$22", "$23", "$24", "$25");		\ -	return __r0;						\ -} - -#define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1)		\ -extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1)		\ -{								\ -	register RTYPE __r0 __asm__("$0");			\ -	register TYPE0 __r16 __asm__("$16") = arg0;		\ -	register TYPE1 __r17 __asm__("$17") = arg1;		\ -	__asm__ __volatile__(					\ -		"call_pal %3 # "#NAME				\ -		: "=r"(__r16), "=r"(__r17), "=r"(__r0)		\ -		: "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17)	\ -		: "$1", "$22", "$23", "$24", "$25");		\ -	return __r0;						\ -} - -__CALL_PAL_W1(cflush, unsigned long); -__CALL_PAL_R0(rdmces, unsigned long); -__CALL_PAL_R0(rdps, unsigned long); -__CALL_PAL_R0(rdusp, unsigned long); -__CALL_PAL_RW1(swpipl, unsigned long, unsigned long); -__CALL_PAL_R0(whami, unsigned long); -__CALL_PAL_W2(wrent, void*, unsigned long); -__CALL_PAL_W1(wripir, unsigned long); -__CALL_PAL_W1(wrkgp, unsigned long); -__CALL_PAL_W1(wrmces, unsigned long); -__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long); -__CALL_PAL_W1(wrusp, unsigned long); -__CALL_PAL_W1(wrvptptr, unsigned long); - -/* - * TB routines.. - */ -#define __tbi(nr,arg,arg1...)					\ -({								\ -	register unsigned long __r16 __asm__("$16") = (nr);	\ -	register unsigned long __r17 __asm__("$17"); arg;	\ -	__asm__ __volatile__(					\ -		"call_pal %3 #__tbi"				\ -		:"=r" (__r16),"=r" (__r17)			\ -		:"0" (__r16),"i" (PAL_tbi) ,##arg1		\ -		:"$0", "$1", "$22", "$23", "$24", "$25");	\ -}) - -#define tbi(x,y)	__tbi(x,__r17=(y),"1" (__r17)) -#define tbisi(x)	__tbi(1,__r17=(x),"1" (__r17)) -#define tbisd(x)	__tbi(2,__r17=(x),"1" (__r17)) -#define tbis(x)		__tbi(3,__r17=(x),"1" (__r17)) -#define tbiap()		__tbi(-1, /* no second argument */) -#define tbia()		__tbi(-2, /* no second argument */) - -/* - * Atomic exchange routines. - */ - -#define __ASM__MB -#define ____xchg(type, args...)		__xchg ## type ## _local(args) -#define ____cmpxchg(type, args...)	__cmpxchg ## type ## _local(args) -#include <asm/xchg.h> - -#define xchg_local(ptr,x)						\ -  ({									\ -     __typeof__(*(ptr)) _x_ = (x);					\ -     (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_,	\ -				       sizeof(*(ptr)));			\ -  }) - -#define cmpxchg_local(ptr, o, n)					\ -  ({									\ -     __typeof__(*(ptr)) _o_ = (o);					\ -     __typeof__(*(ptr)) _n_ = (n);					\ -     (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_,	\ -					  (unsigned long)_n_,		\ -					  sizeof(*(ptr)));		\ -  }) - -#define cmpxchg64_local(ptr, o, n)					\ -  ({									\ -	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\ -	cmpxchg_local((ptr), (o), (n));					\ -  }) - -#ifdef CONFIG_SMP -#undef __ASM__MB -#define __ASM__MB	"\tmb\n" -#endif -#undef ____xchg -#undef ____cmpxchg -#define ____xchg(type, args...)		__xchg ##type(args) -#define ____cmpxchg(type, args...)	__cmpxchg ##type(args) -#include <asm/xchg.h> - -#define xchg(ptr,x)							\ -  ({									\ -     __typeof__(*(ptr)) _x_ = (x);					\ -     (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_,		\ -				 sizeof(*(ptr)));			\ -  }) - -#define cmpxchg(ptr, o, n)						\ -  ({									\ -     __typeof__(*(ptr)) _o_ = (o);					\ -     __typeof__(*(ptr)) _n_ = (n);					\ -     (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,		\ -				    (unsigned long)_n_,	sizeof(*(ptr)));\ -  }) - -#define cmpxchg64(ptr, o, n)						\ -  ({									\ -	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\ -	cmpxchg((ptr), (o), (n));					\ -  }) - -#undef __ASM__MB -#undef ____cmpxchg - -#define __HAVE_ARCH_CMPXCHG 1 - -#endif /* __ASSEMBLY__ */ - -#define arch_align_stack(x) (x) - -#endif diff --git a/arch/alpha/include/asm/termbits.h b/arch/alpha/include/asm/termbits.h deleted file mode 100644 index 879dd358992..00000000000 --- a/arch/alpha/include/asm/termbits.h +++ /dev/null @@ -1,201 +0,0 @@ -#ifndef _ALPHA_TERMBITS_H -#define _ALPHA_TERMBITS_H - -#include <linux/posix_types.h> - -typedef unsigned char	cc_t; -typedef unsigned int	speed_t; -typedef unsigned int	tcflag_t; - -/* - * termios type and macro definitions.  Be careful about adding stuff - * to this file since it's used in GNU libc and there are strict rules - * concerning namespace pollution. - */ - -#define NCCS 19 -struct termios { -	tcflag_t c_iflag;		/* input mode flags */ -	tcflag_t c_oflag;		/* output mode flags */ -	tcflag_t c_cflag;		/* control mode flags */ -	tcflag_t c_lflag;		/* local mode flags */ -	cc_t c_cc[NCCS];		/* control characters */ -	cc_t c_line;			/* line discipline (== c_cc[19]) */ -	speed_t c_ispeed;		/* input speed */ -	speed_t c_ospeed;		/* output speed */ -}; - -/* Alpha has matching termios and ktermios */ - -struct ktermios { -	tcflag_t c_iflag;		/* input mode flags */ -	tcflag_t c_oflag;		/* output mode flags */ -	tcflag_t c_cflag;		/* control mode flags */ -	tcflag_t c_lflag;		/* local mode flags */ -	cc_t c_cc[NCCS];		/* control characters */ -	cc_t c_line;			/* line discipline (== c_cc[19]) */ -	speed_t c_ispeed;		/* input speed */ -	speed_t c_ospeed;		/* output speed */ -}; - -/* c_cc characters */ -#define VEOF 0 -#define VEOL 1 -#define VEOL2 2 -#define VERASE 3 -#define VWERASE 4 -#define VKILL 5 -#define VREPRINT 6 -#define VSWTC 7 -#define VINTR 8 -#define VQUIT 9 -#define VSUSP 10 -#define VSTART 12 -#define VSTOP 13 -#define VLNEXT 14 -#define VDISCARD 15 -#define VMIN 16 -#define VTIME 17 - -/* c_iflag bits */ -#define IGNBRK	0000001 -#define BRKINT	0000002 -#define IGNPAR	0000004 -#define PARMRK	0000010 -#define INPCK	0000020 -#define ISTRIP	0000040 -#define INLCR	0000100 -#define IGNCR	0000200 -#define ICRNL	0000400 -#define IXON	0001000 -#define IXOFF	0002000 -#define IXANY	0004000 -#define IUCLC	0010000 -#define IMAXBEL	0020000 -#define IUTF8	0040000 - -/* c_oflag bits */ -#define OPOST	0000001 -#define ONLCR	0000002 -#define OLCUC	0000004 - -#define OCRNL	0000010 -#define ONOCR	0000020 -#define ONLRET	0000040 - -#define OFILL	00000100 -#define OFDEL	00000200 -#define NLDLY	00001400 -#define   NL0	00000000 -#define   NL1	00000400 -#define   NL2	00001000 -#define   NL3	00001400 -#define TABDLY	00006000 -#define   TAB0	00000000 -#define   TAB1	00002000 -#define   TAB2	00004000 -#define   TAB3	00006000 -#define CRDLY	00030000 -#define   CR0	00000000 -#define   CR1	00010000 -#define   CR2	00020000 -#define   CR3	00030000 -#define FFDLY	00040000 -#define   FF0	00000000 -#define   FF1	00040000 -#define BSDLY	00100000 -#define   BS0	00000000 -#define   BS1	00100000 -#define VTDLY	00200000 -#define   VT0	00000000 -#define   VT1	00200000 -#define XTABS	01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */ - -/* c_cflag bit meaning */ -#define CBAUD	0000037 -#define  B0	0000000		/* hang up */ -#define  B50	0000001 -#define  B75	0000002 -#define  B110	0000003 -#define  B134	0000004 -#define  B150	0000005 -#define  B200	0000006 -#define  B300	0000007 -#define  B600	0000010 -#define  B1200	0000011 -#define  B1800	0000012 -#define  B2400	0000013 -#define  B4800	0000014 -#define  B9600	0000015 -#define  B19200	0000016 -#define  B38400	0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CBAUDEX 0000000 -#define  B57600   00020 -#define  B115200  00021 -#define  B230400  00022 -#define  B460800  00023 -#define  B500000  00024 -#define  B576000  00025 -#define  B921600  00026 -#define B1000000  00027 -#define B1152000  00030 -#define B1500000  00031 -#define B2000000  00032 -#define B2500000  00033 -#define B3000000  00034 -#define B3500000  00035 -#define B4000000  00036 - -#define CSIZE	00001400 -#define   CS5	00000000 -#define   CS6	00000400 -#define   CS7	00001000 -#define   CS8	00001400 - -#define CSTOPB	00002000 -#define CREAD	00004000 -#define PARENB	00010000 -#define PARODD	00020000 -#define HUPCL	00040000 - -#define CLOCAL	00100000 -#define CMSPAR	  010000000000		/* mark or space (stick) parity */ -#define CRTSCTS	  020000000000		/* flow control */ - -/* c_lflag bits */ -#define ISIG	0x00000080 -#define ICANON	0x00000100 -#define XCASE	0x00004000 -#define ECHO	0x00000008 -#define ECHOE	0x00000002 -#define ECHOK	0x00000004 -#define ECHONL	0x00000010 -#define NOFLSH	0x80000000 -#define TOSTOP	0x00400000 -#define ECHOCTL	0x00000040 -#define ECHOPRT	0x00000020 -#define ECHOKE	0x00000001 -#define FLUSHO	0x00800000 -#define PENDIN	0x20000000 -#define IEXTEN	0x00000400 -#define EXTPROC	0x10000000 - -/* Values for the ACTION argument to `tcflow'.  */ -#define	TCOOFF		0 -#define	TCOON		1 -#define	TCIOFF		2 -#define	TCION		3 - -/* Values for the QUEUE_SELECTOR argument to `tcflush'.  */ -#define	TCIFLUSH	0 -#define	TCOFLUSH	1 -#define	TCIOFLUSH	2 - -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */ -#define	TCSANOW		0 -#define	TCSADRAIN	1 -#define	TCSAFLUSH	2 - -#endif /* _ALPHA_TERMBITS_H */ diff --git a/arch/alpha/include/asm/termios.h b/arch/alpha/include/asm/termios.h index fa13716a11c..7fde0f88da8 100644 --- a/arch/alpha/include/asm/termios.h +++ b/arch/alpha/include/asm/termios.h @@ -1,72 +1,8 @@  #ifndef _ALPHA_TERMIOS_H  #define _ALPHA_TERMIOS_H -#include <asm/ioctls.h> -#include <asm/termbits.h> +#include <uapi/asm/termios.h> -struct sgttyb { -	char	sg_ispeed; -	char	sg_ospeed; -	char	sg_erase; -	char	sg_kill; -	short	sg_flags; -}; - -struct tchars { -	char	t_intrc; -	char	t_quitc; -	char	t_startc; -	char	t_stopc; -	char	t_eofc; -	char	t_brkc; -}; - -struct ltchars { -	char	t_suspc; -	char	t_dsuspc; -	char	t_rprntc; -	char	t_flushc; -	char	t_werasc; -	char	t_lnextc; -}; - -struct winsize { -	unsigned short ws_row; -	unsigned short ws_col; -	unsigned short ws_xpixel; -	unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { -	unsigned short c_iflag;		/* input mode flags */ -	unsigned short c_oflag;		/* output mode flags */ -	unsigned short c_cflag;		/* control mode flags */ -	unsigned short c_lflag;		/* local mode flags */ -	unsigned char c_line;		/* line discipline */ -	unsigned char c_cc[NCC];	/* control characters */ -}; - -/* - * c_cc characters in the termio structure.  Oh, how I love being - * backwardly compatible.  Notice that character 4 and 5 are - * interpreted differently depending on whether ICANON is set in - * c_lflag.  If it's set, they are used as _VEOF and _VEOL, otherwise - * as _VMIN and V_TIME.  This is for compatibility with OSF/1 (which - * is compatible with sysV)... - */ -#define _VINTR	0 -#define _VQUIT	1 -#define _VERASE	2 -#define _VKILL	3 -#define _VEOF	4 -#define _VMIN	4 -#define _VEOL	5 -#define _VTIME	5 -#define _VEOL2	6 -#define _VSWTC	7 - -#ifdef __KERNEL__  /*	eof=^D		eol=\0		eol2=\0		erase=del  	werase=^W	kill=^U		reprint=^R	sxtc=\0  	intr=^C		quit=^\		susp=^Z		<OSF/1 VDSUSP> @@ -141,6 +77,4 @@ struct termio {  #define kernel_termios_to_user_termios(u, k) \  	copy_to_user(u, k, sizeof(struct termios)) -#endif	/* __KERNEL__ */ -  #endif	/* _ALPHA_TERMIOS_H */ diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h index 6f32f9c84a2..48bbea6898b 100644 --- a/arch/alpha/include/asm/thread_info.h +++ b/arch/alpha/include/asm/thread_info.h @@ -7,6 +7,7 @@  #include <asm/processor.h>  #include <asm/types.h>  #include <asm/hwrpb.h> +#include <asm/sysinfo.h>  #endif  #ifndef __ASSEMBLY__ @@ -21,6 +22,7 @@ struct thread_info {  	mm_segment_t		addr_limit;	/* thread address space */  	unsigned		cpu;		/* current CPU */  	int			preempt_count; /* 0 => preemptable, <0 => BUG */ +	unsigned int		status;		/* thread-synchronous flags */  	int bpt_nsaved;  	unsigned long bpt_addr[2];		/* breakpoint handling  */ @@ -56,15 +58,11 @@ register struct thread_info *__current_thread_info __asm__("$8");  #define THREAD_SIZE_ORDER 1  #define THREAD_SIZE (2*PAGE_SIZE) -#define PREEMPT_ACTIVE		0x40000000 -  /*   * Thread information flags:   * - these are process state flags and used from assembly   * - pending work-to-be-done flags come first and must be assigned to be   *   within bits 0 to 7 to fit in and immediate operand. - * - ALPHA_UAC_SHIFT below must be kept consistent with the unaligned - *   control flags.   *   * TIF_SYSCALL_TRACE is known to be 0 via blbs.   */ @@ -72,22 +70,17 @@ register struct thread_info *__current_thread_info __asm__("$8");  #define TIF_NOTIFY_RESUME	1	/* callback before returning to user */  #define TIF_SIGPENDING		2	/* signal pending */  #define TIF_NEED_RESCHED	3	/* rescheduling necessary */ -#define TIF_POLLING_NRFLAG	8	/* poll_idle is polling NEED_RESCHED */ +#define TIF_SYSCALL_AUDIT	4	/* syscall audit active */  #define TIF_DIE_IF_KERNEL	9	/* dik recursion lock */ -#define TIF_UAC_NOPRINT		10	/* see sysinfo.h */ -#define TIF_UAC_NOFIX		11 -#define TIF_UAC_SIGBUS		12  #define TIF_MEMDIE		13	/* is terminating due to OOM killer */ -#define TIF_RESTORE_SIGMASK	14	/* restore signal mask in do_signal */ -#define TIF_FREEZE		16	/* is freezing for suspend */ +#define TIF_POLLING_NRFLAG	14	/* idle is polling for TIF_NEED_RESCHED */  #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)  #define _TIF_SIGPENDING		(1<<TIF_SIGPENDING)  #define _TIF_NEED_RESCHED	(1<<TIF_NEED_RESCHED) -#define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG) -#define _TIF_RESTORE_SIGMASK	(1<<TIF_RESTORE_SIGMASK)  #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME) -#define _TIF_FREEZE		(1<<TIF_FREEZE) +#define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT) +#define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)  /* Work to do on interrupt/exception return.  */  #define _TIF_WORK_MASK		(_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ @@ -97,26 +90,58 @@ register struct thread_info *__current_thread_info __asm__("$8");  #define _TIF_ALLWORK_MASK	(_TIF_WORK_MASK		\  				 | _TIF_SYSCALL_TRACE) -#define ALPHA_UAC_SHIFT		10 -#define ALPHA_UAC_MASK		(1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \ -				 1 << TIF_UAC_SIGBUS) +#define TS_UAC_NOPRINT		0x0001	/* ! Preserve the following three */ +#define TS_UAC_NOFIX		0x0002	/* ! flags as they match          */ +#define TS_UAC_SIGBUS		0x0004	/* ! userspace part of 'osf_sysinfo' */ +#define TS_RESTORE_SIGMASK	0x0008	/* restore signal mask in do_signal() */ + +#ifndef __ASSEMBLY__ +#define HAVE_SET_RESTORE_SIGMASK	1 +static inline void set_restore_sigmask(void) +{ +	struct thread_info *ti = current_thread_info(); +	ti->status |= TS_RESTORE_SIGMASK; +	WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags)); +} +static inline void clear_restore_sigmask(void) +{ +	current_thread_info()->status &= ~TS_RESTORE_SIGMASK; +} +static inline bool test_restore_sigmask(void) +{ +	return current_thread_info()->status & TS_RESTORE_SIGMASK; +} +static inline bool test_and_clear_restore_sigmask(void) +{ +	struct thread_info *ti = current_thread_info(); +	if (!(ti->status & TS_RESTORE_SIGMASK)) +		return false; +	ti->status &= ~TS_RESTORE_SIGMASK; +	return true; +} +#endif -#define SET_UNALIGN_CTL(task,value)	({				     \ -	task_thread_info(task)->flags = ((task_thread_info(task)->flags &    \ -		~ALPHA_UAC_MASK)					     \ -		| (((value) << ALPHA_UAC_SHIFT)       & (1<<TIF_UAC_NOPRINT))\ -		| (((value) << (ALPHA_UAC_SHIFT + 1)) & (1<<TIF_UAC_SIGBUS)) \ -		| (((value) << (ALPHA_UAC_SHIFT - 1)) & (1<<TIF_UAC_NOFIX)));\ +#define SET_UNALIGN_CTL(task,value)	({				\ +	__u32 status = task_thread_info(task)->status & ~UAC_BITMASK;	\ +	if (value & PR_UNALIGN_NOPRINT)					\ +		status |= TS_UAC_NOPRINT;				\ +	if (value & PR_UNALIGN_SIGBUS)					\ +		status |= TS_UAC_SIGBUS;				\ +	if (value & 4)	/* alpha-specific */				\ +		status |= TS_UAC_NOFIX;					\ +	task_thread_info(task)->status = status;			\  	0; })  #define GET_UNALIGN_CTL(task,value)	({				\ -	put_user((task_thread_info(task)->flags & (1 << TIF_UAC_NOPRINT))\ -		  >> ALPHA_UAC_SHIFT					\ -		 | (task_thread_info(task)->flags & (1 << TIF_UAC_SIGBUS))\ -		 >> (ALPHA_UAC_SHIFT + 1)				\ -		 | (task_thread_info(task)->flags & (1 << TIF_UAC_NOFIX))\ -		 >> (ALPHA_UAC_SHIFT - 1),				\ -		 (int __user *)(value));				\ +	__u32 status = task_thread_info(task)->status & ~UAC_BITMASK;	\ +	__u32 res = 0;							\ +	if (status & TS_UAC_NOPRINT)					\ +		res |= PR_UNALIGN_NOPRINT;				\ +	if (status & TS_UAC_SIGBUS)					\ +		res |= PR_UNALIGN_SIGBUS;				\ +	if (status & TS_UAC_NOFIX)					\ +		res |= 4;						\ +	put_user(res, (int __user *)(value));				\  	})  #endif /* __KERNEL__ */ diff --git a/arch/alpha/include/asm/types.h b/arch/alpha/include/asm/types.h index bd621ecd1eb..f61e1a56c37 100644 --- a/arch/alpha/include/asm/types.h +++ b/arch/alpha/include/asm/types.h @@ -1,35 +1,7 @@  #ifndef _ALPHA_TYPES_H  #define _ALPHA_TYPES_H -/* - * This file is never included by application software unless - * explicitly requested (e.g., via linux/types.h) in which case the - * application is Linux specific so (user-) name space pollution is - * not a major issue.  However, for interoperability, libraries still - * need to be careful to avoid a name clashes. - */ - -#ifdef __KERNEL__  #include <asm-generic/int-ll64.h> -#else -#include <asm-generic/int-l64.h> -#endif - -#ifndef __ASSEMBLY__ - -typedef unsigned int umode_t; - -#endif /* __ASSEMBLY__ */ - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ -#ifndef __ASSEMBLY__ - -typedef u64 dma_addr_t; -typedef u64 dma64_addr_t; +#include <uapi/asm/types.h> -#endif /* __ASSEMBLY__ */ -#endif /* __KERNEL__ */  #endif /* _ALPHA_TYPES_H */ diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h index b49ec2f8d6e..766fdfde2b7 100644 --- a/arch/alpha/include/asm/uaccess.h +++ b/arch/alpha/include/asm/uaccess.h @@ -433,36 +433,12 @@ clear_user(void __user *to, long len)  #undef __module_address  #undef __module_call -/* Returns: -EFAULT if exception before terminator, N if the entire -   buffer filled, else strlen.  */ +#define user_addr_max() \ +        (segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) -extern long __strncpy_from_user(char *__to, const char __user *__from, long __to_len); - -extern inline long -strncpy_from_user(char *to, const char __user *from, long n) -{ -	long ret = -EFAULT; -	if (__access_ok((unsigned long)from, 0, get_fs())) -		ret = __strncpy_from_user(to, from, n); -	return ret; -} - -/* Returns: 0 if bad, string length+1 (memory size) of string if ok */ -extern long __strlen_user(const char __user *); - -extern inline long strlen_user(const char __user *str) -{ -	return access_ok(VERIFY_READ,str,0) ? __strlen_user(str) : 0; -} - -/* Returns: 0 if exception before NUL or reaching the supplied limit (N), - * a value greater than N if the limit would be exceeded, else strlen.  */ -extern long __strnlen_user(const char __user *, long); - -extern inline long strnlen_user(const char __user *str, long n) -{ -	return access_ok(VERIFY_READ,str,0) ? __strnlen_user(str, n) : 0; -} +extern long strncpy_from_user(char *dest, const char __user *src, long count); +extern __must_check long strlen_user(const char __user *str); +extern __must_check long strnlen_user(const char __user *str, long n);  /*   * About the exception table: diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index 058937bf5a7..f2c94402e2c 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h @@ -1,463 +1,10 @@  #ifndef _ALPHA_UNISTD_H  #define _ALPHA_UNISTD_H -#define __NR_osf_syscall	  0	/* not implemented */ -#define __NR_exit		  1 -#define __NR_fork		  2 -#define __NR_read		  3 -#define __NR_write		  4 -#define __NR_osf_old_open	  5	/* not implemented */ -#define __NR_close		  6 -#define __NR_osf_wait4		  7 -#define __NR_osf_old_creat	  8	/* not implemented */ -#define __NR_link		  9 -#define __NR_unlink		 10 -#define __NR_osf_execve		 11	/* not implemented */ -#define __NR_chdir		 12 -#define __NR_fchdir		 13 -#define __NR_mknod		 14 -#define __NR_chmod		 15 -#define __NR_chown		 16 -#define __NR_brk		 17 -#define __NR_osf_getfsstat	 18	/* not implemented */ -#define __NR_lseek		 19 -#define __NR_getxpid		 20 -#define __NR_osf_mount		 21 -#define __NR_umount		 22 -#define __NR_setuid		 23 -#define __NR_getxuid		 24 -#define __NR_exec_with_loader	 25	/* not implemented */ -#define __NR_ptrace		 26 -#define __NR_osf_nrecvmsg	 27	/* not implemented */ -#define __NR_osf_nsendmsg	 28	/* not implemented */ -#define __NR_osf_nrecvfrom	 29	/* not implemented */ -#define __NR_osf_naccept	 30	/* not implemented */ -#define __NR_osf_ngetpeername	 31	/* not implemented */ -#define __NR_osf_ngetsockname	 32	/* not implemented */ -#define __NR_access		 33 -#define __NR_osf_chflags	 34	/* not implemented */ -#define __NR_osf_fchflags	 35	/* not implemented */ -#define __NR_sync		 36 -#define __NR_kill		 37 -#define __NR_osf_old_stat	 38	/* not implemented */ -#define __NR_setpgid		 39 -#define __NR_osf_old_lstat	 40	/* not implemented */ -#define __NR_dup		 41 -#define __NR_pipe		 42 -#define __NR_osf_set_program_attributes	43 -#define __NR_osf_profil		 44	/* not implemented */ -#define __NR_open		 45 -#define __NR_osf_old_sigaction	 46	/* not implemented */ -#define __NR_getxgid		 47 -#define __NR_osf_sigprocmask	 48 -#define __NR_osf_getlogin	 49	/* not implemented */ -#define __NR_osf_setlogin	 50	/* not implemented */ -#define __NR_acct		 51 -#define __NR_sigpending		 52 +#include <uapi/asm/unistd.h> -#define __NR_ioctl		 54 -#define __NR_osf_reboot		 55	/* not implemented */ -#define __NR_osf_revoke		 56	/* not implemented */ -#define __NR_symlink		 57 -#define __NR_readlink		 58 -#define __NR_execve		 59 -#define __NR_umask		 60 -#define __NR_chroot		 61 -#define __NR_osf_old_fstat	 62	/* not implemented */ -#define __NR_getpgrp		 63 -#define __NR_getpagesize	 64 -#define __NR_osf_mremap		 65	/* not implemented */ -#define __NR_vfork		 66 -#define __NR_stat		 67 -#define __NR_lstat		 68 -#define __NR_osf_sbrk		 69	/* not implemented */ -#define __NR_osf_sstk		 70	/* not implemented */ -#define __NR_mmap		 71	/* OSF/1 mmap is superset of Linux */ -#define __NR_osf_old_vadvise	 72	/* not implemented */ -#define __NR_munmap		 73 -#define __NR_mprotect		 74 -#define __NR_madvise		 75 -#define __NR_vhangup		 76 -#define __NR_osf_kmodcall	 77	/* not implemented */ -#define __NR_osf_mincore	 78	/* not implemented */ -#define __NR_getgroups		 79 -#define __NR_setgroups		 80 -#define __NR_osf_old_getpgrp	 81	/* not implemented */ -#define __NR_setpgrp		 82	/* BSD alias for setpgid */ -#define __NR_osf_setitimer	 83 -#define __NR_osf_old_wait	 84	/* not implemented */ -#define __NR_osf_table		 85	/* not implemented */ -#define __NR_osf_getitimer	 86 -#define __NR_gethostname	 87 -#define __NR_sethostname	 88 -#define __NR_getdtablesize	 89 -#define __NR_dup2		 90 -#define __NR_fstat		 91 -#define __NR_fcntl		 92 -#define __NR_osf_select		 93 -#define __NR_poll		 94 -#define __NR_fsync		 95 -#define __NR_setpriority	 96 -#define __NR_socket		 97 -#define __NR_connect		 98 -#define __NR_accept		 99 -#define __NR_getpriority	100 -#define __NR_send		101 -#define __NR_recv		102 -#define __NR_sigreturn		103 -#define __NR_bind		104 -#define __NR_setsockopt		105 -#define __NR_listen		106 -#define __NR_osf_plock		107	/* not implemented */ -#define __NR_osf_old_sigvec	108	/* not implemented */ -#define __NR_osf_old_sigblock	109	/* not implemented */ -#define __NR_osf_old_sigsetmask	110	/* not implemented */ -#define __NR_sigsuspend		111 -#define __NR_osf_sigstack	112 -#define __NR_recvmsg		113 -#define __NR_sendmsg		114 -#define __NR_osf_old_vtrace	115	/* not implemented */ -#define __NR_osf_gettimeofday	116 -#define __NR_osf_getrusage	117 -#define __NR_getsockopt		118 +#define NR_SYSCALLS			508 -#define __NR_readv		120 -#define __NR_writev		121 -#define __NR_osf_settimeofday	122 -#define __NR_fchown		123 -#define __NR_fchmod		124 -#define __NR_recvfrom		125 -#define __NR_setreuid		126 -#define __NR_setregid		127 -#define __NR_rename		128 -#define __NR_truncate		129 -#define __NR_ftruncate		130 -#define __NR_flock		131 -#define __NR_setgid		132 -#define __NR_sendto		133 -#define __NR_shutdown		134 -#define __NR_socketpair		135 -#define __NR_mkdir		136 -#define __NR_rmdir		137 -#define __NR_osf_utimes		138 -#define __NR_osf_old_sigreturn	139	/* not implemented */ -#define __NR_osf_adjtime	140	/* not implemented */ -#define __NR_getpeername	141 -#define __NR_osf_gethostid	142	/* not implemented */ -#define __NR_osf_sethostid	143	/* not implemented */ -#define __NR_getrlimit		144 -#define __NR_setrlimit		145 -#define __NR_osf_old_killpg	146	/* not implemented */ -#define __NR_setsid		147 -#define __NR_quotactl		148 -#define __NR_osf_oldquota	149	/* not implemented */ -#define __NR_getsockname	150 - -#define __NR_osf_pid_block	153	/* not implemented */ -#define __NR_osf_pid_unblock	154	/* not implemented */ - -#define __NR_sigaction		156 -#define __NR_osf_sigwaitprim	157	/* not implemented */ -#define __NR_osf_nfssvc		158	/* not implemented */ -#define __NR_osf_getdirentries	159 -#define __NR_osf_statfs		160 -#define __NR_osf_fstatfs	161 - -#define __NR_osf_asynch_daemon	163	/* not implemented */ -#define __NR_osf_getfh		164	/* not implemented */	 -#define __NR_osf_getdomainname	165 -#define __NR_setdomainname	166 - -#define __NR_osf_exportfs	169	/* not implemented */ - -#define __NR_osf_alt_plock	181	/* not implemented */ - -#define __NR_osf_getmnt		184	/* not implemented */ - -#define __NR_osf_alt_sigpending	187	/* not implemented */ -#define __NR_osf_alt_setsid	188	/* not implemented */ - -#define __NR_osf_swapon		199 -#define __NR_msgctl		200 -#define __NR_msgget		201 -#define __NR_msgrcv		202 -#define __NR_msgsnd		203 -#define __NR_semctl		204 -#define __NR_semget		205 -#define __NR_semop		206 -#define __NR_osf_utsname	207 -#define __NR_lchown		208 -#define __NR_osf_shmat		209 -#define __NR_shmctl		210 -#define __NR_shmdt		211 -#define __NR_shmget		212 -#define __NR_osf_mvalid		213	/* not implemented */ -#define __NR_osf_getaddressconf	214	/* not implemented */ -#define __NR_osf_msleep		215	/* not implemented */ -#define __NR_osf_mwakeup	216	/* not implemented */ -#define __NR_msync		217 -#define __NR_osf_signal		218	/* not implemented */ -#define __NR_osf_utc_gettime	219	/* not implemented */ -#define __NR_osf_utc_adjtime	220	/* not implemented */ - -#define __NR_osf_security	222	/* not implemented */ -#define __NR_osf_kloadcall	223	/* not implemented */ - -#define __NR_getpgid		233 -#define __NR_getsid		234 -#define __NR_sigaltstack	235 -#define __NR_osf_waitid		236	/* not implemented */ -#define __NR_osf_priocntlset	237	/* not implemented */ -#define __NR_osf_sigsendset	238	/* not implemented */ -#define __NR_osf_set_speculative	239	/* not implemented */ -#define __NR_osf_msfs_syscall	240	/* not implemented */ -#define __NR_osf_sysinfo	241 -#define __NR_osf_uadmin		242	/* not implemented */ -#define __NR_osf_fuser		243	/* not implemented */ -#define __NR_osf_proplist_syscall    244 -#define __NR_osf_ntp_adjtime	245	/* not implemented */ -#define __NR_osf_ntp_gettime	246	/* not implemented */ -#define __NR_osf_pathconf	247	/* not implemented */ -#define __NR_osf_fpathconf	248	/* not implemented */ - -#define __NR_osf_uswitch	250	/* not implemented */ -#define __NR_osf_usleep_thread	251 -#define __NR_osf_audcntl	252	/* not implemented */ -#define __NR_osf_audgen		253	/* not implemented */ -#define __NR_sysfs		254 -#define __NR_osf_subsys_info	255	/* not implemented */ -#define __NR_osf_getsysinfo	256 -#define __NR_osf_setsysinfo	257 -#define __NR_osf_afs_syscall	258	/* not implemented */ -#define __NR_osf_swapctl	259	/* not implemented */ -#define __NR_osf_memcntl	260	/* not implemented */ -#define __NR_osf_fdatasync	261	/* not implemented */ - -/* - * Ignore legacy syscalls that we don't use. - */ -#define __IGNORE_alarm -#define __IGNORE_creat -#define __IGNORE_getegid -#define __IGNORE_geteuid -#define __IGNORE_getgid -#define __IGNORE_getpid -#define __IGNORE_getppid -#define __IGNORE_getuid -#define __IGNORE_pause -#define __IGNORE_time -#define __IGNORE_utime -#define __IGNORE_umount2 - -/* - * Linux-specific system calls begin at 300 - */ -#define __NR_bdflush		300 -#define __NR_sethae		301 -#define __NR_mount		302 -#define __NR_old_adjtimex	303 -#define __NR_swapoff		304 -#define __NR_getdents		305 -#define __NR_create_module	306 -#define __NR_init_module	307 -#define __NR_delete_module	308 -#define __NR_get_kernel_syms	309 -#define __NR_syslog		310 -#define __NR_reboot		311 -#define __NR_clone		312 -#define __NR_uselib		313 -#define __NR_mlock		314 -#define __NR_munlock		315 -#define __NR_mlockall		316 -#define __NR_munlockall		317 -#define __NR_sysinfo		318 -#define __NR__sysctl		319 -/* 320 was sys_idle.  */ -#define __NR_oldumount		321 -#define __NR_swapon		322 -#define __NR_times		323 -#define __NR_personality	324 -#define __NR_setfsuid		325 -#define __NR_setfsgid		326 -#define __NR_ustat		327 -#define __NR_statfs		328 -#define __NR_fstatfs		329 -#define __NR_sched_setparam		330 -#define __NR_sched_getparam		331 -#define __NR_sched_setscheduler		332 -#define __NR_sched_getscheduler		333 -#define __NR_sched_yield		334 -#define __NR_sched_get_priority_max	335 -#define __NR_sched_get_priority_min	336 -#define __NR_sched_rr_get_interval	337 -#define __NR_afs_syscall		338 -#define __NR_uname			339 -#define __NR_nanosleep			340 -#define __NR_mremap			341 -#define __NR_nfsservctl			342 -#define __NR_setresuid			343 -#define __NR_getresuid			344 -#define __NR_pciconfig_read		345 -#define __NR_pciconfig_write		346 -#define __NR_query_module		347 -#define __NR_prctl			348 -#define __NR_pread64			349 -#define __NR_pwrite64			350 -#define __NR_rt_sigreturn		351 -#define __NR_rt_sigaction		352 -#define __NR_rt_sigprocmask		353 -#define __NR_rt_sigpending		354 -#define __NR_rt_sigtimedwait		355 -#define __NR_rt_sigqueueinfo		356 -#define __NR_rt_sigsuspend		357 -#define __NR_select			358 -#define __NR_gettimeofday		359 -#define __NR_settimeofday		360 -#define __NR_getitimer			361 -#define __NR_setitimer			362 -#define __NR_utimes			363 -#define __NR_getrusage			364 -#define __NR_wait4			365 -#define __NR_adjtimex			366 -#define __NR_getcwd			367 -#define __NR_capget			368 -#define __NR_capset			369 -#define __NR_sendfile			370 -#define __NR_setresgid			371 -#define __NR_getresgid			372 -#define __NR_dipc			373 -#define __NR_pivot_root			374 -#define __NR_mincore			375 -#define __NR_pciconfig_iobase		376 -#define __NR_getdents64			377 -#define __NR_gettid			378 -#define __NR_readahead			379 -/* 380 is unused */ -#define __NR_tkill			381 -#define __NR_setxattr			382 -#define __NR_lsetxattr			383 -#define __NR_fsetxattr			384 -#define __NR_getxattr			385 -#define __NR_lgetxattr			386 -#define __NR_fgetxattr			387 -#define __NR_listxattr			388 -#define __NR_llistxattr			389 -#define __NR_flistxattr			390 -#define __NR_removexattr		391 -#define __NR_lremovexattr		392 -#define __NR_fremovexattr		393 -#define __NR_futex			394 -#define __NR_sched_setaffinity		395      -#define __NR_sched_getaffinity		396 -#define __NR_tuxcall			397 -#define __NR_io_setup			398 -#define __NR_io_destroy			399 -#define __NR_io_getevents		400 -#define __NR_io_submit			401 -#define __NR_io_cancel			402 -#define __NR_exit_group			405 -#define __NR_lookup_dcookie		406 -#define __NR_epoll_create		407 -#define __NR_epoll_ctl			408 -#define __NR_epoll_wait			409 -/* Feb 2007: These three sys_epoll defines shouldn't be here but culling - * them would break userspace apps ... we'll kill them off in 2010 :) */ -#define __NR_sys_epoll_create		__NR_epoll_create -#define __NR_sys_epoll_ctl		__NR_epoll_ctl -#define __NR_sys_epoll_wait		__NR_epoll_wait -#define __NR_remap_file_pages		410 -#define __NR_set_tid_address		411 -#define __NR_restart_syscall		412 -#define __NR_fadvise64			413 -#define __NR_timer_create		414 -#define __NR_timer_settime		415 -#define __NR_timer_gettime		416 -#define __NR_timer_getoverrun		417 -#define __NR_timer_delete		418 -#define __NR_clock_settime		419 -#define __NR_clock_gettime		420 -#define __NR_clock_getres		421 -#define __NR_clock_nanosleep		422 -#define __NR_semtimedop			423 -#define __NR_tgkill			424 -#define __NR_stat64			425 -#define __NR_lstat64			426 -#define __NR_fstat64			427 -#define __NR_vserver			428 -#define __NR_mbind			429 -#define __NR_get_mempolicy		430 -#define __NR_set_mempolicy		431 -#define __NR_mq_open			432 -#define __NR_mq_unlink			433 -#define __NR_mq_timedsend		434 -#define __NR_mq_timedreceive		435 -#define __NR_mq_notify			436 -#define __NR_mq_getsetattr		437 -#define __NR_waitid			438 -#define __NR_add_key			439 -#define __NR_request_key		440 -#define __NR_keyctl			441 -#define __NR_ioprio_set			442 -#define __NR_ioprio_get			443 -#define __NR_inotify_init		444 -#define __NR_inotify_add_watch		445 -#define __NR_inotify_rm_watch		446 -#define __NR_fdatasync			447 -#define __NR_kexec_load			448 -#define __NR_migrate_pages		449 -#define __NR_openat			450 -#define __NR_mkdirat			451 -#define __NR_mknodat			452 -#define __NR_fchownat			453 -#define __NR_futimesat			454 -#define __NR_fstatat64			455 -#define __NR_unlinkat			456 -#define __NR_renameat			457 -#define __NR_linkat			458 -#define __NR_symlinkat			459 -#define __NR_readlinkat			460 -#define __NR_fchmodat			461 -#define __NR_faccessat			462 -#define __NR_pselect6			463 -#define __NR_ppoll			464 -#define __NR_unshare			465 -#define __NR_set_robust_list		466 -#define __NR_get_robust_list		467 -#define __NR_splice			468 -#define __NR_sync_file_range		469 -#define __NR_tee			470 -#define __NR_vmsplice			471 -#define __NR_move_pages			472 -#define __NR_getcpu			473 -#define __NR_epoll_pwait		474 -#define __NR_utimensat			475 -#define __NR_signalfd			476 -#define __NR_timerfd			477 -#define __NR_eventfd			478 -#define __NR_recvmmsg			479 -#define __NR_fallocate			480 -#define __NR_timerfd_create		481 -#define __NR_timerfd_settime		482 -#define __NR_timerfd_gettime		483 -#define __NR_signalfd4			484 -#define __NR_eventfd2			485 -#define __NR_epoll_create1		486 -#define __NR_dup3			487 -#define __NR_pipe2			488 -#define __NR_inotify_init1		489 -#define __NR_preadv			490 -#define __NR_pwritev			491 -#define __NR_rt_tgsigqueueinfo		492 -#define __NR_perf_event_open		493 -#define __NR_fanotify_init		494 -#define __NR_fanotify_mark		495 -#define __NR_prlimit64			496 - -#ifdef __KERNEL__ - -#define NR_SYSCALLS			497 - -#define __ARCH_WANT_IPC_PARSE_VERSION  #define __ARCH_WANT_OLD_READDIR  #define __ARCH_WANT_STAT64  #define __ARCH_WANT_SYS_GETHOSTNAME @@ -466,19 +13,8 @@  #define __ARCH_WANT_SYS_OLD_GETRLIMIT  #define __ARCH_WANT_SYS_OLDUMOUNT  #define __ARCH_WANT_SYS_SIGPENDING -#define __ARCH_WANT_SYS_RT_SIGSUSPEND - -/* "Conditional" syscalls.  What we want is - -	__attribute__((weak,alias("sys_ni_syscall"))) - -   but that raises the problem of what type to give the symbol.  If we use -   a prototype, it'll conflict with the definition given in this file and -   others.  If we use __typeof, we discover that not all symbols actually -   have declarations.  If we use no prototype, then we get warnings from -   -Wstrict-prototypes.  Ho hum.  */ - -#define cond_syscall(x)  asm(".weak\t" #x "\n" #x " = sys_ni_syscall") +#define __ARCH_WANT_SYS_FORK +#define __ARCH_WANT_SYS_VFORK +#define __ARCH_WANT_SYS_CLONE -#endif /* __KERNEL__ */  #endif /* _ALPHA_UNISTD_H */ diff --git a/arch/alpha/include/asm/word-at-a-time.h b/arch/alpha/include/asm/word-at-a-time.h new file mode 100644 index 00000000000..6b340d0f152 --- /dev/null +++ b/arch/alpha/include/asm/word-at-a-time.h @@ -0,0 +1,55 @@ +#ifndef _ASM_WORD_AT_A_TIME_H +#define _ASM_WORD_AT_A_TIME_H + +#include <asm/compiler.h> + +/* + * word-at-a-time interface for Alpha. + */ + +/* + * We do not use the word_at_a_time struct on Alpha, but it needs to be + * implemented to humour the generic code. + */ +struct word_at_a_time { +	const unsigned long unused; +}; + +#define WORD_AT_A_TIME_CONSTANTS { 0 } + +/* Return nonzero if val has a zero */ +static inline unsigned long has_zero(unsigned long val, unsigned long *bits, const struct word_at_a_time *c) +{ +	unsigned long zero_locations = __kernel_cmpbge(0, val); +	*bits = zero_locations; +	return zero_locations; +} + +static inline unsigned long prep_zero_mask(unsigned long val, unsigned long bits, const struct word_at_a_time *c) +{ +	return bits; +} + +#define create_zero_mask(bits) (bits) + +static inline unsigned long find_zero(unsigned long bits) +{ +#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) +	/* Simple if have CIX instructions */ +	return __kernel_cttz(bits); +#else +	unsigned long t1, t2, t3; +	/* Retain lowest set bit only */ +	bits &= -bits; +	/* Binary search for lowest set bit */ +	t1 = bits & 0xf0; +	t2 = bits & 0xcc; +	t3 = bits & 0xaa; +	if (t1) t1 = 4; +	if (t2) t2 = 2; +	if (t3) t3 = 1; +	return t1 + t2 + t3; +#endif +} + +#endif /* _ASM_WORD_AT_A_TIME_H */ diff --git a/arch/alpha/include/asm/xchg.h b/arch/alpha/include/asm/xchg.h index beba1b803e0..0ca9724597c 100644 --- a/arch/alpha/include/asm/xchg.h +++ b/arch/alpha/include/asm/xchg.h @@ -1,10 +1,10 @@ -#ifndef __ALPHA_SYSTEM_H +#ifndef _ALPHA_CMPXCHG_H  #error Do not include xchg.h directly!  #else  /*   * xchg/xchg_local and cmpxchg/cmpxchg_local share the same code   * except that local version do not have the expensive memory barrier. - * So this file is included twice from asm/system.h. + * So this file is included twice from asm/cmpxchg.h.   */  /*  | 
