diff options
Diffstat (limited to 'arch/sparc/include')
103 files changed, 1167 insertions, 1268 deletions
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index 7e4a97fbded..a4582181800 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild @@ -6,12 +6,15 @@ generic-y += cputime.h  generic-y += div64.h  generic-y += emergency-restart.h  generic-y += exec.h -generic-y += linkage.h -generic-y += local64.h -generic-y += mutex.h +generic-y += hash.h  generic-y += irq_regs.h +generic-y += linkage.h  generic-y += local.h +generic-y += local64.h +generic-y += mcs_spinlock.h  generic-y += module.h +generic-y += mutex.h +generic-y += preempt.h  generic-y += serial.h  generic-y += trace_clock.h  generic-y += types.h diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h index 905832aa9e9..7aed2be45b4 100644 --- a/arch/sparc/include/asm/atomic_32.h +++ b/arch/sparc/include/asm/atomic_32.h @@ -14,16 +14,17 @@  #include <linux/types.h>  #include <asm/cmpxchg.h> +#include <asm/barrier.h>  #include <asm-generic/atomic64.h>  #define ATOMIC_INIT(i)  { (i) } -extern int __atomic_add_return(int, atomic_t *); -extern int atomic_cmpxchg(atomic_t *, int, int); +int __atomic_add_return(int, atomic_t *); +int atomic_cmpxchg(atomic_t *, int, int);  #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) -extern int __atomic_add_unless(atomic_t *, int, int); -extern void atomic_set(atomic_t *, int); +int __atomic_add_unless(atomic_t *, int, int); +void atomic_set(atomic_t *, int);  #define atomic_read(v)          (*(volatile int *)&(v)->counter) @@ -52,10 +53,4 @@ extern void atomic_set(atomic_t *, int);  #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)  #define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) -/* Atomic operations are already serializing */ -#define smp_mb__before_atomic_dec()	barrier() -#define smp_mb__after_atomic_dec()	barrier() -#define smp_mb__before_atomic_inc()	barrier() -#define smp_mb__after_atomic_inc()	barrier() -  #endif /* !(__ARCH_SPARC_ATOMIC__) */ diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h index be56a244c9c..bb894c8bec5 100644 --- a/arch/sparc/include/asm/atomic_64.h +++ b/arch/sparc/include/asm/atomic_64.h @@ -9,6 +9,7 @@  #include <linux/types.h>  #include <asm/cmpxchg.h> +#include <asm/barrier.h>  #define ATOMIC_INIT(i)		{ (i) }  #define ATOMIC64_INIT(i)	{ (i) } @@ -19,15 +20,15 @@  #define atomic_set(v, i)	(((v)->counter) = i)  #define atomic64_set(v, i)	(((v)->counter) = i) -extern void atomic_add(int, atomic_t *); -extern void atomic64_add(long, atomic64_t *); -extern void atomic_sub(int, atomic_t *); -extern void atomic64_sub(long, atomic64_t *); +void atomic_add(int, atomic_t *); +void atomic64_add(long, atomic64_t *); +void atomic_sub(int, atomic_t *); +void atomic64_sub(long, atomic64_t *); -extern int atomic_add_ret(int, atomic_t *); -extern long atomic64_add_ret(long, atomic64_t *); -extern int atomic_sub_ret(int, atomic_t *); -extern long atomic64_sub_ret(long, atomic64_t *); +int atomic_add_ret(int, atomic_t *); +long atomic64_add_ret(long, atomic64_t *); +int atomic_sub_ret(int, atomic_t *); +long atomic64_sub_ret(long, atomic64_t *);  #define atomic_dec_return(v) atomic_sub_ret(1, v)  #define atomic64_dec_return(v) atomic64_sub_ret(1, v) @@ -106,12 +107,6 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u)  #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) -extern long atomic64_dec_if_positive(atomic64_t *v); - -/* Atomic operations are already serializing */ -#define smp_mb__before_atomic_dec()	barrier() -#define smp_mb__after_atomic_dec()	barrier() -#define smp_mb__before_atomic_inc()	barrier() -#define smp_mb__after_atomic_inc()	barrier() +long atomic64_dec_if_positive(atomic64_t *v);  #endif /* !(__ARCH_SPARC64_ATOMIC__) */ diff --git a/arch/sparc/include/asm/auxio.h b/arch/sparc/include/asm/auxio.h index 13dc67f0301..3e09a07b77e 100644 --- a/arch/sparc/include/asm/auxio.h +++ b/arch/sparc/include/asm/auxio.h @@ -1,5 +1,12 @@  #ifndef ___ASM_SPARC_AUXIO_H  #define ___ASM_SPARC_AUXIO_H + +#ifndef __ASSEMBLY__ + +extern void __iomem *auxio_register; + +#endif /* ifndef __ASSEMBLY__ */ +  #if defined(__sparc__) && defined(__arch64__)  #include <asm/auxio_64.h>  #else diff --git a/arch/sparc/include/asm/auxio_32.h b/arch/sparc/include/asm/auxio_32.h index 3a319775ae3..5d685df427b 100644 --- a/arch/sparc/include/asm/auxio_32.h +++ b/arch/sparc/include/asm/auxio_32.h @@ -34,8 +34,8 @@   * NOTE: these routines are implementation dependent--   * understand the hardware you are querying!   */ -extern void set_auxio(unsigned char bits_on, unsigned char bits_off); -extern unsigned char get_auxio(void); /* .../asm/floppy.h */ +void set_auxio(unsigned char bits_on, unsigned char bits_off); +unsigned char get_auxio(void); /* .../asm/floppy.h */  /*   * The following routines are provided for driver-compatibility @@ -78,7 +78,7 @@ do { \  /* AUXIO2 (Power Off Control) */ -extern __volatile__ unsigned char * auxio_power_register; +extern volatile u8 __iomem *auxio_power_register;  #define	AUXIO_POWER_DETECT_FAILURE	32  #define	AUXIO_POWER_CLEAR_FAILURE	2 diff --git a/arch/sparc/include/asm/auxio_64.h b/arch/sparc/include/asm/auxio_64.h index f61cd1e3e39..6079e59a7ad 100644 --- a/arch/sparc/include/asm/auxio_64.h +++ b/arch/sparc/include/asm/auxio_64.h @@ -75,8 +75,6 @@  #ifndef __ASSEMBLY__ -extern void __iomem *auxio_register; -  #define AUXIO_LTE_ON	1  #define AUXIO_LTE_OFF	0 @@ -84,7 +82,7 @@ extern void __iomem *auxio_register;   *   * on - AUXIO_LTE_ON or AUXIO_LTE_OFF   */ -extern void auxio_set_lte(int on); +void auxio_set_lte(int on);  #define AUXIO_LED_ON	1  #define AUXIO_LED_OFF	0 @@ -93,7 +91,7 @@ extern void auxio_set_lte(int on);   *   * on - AUXIO_LED_ON or AUXIO_LED_OFF   */ -extern void auxio_set_led(int on); +void auxio_set_led(int on);  #endif /* ifndef __ASSEMBLY__ */ diff --git a/arch/sparc/include/asm/barrier_32.h b/arch/sparc/include/asm/barrier_32.h index c1b76654ee7..ae69eda288f 100644 --- a/arch/sparc/include/asm/barrier_32.h +++ b/arch/sparc/include/asm/barrier_32.h @@ -1,15 +1,7 @@  #ifndef __SPARC_BARRIER_H  #define __SPARC_BARRIER_H -/* XXX Change this if we ever use a PSO mode kernel. */ -#define mb()	__asm__ __volatile__ ("" : : : "memory") -#define rmb()	mb() -#define wmb()	mb() -#define read_barrier_depends()	do { } while(0) -#define set_mb(__var, __value)  do { __var = __value; mb(); } while(0) -#define smp_mb()	__asm__ __volatile__("":::"memory") -#define smp_rmb()	__asm__ __volatile__("":::"memory") -#define smp_wmb()	__asm__ __volatile__("":::"memory") -#define smp_read_barrier_depends()	do { } while(0) +#include <asm/processor.h> /* for nop() */ +#include <asm-generic/barrier.h>  #endif /* !(__SPARC_BARRIER_H) */ diff --git a/arch/sparc/include/asm/barrier_64.h b/arch/sparc/include/asm/barrier_64.h index 95d45986f90..305dcc3dc72 100644 --- a/arch/sparc/include/asm/barrier_64.h +++ b/arch/sparc/include/asm/barrier_64.h @@ -53,4 +53,22 @@ do {	__asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" \  #define smp_read_barrier_depends()	do { } while(0) +#define smp_store_release(p, v)						\ +do {									\ +	compiletime_assert_atomic_type(*p);				\ +	barrier();							\ +	ACCESS_ONCE(*p) = (v);						\ +} while (0) + +#define smp_load_acquire(p)						\ +({									\ +	typeof(*p) ___p1 = ACCESS_ONCE(*p);				\ +	compiletime_assert_atomic_type(*p);				\ +	barrier();							\ +	___p1;								\ +}) + +#define smp_mb__before_atomic()	barrier() +#define smp_mb__after_atomic()	barrier() +  #endif /* !(__SPARC64_BARRIER_H) */ diff --git a/arch/sparc/include/asm/bitext.h b/arch/sparc/include/asm/bitext.h index 297b2f2fcb4..9c988bf3adb 100644 --- a/arch/sparc/include/asm/bitext.h +++ b/arch/sparc/include/asm/bitext.h @@ -20,8 +20,8 @@ struct bit_map {  	int num_colors;  }; -extern int bit_map_string_get(struct bit_map *t, int len, int align); -extern void bit_map_clear(struct bit_map *t, int offset, int len); -extern void bit_map_init(struct bit_map *t, unsigned long *map, int size); +int bit_map_string_get(struct bit_map *t, int len, int align); +void bit_map_clear(struct bit_map *t, int offset, int len); +void bit_map_init(struct bit_map *t, unsigned long *map, int size);  #endif /* defined(_SPARC_BITEXT_H) */ diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h index 25a676653d4..600ed1d9c8c 100644 --- a/arch/sparc/include/asm/bitops_32.h +++ b/arch/sparc/include/asm/bitops_32.h @@ -18,9 +18,9 @@  #error only <linux/bitops.h> can be included directly  #endif -extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask); -extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); -extern unsigned long ___change_bit(unsigned long *addr, unsigned long mask); +unsigned long ___set_bit(unsigned long *addr, unsigned long mask); +unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); +unsigned long ___change_bit(unsigned long *addr, unsigned long mask);  /*   * Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0' @@ -90,9 +90,6 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)  #include <asm-generic/bitops/non-atomic.h> -#define smp_mb__before_clear_bit()	do { } while(0) -#define smp_mb__after_clear_bit()	do { } while(0) -  #include <asm-generic/bitops/ffz.h>  #include <asm-generic/bitops/__ffs.h>  #include <asm-generic/bitops/sched.h> diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h index 29011cc0e4b..2d522402a93 100644 --- a/arch/sparc/include/asm/bitops_64.h +++ b/arch/sparc/include/asm/bitops_64.h @@ -13,27 +13,25 @@  #include <linux/compiler.h>  #include <asm/byteorder.h> +#include <asm/barrier.h> -extern int test_and_set_bit(unsigned long nr, volatile unsigned long *addr); -extern int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr); -extern int test_and_change_bit(unsigned long nr, volatile unsigned long *addr); -extern void set_bit(unsigned long nr, volatile unsigned long *addr); -extern void clear_bit(unsigned long nr, volatile unsigned long *addr); -extern void change_bit(unsigned long nr, volatile unsigned long *addr); +int test_and_set_bit(unsigned long nr, volatile unsigned long *addr); +int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr); +int test_and_change_bit(unsigned long nr, volatile unsigned long *addr); +void set_bit(unsigned long nr, volatile unsigned long *addr); +void clear_bit(unsigned long nr, volatile unsigned long *addr); +void change_bit(unsigned long nr, volatile unsigned long *addr);  #include <asm-generic/bitops/non-atomic.h> -#define smp_mb__before_clear_bit()	barrier() -#define smp_mb__after_clear_bit()	barrier() -  #include <asm-generic/bitops/fls.h>  #include <asm-generic/bitops/__fls.h>  #include <asm-generic/bitops/fls64.h>  #ifdef __KERNEL__ -extern int ffs(int x); -extern unsigned long __ffs(unsigned long); +int ffs(int x); +unsigned long __ffs(unsigned long);  #include <asm-generic/bitops/ffz.h>  #include <asm-generic/bitops/sched.h> @@ -43,10 +41,10 @@ extern unsigned long __ffs(unsigned long);   * of bits set) of a N-bit word   */ -extern unsigned long __arch_hweight64(__u64 w); -extern unsigned int __arch_hweight32(unsigned int w); -extern unsigned int __arch_hweight16(unsigned int w); -extern unsigned int __arch_hweight8(unsigned int w); +unsigned long __arch_hweight64(__u64 w); +unsigned int __arch_hweight32(unsigned int w); +unsigned int __arch_hweight16(unsigned int w); +unsigned int __arch_hweight8(unsigned int w);  #include <asm-generic/bitops/const_hweight.h>  #include <asm-generic/bitops/lock.h> diff --git a/arch/sparc/include/asm/btext.h b/arch/sparc/include/asm/btext.h index 9b2bc6b6ed0..75a32b109e1 100644 --- a/arch/sparc/include/asm/btext.h +++ b/arch/sparc/include/asm/btext.h @@ -1,6 +1,6 @@  #ifndef _SPARC_BTEXT_H  #define _SPARC_BTEXT_H -extern int btext_find_display(void); +int btext_find_display(void);  #endif /* _SPARC_BTEXT_H */ diff --git a/arch/sparc/include/asm/bug.h b/arch/sparc/include/asm/bug.h index 6bd9f43cb5a..eaa8f8d3812 100644 --- a/arch/sparc/include/asm/bug.h +++ b/arch/sparc/include/asm/bug.h @@ -5,7 +5,7 @@  #include <linux/compiler.h>  #ifdef CONFIG_DEBUG_BUGVERBOSE -extern void do_BUG(const char *file, int line); +void do_BUG(const char *file, int line);  #define BUG() do {					\  	do_BUG(__FILE__, __LINE__);			\  	__builtin_trap();				\ @@ -20,6 +20,6 @@ extern void do_BUG(const char *file, int line);  #include <asm-generic/bug.h>  struct pt_regs; -extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn)); +void __noreturn die_if_kernel(char *str, struct pt_regs *regs);  #endif diff --git a/arch/sparc/include/asm/cacheflush_32.h b/arch/sparc/include/asm/cacheflush_32.h index bb014c24f31..12164006181 100644 --- a/arch/sparc/include/asm/cacheflush_32.h +++ b/arch/sparc/include/asm/cacheflush_32.h @@ -36,7 +36,7 @@  #define flush_page_for_dma(addr) \  	sparc32_cachetlb_ops->page_for_dma(addr) -extern void sparc_flush_page_to_ram(struct page *page); +void sparc_flush_page_to_ram(struct page *page);  #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1  #define flush_dcache_page(page)			sparc_flush_page_to_ram(page) @@ -51,8 +51,8 @@ extern void sparc_flush_page_to_ram(struct page *page);   * way the windows are all clean for the next process and the stack   * frames are up to date.   */ -extern void flush_user_windows(void); -extern void kill_user_windows(void); -extern void flushw_all(void); +void flush_user_windows(void); +void kill_user_windows(void); +void flushw_all(void);  #endif /* _SPARC_CACHEFLUSH_H */ diff --git a/arch/sparc/include/asm/cacheflush_64.h b/arch/sparc/include/asm/cacheflush_64.h index 301736d9e7a..38965379e35 100644 --- a/arch/sparc/include/asm/cacheflush_64.h +++ b/arch/sparc/include/asm/cacheflush_64.h @@ -10,7 +10,7 @@  /* Cache flush operations. */  #define flushw_all()	__asm__ __volatile__("flushw") -extern void __flushw_user(void); +void __flushw_user(void);  #define flushw_user() __flushw_user()  #define flush_user_windows flushw_user @@ -30,29 +30,29 @@ extern void __flushw_user(void);   * use block commit stores (which invalidate icache lines) during   * module load, so we need this.   */ -extern void flush_icache_range(unsigned long start, unsigned long end); -extern void __flush_icache_page(unsigned long); +void flush_icache_range(unsigned long start, unsigned long end); +void __flush_icache_page(unsigned long); -extern void __flush_dcache_page(void *addr, int flush_icache); -extern void flush_dcache_page_impl(struct page *page); +void __flush_dcache_page(void *addr, int flush_icache); +void flush_dcache_page_impl(struct page *page);  #ifdef CONFIG_SMP -extern void smp_flush_dcache_page_impl(struct page *page, int cpu); -extern void flush_dcache_page_all(struct mm_struct *mm, struct page *page); +void smp_flush_dcache_page_impl(struct page *page, int cpu); +void flush_dcache_page_all(struct mm_struct *mm, struct page *page);  #else  #define smp_flush_dcache_page_impl(page,cpu) flush_dcache_page_impl(page)  #define flush_dcache_page_all(mm,page) flush_dcache_page_impl(page)  #endif -extern void __flush_dcache_range(unsigned long start, unsigned long end); +void __flush_dcache_range(unsigned long start, unsigned long end);  #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 -extern void flush_dcache_page(struct page *page); +void flush_dcache_page(struct page *page);  #define flush_icache_page(vma, pg)	do { } while(0)  #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0) -extern void flush_ptrace_access(struct vm_area_struct *, struct page *, -				unsigned long uaddr, void *kaddr, -				unsigned long len, int write); +void flush_ptrace_access(struct vm_area_struct *, struct page *, +			 unsigned long uaddr, void *kaddr, +			 unsigned long len, int write);  #define copy_to_user_page(vma, page, vaddr, dst, src, len)		\  	do {								\ diff --git a/arch/sparc/include/asm/checksum_32.h b/arch/sparc/include/asm/checksum_32.h index bdbda1453aa..426b2389a1c 100644 --- a/arch/sparc/include/asm/checksum_32.h +++ b/arch/sparc/include/asm/checksum_32.h @@ -29,7 +29,7 @@   *   * it's best to have buff aligned on a 32-bit boundary   */ -extern __wsum csum_partial(const void *buff, int len, __wsum sum); +__wsum csum_partial(const void *buff, int len, __wsum sum);  /* the same as csum_partial, but copies from fs:src while it   * checksums @@ -38,7 +38,7 @@ extern __wsum csum_partial(const void *buff, int len, __wsum sum);   * better 64-bit) boundary   */ -extern unsigned int __csum_partial_copy_sparc_generic (const unsigned char *, unsigned char *); +unsigned int __csum_partial_copy_sparc_generic (const unsigned char *, unsigned char *);  static inline __wsum  csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) @@ -238,4 +238,16 @@ static inline __sum16 ip_compute_csum(const void *buff, int len)  	return csum_fold(csum_partial(buff, len, 0));  } +#define HAVE_ARCH_CSUM_ADD +static inline __wsum csum_add(__wsum csum, __wsum addend) +{ +	__asm__ __volatile__( +		"addcc   %0, %1, %0\n" +		"addx    %0, %%g0, %0" +		: "=r" (csum) +		: "r" (addend), "0" (csum)); + +	return csum; +} +  #endif /* !(__SPARC_CHECKSUM_H) */ diff --git a/arch/sparc/include/asm/checksum_64.h b/arch/sparc/include/asm/checksum_64.h index 019b9615e43..b8779a6a591 100644 --- a/arch/sparc/include/asm/checksum_64.h +++ b/arch/sparc/include/asm/checksum_64.h @@ -29,7 +29,7 @@   *   * it's best to have buff aligned on a 32-bit boundary   */ -extern __wsum csum_partial(const void * buff, int len, __wsum sum); +__wsum csum_partial(const void * buff, int len, __wsum sum);  /* the same as csum_partial, but copies from user space while it   * checksums @@ -37,12 +37,12 @@ extern __wsum csum_partial(const void * buff, int len, __wsum sum);   * here even more important to align src and dst on a 32-bit (or even   * better 64-bit) boundary   */ -extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, -					      int len, __wsum sum); +__wsum csum_partial_copy_nocheck(const void *src, void *dst, +				 int len, __wsum sum); -extern long __csum_partial_copy_from_user(const void __user *src, -					  void *dst, int len, -					  __wsum sum); +long __csum_partial_copy_from_user(const void __user *src, +				   void *dst, int len, +				   __wsum sum);  static inline __wsum  csum_partial_copy_from_user(const void __user *src, @@ -59,9 +59,9 @@ csum_partial_copy_from_user(const void __user *src,   *	Copy and checksum to user   */  #define HAVE_CSUM_COPY_USER -extern long __csum_partial_copy_to_user(const void *src, -					void __user *dst, int len, -					  __wsum sum); +long __csum_partial_copy_to_user(const void *src, +				 void __user *dst, int len, +				 __wsum sum);  static inline __wsum  csum_and_copy_to_user(const void *src, @@ -77,7 +77,7 @@ csum_and_copy_to_user(const void *src,  /* ihl is always 5 or greater, almost always is 5, and iph is word aligned   * the majority of the time.   */ -extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); +__sum16 ip_fast_csum(const void *iph, unsigned int ihl);  /* Fold a partial checksum without adding pseudo headers. */  static inline __sum16 csum_fold(__wsum sum) @@ -96,9 +96,9 @@ static inline __sum16 csum_fold(__wsum sum)  }  static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, -					       unsigned int len, -					       unsigned short proto, -					       __wsum sum) +					unsigned int len, +					unsigned short proto, +					__wsum sum)  {  	__asm__ __volatile__(  "	addcc		%1, %0, %0\n" @@ -116,9 +116,9 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,   * returns a 16-bit checksum, already complemented   */  static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, -						   unsigned short len, -						   unsigned short proto, -						   __wsum sum) +					unsigned short len, +					unsigned short proto, +					__wsum sum)  {  	return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));  } @@ -164,4 +164,16 @@ static inline __sum16 ip_compute_csum(const void *buff, int len)  	return csum_fold(csum_partial(buff, len, 0));  } +#define HAVE_ARCH_CSUM_ADD +static inline __wsum csum_add(__wsum csum, __wsum addend) +{ +	__asm__ __volatile__( +		"addcc   %0, %1, %0\n" +		"addx    %0, %%g0, %0" +		: "=r" (csum) +		: "r" (addend), "0" (csum)); + +	return csum; +} +  #endif /* !(__SPARC64_CHECKSUM_H) */ diff --git a/arch/sparc/include/asm/cmpxchg_32.h b/arch/sparc/include/asm/cmpxchg_32.h index 1fae1a02e3c..32c29a133f9 100644 --- a/arch/sparc/include/asm/cmpxchg_32.h +++ b/arch/sparc/include/asm/cmpxchg_32.h @@ -20,7 +20,7 @@ static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned lon  	return val;  } -extern void __xchg_called_with_bad_pointer(void); +void __xchg_called_with_bad_pointer(void);  static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size)  { @@ -45,9 +45,9 @@ static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int  #define __HAVE_ARCH_CMPXCHG	1  /* bug catcher for when unsupported size is used - won't link */ -extern void __cmpxchg_called_with_bad_pointer(void); +void __cmpxchg_called_with_bad_pointer(void);  /* we only need to support cmpxchg of a u32 on sparc */ -extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); +unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);  /* don't worry...optimizer will get rid of most of this */  static inline unsigned long diff --git a/arch/sparc/include/asm/cmpxchg_64.h b/arch/sparc/include/asm/cmpxchg_64.h index 4adefe8e288..0e1ed6cfbf6 100644 --- a/arch/sparc/include/asm/cmpxchg_64.h +++ b/arch/sparc/include/asm/cmpxchg_64.h @@ -42,7 +42,7 @@ static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long  #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -extern void __xchg_called_with_bad_pointer(void); +void __xchg_called_with_bad_pointer(void);  static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,  				       int size) @@ -91,7 +91,7 @@ __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)  /* This function doesn't exist, so you'll get a linker error     if something tries to do an invalid cmpxchg().  */ -extern void __cmpxchg_called_with_bad_pointer(void); +void __cmpxchg_called_with_bad_pointer(void);  static inline unsigned long  __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) diff --git a/arch/sparc/include/asm/cpudata.h b/arch/sparc/include/asm/cpudata.h index b5976de7cac..128b56b0867 100644 --- a/arch/sparc/include/asm/cpudata.h +++ b/arch/sparc/include/asm/cpudata.h @@ -1,5 +1,15 @@  #ifndef ___ASM_SPARC_CPUDATA_H  #define ___ASM_SPARC_CPUDATA_H + +#ifndef __ASSEMBLY__ + +#include <linux/threads.h> +#include <linux/percpu.h> + +extern const struct seq_operations cpuinfo_op; + +#endif /* !(__ASSEMBLY__) */ +  #if defined(__sparc__) && defined(__arch64__)  #include <asm/cpudata_64.h>  #else diff --git a/arch/sparc/include/asm/cpudata_64.h b/arch/sparc/include/asm/cpudata_64.h index 050ef35b9dc..0e594076912 100644 --- a/arch/sparc/include/asm/cpudata_64.h +++ b/arch/sparc/include/asm/cpudata_64.h @@ -8,9 +8,6 @@  #ifndef __ASSEMBLY__ -#include <linux/percpu.h> -#include <linux/threads.h> -  typedef struct {  	/* Dcache line 1 */  	unsigned int	__softirq_pending; /* must be 1st, see rtrap.S */ @@ -35,8 +32,6 @@ DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);  #define cpu_data(__cpu)		per_cpu(__cpu_data, (__cpu))  #define local_cpu_data()	__get_cpu_var(__cpu_data) -extern const struct seq_operations cpuinfo_op; -  #endif /* !(__ASSEMBLY__) */  #include <asm/trap_block.h> diff --git a/arch/sparc/include/asm/delay_32.h b/arch/sparc/include/asm/delay_32.h index bc9aba2bead..3fb8ca144b4 100644 --- a/arch/sparc/include/asm/delay_32.h +++ b/arch/sparc/include/asm/delay_32.h @@ -20,8 +20,8 @@ static inline void __delay(unsigned long loops)  }  /* This is too messy with inline asm on the Sparc. */ -extern void __udelay(unsigned long usecs, unsigned long lpj); -extern void __ndelay(unsigned long nsecs, unsigned long lpj); +void __udelay(unsigned long usecs, unsigned long lpj); +void __ndelay(unsigned long nsecs, unsigned long lpj);  #ifdef CONFIG_SMP  #define __udelay_val	cpu_data(smp_processor_id()).udelay_val diff --git a/arch/sparc/include/asm/delay_64.h b/arch/sparc/include/asm/delay_64.h index a77aa622d76..0ba5424856d 100644 --- a/arch/sparc/include/asm/delay_64.h +++ b/arch/sparc/include/asm/delay_64.h @@ -8,8 +8,8 @@  #ifndef __ASSEMBLY__ -extern void __delay(unsigned long loops); -extern void udelay(unsigned long usecs); +void __delay(unsigned long loops); +void udelay(unsigned long usecs);  #define mdelay(n)	udelay((n) * 1000)  #endif /* !__ASSEMBLY__ */ diff --git a/arch/sparc/include/asm/device.h b/arch/sparc/include/asm/device.h index daa6a8a5e9c..bb3f0b0c675 100644 --- a/arch/sparc/include/asm/device.h +++ b/arch/sparc/include/asm/device.h @@ -19,7 +19,7 @@ struct dev_archdata {  	int			numa_node;  }; -extern void of_propagate_archdata(struct platform_device *bus); +void of_propagate_archdata(struct platform_device *bus);  struct pdev_archdata {  	struct resource		resource[PROMREG_MAX]; diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 05fe53f5346..1ee02710b2d 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h @@ -7,7 +7,7 @@  #define DMA_ERROR_CODE	(~(dma_addr_t)0x0) -extern int dma_supported(struct device *dev, u64 mask); +int dma_supported(struct device *dev, u64 mask);  #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)  #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) diff --git a/arch/sparc/include/asm/ebus_dma.h b/arch/sparc/include/asm/ebus_dma.h index f07a5b541c9..fcfb4948147 100644 --- a/arch/sparc/include/asm/ebus_dma.h +++ b/arch/sparc/include/asm/ebus_dma.h @@ -22,14 +22,14 @@ struct ebus_dma_info {  	unsigned char	name[64];  }; -extern int ebus_dma_register(struct ebus_dma_info *p); -extern int ebus_dma_irq_enable(struct ebus_dma_info *p, int on); -extern void ebus_dma_unregister(struct ebus_dma_info *p); -extern int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr, +int ebus_dma_register(struct ebus_dma_info *p); +int ebus_dma_irq_enable(struct ebus_dma_info *p, int on); +void ebus_dma_unregister(struct ebus_dma_info *p); +int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr,  			    size_t len); -extern void ebus_dma_prepare(struct ebus_dma_info *p, int write); -extern unsigned int ebus_dma_residue(struct ebus_dma_info *p); -extern unsigned int ebus_dma_addr(struct ebus_dma_info *p); -extern void ebus_dma_enable(struct ebus_dma_info *p, int on); +void ebus_dma_prepare(struct ebus_dma_info *p, int write); +unsigned int ebus_dma_residue(struct ebus_dma_info *p); +unsigned int ebus_dma_addr(struct ebus_dma_info *p); +void ebus_dma_enable(struct ebus_dma_info *p, int on);  #endif /* __ASM_SPARC_EBUS_DMA_H */ diff --git a/arch/sparc/include/asm/floppy_32.h b/arch/sparc/include/asm/floppy_32.h index fb3f16954c6..071b83e52f1 100644 --- a/arch/sparc/include/asm/floppy_32.h +++ b/arch/sparc/include/asm/floppy_32.h @@ -9,11 +9,12 @@  #include <linux/of.h>  #include <linux/of_device.h> -#include <asm/page.h>  #include <asm/pgtable.h>  #include <asm/idprom.h>  #include <asm/oplib.h>  #include <asm/auxio.h> +#include <asm/setup.h> +#include <asm/page.h>  #include <asm/irq.h>  /* We don't need no stinkin' I/O port allocation crap. */ @@ -49,7 +50,6 @@ struct sun_flpy_controller {  /* You'll only ever find one controller on a SparcStation anyways. */  static struct sun_flpy_controller *sun_fdc = NULL; -extern volatile unsigned char *fdc_status;  struct sun_floppy_ops {  	unsigned char (*fd_inb)(int port); @@ -212,13 +212,6 @@ static void sun_82077_fd_outb(unsigned char value, int port)   * underruns.  If non-zero, doing_pdma encodes the direction of   * the transfer for debugging.  1=read 2=write   */ -extern char *pdma_vaddr; -extern unsigned long pdma_size; -extern volatile int doing_pdma; - -/* This is software state */ -extern char *pdma_base; -extern unsigned long pdma_areasize;  /* Common routines to all controller types on the Sparc. */  static inline void virtual_dma_init(void) @@ -263,8 +256,7 @@ static inline void sun_fd_enable_dma(void)  	pdma_areasize = pdma_size;  } -extern int sparc_floppy_request_irq(unsigned int irq, -                                    irq_handler_t irq_handler); +int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler);  static int sun_fd_request_irq(void)  { diff --git a/arch/sparc/include/asm/floppy_64.h b/arch/sparc/include/asm/floppy_64.h index e204f902e6c..625756406a7 100644 --- a/arch/sparc/include/asm/floppy_64.h +++ b/arch/sparc/include/asm/floppy_64.h @@ -254,7 +254,7 @@ static int sun_fd_request_irq(void)  		once = 1;  		error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, -				    IRQF_DISABLED, "floppy", NULL); +				    0, "floppy", NULL);  		return ((error == 0) ? 0 : -1);  	} @@ -296,7 +296,7 @@ struct sun_pci_dma_op {  static struct sun_pci_dma_op sun_pci_dma_current = { -1U, 0, 0, NULL};  static struct sun_pci_dma_op sun_pci_dma_pending = { -1U, 0, 0, NULL}; -extern irqreturn_t floppy_interrupt(int irq, void *dev_id); +irqreturn_t floppy_interrupt(int irq, void *dev_id);  static unsigned char sun_pci_fd_inb(unsigned long port)  { diff --git a/arch/sparc/include/asm/ftrace.h b/arch/sparc/include/asm/ftrace.h index b0f18e9893d..9ec94ad116f 100644 --- a/arch/sparc/include/asm/ftrace.h +++ b/arch/sparc/include/asm/ftrace.h @@ -6,7 +6,7 @@  #define MCOUNT_INSN_SIZE	4 /* sizeof mcount call */  #ifndef __ASSEMBLY__ -extern void _mcount(void); +void _mcount(void);  #endif  #endif @@ -22,4 +22,8 @@ struct dyn_arch_ftrace {  };  #endif /*  CONFIG_DYNAMIC_FTRACE */ +unsigned long prepare_ftrace_return(unsigned long parent, +				    unsigned long self_addr, +				    unsigned long frame_pointer); +  #endif /* _ASM_SPARC64_FTRACE */ diff --git a/arch/sparc/include/asm/hardirq_32.h b/arch/sparc/include/asm/hardirq_32.h index 162007643cd..ee93923b7f8 100644 --- a/arch/sparc/include/asm/hardirq_32.h +++ b/arch/sparc/include/asm/hardirq_32.h @@ -7,7 +7,6 @@  #ifndef __SPARC_HARDIRQ_H  #define __SPARC_HARDIRQ_H -#define HARDIRQ_BITS    8  #include <asm-generic/hardirq.h>  #endif /* __SPARC_HARDIRQ_H */ diff --git a/arch/sparc/include/asm/hardirq_64.h b/arch/sparc/include/asm/hardirq_64.h index 7c29fd1a87a..f478ff1ddd0 100644 --- a/arch/sparc/include/asm/hardirq_64.h +++ b/arch/sparc/include/asm/hardirq_64.h @@ -14,6 +14,4 @@  void ack_bad_irq(unsigned int irq); -#define HARDIRQ_BITS	8 -  #endif /* !(__SPARC64_HARDIRQ_H) */ diff --git a/arch/sparc/include/asm/highmem.h b/arch/sparc/include/asm/highmem.h index 4f9e15c757e..92ded294a4e 100644 --- a/arch/sparc/include/asm/highmem.h +++ b/arch/sparc/include/asm/highmem.h @@ -31,7 +31,7 @@ extern unsigned long highstart_pfn, highend_pfn;  extern pgprot_t kmap_prot;  extern pte_t *pkmap_page_table; -extern void kmap_init(void) __init; +void kmap_init(void) __init;  /*   * Right now we initialize only a single pte table. It can be extended @@ -49,8 +49,8 @@ extern void kmap_init(void) __init;  #define PKMAP_END (PKMAP_ADDR(LAST_PKMAP)) -extern void *kmap_high(struct page *page); -extern void kunmap_high(struct page *page); +void *kmap_high(struct page *page); +void kunmap_high(struct page *page);  static inline void *kmap(struct page *page)  { @@ -68,8 +68,8 @@ static inline void kunmap(struct page *page)  	kunmap_high(page);  } -extern void *kmap_atomic(struct page *page); -extern void __kunmap_atomic(void *kvaddr); +void *kmap_atomic(struct page *page); +void __kunmap_atomic(void *kvaddr);  #define flush_cache_kmaps()	flush_cache_all() diff --git a/arch/sparc/include/asm/hvtramp.h b/arch/sparc/include/asm/hvtramp.h index b2b9b947b3a..04b56f862bb 100644 --- a/arch/sparc/include/asm/hvtramp.h +++ b/arch/sparc/include/asm/hvtramp.h @@ -19,7 +19,7 @@ struct hvtramp_descr {  	struct hvtramp_mapping	maps[1];  }; -extern void hv_cpu_startup(unsigned long hvdescr_pa); +void hv_cpu_startup(unsigned long hvdescr_pa);  #endif diff --git a/arch/sparc/include/asm/hypervisor.h b/arch/sparc/include/asm/hypervisor.h index ca121f0fa3e..94b39caea3e 100644 --- a/arch/sparc/include/asm/hypervisor.h +++ b/arch/sparc/include/asm/hypervisor.h @@ -98,7 +98,7 @@  #define HV_FAST_MACH_EXIT		0x00  #ifndef __ASSEMBLY__ -extern void sun4v_mach_exit(unsigned long exit_code); +void sun4v_mach_exit(unsigned long exit_code);  #endif  /* Domain services.  */ @@ -127,9 +127,9 @@ extern void sun4v_mach_exit(unsigned long exit_code);  #define HV_FAST_MACH_DESC		0x01  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_mach_desc(unsigned long buffer_pa, -				     unsigned long buf_len, -				     unsigned long *real_buf_len); +unsigned long sun4v_mach_desc(unsigned long buffer_pa, +			      unsigned long buf_len, +			      unsigned long *real_buf_len);  #endif  /* mach_sir() @@ -148,7 +148,7 @@ extern unsigned long sun4v_mach_desc(unsigned long buffer_pa,  #define HV_FAST_MACH_SIR		0x02  #ifndef __ASSEMBLY__ -extern void sun4v_mach_sir(void); +void sun4v_mach_sir(void);  #endif  /* mach_set_watchdog() @@ -204,8 +204,8 @@ extern void sun4v_mach_sir(void);  #define HV_FAST_MACH_SET_WATCHDOG	0x05  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_mach_set_watchdog(unsigned long timeout, -					     unsigned long *orig_timeout); +unsigned long sun4v_mach_set_watchdog(unsigned long timeout, +				      unsigned long *orig_timeout);  #endif  /* CPU services. @@ -250,10 +250,10 @@ extern unsigned long sun4v_mach_set_watchdog(unsigned long timeout,  #define HV_FAST_CPU_START		0x10  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_cpu_start(unsigned long cpuid, -				     unsigned long pc, -				     unsigned long rtba, -				     unsigned long arg0); +unsigned long sun4v_cpu_start(unsigned long cpuid, +			      unsigned long pc, +			      unsigned long rtba, +			      unsigned long arg0);  #endif  /* cpu_stop() @@ -278,7 +278,7 @@ extern unsigned long sun4v_cpu_start(unsigned long cpuid,  #define HV_FAST_CPU_STOP		0x11  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_cpu_stop(unsigned long cpuid); +unsigned long sun4v_cpu_stop(unsigned long cpuid);  #endif  /* cpu_yield() @@ -295,7 +295,7 @@ extern unsigned long sun4v_cpu_stop(unsigned long cpuid);  #define HV_FAST_CPU_YIELD		0x12  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_cpu_yield(void); +unsigned long sun4v_cpu_yield(void);  #endif  /* cpu_qconf() @@ -341,9 +341,9 @@ extern unsigned long sun4v_cpu_yield(void);  #define  HV_CPU_QUEUE_NONRES_ERROR	 0x3f  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_cpu_qconf(unsigned long type, -				     unsigned long queue_paddr, -				     unsigned long num_queue_entries); +unsigned long sun4v_cpu_qconf(unsigned long type, +			      unsigned long queue_paddr, +			      unsigned long num_queue_entries);  #endif  /* cpu_qinfo() @@ -394,7 +394,9 @@ extern unsigned long sun4v_cpu_qconf(unsigned long type,  #define HV_FAST_CPU_MONDO_SEND		0x42  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_cpu_mondo_send(unsigned long cpu_count, unsigned long cpu_list_pa, unsigned long mondo_block_pa); +unsigned long sun4v_cpu_mondo_send(unsigned long cpu_count, +				   unsigned long cpu_list_pa, +				   unsigned long mondo_block_pa);  #endif  /* cpu_myid() @@ -425,7 +427,7 @@ extern unsigned long sun4v_cpu_mondo_send(unsigned long cpu_count, unsigned long  #define  HV_CPU_STATE_ERROR		 0x03  #ifndef __ASSEMBLY__ -extern long sun4v_cpu_state(unsigned long cpuid); +long sun4v_cpu_state(unsigned long cpuid);  #endif  /* cpu_set_rtba() @@ -625,8 +627,8 @@ struct hv_fault_status {  #define HV_FAST_MMU_TSB_CTX0		0x20  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions, -					unsigned long tsb_desc_ra); +unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions, +				 unsigned long tsb_desc_ra);  #endif  /* mmu_tsb_ctxnon0() @@ -710,7 +712,7 @@ extern unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions,  #define HV_FAST_MMU_DEMAP_ALL		0x24  #ifndef __ASSEMBLY__ -extern void sun4v_mmu_demap_all(void); +void sun4v_mmu_demap_all(void);  #endif  /* mmu_map_perm_addr() @@ -740,10 +742,10 @@ extern void sun4v_mmu_demap_all(void);  #define HV_FAST_MMU_MAP_PERM_ADDR	0x25  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr, -					     unsigned long set_to_zero, -					     unsigned long tte, -					     unsigned long flags); +unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr, +				      unsigned long set_to_zero, +				      unsigned long tte, +				      unsigned long flags);  #endif  /* mmu_fault_area_conf() @@ -945,7 +947,7 @@ extern unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr,  #define HV_FAST_TOD_GET			0x50  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_tod_get(unsigned long *time); +unsigned long sun4v_tod_get(unsigned long *time);  #endif  /* tod_set() @@ -962,7 +964,7 @@ extern unsigned long sun4v_tod_get(unsigned long *time);  #define HV_FAST_TOD_SET			0x51  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_tod_set(unsigned long time); +unsigned long sun4v_tod_set(unsigned long time);  #endif  /* Console services */ @@ -1038,14 +1040,14 @@ extern unsigned long sun4v_tod_set(unsigned long time);  #define HV_FAST_CONS_WRITE		0x63  #ifndef __ASSEMBLY__ -extern long sun4v_con_getchar(long *status); -extern long sun4v_con_putchar(long c); -extern long sun4v_con_read(unsigned long buffer, -			   unsigned long size, -			   unsigned long *bytes_read); -extern unsigned long sun4v_con_write(unsigned long buffer, -				     unsigned long size, -				     unsigned long *bytes_written); +long sun4v_con_getchar(long *status); +long sun4v_con_putchar(long c); +long sun4v_con_read(unsigned long buffer, +		    unsigned long size, +		    unsigned long *bytes_read); +unsigned long sun4v_con_write(unsigned long buffer, +			      unsigned long size, +			      unsigned long *bytes_written);  #endif  /* mach_set_soft_state() @@ -1080,8 +1082,8 @@ extern unsigned long sun4v_con_write(unsigned long buffer,  #define  HV_SOFT_STATE_TRANSITION	 0x02  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_mach_set_soft_state(unsigned long soft_state, -					       unsigned long msg_string_ra); +unsigned long sun4v_mach_set_soft_state(unsigned long soft_state, +				        unsigned long msg_string_ra);  #endif  /* mach_get_soft_state() @@ -1159,20 +1161,20 @@ extern unsigned long sun4v_mach_set_soft_state(unsigned long soft_state,  #define HV_FAST_SVC_CLRSTATUS		0x84  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_svc_send(unsigned long svc_id, -				    unsigned long buffer, -				    unsigned long buffer_size, -				    unsigned long *sent_bytes); -extern unsigned long sun4v_svc_recv(unsigned long svc_id, -				    unsigned long buffer, -				    unsigned long buffer_size, -				    unsigned long *recv_bytes); -extern unsigned long sun4v_svc_getstatus(unsigned long svc_id, -					 unsigned long *status_bits); -extern unsigned long sun4v_svc_setstatus(unsigned long svc_id, -					 unsigned long status_bits); -extern unsigned long sun4v_svc_clrstatus(unsigned long svc_id, -					 unsigned long status_bits); +unsigned long sun4v_svc_send(unsigned long svc_id, +			     unsigned long buffer, +			     unsigned long buffer_size, +			     unsigned long *sent_bytes); +unsigned long sun4v_svc_recv(unsigned long svc_id, +			     unsigned long buffer, +			     unsigned long buffer_size, +			     unsigned long *recv_bytes); +unsigned long sun4v_svc_getstatus(unsigned long svc_id, +				  unsigned long *status_bits); +unsigned long sun4v_svc_setstatus(unsigned long svc_id, +				  unsigned long status_bits); +unsigned long sun4v_svc_clrstatus(unsigned long svc_id, +				  unsigned long status_bits);  #endif  /* Trap trace services. @@ -1458,8 +1460,8 @@ struct hv_trap_trace_entry {  #define HV_FAST_INTR_DEVINO2SYSINO	0xa0  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_devino_to_sysino(unsigned long devhandle, -					    unsigned long devino); +unsigned long sun4v_devino_to_sysino(unsigned long devhandle, +				     unsigned long devino);  #endif  /* intr_getenabled() @@ -1476,7 +1478,7 @@ extern unsigned long sun4v_devino_to_sysino(unsigned long devhandle,  #define HV_FAST_INTR_GETENABLED		0xa1  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_intr_getenabled(unsigned long sysino); +unsigned long sun4v_intr_getenabled(unsigned long sysino);  #endif  /* intr_setenabled() @@ -1492,7 +1494,8 @@ extern unsigned long sun4v_intr_getenabled(unsigned long sysino);  #define HV_FAST_INTR_SETENABLED		0xa2  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_intr_setenabled(unsigned long sysino, unsigned long intr_enabled); +unsigned long sun4v_intr_setenabled(unsigned long sysino, +				    unsigned long intr_enabled);  #endif  /* intr_getstate() @@ -1508,7 +1511,7 @@ extern unsigned long sun4v_intr_setenabled(unsigned long sysino, unsigned long i  #define HV_FAST_INTR_GETSTATE		0xa3  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_intr_getstate(unsigned long sysino); +unsigned long sun4v_intr_getstate(unsigned long sysino);  #endif  /* intr_setstate() @@ -1528,7 +1531,7 @@ extern unsigned long sun4v_intr_getstate(unsigned long sysino);  #define HV_FAST_INTR_SETSTATE		0xa4  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long intr_state); +unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long intr_state);  #endif  /* intr_gettarget() @@ -1546,7 +1549,7 @@ extern unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long int  #define HV_FAST_INTR_GETTARGET		0xa5  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_intr_gettarget(unsigned long sysino); +unsigned long sun4v_intr_gettarget(unsigned long sysino);  #endif  /* intr_settarget() @@ -1563,7 +1566,7 @@ extern unsigned long sun4v_intr_gettarget(unsigned long sysino);  #define HV_FAST_INTR_SETTARGET		0xa6  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid); +unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid);  #endif  /* vintr_get_cookie() @@ -1647,30 +1650,30 @@ extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cp  #define HV_FAST_VINTR_SET_TARGET	0xae  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle, -					    unsigned long dev_ino, -					    unsigned long *cookie); -extern unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle, -					    unsigned long dev_ino, -					    unsigned long cookie); -extern unsigned long sun4v_vintr_get_valid(unsigned long dev_handle, -					   unsigned long dev_ino, -					   unsigned long *valid); -extern unsigned long sun4v_vintr_set_valid(unsigned long dev_handle, -					   unsigned long dev_ino, -					   unsigned long valid); -extern unsigned long sun4v_vintr_get_state(unsigned long dev_handle, -					   unsigned long dev_ino, -					   unsigned long *state); -extern unsigned long sun4v_vintr_set_state(unsigned long dev_handle, -					   unsigned long dev_ino, -					   unsigned long state); -extern unsigned long sun4v_vintr_get_target(unsigned long dev_handle, -					    unsigned long dev_ino, -					    unsigned long *cpuid); -extern unsigned long sun4v_vintr_set_target(unsigned long dev_handle, -					    unsigned long dev_ino, -					    unsigned long cpuid); +unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle, +				     unsigned long dev_ino, +				     unsigned long *cookie); +unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle, +				     unsigned long dev_ino, +				     unsigned long cookie); +unsigned long sun4v_vintr_get_valid(unsigned long dev_handle, +				    unsigned long dev_ino, +				    unsigned long *valid); +unsigned long sun4v_vintr_set_valid(unsigned long dev_handle, +				    unsigned long dev_ino, +				    unsigned long valid); +unsigned long sun4v_vintr_get_state(unsigned long dev_handle, +				    unsigned long dev_ino, +				    unsigned long *state); +unsigned long sun4v_vintr_set_state(unsigned long dev_handle, +				    unsigned long dev_ino, +				    unsigned long state); +unsigned long sun4v_vintr_get_target(unsigned long dev_handle, +				     unsigned long dev_ino, +				     unsigned long *cpuid); +unsigned long sun4v_vintr_set_target(unsigned long dev_handle, +				     unsigned long dev_ino, +				     unsigned long cpuid);  #endif  /* PCI IO services. @@ -2627,50 +2630,50 @@ struct ldc_mtable_entry {  #define HV_FAST_LDC_REVOKE		0xef  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_ldc_tx_qconf(unsigned long channel, -					unsigned long ra, -					unsigned long num_entries); -extern unsigned long sun4v_ldc_tx_qinfo(unsigned long channel, -					unsigned long *ra, -					unsigned long *num_entries); -extern unsigned long sun4v_ldc_tx_get_state(unsigned long channel, -					    unsigned long *head_off, -					    unsigned long *tail_off, -					    unsigned long *chan_state); -extern unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel, -					    unsigned long tail_off); -extern unsigned long sun4v_ldc_rx_qconf(unsigned long channel, -					unsigned long ra, -					unsigned long num_entries); -extern unsigned long sun4v_ldc_rx_qinfo(unsigned long channel, -					unsigned long *ra, -					unsigned long *num_entries); -extern unsigned long sun4v_ldc_rx_get_state(unsigned long channel, -					    unsigned long *head_off, -					    unsigned long *tail_off, -					    unsigned long *chan_state); -extern unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel, -					    unsigned long head_off); -extern unsigned long sun4v_ldc_set_map_table(unsigned long channel, -					     unsigned long ra, -					     unsigned long num_entries); -extern unsigned long sun4v_ldc_get_map_table(unsigned long channel, -					     unsigned long *ra, -					     unsigned long *num_entries); -extern unsigned long sun4v_ldc_copy(unsigned long channel, -				    unsigned long dir_code, -				    unsigned long tgt_raddr, -				    unsigned long lcl_raddr, -				    unsigned long len, -				    unsigned long *actual_len); -extern unsigned long sun4v_ldc_mapin(unsigned long channel, -				     unsigned long cookie, -				     unsigned long *ra, -				     unsigned long *perm); -extern unsigned long sun4v_ldc_unmap(unsigned long ra); -extern unsigned long sun4v_ldc_revoke(unsigned long channel, -				      unsigned long cookie, -				      unsigned long mte_cookie); +unsigned long sun4v_ldc_tx_qconf(unsigned long channel, +				 unsigned long ra, +				 unsigned long num_entries); +unsigned long sun4v_ldc_tx_qinfo(unsigned long channel, +				 unsigned long *ra, +				 unsigned long *num_entries); +unsigned long sun4v_ldc_tx_get_state(unsigned long channel, +				     unsigned long *head_off, +				     unsigned long *tail_off, +				     unsigned long *chan_state); +unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel, +				     unsigned long tail_off); +unsigned long sun4v_ldc_rx_qconf(unsigned long channel, +				 unsigned long ra, +				 unsigned long num_entries); +unsigned long sun4v_ldc_rx_qinfo(unsigned long channel, +				 unsigned long *ra, +				 unsigned long *num_entries); +unsigned long sun4v_ldc_rx_get_state(unsigned long channel, +				     unsigned long *head_off, +				     unsigned long *tail_off, +				     unsigned long *chan_state); +unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel, +				     unsigned long head_off); +unsigned long sun4v_ldc_set_map_table(unsigned long channel, +				      unsigned long ra, +				      unsigned long num_entries); +unsigned long sun4v_ldc_get_map_table(unsigned long channel, +				      unsigned long *ra, +				      unsigned long *num_entries); +unsigned long sun4v_ldc_copy(unsigned long channel, +			     unsigned long dir_code, +			     unsigned long tgt_raddr, +			     unsigned long lcl_raddr, +			     unsigned long len, +			     unsigned long *actual_len); +unsigned long sun4v_ldc_mapin(unsigned long channel, +			      unsigned long cookie, +			      unsigned long *ra, +			      unsigned long *perm); +unsigned long sun4v_ldc_unmap(unsigned long ra); +unsigned long sun4v_ldc_revoke(unsigned long channel, +			       unsigned long cookie, +			       unsigned long mte_cookie);  #endif  /* Performance counter services.  */ @@ -2727,14 +2730,14 @@ extern unsigned long sun4v_ldc_revoke(unsigned long channel,  #define HV_FAST_N2_SET_PERFREG		0x105  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_niagara_getperf(unsigned long reg, -					   unsigned long *val); -extern unsigned long sun4v_niagara_setperf(unsigned long reg, -					   unsigned long val); -extern unsigned long sun4v_niagara2_getperf(unsigned long reg, -					    unsigned long *val); -extern unsigned long sun4v_niagara2_setperf(unsigned long reg, -					    unsigned long val); +unsigned long sun4v_niagara_getperf(unsigned long reg, +				    unsigned long *val); +unsigned long sun4v_niagara_setperf(unsigned long reg, +				    unsigned long val); +unsigned long sun4v_niagara2_getperf(unsigned long reg, +				     unsigned long *val); +unsigned long sun4v_niagara2_setperf(unsigned long reg, +				     unsigned long val);  #endif  /* MMU statistics services. @@ -2829,8 +2832,8 @@ struct hv_mmu_statistics {  #define HV_FAST_MMUSTAT_INFO		0x103  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_mmustat_conf(unsigned long ra, unsigned long *orig_ra); -extern unsigned long sun4v_mmustat_info(unsigned long *ra); +unsigned long sun4v_mmustat_conf(unsigned long ra, unsigned long *orig_ra); +unsigned long sun4v_mmustat_info(unsigned long *ra);  #endif  /* NCS crypto services  */ @@ -2919,9 +2922,9 @@ struct hv_ncs_qtail_update_arg {  #define HV_FAST_NCS_REQUEST		0x110  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_ncs_request(unsigned long request, -				       unsigned long arg_ra, -				       unsigned long arg_size); +unsigned long sun4v_ncs_request(unsigned long request, +			        unsigned long arg_ra, +			        unsigned long arg_size);  #endif  #define HV_FAST_FIRE_GET_PERFREG	0x120 @@ -2930,18 +2933,18 @@ extern unsigned long sun4v_ncs_request(unsigned long request,  #define HV_FAST_REBOOT_DATA_SET		0x172  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_reboot_data_set(unsigned long ra, -					   unsigned long len); +unsigned long sun4v_reboot_data_set(unsigned long ra, +				    unsigned long len);  #endif  #define HV_FAST_VT_GET_PERFREG		0x184  #define HV_FAST_VT_SET_PERFREG		0x185  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_vt_get_perfreg(unsigned long reg_num, -					  unsigned long *reg_val); -extern unsigned long sun4v_vt_set_perfreg(unsigned long reg_num, -					  unsigned long reg_val); +unsigned long sun4v_vt_get_perfreg(unsigned long reg_num, +				   unsigned long *reg_val); +unsigned long sun4v_vt_set_perfreg(unsigned long reg_num, +				   unsigned long reg_val);  #endif  /* Function numbers for HV_CORE_TRAP.  */ @@ -2978,21 +2981,21 @@ extern unsigned long sun4v_vt_set_perfreg(unsigned long reg_num,  #define HV_GRP_DIAG			0x0300  #ifndef __ASSEMBLY__ -extern unsigned long sun4v_get_version(unsigned long group, -				       unsigned long *major, -				       unsigned long *minor); -extern unsigned long sun4v_set_version(unsigned long group, -				       unsigned long major, -				       unsigned long minor, -				       unsigned long *actual_minor); - -extern int sun4v_hvapi_register(unsigned long group, unsigned long major, -				unsigned long *minor); -extern void sun4v_hvapi_unregister(unsigned long group); -extern int sun4v_hvapi_get(unsigned long group, -			   unsigned long *major, -			   unsigned long *minor); -extern void sun4v_hvapi_init(void); +unsigned long sun4v_get_version(unsigned long group, +			        unsigned long *major, +			        unsigned long *minor); +unsigned long sun4v_set_version(unsigned long group, +			        unsigned long major, +			        unsigned long minor, +			        unsigned long *actual_minor); + +int sun4v_hvapi_register(unsigned long group, unsigned long major, +			 unsigned long *minor); +void sun4v_hvapi_unregister(unsigned long group); +int sun4v_hvapi_get(unsigned long group, +		    unsigned long *major, +		    unsigned long *minor); +void sun4v_hvapi_init(void);  #endif  #endif /* !(_SPARC64_HYPERVISOR_H) */ diff --git a/arch/sparc/include/asm/idprom.h b/arch/sparc/include/asm/idprom.h index 6976aa2439c..3793f7f91c4 100644 --- a/arch/sparc/include/asm/idprom.h +++ b/arch/sparc/include/asm/idprom.h @@ -20,6 +20,6 @@ struct idprom {  };  extern struct idprom *idprom; -extern void idprom_init(void); +void idprom_init(void);  #endif /* !(_SPARC_IDPROM_H) */ diff --git a/arch/sparc/include/asm/io-unit.h b/arch/sparc/include/asm/io-unit.h index 01ab2f613e9..04a9701e720 100644 --- a/arch/sparc/include/asm/io-unit.h +++ b/arch/sparc/include/asm/io-unit.h @@ -43,7 +43,7 @@  struct iounit_struct {  	unsigned long		bmap[(IOUNIT_DMA_SIZE >> (PAGE_SHIFT + 3)) / sizeof(unsigned long)];  	spinlock_t		lock; -	iopte_t			*page_table; +	iopte_t __iomem		*page_table;  	unsigned long		rotor[3];  	unsigned long		limit[4];  }; diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c1acbd891cb..9f532902627 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -2,191 +2,94 @@  #define __SPARC_IO_H  #include <linux/kernel.h> -#include <linux/types.h>  #include <linux/ioport.h>  /* struct resource */ -#include <asm/page.h>      /* IO address mapping routines need this */ -#include <asm-generic/pci_iomap.h> - -#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT) - -static inline u32 flip_dword (u32 l) -{ -	return ((l&0xff)<<24) | (((l>>8)&0xff)<<16) | (((l>>16)&0xff)<<8)| ((l>>24)&0xff); -} - -static inline u16 flip_word (u16 w) -{ -	return ((w&0xff) << 8) | ((w>>8)&0xff); -} - -#define mmiowb() - -/* - * Memory mapped I/O to PCI - */ - -static inline u8 __raw_readb(const volatile void __iomem *addr) -{ -	return *(__force volatile u8 *)addr; -} - -static inline u16 __raw_readw(const volatile void __iomem *addr) -{ -	return *(__force volatile u16 *)addr; -} - -static inline u32 __raw_readl(const volatile void __iomem *addr) -{ -	return *(__force volatile u32 *)addr; -} +#define readb_relaxed(__addr)	readb(__addr) +#define readw_relaxed(__addr)	readw(__addr) +#define readl_relaxed(__addr)	readl(__addr) -static inline void __raw_writeb(u8 b, volatile void __iomem *addr) -{ -	*(__force volatile u8 *)addr = b; -} +#define IO_SPACE_LIMIT 0xffffffff -static inline void __raw_writew(u16 w, volatile void __iomem *addr) -{ -	*(__force volatile u16 *)addr = w; -} +#define memset_io(d,c,sz)     _memset_io(d,c,sz) +#define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz) +#define memcpy_toio(d,s,sz)   _memcpy_toio(d,s,sz) -static inline void __raw_writel(u32 l, volatile void __iomem *addr) -{ -	*(__force volatile u32 *)addr = l; -} +#include <asm-generic/io.h> -static inline u8 __readb(const volatile void __iomem *addr) +static inline void _memset_io(volatile void __iomem *dst, +                              int c, __kernel_size_t n)  { -	return *(__force volatile u8 *)addr; -} +	volatile void __iomem *d = dst; -static inline u16 __readw(const volatile void __iomem *addr) -{ -	return flip_word(*(__force volatile u16 *)addr); +	while (n--) { +		writeb(c, d); +		d++; +	}  } -static inline u32 __readl(const volatile void __iomem *addr) +static inline void _memcpy_fromio(void *dst, const volatile void __iomem *src, +                                  __kernel_size_t n)  { -	return flip_dword(*(__force volatile u32 *)addr); -} +	char *d = dst; -static inline void __writeb(u8 b, volatile void __iomem *addr) -{ -	*(__force volatile u8 *)addr = b; +	while (n--) { +		char tmp = readb(src); +		*d++ = tmp; +		src++; +	}  } -static inline void __writew(u16 w, volatile void __iomem *addr) +static inline void _memcpy_toio(volatile void __iomem *dst, const void *src, +                                __kernel_size_t n)  { -	*(__force volatile u16 *)addr = flip_word(w); -} +	const char *s = src; +	volatile void __iomem *d = dst; -static inline void __writel(u32 l, volatile void __iomem *addr) -{ -	*(__force volatile u32 *)addr = flip_dword(l); +	while (n--) { +		char tmp = *s++; +		writeb(tmp, d); +		d++; +	}  } -#define readb(__addr)		__readb(__addr) -#define readw(__addr)		__readw(__addr) -#define readl(__addr)		__readl(__addr) -#define readb_relaxed(__addr)	readb(__addr) -#define readw_relaxed(__addr)	readw(__addr) -#define readl_relaxed(__addr)	readl(__addr) - -#define writeb(__b, __addr)	__writeb((__b),(__addr)) -#define writew(__w, __addr)	__writew((__w),(__addr)) -#define writel(__l, __addr)	__writel((__l),(__addr)) - -/* - * I/O space operations - * - * Arrangement on a Sun is somewhat complicated. - * - * First of all, we want to use standard Linux drivers - * for keyboard, PC serial, etc. These drivers think - * they access I/O space and use inb/outb. - * On the other hand, EBus bridge accepts PCI *memory* - * cycles and converts them into ISA *I/O* cycles. - * Ergo, we want inb & outb to generate PCI memory cycles. - * - * If we want to issue PCI *I/O* cycles, we do this - * with a low 64K fixed window in PCIC. This window gets - * mapped somewhere into virtual kernel space and we - * can use inb/outb again. - */ -#define inb_local(__addr)	__readb((void __iomem *)(unsigned long)(__addr)) -#define inb(__addr)		__readb((void __iomem *)(unsigned long)(__addr)) -#define inw(__addr)		__readw((void __iomem *)(unsigned long)(__addr)) -#define inl(__addr)		__readl((void __iomem *)(unsigned long)(__addr)) - -#define outb_local(__b, __addr)	__writeb(__b, (void __iomem *)(unsigned long)(__addr)) -#define outb(__b, __addr)	__writeb(__b, (void __iomem *)(unsigned long)(__addr)) -#define outw(__w, __addr)	__writew(__w, (void __iomem *)(unsigned long)(__addr)) -#define outl(__l, __addr)	__writel(__l, (void __iomem *)(unsigned long)(__addr)) - -#define inb_p(__addr)		inb(__addr) -#define outb_p(__b, __addr)	outb(__b, __addr) -#define inw_p(__addr)		inw(__addr) -#define outw_p(__w, __addr)	outw(__w, __addr) -#define inl_p(__addr)		inl(__addr) -#define outl_p(__l, __addr)	outl(__l, __addr) - -void outsb(unsigned long addr, const void *src, unsigned long cnt); -void outsw(unsigned long addr, const void *src, unsigned long cnt); -void outsl(unsigned long addr, const void *src, unsigned long cnt); -void insb(unsigned long addr, void *dst, unsigned long count); -void insw(unsigned long addr, void *dst, unsigned long count); -void insl(unsigned long addr, void *dst, unsigned long count); - -#define IO_SPACE_LIMIT 0xffffffff -  /*   * SBus accessors.   *   * SBus has only one, memory mapped, I/O space.   * We do not need to flip bytes for SBus of course.   */ -static inline u8 _sbus_readb(const volatile void __iomem *addr) +static inline u8 sbus_readb(const volatile void __iomem *addr)  {  	return *(__force volatile u8 *)addr;  } -static inline u16 _sbus_readw(const volatile void __iomem *addr) +static inline u16 sbus_readw(const volatile void __iomem *addr)  {  	return *(__force volatile u16 *)addr;  } -static inline u32 _sbus_readl(const volatile void __iomem *addr) +static inline u32 sbus_readl(const volatile void __iomem *addr)  {  	return *(__force volatile u32 *)addr;  } -static inline void _sbus_writeb(u8 b, volatile void __iomem *addr) +static inline void sbus_writeb(u8 b, volatile void __iomem *addr)  {  	*(__force volatile u8 *)addr = b;  } -static inline void _sbus_writew(u16 w, volatile void __iomem *addr) +static inline void sbus_writew(u16 w, volatile void __iomem *addr)  {  	*(__force volatile u16 *)addr = w;  } -static inline void _sbus_writel(u32 l, volatile void __iomem *addr) +static inline void sbus_writel(u32 l, volatile void __iomem *addr)  {  	*(__force volatile u32 *)addr = l;  } -/* - * The only reason for #define's is to hide casts to unsigned long. - */ -#define sbus_readb(__addr)		_sbus_readb(__addr) -#define sbus_readw(__addr)		_sbus_readw(__addr) -#define sbus_readl(__addr)		_sbus_readl(__addr) -#define sbus_writeb(__b, __addr)	_sbus_writeb(__b, __addr) -#define sbus_writew(__w, __addr)	_sbus_writew(__w, __addr) -#define sbus_writel(__l, __addr)	_sbus_writel(__l, __addr) - -static inline void sbus_memset_io(volatile void __iomem *__dst, int c, __kernel_size_t n) +static inline void sbus_memset_io(volatile void __iomem *__dst, int c, +                                  __kernel_size_t n)  {  	while(n--) {  		sbus_writeb(c, __dst); @@ -194,22 +97,9 @@ static inline void sbus_memset_io(volatile void __iomem *__dst, int c, __kernel_  	}  } -static inline void -_memset_io(volatile void __iomem *dst, int c, __kernel_size_t n) -{ -	volatile void __iomem *d = dst; - -	while (n--) { -		writeb(c, d); -		d++; -	} -} - -#define memset_io(d,c,sz)	_memset_io(d,c,sz) - -static inline void -_sbus_memcpy_fromio(void *dst, const volatile void __iomem *src, -		    __kernel_size_t n) +static inline void sbus_memcpy_fromio(void *dst, +                                      const volatile void __iomem *src, +                                      __kernel_size_t n)  {  	char *d = dst; @@ -220,25 +110,9 @@ _sbus_memcpy_fromio(void *dst, const volatile void __iomem *src,  	}  } -#define sbus_memcpy_fromio(d, s, sz)	_sbus_memcpy_fromio(d, s, sz) - -static inline void -_memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n) -{ -	char *d = dst; - -	while (n--) { -		char tmp = readb(src); -		*d++ = tmp; -		src++; -	} -} - -#define memcpy_fromio(d,s,sz)	_memcpy_fromio(d,s,sz) - -static inline void -_sbus_memcpy_toio(volatile void __iomem *dst, const void *src, -		  __kernel_size_t n) +static inline void sbus_memcpy_toio(volatile void __iomem *dst, +                                    const void *src, +                                    __kernel_size_t n)  {  	const char *s = src;  	volatile void __iomem *d = dst; @@ -250,81 +124,26 @@ _sbus_memcpy_toio(volatile void __iomem *dst, const void *src,  	}  } -#define sbus_memcpy_toio(d, s, sz)	_sbus_memcpy_toio(d, s, sz) - -static inline void -_memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n) -{ -	const char *s = src; -	volatile void __iomem *d = dst; - -	while (n--) { -		char tmp = *s++; -		writeb(tmp, d); -		d++; -	} -} - -#define memcpy_toio(d,s,sz)	_memcpy_toio(d,s,sz) -  #ifdef __KERNEL__  /*   * Bus number may be embedded in the higher bits of the physical address.   * This is why we have no bus number argument to ioremap().   */ -extern void __iomem *ioremap(unsigned long offset, unsigned long size); +void __iomem *ioremap(unsigned long offset, unsigned long size);  #define ioremap_nocache(X,Y)	ioremap((X),(Y))  #define ioremap_wc(X,Y)		ioremap((X),(Y)) -extern void iounmap(volatile void __iomem *addr); - -#define ioread8(X)			readb(X) -#define ioread16(X)			readw(X) -#define ioread16be(X)			__raw_readw(X) -#define ioread32(X)			readl(X) -#define ioread32be(X)			__raw_readl(X) -#define iowrite8(val,X)			writeb(val,X) -#define iowrite16(val,X)		writew(val,X) -#define iowrite16be(val,X)		__raw_writew(val,X) -#define iowrite32(val,X)		writel(val,X) -#define iowrite32be(val,X)		__raw_writel(val,X) - -static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count) -{ -	insb((unsigned long __force)port, buf, count); -} -static inline void ioread16_rep(void __iomem *port, void *buf, unsigned long count) -{ -	insw((unsigned long __force)port, buf, count); -} - -static inline void ioread32_rep(void __iomem *port, void *buf, unsigned long count) -{ -	insl((unsigned long __force)port, buf, count); -} - -static inline void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count) -{ -	outsb((unsigned long __force)port, buf, count); -} - -static inline void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count) -{ -	outsw((unsigned long __force)port, buf, count); -} - -static inline void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count) -{ -	outsl((unsigned long __force)port, buf, count); -} +void iounmap(volatile void __iomem *addr);  /* Create a virtual mapping cookie for an IO port range */ -extern void __iomem *ioport_map(unsigned long port, unsigned int nr); -extern void ioport_unmap(void __iomem *); +void __iomem *ioport_map(unsigned long port, unsigned int nr); +void ioport_unmap(void __iomem *);  /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */  struct pci_dev; -extern void pci_iounmap(struct pci_dev *dev, void __iomem *); +void pci_iounmap(struct pci_dev *dev, void __iomem *); + +  /*   * At the moment, we do not use CMOS_READ anywhere outside of rtc.c, @@ -343,21 +162,11 @@ static inline int sbus_can_burst64(void)  	return 0; /* actually, sparc_cpu_model==sun4d */  }  struct device; -extern void sbus_set_sbus64(struct device *, int); +void sbus_set_sbus64(struct device *, int);  #endif  #define __ARCH_HAS_NO_PAGE_ZERO_MAPPED		1 -/* - * Convert a physical pointer to a virtual kernel pointer for /dev/mem - * access - */ -#define xlate_dev_mem_ptr(p)	__va(p) - -/* - * Convert a virtual cached pointer to an uncached pointer - */ -#define xlate_dev_kmem_ptr(p)	p  #endif /* !(__SPARC_IO_H) */ diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 09b0b88aeb2..05381c3a422 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -15,7 +15,6 @@  /* BIO layer definitions. */  extern unsigned long kern_base, kern_size; -#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)  static inline u8 _inb(unsigned long addr)  { @@ -91,12 +90,12 @@ static inline void _outl(u32 l, unsigned long addr)  #define inl_p(__addr)		inl(__addr)  #define outl_p(__l, __addr)	outl(__l, __addr) -extern void outsb(unsigned long, const void *, unsigned long); -extern void outsw(unsigned long, const void *, unsigned long); -extern void outsl(unsigned long, const void *, unsigned long); -extern void insb(unsigned long, void *, unsigned long); -extern void insw(unsigned long, void *, unsigned long); -extern void insl(unsigned long, void *, unsigned long); +void outsb(unsigned long, const void *, unsigned long); +void outsw(unsigned long, const void *, unsigned long); +void outsl(unsigned long, const void *, unsigned long); +void insb(unsigned long, void *, unsigned long); +void insw(unsigned long, void *, unsigned long); +void insl(unsigned long, void *, unsigned long);  static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count)  { @@ -509,12 +508,12 @@ static inline void iounmap(volatile void __iomem *addr)  #define iowrite32be(val,X)		__raw_writel(val,X)  /* Create a virtual mapping cookie for an IO port range */ -extern void __iomem *ioport_map(unsigned long port, unsigned int nr); -extern void ioport_unmap(void __iomem *); +void __iomem *ioport_map(unsigned long port, unsigned int nr); +void ioport_unmap(void __iomem *);  /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */  struct pci_dev; -extern void pci_iounmap(struct pci_dev *dev, void __iomem *); +void pci_iounmap(struct pci_dev *dev, void __iomem *);  static inline int sbus_can_dma_64bit(void)  { @@ -525,7 +524,7 @@ static inline int sbus_can_burst64(void)  	return 1;  }  struct device; -extern void sbus_set_sbus64(struct device *, int); +void sbus_set_sbus64(struct device *, int);  /*   * Convert a physical pointer to a virtual kernel pointer for /dev/mem diff --git a/arch/sparc/include/asm/iommu_32.h b/arch/sparc/include/asm/iommu_32.h index 70c589c05a1..f6c066b52fd 100644 --- a/arch/sparc/include/asm/iommu_32.h +++ b/arch/sparc/include/asm/iommu_32.h @@ -99,7 +99,7 @@ struct iommu_regs {  #define IOPTE_WAZ           0x00000001 /* Write as zeros */  struct iommu_struct { -	struct iommu_regs *regs; +	struct iommu_regs __iomem *regs;  	iopte_t *page_table;  	/* For convenience */  	unsigned long start; /* First managed virtual address */ @@ -108,14 +108,14 @@ struct iommu_struct {  	struct bit_map usemap;  }; -static inline void iommu_invalidate(struct iommu_regs *regs) +static inline void iommu_invalidate(struct iommu_regs __iomem *regs)  { -	regs->tlbflush = 0; +	sbus_writel(0, ®s->tlbflush);  } -static inline void iommu_invalidate_page(struct iommu_regs *regs, unsigned long ba) +static inline void iommu_invalidate_page(struct iommu_regs __iomem *regs, unsigned long ba)  { -	regs->pageflush = (ba & PAGE_MASK); +	sbus_writel(ba & PAGE_MASK, ®s->pageflush);  }  #endif /* !(_SPARC_IOMMU_H) */ diff --git a/arch/sparc/include/asm/iommu_64.h b/arch/sparc/include/asm/iommu_64.h index caf798b5619..2b9321ab064 100644 --- a/arch/sparc/include/asm/iommu_64.h +++ b/arch/sparc/include/asm/iommu_64.h @@ -58,8 +58,8 @@ struct strbuf {  	volatile unsigned long	__flushflag_buf[(64+(64-1)) / sizeof(long)];  }; -extern int iommu_table_init(struct iommu *iommu, int tsbsize, -			    u32 dma_offset, u32 dma_addr_mask, -			    int numa_node); +int iommu_table_init(struct iommu *iommu, int tsbsize, +		     u32 dma_offset, u32 dma_addr_mask, +		     int numa_node);  #endif /* !(_SPARC64_IOMMU_H) */ diff --git a/arch/sparc/include/asm/irq_32.h b/arch/sparc/include/asm/irq_32.h index 2ae3acaeb1b..eecd3d8442c 100644 --- a/arch/sparc/include/asm/irq_32.h +++ b/arch/sparc/include/asm/irq_32.h @@ -16,7 +16,8 @@  #define irq_canonicalize(irq)	(irq) -extern void __init init_IRQ(void); +void __init init_IRQ(void); +void __init sun4d_init_sbi_irq(void);  #define NO_IRQ		0xffffffff diff --git a/arch/sparc/include/asm/irq_64.h b/arch/sparc/include/asm/irq_64.h index abf6afe82ca..91d21938130 100644 --- a/arch/sparc/include/asm/irq_64.h +++ b/arch/sparc/include/asm/irq_64.h @@ -39,32 +39,32 @@   */  #define NR_IRQS    255 -extern void irq_install_pre_handler(int irq, -				    void (*func)(unsigned int, void *, void *), -				    void *arg1, void *arg2); +void irq_install_pre_handler(int irq, +			     void (*func)(unsigned int, void *, void *), +			     void *arg1, void *arg2);  #define irq_canonicalize(irq)	(irq) -extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); -extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); -extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino); -extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p, -				    unsigned int msi_devino_start, -				    unsigned int msi_devino_end); -extern void sun4v_destroy_msi(unsigned int irq); -extern unsigned int sun4u_build_msi(u32 portid, unsigned int *irq_p, -				    unsigned int msi_devino_start, -				    unsigned int msi_devino_end, -				    unsigned long imap_base, -				    unsigned long iclr_base); -extern void sun4u_destroy_msi(unsigned int irq); - -extern unsigned char irq_alloc(unsigned int dev_handle, -				    unsigned int dev_ino); +unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); +unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); +unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino); +unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p, +			     unsigned int msi_devino_start, +			     unsigned int msi_devino_end); +void sun4v_destroy_msi(unsigned int irq); +unsigned int sun4u_build_msi(u32 portid, unsigned int *irq_p, +			     unsigned int msi_devino_start, +			     unsigned int msi_devino_end, +			     unsigned long imap_base, +			     unsigned long iclr_base); +void sun4u_destroy_msi(unsigned int irq); + +unsigned char irq_alloc(unsigned int dev_handle, +			unsigned int dev_ino);  #ifdef CONFIG_PCI_MSI -extern void irq_free(unsigned int irq); +void irq_free(unsigned int irq);  #endif -extern void __init init_IRQ(void); -extern void fixup_irqs(void); +void __init init_IRQ(void); +void fixup_irqs(void);  static inline void set_softint(unsigned long bits)  { @@ -89,7 +89,7 @@ static inline unsigned long get_softint(void)  	return retval;  } -void arch_trigger_all_cpu_backtrace(void); +void arch_trigger_all_cpu_backtrace(bool);  #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace  extern void *hardirq_stack[NR_CPUS]; diff --git a/arch/sparc/include/asm/irqflags_32.h b/arch/sparc/include/asm/irqflags_32.h index e414c06615c..71cc284f55c 100644 --- a/arch/sparc/include/asm/irqflags_32.h +++ b/arch/sparc/include/asm/irqflags_32.h @@ -15,9 +15,9 @@  #include <linux/types.h>  #include <asm/psr.h> -extern void arch_local_irq_restore(unsigned long); -extern unsigned long arch_local_irq_save(void); -extern void arch_local_irq_enable(void); +void arch_local_irq_restore(unsigned long); +unsigned long arch_local_irq_save(void); +void arch_local_irq_enable(void);  static inline notrace unsigned long arch_local_save_flags(void)  { diff --git a/arch/sparc/include/asm/jump_label.h b/arch/sparc/include/asm/jump_label.h index 5080d16a832..ec2e2e2aba7 100644 --- a/arch/sparc/include/asm/jump_label.h +++ b/arch/sparc/include/asm/jump_label.h @@ -9,7 +9,7 @@  static __always_inline bool arch_static_branch(struct static_key *key)  { -		asm goto("1:\n\t" +		asm_volatile_goto("1:\n\t"  			 "nop\n\t"  			 "nop\n\t"  			 ".pushsection __jump_table,  \"aw\"\n\t" diff --git a/arch/sparc/include/asm/kdebug_64.h b/arch/sparc/include/asm/kdebug_64.h index feb3578e12c..04465de8f3b 100644 --- a/arch/sparc/include/asm/kdebug_64.h +++ b/arch/sparc/include/asm/kdebug_64.h @@ -3,7 +3,7 @@  struct pt_regs; -extern void bad_trap(struct pt_regs *, long); +void bad_trap(struct pt_regs *, long);  /* Grossly misnamed. */  enum die_val { diff --git a/arch/sparc/include/asm/kgdb.h b/arch/sparc/include/asm/kgdb.h index b6ef301d05b..47366af7a58 100644 --- a/arch/sparc/include/asm/kgdb.h +++ b/arch/sparc/include/asm/kgdb.h @@ -28,9 +28,12 @@ enum regnames {  #define NUMREGBYTES		((GDB_CSR + 1) * 4)  #else  #define NUMREGBYTES		((GDB_Y + 1) * 8) + +struct pt_regs; +asmlinkage void kgdb_trap(unsigned long trap_level, struct pt_regs *regs);  #endif -extern void arch_kgdb_breakpoint(void); +void arch_kgdb_breakpoint(void);  #define BREAK_INSTR_SIZE	4  #define CACHE_FLUSH_IS_SAFE	1 diff --git a/arch/sparc/include/asm/kprobes.h b/arch/sparc/include/asm/kprobes.h index 5879d71afda..a145d798e11 100644 --- a/arch/sparc/include/asm/kprobes.h +++ b/arch/sparc/include/asm/kprobes.h @@ -43,7 +43,9 @@ struct kprobe_ctlblk {  	struct prev_kprobe prev_kprobe;  }; -extern int kprobe_exceptions_notify(struct notifier_block *self, -				    unsigned long val, void *data); -extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); +int kprobe_exceptions_notify(struct notifier_block *self, +			     unsigned long val, void *data); +int kprobe_fault_handler(struct pt_regs *regs, int trapnr); +asmlinkage void __kprobes kprobe_trap(unsigned long trap_level, +				      struct pt_regs *regs);  #endif /* _SPARC64_KPROBES_H */ diff --git a/arch/sparc/include/asm/ldc.h b/arch/sparc/include/asm/ldc.h index bdb524a7b81..c8c67f621f4 100644 --- a/arch/sparc/include/asm/ldc.h +++ b/arch/sparc/include/asm/ldc.h @@ -4,9 +4,9 @@  #include <asm/hypervisor.h>  extern int ldom_domaining_enabled; -extern void ldom_set_var(const char *var, const char *value); -extern void ldom_reboot(const char *boot_command); -extern void ldom_power_off(void); +void ldom_set_var(const char *var, const char *value); +void ldom_reboot(const char *boot_command); +void ldom_power_off(void);  /* The event handler will be evoked when link state changes   * or data becomes available on the receive side. @@ -51,30 +51,30 @@ struct ldc_channel_config {  struct ldc_channel;  /* Allocate state for a channel.  */ -extern struct ldc_channel *ldc_alloc(unsigned long id, -				     const struct ldc_channel_config *cfgp, -				     void *event_arg); +struct ldc_channel *ldc_alloc(unsigned long id, +			      const struct ldc_channel_config *cfgp, +			      void *event_arg);  /* Shut down and free state for a channel.  */ -extern void ldc_free(struct ldc_channel *lp); +void ldc_free(struct ldc_channel *lp);  /* Register TX and RX queues of the link with the hypervisor.  */ -extern int ldc_bind(struct ldc_channel *lp, const char *name); +int ldc_bind(struct ldc_channel *lp, const char *name);  /* For non-RAW protocols we need to complete a handshake before   * communication can proceed.  ldc_connect() does that, if the   * handshake completes successfully, an LDC_EVENT_UP event will   * be sent up to the driver.   */ -extern int ldc_connect(struct ldc_channel *lp); -extern int ldc_disconnect(struct ldc_channel *lp); +int ldc_connect(struct ldc_channel *lp); +int ldc_disconnect(struct ldc_channel *lp); -extern int ldc_state(struct ldc_channel *lp); +int ldc_state(struct ldc_channel *lp);  /* Read and write operations.  Only valid when the link is up.  */ -extern int ldc_write(struct ldc_channel *lp, const void *buf, -		     unsigned int size); -extern int ldc_read(struct ldc_channel *lp, void *buf, unsigned int size); +int ldc_write(struct ldc_channel *lp, const void *buf, +	      unsigned int size); +int ldc_read(struct ldc_channel *lp, void *buf, unsigned int size);  #define LDC_MAP_SHADOW	0x01  #define LDC_MAP_DIRECT	0x02 @@ -92,22 +92,22 @@ struct ldc_trans_cookie {  };  struct scatterlist; -extern int ldc_map_sg(struct ldc_channel *lp, -		      struct scatterlist *sg, int num_sg, -		      struct ldc_trans_cookie *cookies, int ncookies, -		      unsigned int map_perm); +int ldc_map_sg(struct ldc_channel *lp, +	       struct scatterlist *sg, int num_sg, +	       struct ldc_trans_cookie *cookies, int ncookies, +	       unsigned int map_perm); -extern int ldc_map_single(struct ldc_channel *lp, -			  void *buf, unsigned int len, -			  struct ldc_trans_cookie *cookies, int ncookies, -			  unsigned int map_perm); +int ldc_map_single(struct ldc_channel *lp, +		   void *buf, unsigned int len, +		   struct ldc_trans_cookie *cookies, int ncookies, +		   unsigned int map_perm); -extern void ldc_unmap(struct ldc_channel *lp, struct ldc_trans_cookie *cookies, -		      int ncookies); +void ldc_unmap(struct ldc_channel *lp, struct ldc_trans_cookie *cookies, +	       int ncookies); -extern int ldc_copy(struct ldc_channel *lp, int copy_dir, -		    void *buf, unsigned int len, unsigned long offset, -		    struct ldc_trans_cookie *cookies, int ncookies); +int ldc_copy(struct ldc_channel *lp, int copy_dir, +	     void *buf, unsigned int len, unsigned long offset, +	     struct ldc_trans_cookie *cookies, int ncookies);  static inline int ldc_get_dring_entry(struct ldc_channel *lp,  				      void *buf, unsigned int len, @@ -127,12 +127,12 @@ static inline int ldc_put_dring_entry(struct ldc_channel *lp,  	return ldc_copy(lp, LDC_COPY_OUT, buf, len, offset, cookies, ncookies);  } -extern void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len, -				 struct ldc_trans_cookie *cookies, -				 int *ncookies, unsigned int map_perm); +void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len, +			  struct ldc_trans_cookie *cookies, +			  int *ncookies, unsigned int map_perm); -extern void ldc_free_exp_dring(struct ldc_channel *lp, void *buf, -			       unsigned int len, -			       struct ldc_trans_cookie *cookies, int ncookies); +void ldc_free_exp_dring(struct ldc_channel *lp, void *buf, +		        unsigned int len, +		        struct ldc_trans_cookie *cookies, int ncookies);  #endif /* _SPARC64_LDC_H */ diff --git a/arch/sparc/include/asm/leon.h b/arch/sparc/include/asm/leon.h index c2f6ff6d7a3..204771cd74a 100644 --- a/arch/sparc/include/asm/leon.h +++ b/arch/sparc/include/asm/leon.h @@ -82,8 +82,8 @@ static inline unsigned long leon_load_reg(unsigned long paddr)  #define LEON_BYPASS_LOAD_PA(x)      leon_load_reg((unsigned long)(x))  #define LEON_BYPASS_STORE_PA(x, v)  leon_store_reg((unsigned long)(x), (unsigned long)(v)) -extern void leon_switch_mm(void); -extern void leon_init_IRQ(void); +void leon_switch_mm(void); +void leon_init_IRQ(void);  static inline unsigned long sparc_leon3_get_dcachecfg(void)  { @@ -196,14 +196,14 @@ static inline int sparc_leon3_cpuid(void)  #ifndef __ASSEMBLY__  struct vm_area_struct; -extern unsigned long leon_swprobe(unsigned long vaddr, unsigned long *paddr); -extern void leon_flush_icache_all(void); -extern void leon_flush_dcache_all(void); -extern void leon_flush_cache_all(void); -extern void leon_flush_tlb_all(void); +unsigned long leon_swprobe(unsigned long vaddr, unsigned long *paddr); +void leon_flush_icache_all(void); +void leon_flush_dcache_all(void); +void leon_flush_cache_all(void); +void leon_flush_tlb_all(void);  extern int leon_flush_during_switch; -extern int leon_flush_needed(void); -extern void leon_flush_pcache_all(struct vm_area_struct *vma, unsigned long page); +int leon_flush_needed(void); +void leon_flush_pcache_all(struct vm_area_struct *vma, unsigned long page);  /* struct that hold LEON3 cache configuration registers */  struct leon3_cacheregs { @@ -217,29 +217,29 @@ struct leon3_cacheregs {  struct device_node;  struct task_struct; -extern unsigned int leon_build_device_irq(unsigned int real_irq, -					   irq_flow_handler_t flow_handler, -					   const char *name, int do_ack); -extern void leon_update_virq_handling(unsigned int virq, -			      irq_flow_handler_t flow_handler, -			      const char *name, int do_ack); -extern void leon_init_timers(void); -extern void leon_trans_init(struct device_node *dp); -extern void leon_node_init(struct device_node *dp, struct device_node ***nextp); -extern void init_leon(void); -extern void poke_leonsparc(void); -extern void leon3_getCacheRegs(struct leon3_cacheregs *regs); +unsigned int leon_build_device_irq(unsigned int real_irq, +				   irq_flow_handler_t flow_handler, +				   const char *name, int do_ack); +void leon_update_virq_handling(unsigned int virq, +			       irq_flow_handler_t flow_handler, +			       const char *name, int do_ack); +void leon_init_timers(void); +void leon_trans_init(struct device_node *dp); +void leon_node_init(struct device_node *dp, struct device_node ***nextp); +void init_leon(void); +void poke_leonsparc(void); +void leon3_getCacheRegs(struct leon3_cacheregs *regs);  extern int leon3_ticker_irq;  #ifdef CONFIG_SMP -extern int leon_smp_nrcpus(void); -extern void leon_clear_profile_irq(int cpu); -extern void leon_smp_done(void); -extern void leon_boot_cpus(void); -extern int leon_boot_one_cpu(int i, struct task_struct *); +int leon_smp_nrcpus(void); +void leon_clear_profile_irq(int cpu); +void leon_smp_done(void); +void leon_boot_cpus(void); +int leon_boot_one_cpu(int i, struct task_struct *);  void leon_init_smp(void);  void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu); -extern irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused); +irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused);  extern unsigned int smpleon_ipi[];  extern unsigned int linux_trap_ipi15_leon[]; diff --git a/arch/sparc/include/asm/leon_pci.h b/arch/sparc/include/asm/leon_pci.h index bfd3ab3092b..049d067ed8b 100644 --- a/arch/sparc/include/asm/leon_pci.h +++ b/arch/sparc/include/asm/leon_pci.h @@ -16,7 +16,7 @@ struct leon_pci_info {  	int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);  }; -extern void leon_pci_init(struct platform_device *ofdev, -				struct leon_pci_info *info); +void leon_pci_init(struct platform_device *ofdev, +		   struct leon_pci_info *info);  #endif /* _ASM_LEON_PCI_H_ */ diff --git a/arch/sparc/include/asm/mc146818rtc.h b/arch/sparc/include/asm/mc146818rtc.h index 67ed9e3a023..d8e72f37dc4 100644 --- a/arch/sparc/include/asm/mc146818rtc.h +++ b/arch/sparc/include/asm/mc146818rtc.h @@ -1,5 +1,10 @@  #ifndef ___ASM_SPARC_MC146818RTC_H  #define ___ASM_SPARC_MC146818RTC_H + +#include <linux/spinlock.h> + +extern spinlock_t rtc_lock; +  #if defined(__sparc__) && defined(__arch64__)  #include <asm/mc146818rtc_64.h>  #else diff --git a/arch/sparc/include/asm/mdesc.h b/arch/sparc/include/asm/mdesc.h index 139097f3a67..aebeb88f70d 100644 --- a/arch/sparc/include/asm/mdesc.h +++ b/arch/sparc/include/asm/mdesc.h @@ -12,13 +12,13 @@ struct mdesc_handle;   * the first argument to all of the operational calls that work   * on mdescs.   */ -extern struct mdesc_handle *mdesc_grab(void); -extern void mdesc_release(struct mdesc_handle *); +struct mdesc_handle *mdesc_grab(void); +void mdesc_release(struct mdesc_handle *);  #define MDESC_NODE_NULL		(~(u64)0) -extern u64 mdesc_node_by_name(struct mdesc_handle *handle, -			      u64 from_node, const char *name); +u64 mdesc_node_by_name(struct mdesc_handle *handle, +		       u64 from_node, const char *name);  #define mdesc_for_each_node_by_name(__hdl, __node, __name) \  	for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \  	     (__node) != MDESC_NODE_NULL; \ @@ -34,9 +34,9 @@ extern u64 mdesc_node_by_name(struct mdesc_handle *handle,   *   * These same rules apply to mdesc_node_name().   */ -extern const void *mdesc_get_property(struct mdesc_handle *handle, -				      u64 node, const char *name, int *lenp); -extern const char *mdesc_node_name(struct mdesc_handle *hp, u64 node); +const void *mdesc_get_property(struct mdesc_handle *handle, +			       u64 node, const char *name, int *lenp); +const char *mdesc_node_name(struct mdesc_handle *hp, u64 node);  /* MD arc iteration, the standard sequence is:   * @@ -50,16 +50,16 @@ extern const char *mdesc_node_name(struct mdesc_handle *hp, u64 node);  #define MDESC_ARC_TYPE_FWD	"fwd"  #define MDESC_ARC_TYPE_BACK	"back" -extern u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from, -			  const char *arc_type); +u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from, +		   const char *arc_type);  #define mdesc_for_each_arc(__arc, __hdl, __node, __type) \  	for (__arc = mdesc_next_arc(__hdl, __node, __type); \  	     (__arc) != MDESC_NODE_NULL; \  	     __arc = mdesc_next_arc(__hdl, __arc, __type)) -extern u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc); +u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc); -extern void mdesc_update(void); +void mdesc_update(void);  struct mdesc_notifier_client {  	void (*add)(struct mdesc_handle *handle, u64 node); @@ -69,12 +69,12 @@ struct mdesc_notifier_client {  	struct mdesc_notifier_client	*next;  }; -extern void mdesc_register_notifier(struct mdesc_notifier_client *client); +void mdesc_register_notifier(struct mdesc_notifier_client *client); -extern void mdesc_fill_in_cpu_data(cpumask_t *mask); -extern void mdesc_populate_present_mask(cpumask_t *mask); -extern void mdesc_get_page_sizes(cpumask_t *mask, unsigned long *pgsz_mask); +void mdesc_fill_in_cpu_data(cpumask_t *mask); +void mdesc_populate_present_mask(cpumask_t *mask); +void mdesc_get_page_sizes(cpumask_t *mask, unsigned long *pgsz_mask); -extern void sun4v_mdesc_init(void); +void sun4v_mdesc_init(void);  #endif diff --git a/arch/sparc/include/asm/mmu_64.h b/arch/sparc/include/asm/mmu_64.h index 76092c4dd27..70067ce184b 100644 --- a/arch/sparc/include/asm/mmu_64.h +++ b/arch/sparc/include/asm/mmu_64.h @@ -67,9 +67,9 @@ struct tsb {  	unsigned long pte;  } __attribute__((aligned(TSB_ENTRY_ALIGNMENT))); -extern void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte); -extern void tsb_flush(unsigned long ent, unsigned long tag); -extern void tsb_init(struct tsb *tsb, unsigned long size); +void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte); +void tsb_flush(unsigned long ent, unsigned long tag); +void tsb_init(struct tsb *tsb, unsigned long size);  struct tsb_config {  	struct tsb		*tsb; @@ -93,7 +93,6 @@ typedef struct {  	spinlock_t		lock;  	unsigned long		sparc64_ctx_val;  	unsigned long		huge_pte_count; -	struct page		*pgtable_page;  	struct tsb_config	tsb_block[MM_NUM_TSBS];  	struct hv_tsb_descr	tsb_descr[MM_NUM_TSBS];  } mm_context_t; diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h index 3d528f06e4b..b84be675e50 100644 --- a/arch/sparc/include/asm/mmu_context_64.h +++ b/arch/sparc/include/asm/mmu_context_64.h @@ -17,20 +17,20 @@ extern spinlock_t ctx_alloc_lock;  extern unsigned long tlb_context_cache;  extern unsigned long mmu_context_bmap[]; -extern void get_new_mmu_context(struct mm_struct *mm); +void get_new_mmu_context(struct mm_struct *mm);  #ifdef CONFIG_SMP -extern void smp_new_mmu_context_version(void); +void smp_new_mmu_context_version(void);  #else  #define smp_new_mmu_context_version() do { } while (0)  #endif -extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); -extern void destroy_context(struct mm_struct *mm); +int init_new_context(struct task_struct *tsk, struct mm_struct *mm); +void destroy_context(struct mm_struct *mm); -extern void __tsb_context_switch(unsigned long pgd_pa, -				 struct tsb_config *tsb_base, -				 struct tsb_config *tsb_huge, -				 unsigned long tsb_descr_pa); +void __tsb_context_switch(unsigned long pgd_pa, +			  struct tsb_config *tsb_base, +			  struct tsb_config *tsb_huge, +			  unsigned long tsb_descr_pa);  static inline void tsb_context_switch(struct mm_struct *mm)  { @@ -46,9 +46,11 @@ static inline void tsb_context_switch(struct mm_struct *mm)  			     , __pa(&mm->context.tsb_descr[0]));  } -extern void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long mm_rss); +void tsb_grow(struct mm_struct *mm, +	      unsigned long tsb_index, +	      unsigned long mm_rss);  #ifdef CONFIG_SMP -extern void smp_tsb_sync(struct mm_struct *mm); +void smp_tsb_sync(struct mm_struct *mm);  #else  #define smp_tsb_sync(__mm) do { } while (0)  #endif @@ -66,7 +68,7 @@ extern void smp_tsb_sync(struct mm_struct *mm);  	: "r" (CTX_HWBITS((__mm)->context)), \  	  "r" (SECONDARY_CONTEXT), "i" (ASI_DMMU), "i" (ASI_MMU)) -extern void __flush_tlb_mm(unsigned long, unsigned long); +void __flush_tlb_mm(unsigned long, unsigned long);  /* Switch the current MM context. */  static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk) diff --git a/arch/sparc/include/asm/nmi.h b/arch/sparc/include/asm/nmi.h index 72e6500e7ab..26ad2b2607c 100644 --- a/arch/sparc/include/asm/nmi.h +++ b/arch/sparc/include/asm/nmi.h @@ -1,13 +1,13 @@  #ifndef __NMI_H  #define __NMI_H -extern int __init nmi_init(void); -extern void perfctr_irq(int irq, struct pt_regs *regs); -extern void nmi_adjust_hz(unsigned int new_hz); +int __init nmi_init(void); +void perfctr_irq(int irq, struct pt_regs *regs); +void nmi_adjust_hz(unsigned int new_hz);  extern atomic_t nmi_active; -extern void start_nmi_watchdog(void *unused); -extern void stop_nmi_watchdog(void *unused); +void start_nmi_watchdog(void *unused); +void stop_nmi_watchdog(void *unused);  #endif /* __NMI_H */ diff --git a/arch/sparc/include/asm/oplib_32.h b/arch/sparc/include/asm/oplib_32.h index c72f3045820..56a09b9d7b1 100644 --- a/arch/sparc/include/asm/oplib_32.h +++ b/arch/sparc/include/asm/oplib_32.h @@ -43,28 +43,28 @@ extern struct linux_nodeops *prom_nodeops;  /* You must call prom_init() before using any of the library services,   * preferably as early as possible.  Pass it the romvec pointer.   */ -extern void prom_init(struct linux_romvec *rom_ptr); +void prom_init(struct linux_romvec *rom_ptr);  /* Boot argument acquisition, returns the boot command line string. */ -extern char *prom_getbootargs(void); +char *prom_getbootargs(void);  /* Miscellaneous routines, don't really fit in any category per se. */  /* Reboot the machine with the command line passed. */ -extern void prom_reboot(char *boot_command); +void prom_reboot(char *boot_command);  /* Evaluate the forth string passed. */ -extern void prom_feval(char *forth_string); +void prom_feval(char *forth_string);  /* Enter the prom, with possibility of continuation with the 'go'   * command in newer proms.   */ -extern void prom_cmdline(void); +void prom_cmdline(void);  /* Enter the prom, with no chance of continuation for the stand-alone   * which calls this.   */ -extern void __noreturn prom_halt(void); +void __noreturn prom_halt(void);  /* Set the PROM 'sync' callback function to the passed function pointer.   * When the user gives the 'sync' command at the prom prompt while the @@ -73,37 +73,37 @@ extern void __noreturn prom_halt(void);   * XXX The arguments are different on V0 vs. V2->higher proms, grrr! XXX   */  typedef void (*sync_func_t)(void); -extern void prom_setsync(sync_func_t func_ptr); +void prom_setsync(sync_func_t func_ptr);  /* Acquire the IDPROM of the root node in the prom device tree.  This   * gets passed a buffer where you would like it stuffed.  The return value   * is the format type of this idprom or 0xff on error.   */ -extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); +unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size);  /* Get the prom major version. */ -extern int prom_version(void); +int prom_version(void);  /* Get the prom plugin revision. */ -extern int prom_getrev(void); +int prom_getrev(void);  /* Get the prom firmware revision. */ -extern int prom_getprev(void); +int prom_getprev(void);  /* Write a buffer of characters to the console. */ -extern void prom_console_write_buf(const char *buf, int len); +void prom_console_write_buf(const char *buf, int len);  /* Prom's internal routines, don't use in kernel/boot code. */ -extern __printf(1, 2) void prom_printf(const char *fmt, ...); -extern void prom_write(const char *buf, unsigned int len); +__printf(1, 2) void prom_printf(const char *fmt, ...); +void prom_write(const char *buf, unsigned int len);  /* Multiprocessor operations... */  /* Start the CPU with the given device tree node, context table, and context   * at the passed program counter.   */ -extern int prom_startcpu(int cpunode, struct linux_prom_registers *context_table, -			 int context, char *program_counter); +int prom_startcpu(int cpunode, struct linux_prom_registers *context_table, +		  int context, char *program_counter);  /* Initialize the memory lists based upon the prom version. */  void prom_meminit(void); @@ -111,65 +111,65 @@ void prom_meminit(void);  /* PROM device tree traversal functions... */  /* Get the child node of the given node, or zero if no child exists. */ -extern phandle prom_getchild(phandle parent_node); +phandle prom_getchild(phandle parent_node);  /* Get the next sibling node of the given node, or zero if no further   * siblings exist.   */ -extern phandle prom_getsibling(phandle node); +phandle prom_getsibling(phandle node);  /* Get the length, at the passed node, of the given property type.   * Returns -1 on error (ie. no such property at this node).   */ -extern int prom_getproplen(phandle thisnode, const char *property); +int prom_getproplen(phandle thisnode, const char *property);  /* Fetch the requested property using the given buffer.  Returns   * the number of bytes the prom put into your buffer or -1 on error.   */ -extern int __must_check prom_getproperty(phandle thisnode, const char *property, -					 char *prop_buffer, int propbuf_size); +int __must_check prom_getproperty(phandle thisnode, const char *property, +				  char *prop_buffer, int propbuf_size);  /* Acquire an integer property. */ -extern int prom_getint(phandle node, char *property); +int prom_getint(phandle node, char *property);  /* Acquire an integer property, with a default value. */ -extern int prom_getintdefault(phandle node, char *property, int defval); +int prom_getintdefault(phandle node, char *property, int defval);  /* Acquire a boolean property, 0=FALSE 1=TRUE. */ -extern int prom_getbool(phandle node, char *prop); +int prom_getbool(phandle node, char *prop);  /* Acquire a string property, null string on error. */ -extern void prom_getstring(phandle node, char *prop, char *buf, int bufsize); +void prom_getstring(phandle node, char *prop, char *buf, int bufsize);  /* Search all siblings starting at the passed node for "name" matching   * the given string.  Returns the node on success, zero on failure.   */ -extern phandle prom_searchsiblings(phandle node_start, char *name); +phandle prom_searchsiblings(phandle node_start, char *name);  /* Returns the next property after the passed property for the given   * node.  Returns null string on failure.   */ -extern char *prom_nextprop(phandle node, char *prev_property, char *buffer); +char *prom_nextprop(phandle node, char *prev_property, char *buffer);  /* Returns phandle of the path specified */ -extern phandle prom_finddevice(char *name); +phandle prom_finddevice(char *name);  /* Set the indicated property at the given node with the passed value.   * Returns the number of bytes of your value that the prom took.   */ -extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, -			int value_size); +int prom_setprop(phandle node, const char *prop_name, char *prop_value, +		 int value_size); -extern phandle prom_inst2pkg(int); +phandle prom_inst2pkg(int);  /* Dorking with Bus ranges... */  /* Apply promlib probes OBIO ranges to registers. */ -extern void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs); +void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs);  /* Apply ranges of any prom node (and optionally parent node as well) to registers. */ -extern void prom_apply_generic_ranges(phandle node, phandle parent, -				      struct linux_prom_registers *sbusregs, int nregs); +void prom_apply_generic_ranges(phandle node, phandle parent, +			       struct linux_prom_registers *sbusregs, int nregs);  void prom_ranges_init(void); diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h index a12dbe3b776..f34682430fc 100644 --- a/arch/sparc/include/asm/oplib_64.h +++ b/arch/sparc/include/asm/oplib_64.h @@ -62,100 +62,100 @@ struct linux_mem_p1275 {  /* You must call prom_init() before using any of the library services,   * preferably as early as possible.  Pass it the romvec pointer.   */ -extern void prom_init(void *cif_handler, void *cif_stack); +void prom_init(void *cif_handler, void *cif_stack);  /* Boot argument acquisition, returns the boot command line string. */ -extern char *prom_getbootargs(void); +char *prom_getbootargs(void);  /* Miscellaneous routines, don't really fit in any category per se. */  /* Reboot the machine with the command line passed. */ -extern void prom_reboot(const char *boot_command); +void prom_reboot(const char *boot_command);  /* Evaluate the forth string passed. */ -extern void prom_feval(const char *forth_string); +void prom_feval(const char *forth_string);  /* Enter the prom, with possibility of continuation with the 'go'   * command in newer proms.   */ -extern void prom_cmdline(void); +void prom_cmdline(void);  /* Enter the prom, with no chance of continuation for the stand-alone   * which calls this.   */ -extern void prom_halt(void) __attribute__ ((noreturn)); +void prom_halt(void) __attribute__ ((noreturn));  /* Halt and power-off the machine. */ -extern void prom_halt_power_off(void) __attribute__ ((noreturn)); +void prom_halt_power_off(void) __attribute__ ((noreturn));  /* Acquire the IDPROM of the root node in the prom device tree.  This   * gets passed a buffer where you would like it stuffed.  The return value   * is the format type of this idprom or 0xff on error.   */ -extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); +unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size);  /* Write a buffer of characters to the console. */ -extern void prom_console_write_buf(const char *buf, int len); +void prom_console_write_buf(const char *buf, int len);  /* Prom's internal routines, don't use in kernel/boot code. */ -extern __printf(1, 2) void prom_printf(const char *fmt, ...); -extern void prom_write(const char *buf, unsigned int len); +__printf(1, 2) void prom_printf(const char *fmt, ...); +void prom_write(const char *buf, unsigned int len);  /* Multiprocessor operations... */  #ifdef CONFIG_SMP  /* Start the CPU with the given device tree node at the passed program   * counter with the given arg passed in via register %o0.   */ -extern void prom_startcpu(int cpunode, unsigned long pc, unsigned long arg); +void prom_startcpu(int cpunode, unsigned long pc, unsigned long arg);  /* Start the CPU with the given cpu ID at the passed program   * counter with the given arg passed in via register %o0.   */ -extern void prom_startcpu_cpuid(int cpuid, unsigned long pc, unsigned long arg); +void prom_startcpu_cpuid(int cpuid, unsigned long pc, unsigned long arg);  /* Stop the CPU with the given cpu ID.  */ -extern void prom_stopcpu_cpuid(int cpuid); +void prom_stopcpu_cpuid(int cpuid);  /* Stop the current CPU. */ -extern void prom_stopself(void); +void prom_stopself(void);  /* Idle the current CPU. */ -extern void prom_idleself(void); +void prom_idleself(void);  /* Resume the CPU with the passed device tree node. */ -extern void prom_resumecpu(int cpunode); +void prom_resumecpu(int cpunode);  #endif  /* Power management interfaces. */  /* Put the current CPU to sleep. */ -extern void prom_sleepself(void); +void prom_sleepself(void);  /* Put the entire system to sleep. */ -extern int prom_sleepsystem(void); +int prom_sleepsystem(void);  /* Initiate a wakeup event. */ -extern int prom_wakeupsystem(void); +int prom_wakeupsystem(void);  /* MMU and memory related OBP interfaces. */  /* Get unique string identifying SIMM at given physical address. */ -extern int prom_getunumber(int syndrome_code, -			   unsigned long phys_addr, -			   char *buf, int buflen); +int prom_getunumber(int syndrome_code, +		    unsigned long phys_addr, +		    char *buf, int buflen);  /* Retain physical memory to the caller across soft resets. */ -extern int prom_retain(const char *name, unsigned long size, -		       unsigned long align, unsigned long *paddr); +int prom_retain(const char *name, unsigned long size, +		unsigned long align, unsigned long *paddr);  /* Load explicit I/D TLB entries into the calling processor. */ -extern long prom_itlb_load(unsigned long index, -			   unsigned long tte_data, -			   unsigned long vaddr); +long prom_itlb_load(unsigned long index, +		    unsigned long tte_data, +		    unsigned long vaddr); -extern long prom_dtlb_load(unsigned long index, -			   unsigned long tte_data, -			   unsigned long vaddr); +long prom_dtlb_load(unsigned long index, +		    unsigned long tte_data, +		    unsigned long vaddr);  /* Map/Unmap client program address ranges.  First the format of   * the mapping mode argument. @@ -170,81 +170,81 @@ extern long prom_dtlb_load(unsigned long index,  #define PROM_MAP_IE	0x0100 /* Invert-Endianness */  #define PROM_MAP_DEFAULT (PROM_MAP_WRITE | PROM_MAP_READ | PROM_MAP_EXEC | PROM_MAP_CACHED) -extern int prom_map(int mode, unsigned long size, -		    unsigned long vaddr, unsigned long paddr); -extern void prom_unmap(unsigned long size, unsigned long vaddr); +int prom_map(int mode, unsigned long size, +	     unsigned long vaddr, unsigned long paddr); +void prom_unmap(unsigned long size, unsigned long vaddr);  /* PROM device tree traversal functions... */  /* Get the child node of the given node, or zero if no child exists. */ -extern phandle prom_getchild(phandle parent_node); +phandle prom_getchild(phandle parent_node);  /* Get the next sibling node of the given node, or zero if no further   * siblings exist.   */ -extern phandle prom_getsibling(phandle node); +phandle prom_getsibling(phandle node);  /* Get the length, at the passed node, of the given property type.   * Returns -1 on error (ie. no such property at this node).   */ -extern int prom_getproplen(phandle thisnode, const char *property); +int prom_getproplen(phandle thisnode, const char *property);  /* Fetch the requested property using the given buffer.  Returns   * the number of bytes the prom put into your buffer or -1 on error.   */ -extern int prom_getproperty(phandle thisnode, const char *property, -			    char *prop_buffer, int propbuf_size); +int prom_getproperty(phandle thisnode, const char *property, +		     char *prop_buffer, int propbuf_size);  /* Acquire an integer property. */ -extern int prom_getint(phandle node, const char *property); +int prom_getint(phandle node, const char *property);  /* Acquire an integer property, with a default value. */ -extern int prom_getintdefault(phandle node, const char *property, int defval); +int prom_getintdefault(phandle node, const char *property, int defval);  /* Acquire a boolean property, 0=FALSE 1=TRUE. */ -extern int prom_getbool(phandle node, const char *prop); +int prom_getbool(phandle node, const char *prop);  /* Acquire a string property, null string on error. */ -extern void prom_getstring(phandle node, const char *prop, char *buf, -			   int bufsize); +void prom_getstring(phandle node, const char *prop, char *buf, +		    int bufsize);  /* Does the passed node have the given "name"? YES=1 NO=0 */ -extern int prom_nodematch(phandle thisnode, const char *name); +int prom_nodematch(phandle thisnode, const char *name);  /* Search all siblings starting at the passed node for "name" matching   * the given string.  Returns the node on success, zero on failure.   */ -extern phandle prom_searchsiblings(phandle node_start, const char *name); +phandle prom_searchsiblings(phandle node_start, const char *name);  /* Return the first property type, as a string, for the given node.   * Returns a null string on error. Buffer should be at least 32B long.   */ -extern char *prom_firstprop(phandle node, char *buffer); +char *prom_firstprop(phandle node, char *buffer);  /* Returns the next property after the passed property for the given   * node.  Returns null string on failure. Buffer should be at least 32B long.   */ -extern char *prom_nextprop(phandle node, const char *prev_property, char *buf); +char *prom_nextprop(phandle node, const char *prev_property, char *buf);  /* Returns 1 if the specified node has given property. */ -extern int prom_node_has_property(phandle node, const char *property); +int prom_node_has_property(phandle node, const char *property);  /* Returns phandle of the path specified */ -extern phandle prom_finddevice(const char *name); +phandle prom_finddevice(const char *name);  /* Set the indicated property at the given node with the passed value.   * Returns the number of bytes of your value that the prom took.   */ -extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, -			int value_size); +int prom_setprop(phandle node, const char *prop_name, char *prop_value, +		 int value_size); -extern phandle prom_inst2pkg(int); -extern void prom_sun4v_guest_soft_state(void); +phandle prom_inst2pkg(int); +void prom_sun4v_guest_soft_state(void); -extern int prom_ihandle2path(int handle, char *buffer, int bufsize); +int prom_ihandle2path(int handle, char *buffer, int bufsize);  /* Client interface level routines. */ -extern void p1275_cmd_direct(unsigned long *); +void p1275_cmd_direct(unsigned long *);  #endif /* !(__SPARC64_OPLIB_H) */ diff --git a/arch/sparc/include/asm/page.h b/arch/sparc/include/asm/page.h index f21de034902..1be2fdec626 100644 --- a/arch/sparc/include/asm/page.h +++ b/arch/sparc/include/asm/page.h @@ -1,5 +1,8 @@  #ifndef ___ASM_SPARC_PAGE_H  #define ___ASM_SPARC_PAGE_H + +#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT) +  #if defined(__sparc__) && defined(__arch64__)  #include <asm/page_64.h>  #else diff --git a/arch/sparc/include/asm/page_64.h b/arch/sparc/include/asm/page_64.h index e15538899f3..bf109984a03 100644 --- a/arch/sparc/include/asm/page_64.h +++ b/arch/sparc/include/asm/page_64.h @@ -15,7 +15,10 @@  #define DCACHE_ALIASING_POSSIBLE  #endif -#define HPAGE_SHIFT		22 +#define HPAGE_SHIFT		23 +#define REAL_HPAGE_SHIFT	22 + +#define REAL_HPAGE_SIZE		(_AC(1,UL) << REAL_HPAGE_SHIFT)  #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)  #define HPAGE_SIZE		(_AC(1,UL) << HPAGE_SHIFT) @@ -28,17 +31,17 @@  #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)  struct pt_regs; -extern void hugetlb_setup(struct pt_regs *regs); +void hugetlb_setup(struct pt_regs *regs);  #endif  #define WANT_PAGE_VIRTUAL -extern void _clear_page(void *page); +void _clear_page(void *page);  #define clear_page(X)	_clear_page((void *)(X))  struct page; -extern void clear_user_page(void *addr, unsigned long vaddr, struct page *page); +void clear_user_page(void *addr, unsigned long vaddr, struct page *page);  #define copy_page(X,Y)	memcpy((void *)(X), (void *)(Y), PAGE_SIZE) -extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage); +void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage);  /* Unlike sparc32, sparc64's parameter passing API is more   * sane in that structures which as small enough are passed @@ -53,8 +56,8 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct pag  /* These are used to make use of C type-checking.. */  typedef struct { unsigned long pte; } pte_t;  typedef struct { unsigned long iopte; } iopte_t; -typedef struct { unsigned int pmd; } pmd_t; -typedef struct { unsigned int pgd; } pgd_t; +typedef struct { unsigned long pmd; } pmd_t; +typedef struct { unsigned long pgd; } pgd_t;  typedef struct { unsigned long pgprot; } pgprot_t;  #define pte_val(x)	((x).pte) @@ -73,8 +76,8 @@ typedef struct { unsigned long pgprot; } pgprot_t;  /* .. while these make it easier on the compiler */  typedef unsigned long pte_t;  typedef unsigned long iopte_t; -typedef unsigned int pmd_t; -typedef unsigned int pgd_t; +typedef unsigned long pmd_t; +typedef unsigned long pgd_t;  typedef unsigned long pgprot_t;  #define pte_val(x)	(x) @@ -93,18 +96,44 @@ typedef unsigned long pgprot_t;  typedef pte_t *pgtable_t; +/* These two values define the virtual address space range in which we + * must forbid 64-bit user processes from making mappings.  It used to + * represent precisely the virtual address space hole present in most + * early sparc64 chips including UltraSPARC-I.  But now it also is + * further constrained by the limits of our page tables, which is + * 43-bits of virtual address. + */ +#define SPARC64_VA_HOLE_TOP	_AC(0xfffffc0000000000,UL) +#define SPARC64_VA_HOLE_BOTTOM	_AC(0x0000040000000000,UL) + +/* The next two defines specify the actual exclusion region we + * enforce, wherein we use a 4GB red zone on each side of the VA hole. + */ +#define VA_EXCLUDE_START (SPARC64_VA_HOLE_BOTTOM - (1UL << 32UL)) +#define VA_EXCLUDE_END   (SPARC64_VA_HOLE_TOP + (1UL << 32UL)) +  #define TASK_UNMAPPED_BASE	(test_thread_flag(TIF_32BIT) ? \ -				 (_AC(0x0000000070000000,UL)) : \ -				 (_AC(0xfffff80000000000,UL) + (1UL << 32UL))) +				 _AC(0x0000000070000000,UL) : \ +				 VA_EXCLUDE_END)  #include <asm-generic/memory_model.h> +#define PAGE_OFFSET_BY_BITS(X)	(-(_AC(1,UL) << (X))) +extern unsigned long PAGE_OFFSET; +  #endif /* !(__ASSEMBLY__) */ -/* We used to stick this into a hard-coded global register (%g4) - * but that does not make sense anymore. +/* The maximum number of physical memory address bits we support, this + * is used to size various tables used to manage kernel TLB misses and + * also the sparsemem code. + */ +#define MAX_PHYS_ADDRESS_BITS	47 + +/* These two shift counts are used when indexing sparc64_valid_addr_bitmap + * and kpte_linear_bitmap.   */ -#define PAGE_OFFSET		_AC(0xFFFFF80000000000,UL) +#define ILOG2_4MB		22 +#define ILOG2_256MB		28  #ifndef __ASSEMBLY__ diff --git a/arch/sparc/include/asm/pci_32.h b/arch/sparc/include/asm/pci_32.h index dc503297481..53e9b4987db 100644 --- a/arch/sparc/include/asm/pci_32.h +++ b/arch/sparc/include/asm/pci_32.h @@ -16,11 +16,6 @@  #define PCI_IRQ_NONE		0xffffffff -static inline void pcibios_penalize_isa_irq(int irq, int active) -{ -	/* We don't do dynamic PCI IRQ allocation */ -} -  /* Dynamic DMA mapping stuff.   */  #define PCI_DMA_BUS_IS_PHYS	(0) diff --git a/arch/sparc/include/asm/pci_64.h b/arch/sparc/include/asm/pci_64.h index 1633b718d3b..bd00a622616 100644 --- a/arch/sparc/include/asm/pci_64.h +++ b/arch/sparc/include/asm/pci_64.h @@ -16,11 +16,6 @@  #define PCI_IRQ_NONE		0xffffffff -static inline void pcibios_penalize_isa_irq(int irq, int active) -{ -	/* We don't do dynamic PCI IRQ allocation */ -} -  /* The PCI address space does not equal the physical memory   * address space.  The networking and block device layers use   * this boolean for bounce buffer decisions. @@ -57,7 +52,7 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,  /* Return the index of the PCI controller for device PDEV. */ -extern int pci_domain_nr(struct pci_bus *bus); +int pci_domain_nr(struct pci_bus *bus);  static inline int pci_proc_domain(struct pci_bus *bus)  {  	return 1; @@ -69,9 +64,9 @@ static inline int pci_proc_domain(struct pci_bus *bus)  #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA  #define get_pci_unmapped_area get_fb_unmapped_area -extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, -			       enum pci_mmap_state mmap_state, -			       int write_combine); +int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, +			enum pci_mmap_state mmap_state, +			int write_combine);  static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)  { @@ -79,9 +74,9 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)  }  #define HAVE_ARCH_PCI_RESOURCE_TO_USER -extern void pci_resource_to_user(const struct pci_dev *dev, int bar, -				 const struct resource *rsrc, -				 resource_size_t *start, resource_size_t *end); +void pci_resource_to_user(const struct pci_dev *dev, int bar, +			  const struct resource *rsrc, +			  resource_size_t *start, resource_size_t *end);  #endif /* __KERNEL__ */  #endif /* __SPARC64_PCI_H */ diff --git a/arch/sparc/include/asm/pcic.h b/arch/sparc/include/asm/pcic.h index 6676cbcc8b6..f4170679259 100644 --- a/arch/sparc/include/asm/pcic.h +++ b/arch/sparc/include/asm/pcic.h @@ -30,10 +30,10 @@ struct linux_pcic {  };  #ifdef CONFIG_PCIC_PCI -extern int pcic_present(void); -extern int pcic_probe(void); -extern void pci_time_init(void); -extern void sun4m_pci_init_IRQ(void); +int pcic_present(void); +int pcic_probe(void); +void pci_time_init(void); +void sun4m_pci_init_IRQ(void);  #else  static inline int pcic_present(void) { return 0; }  static inline int pcic_probe(void) { return 0; } diff --git a/arch/sparc/include/asm/pcr.h b/arch/sparc/include/asm/pcr.h index 942bb17f60c..cdf800c3326 100644 --- a/arch/sparc/include/asm/pcr.h +++ b/arch/sparc/include/asm/pcr.h @@ -12,8 +12,8 @@ struct pcr_ops {  };  extern const struct pcr_ops *pcr_ops; -extern void deferred_pcr_work_irq(int irq, struct pt_regs *regs); -extern void schedule_deferred_pcr_work(void); +void deferred_pcr_work_irq(int irq, struct pt_regs *regs); +void schedule_deferred_pcr_work(void);  #define PCR_PIC_PRIV		0x00000001 /* PIC access is privileged */  #define PCR_STRACE		0x00000002 /* Trace supervisor events  */ @@ -45,6 +45,6 @@ extern void schedule_deferred_pcr_work(void);  #define PCR_N4_PICNHT		0x00020000 /* PIC non-hypervisor trap  */  #define PCR_N4_NTC		0x00040000 /* Next-To-Commit wrap      */ -extern int pcr_arch_init(void); +int pcr_arch_init(void);  #endif /* __PCR_H */ diff --git a/arch/sparc/include/asm/pgalloc_32.h b/arch/sparc/include/asm/pgalloc_32.h index 9b1c36de0f1..a3890da9442 100644 --- a/arch/sparc/include/asm/pgalloc_32.h +++ b/arch/sparc/include/asm/pgalloc_32.h @@ -14,6 +14,8 @@ struct page;  void *srmmu_get_nocache(int size, int align);  void srmmu_free_nocache(void *addr, int size); +extern struct resource sparc_iomap; +  #define check_pgt_cache()	do { } while (0)  pgd_t *get_pgd_fast(void); diff --git a/arch/sparc/include/asm/pgalloc_64.h b/arch/sparc/include/asm/pgalloc_64.h index bcfe063bce2..39a7ac49b00 100644 --- a/arch/sparc/include/asm/pgalloc_64.h +++ b/arch/sparc/include/asm/pgalloc_64.h @@ -38,12 +38,12 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)  	kmem_cache_free(pgtable_cache, pmd);  } -extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, -				   unsigned long address); -extern pgtable_t pte_alloc_one(struct mm_struct *mm, -			       unsigned long address); -extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte); -extern void pte_free(struct mm_struct *mm, pgtable_t ptepage); +pte_t *pte_alloc_one_kernel(struct mm_struct *mm, +			    unsigned long address); +pgtable_t pte_alloc_one(struct mm_struct *mm, +			unsigned long address); +void pte_free_kernel(struct mm_struct *mm, pte_t *pte); +void pte_free(struct mm_struct *mm, pgtable_t ptepage);  #define pmd_populate_kernel(MM, PMD, PTE)	pmd_set(MM, PMD, PTE)  #define pmd_populate(MM, PMD, PTE)		pmd_set(MM, PMD, PTE) @@ -51,12 +51,12 @@ extern void pte_free(struct mm_struct *mm, pgtable_t ptepage);  #define check_pgt_cache()	do { } while (0) -extern void pgtable_free(void *table, bool is_page); +void pgtable_free(void *table, bool is_page);  #ifdef CONFIG_SMP  struct mmu_gather; -extern void tlb_remove_table(struct mmu_gather *, void *); +void tlb_remove_table(struct mmu_gather *, void *);  static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, bool is_page)  { diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h index 502f632f6cc..b9b91ae19fe 100644 --- a/arch/sparc/include/asm/pgtable_32.h +++ b/arch/sparc/include/asm/pgtable_32.h @@ -25,8 +25,9 @@  struct vm_area_struct;  struct page; -extern void load_mmu(void); -extern unsigned long calc_highpages(void); +void load_mmu(void); +unsigned long calc_highpages(void); +unsigned long __init bootmem_init(unsigned long *pages_avail);  #define pte_ERROR(e)   __builtin_trap()  #define pmd_ERROR(e)   __builtin_trap() @@ -56,7 +57,7 @@ extern unsigned long calc_highpages(void);   * srmmu.c will assign the real one (which is dynamically sized) */  #define swapper_pg_dir NULL -extern void paging_init(void); +void paging_init(void);  extern unsigned long ptr_in_current_pgd; @@ -428,8 +429,8 @@ extern unsigned long *sparc_valid_addr_bitmap;  #define GET_IOSPACE(pfn)		(pfn >> (BITS_PER_LONG - 4))  #define GET_PFN(pfn)			(pfn & 0x0fffffffUL) -extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, -			   unsigned long, pgprot_t); +int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, +		    unsigned long, pgprot_t);  static inline int io_remap_pfn_range(struct vm_area_struct *vma,  				     unsigned long from, unsigned long pfn, diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 36760317814..3770bf5c6e1 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h @@ -24,7 +24,8 @@  /* The kernel image occupies 0x4000000 to 0x6000000 (4MB --> 96MB).   * The page copy blockops can use 0x6000000 to 0x8000000. - * The TSB is mapped in the 0x8000000 to 0xa000000 range. + * The 8K TSB is mapped in the 0x8000000 to 0x8400000 range. + * The 4M TSB is mapped in the 0x8400000 to 0x8800000 range.   * The PROM resides in an area spanning 0xf0000000 to 0x100000000.   * The vmalloc area spans 0x100000000 to 0x200000000.   * Since modules need to be in the lowest 32-bits of the address space, @@ -33,7 +34,8 @@   * 0x400000000.   */  #define	TLBTEMP_BASE		_AC(0x0000000006000000,UL) -#define	TSBMAP_BASE		_AC(0x0000000008000000,UL) +#define	TSBMAP_8K_BASE		_AC(0x0000000008000000,UL) +#define	TSBMAP_4M_BASE		_AC(0x0000000008400000,UL)  #define MODULES_VADDR		_AC(0x0000000010000000,UL)  #define MODULES_LEN		_AC(0x00000000e0000000,UL)  #define MODULES_END		_AC(0x00000000f0000000,UL) @@ -48,18 +50,18 @@  /* PMD_SHIFT determines the size of the area a second-level page   * table can map   */ -#define PMD_SHIFT	(PAGE_SHIFT + (PAGE_SHIFT-4)) +#define PMD_SHIFT	(PAGE_SHIFT + (PAGE_SHIFT-3))  #define PMD_SIZE	(_AC(1,UL) << PMD_SHIFT)  #define PMD_MASK	(~(PMD_SIZE-1)) -#define PMD_BITS	(PAGE_SHIFT - 2) +#define PMD_BITS	(PAGE_SHIFT - 3)  /* PGDIR_SHIFT determines what a third-level page table entry can map */ -#define PGDIR_SHIFT	(PAGE_SHIFT + (PAGE_SHIFT-4) + PMD_BITS) +#define PGDIR_SHIFT	(PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS)  #define PGDIR_SIZE	(_AC(1,UL) << PGDIR_SHIFT)  #define PGDIR_MASK	(~(PGDIR_SIZE-1)) -#define PGDIR_BITS	(PAGE_SHIFT - 2) +#define PGDIR_BITS	(PAGE_SHIFT - 3) -#if (PGDIR_SHIFT + PGDIR_BITS) != 44 +#if (PGDIR_SHIFT + PGDIR_BITS) != 43  #error Page table parameters do not cover virtual address space properly.  #endif @@ -67,44 +69,41 @@  #error PMD_SHIFT must equal HPAGE_SHIFT for transparent huge pages.  #endif -/* PMDs point to PTE tables which are 4K aligned.  */ -#define PMD_PADDR	_AC(0xfffffffe,UL) -#define PMD_PADDR_SHIFT	_AC(11,UL) +#ifndef __ASSEMBLY__ -#define PMD_ISHUGE	_AC(0x00000001,UL) +#include <linux/sched.h> -/* This is the PMD layout when PMD_ISHUGE is set.  With 4MB huge - * pages, this frees up a bunch of bits in the layout that we can - * use for the protection settings and software metadata. - */ -#define PMD_HUGE_PADDR		_AC(0xfffff800,UL) -#define PMD_HUGE_PROTBITS	_AC(0x000007ff,UL) -#define PMD_HUGE_PRESENT	_AC(0x00000400,UL) -#define PMD_HUGE_WRITE		_AC(0x00000200,UL) -#define PMD_HUGE_DIRTY		_AC(0x00000100,UL) -#define PMD_HUGE_ACCESSED	_AC(0x00000080,UL) -#define PMD_HUGE_EXEC		_AC(0x00000040,UL) -#define PMD_HUGE_SPLITTING	_AC(0x00000020,UL) - -/* PGDs point to PMD tables which are 8K aligned.  */ -#define PGD_PADDR	_AC(0xfffffffc,UL) -#define PGD_PADDR_SHIFT	_AC(11,UL) +extern unsigned long sparc64_valid_addr_bitmap[]; -#ifndef __ASSEMBLY__ +/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ +static inline bool __kern_addr_valid(unsigned long paddr) +{ +	if ((paddr >> MAX_PHYS_ADDRESS_BITS) != 0UL) +		return false; +	return test_bit(paddr >> ILOG2_4MB, sparc64_valid_addr_bitmap); +} -#include <linux/sched.h> +static inline bool kern_addr_valid(unsigned long addr) +{ +	unsigned long paddr = __pa(addr); + +	return __kern_addr_valid(paddr); +}  /* Entries per page directory level. */ -#define PTRS_PER_PTE	(1UL << (PAGE_SHIFT-4)) +#define PTRS_PER_PTE	(1UL << (PAGE_SHIFT-3))  #define PTRS_PER_PMD	(1UL << PMD_BITS)  #define PTRS_PER_PGD	(1UL << PGDIR_BITS)  /* Kernel has a separate 44bit address space. */  #define FIRST_USER_ADDRESS	0 -#define pte_ERROR(e)	__builtin_trap() -#define pmd_ERROR(e)	__builtin_trap() -#define pgd_ERROR(e)	__builtin_trap() +#define pmd_ERROR(e)							\ +	pr_err("%s:%d: bad pmd %p(%016lx) seen at (%pS)\n",		\ +	       __FILE__, __LINE__, &(e), pmd_val(e), __builtin_return_address(0)) +#define pgd_ERROR(e)							\ +	pr_err("%s:%d: bad pgd %p(%016lx) seen at (%pS)\n",		\ +	       __FILE__, __LINE__, &(e), pgd_val(e), __builtin_return_address(0))  #endif /* !(__ASSEMBLY__) */ @@ -112,6 +111,7 @@  #define _PAGE_VALID	  _AC(0x8000000000000000,UL) /* Valid TTE            */  #define _PAGE_R	  	  _AC(0x8000000000000000,UL) /* Keep ref bit uptodate*/  #define _PAGE_SPECIAL     _AC(0x0200000000000000,UL) /* Special page         */ +#define _PAGE_PMD_HUGE    _AC(0x0100000000000000,UL) /* Huge page            */  /* Advertise support for _PAGE_SPECIAL */  #define __HAVE_ARCH_PTE_SPECIAL @@ -125,6 +125,7 @@  #define _PAGE_IE_4U	  _AC(0x0800000000000000,UL) /* Invert Endianness    */  #define _PAGE_SOFT2_4U	  _AC(0x07FC000000000000,UL) /* Software bits, set 2 */  #define _PAGE_SPECIAL_4U  _AC(0x0200000000000000,UL) /* Special page         */ +#define _PAGE_PMD_HUGE_4U _AC(0x0100000000000000,UL) /* Huge page            */  #define _PAGE_RES1_4U	  _AC(0x0002000000000000,UL) /* Reserved             */  #define _PAGE_SZ32MB_4U	  _AC(0x0001000000000000,UL) /* (Panther) 32MB page  */  #define _PAGE_SZ256MB_4U  _AC(0x2001000000000000,UL) /* (Panther) 256MB page */ @@ -155,6 +156,7 @@  #define _PAGE_READ_4V	  _AC(0x0800000000000000,UL) /* Readable SW Bit      */  #define _PAGE_WRITE_4V	  _AC(0x0400000000000000,UL) /* Writable SW Bit      */  #define _PAGE_SPECIAL_4V  _AC(0x0200000000000000,UL) /* Special page         */ +#define _PAGE_PMD_HUGE_4V _AC(0x0100000000000000,UL) /* Huge page            */  #define _PAGE_PADDR_4V	  _AC(0x00FFFFFFFFFFE000,UL) /* paddr[55:13]         */  #define _PAGE_IE_4V	  _AC(0x0000000000001000,UL) /* Invert Endianness    */  #define _PAGE_E_4V	  _AC(0x0000000000000800,UL) /* side-Effect          */ @@ -180,6 +182,10 @@  #define _PAGE_SZBITS_4U	_PAGE_SZ8K_4U  #define _PAGE_SZBITS_4V	_PAGE_SZ8K_4V +#if REAL_HPAGE_SHIFT != 22 +#error REAL_HPAGE_SHIFT and _PAGE_SZHUGE_foo must match up +#endif +  #define _PAGE_SZHUGE_4U	_PAGE_SZ4MB_4U  #define _PAGE_SZHUGE_4V	_PAGE_SZ4MB_4V @@ -204,9 +210,9 @@  #ifndef __ASSEMBLY__ -extern pte_t mk_pte_io(unsigned long, pgprot_t, int, unsigned long); +pte_t mk_pte_io(unsigned long, pgprot_t, int, unsigned long); -extern unsigned long pte_sz_bits(unsigned long size); +unsigned long pte_sz_bits(unsigned long size);  extern pgprot_t PAGE_KERNEL;  extern pgprot_t PAGE_KERNEL_LOCKED; @@ -239,16 +245,13 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)  #define mk_pte(page, pgprot)	pfn_pte(page_to_pfn(page), (pgprot))  #ifdef CONFIG_TRANSPARENT_HUGEPAGE -extern pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot); -#define mk_pmd(page, pgprot)	pfn_pmd(page_to_pfn(page), (pgprot)) - -extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot); - -static inline pmd_t pmd_mkhuge(pmd_t pmd) +static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)  { -	/* Do nothing, mk_pmd() does this part.  */ -	return pmd; +	pte_t pte = pfn_pte(page_nr, pgprot); + +	return __pmd(pte_val(pte));  } +#define mk_pmd(page, pgprot)	pfn_pmd(page_to_pfn(page), (pgprot))  #endif  /* This one can be done with two shifts.  */ @@ -277,8 +280,8 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t prot)  {  	unsigned long mask, tmp; -	/* SUN4U: 0x600307ffffffecb8 (negated == 0x9ffcf80000001347) -	 * SUN4V: 0x30ffffffffffee17 (negated == 0xcf000000000011e8) +	/* SUN4U: 0x630107ffffffec38 (negated == 0x9cfef800000013c7) +	 * SUN4V: 0x33ffffffffffee07 (negated == 0xcc000000000011f8)  	 *  	 * Even if we use negation tricks the result is still a 6  	 * instruction sequence, so don't try to play fancy and just @@ -308,15 +311,26 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t prot)  	"	.previous\n"  	: "=r" (mask), "=r" (tmp)  	: "i" (_PAGE_PADDR_4U | _PAGE_MODIFIED_4U | _PAGE_ACCESSED_4U | -	       _PAGE_CP_4U | _PAGE_CV_4U | _PAGE_E_4U | _PAGE_PRESENT_4U | -	       _PAGE_SPECIAL), +	       _PAGE_CP_4U | _PAGE_CV_4U | _PAGE_E_4U | +	       _PAGE_SPECIAL | _PAGE_PMD_HUGE | _PAGE_SZALL_4U),  	  "i" (_PAGE_PADDR_4V | _PAGE_MODIFIED_4V | _PAGE_ACCESSED_4V | -	       _PAGE_CP_4V | _PAGE_CV_4V | _PAGE_E_4V | _PAGE_PRESENT_4V | -	       _PAGE_SPECIAL)); +	       _PAGE_CP_4V | _PAGE_CV_4V | _PAGE_E_4V | +	       _PAGE_SPECIAL | _PAGE_PMD_HUGE | _PAGE_SZALL_4V));  	return __pte((pte_val(pte) & mask) | (pgprot_val(prot) & ~mask));  } +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) +{ +	pte_t pte = __pte(pmd_val(pmd)); + +	pte = pte_modify(pte, newprot); + +	return __pmd(pte_val(pte)); +} +#endif +  static inline pte_t pgoff_to_pte(unsigned long off)  {  	off <<= PAGE_SHIFT; @@ -357,7 +371,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot)   */  #define pgprot_noncached pgprot_noncached -#ifdef CONFIG_HUGETLB_PAGE +#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)  static inline pte_t pte_mkhuge(pte_t pte)  {  	unsigned long mask; @@ -375,6 +389,17 @@ static inline pte_t pte_mkhuge(pte_t pte)  	return __pte(pte_val(pte) | mask);  } +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +static inline pmd_t pmd_mkhuge(pmd_t pmd) +{ +	pte_t pte = __pte(pmd_val(pmd)); + +	pte = pte_mkhuge(pte); +	pte_val(pte) |= _PAGE_PMD_HUGE; + +	return __pmd(pte_val(pte)); +} +#endif  #endif  static inline pte_t pte_mkdirty(pte_t pte) @@ -616,7 +641,7 @@ static inline unsigned long pte_present(pte_t pte)  }  #define pte_accessible pte_accessible -static inline unsigned long pte_accessible(pte_t a) +static inline unsigned long pte_accessible(struct mm_struct *mm, pte_t a)  {  	return pte_val(a) & _PAGE_VALID;  } @@ -626,98 +651,137 @@ static inline unsigned long pte_special(pte_t pte)  	return pte_val(pte) & _PAGE_SPECIAL;  } -static inline int pmd_large(pmd_t pmd) +static inline unsigned long pmd_large(pmd_t pmd)  { -	return (pmd_val(pmd) & (PMD_ISHUGE | PMD_HUGE_PRESENT)) == -		(PMD_ISHUGE | PMD_HUGE_PRESENT); +	pte_t pte = __pte(pmd_val(pmd)); + +	return pte_val(pte) & _PAGE_PMD_HUGE;  }  #ifdef CONFIG_TRANSPARENT_HUGEPAGE -static inline int pmd_young(pmd_t pmd) +static inline unsigned long pmd_young(pmd_t pmd)  { -	return pmd_val(pmd) & PMD_HUGE_ACCESSED; +	pte_t pte = __pte(pmd_val(pmd)); + +	return pte_young(pte);  } -static inline int pmd_write(pmd_t pmd) +static inline unsigned long pmd_write(pmd_t pmd)  { -	return pmd_val(pmd) & PMD_HUGE_WRITE; +	pte_t pte = __pte(pmd_val(pmd)); + +	return pte_write(pte);  }  static inline unsigned long pmd_pfn(pmd_t pmd)  { -	unsigned long val = pmd_val(pmd) & PMD_HUGE_PADDR; +	pte_t pte = __pte(pmd_val(pmd)); -	return val >> (PAGE_SHIFT - PMD_PADDR_SHIFT); +	return pte_pfn(pte);  } -static inline int pmd_trans_splitting(pmd_t pmd) +static inline unsigned long pmd_trans_huge(pmd_t pmd)  { -	return (pmd_val(pmd) & (PMD_ISHUGE|PMD_HUGE_SPLITTING)) == -		(PMD_ISHUGE|PMD_HUGE_SPLITTING); +	pte_t pte = __pte(pmd_val(pmd)); + +	return pte_val(pte) & _PAGE_PMD_HUGE;  } -static inline int pmd_trans_huge(pmd_t pmd) +static inline unsigned long pmd_trans_splitting(pmd_t pmd)  { -	return pmd_val(pmd) & PMD_ISHUGE; +	pte_t pte = __pte(pmd_val(pmd)); + +	return pmd_trans_huge(pmd) && pte_special(pte);  }  #define has_transparent_hugepage() 1  static inline pmd_t pmd_mkold(pmd_t pmd)  { -	pmd_val(pmd) &= ~PMD_HUGE_ACCESSED; -	return pmd; +	pte_t pte = __pte(pmd_val(pmd)); + +	pte = pte_mkold(pte); + +	return __pmd(pte_val(pte));  }  static inline pmd_t pmd_wrprotect(pmd_t pmd)  { -	pmd_val(pmd) &= ~PMD_HUGE_WRITE; -	return pmd; +	pte_t pte = __pte(pmd_val(pmd)); + +	pte = pte_wrprotect(pte); + +	return __pmd(pte_val(pte));  }  static inline pmd_t pmd_mkdirty(pmd_t pmd)  { -	pmd_val(pmd) |= PMD_HUGE_DIRTY; -	return pmd; +	pte_t pte = __pte(pmd_val(pmd)); + +	pte = pte_mkdirty(pte); + +	return __pmd(pte_val(pte));  }  static inline pmd_t pmd_mkyoung(pmd_t pmd)  { -	pmd_val(pmd) |= PMD_HUGE_ACCESSED; -	return pmd; +	pte_t pte = __pte(pmd_val(pmd)); + +	pte = pte_mkyoung(pte); + +	return __pmd(pte_val(pte));  }  static inline pmd_t pmd_mkwrite(pmd_t pmd)  { -	pmd_val(pmd) |= PMD_HUGE_WRITE; -	return pmd; -} +	pte_t pte = __pte(pmd_val(pmd)); -static inline pmd_t pmd_mknotpresent(pmd_t pmd) -{ -	pmd_val(pmd) &= ~PMD_HUGE_PRESENT; -	return pmd; +	pte = pte_mkwrite(pte); + +	return __pmd(pte_val(pte));  }  static inline pmd_t pmd_mksplitting(pmd_t pmd)  { -	pmd_val(pmd) |= PMD_HUGE_SPLITTING; -	return pmd; +	pte_t pte = __pte(pmd_val(pmd)); + +	pte = pte_mkspecial(pte); + +	return __pmd(pte_val(pte));  } -extern pgprot_t pmd_pgprot(pmd_t entry); +static inline pgprot_t pmd_pgprot(pmd_t entry) +{ +	unsigned long val = pmd_val(entry); + +	return __pgprot(val); +}  #endif  static inline int pmd_present(pmd_t pmd)  { -	return pmd_val(pmd) != 0U; +	return pmd_val(pmd) != 0UL;  }  #define pmd_none(pmd)			(!pmd_val(pmd)) +/* pmd_bad() is only called on non-trans-huge PMDs.  Our encoding is + * very simple, it's just the physical address.  PTE tables are of + * size PAGE_SIZE so make sure the sub-PAGE_SIZE bits are clear and + * the top bits outside of the range of any physical address size we + * support are clear as well.  We also validate the physical itself. + */ +#define pmd_bad(pmd)			((pmd_val(pmd) & ~PAGE_MASK) || \ +					 !__kern_addr_valid(pmd_val(pmd))) + +#define pud_none(pud)			(!pud_val(pud)) + +#define pud_bad(pud)			((pud_val(pud) & ~PAGE_MASK) || \ +					 !__kern_addr_valid(pud_val(pud))) +  #ifdef CONFIG_TRANSPARENT_HUGEPAGE -extern void set_pmd_at(struct mm_struct *mm, unsigned long addr, -		       pmd_t *pmdp, pmd_t pmd); +void set_pmd_at(struct mm_struct *mm, unsigned long addr, +		pmd_t *pmdp, pmd_t pmd);  #else  static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,  			      pmd_t *pmdp, pmd_t pmd) @@ -728,33 +792,29 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,  static inline void pmd_set(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)  { -	unsigned long val = __pa((unsigned long) (ptep)) >> PMD_PADDR_SHIFT; +	unsigned long val = __pa((unsigned long) (ptep));  	pmd_val(*pmdp) = val;  }  #define pud_set(pudp, pmdp)	\ -	(pud_val(*(pudp)) = (__pa((unsigned long) (pmdp)) >> PGD_PADDR_SHIFT)) +	(pud_val(*(pudp)) = (__pa((unsigned long) (pmdp))))  static inline unsigned long __pmd_page(pmd_t pmd)  { -	unsigned long paddr = (unsigned long) pmd_val(pmd); -#ifdef CONFIG_TRANSPARENT_HUGEPAGE -	if (pmd_val(pmd) & PMD_ISHUGE) -		paddr &= PMD_HUGE_PADDR; -#endif -	paddr <<= PMD_PADDR_SHIFT; -	return ((unsigned long) __va(paddr)); +	pte_t pte = __pte(pmd_val(pmd)); +	unsigned long pfn; + +	pfn = pte_pfn(pte); + +	return ((unsigned long) __va(pfn << PAGE_SHIFT));  }  #define pmd_page(pmd) 			virt_to_page((void *)__pmd_page(pmd))  #define pud_page_vaddr(pud)		\ -	((unsigned long) __va((((unsigned long)pud_val(pud))<<PGD_PADDR_SHIFT))) +	((unsigned long) __va(pud_val(pud)))  #define pud_page(pud) 			virt_to_page((void *)pud_page_vaddr(pud)) -#define pmd_bad(pmd)			(0) -#define pmd_clear(pmdp)			(pmd_val(*(pmdp)) = 0U) -#define pud_none(pud)			(!pud_val(pud)) -#define pud_bad(pud)			(0) +#define pmd_clear(pmdp)			(pmd_val(*(pmdp)) = 0UL)  #define pud_present(pud)		(pud_val(pud) != 0U) -#define pud_clear(pudp)			(pud_val(*(pudp)) = 0U) +#define pud_clear(pudp)			(pud_val(*(pudp)) = 0UL)  /* Same in both SUN4V and SUN4U.  */  #define pte_none(pte) 			(!pte_val(pte)) @@ -780,8 +840,8 @@ static inline unsigned long __pmd_page(pmd_t pmd)  #define pte_unmap(pte)			do { } while (0)  /* Actual page table PTE updates.  */ -extern void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, -			  pte_t *ptep, pte_t orig, int fullmm); +void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, +		   pte_t *ptep, pte_t orig, int fullmm);  #define __HAVE_ARCH_PMDP_GET_AND_CLEAR  static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, @@ -789,7 +849,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,  				       pmd_t *pmdp)  {  	pmd_t pmd = *pmdp; -	set_pmd_at(mm, addr, pmdp, __pmd(0U)); +	set_pmd_at(mm, addr, pmdp, __pmd(0UL));  	return pmd;  } @@ -806,7 +866,7 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,  	 * SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U  	 *             and SUN4V pte layout, so this inline test is fine.  	 */ -	if (likely(mm != &init_mm) && pte_accessible(orig)) +	if (likely(mm != &init_mm) && pte_accessible(mm, orig))  		tlb_batch_add(mm, addr, ptep, orig, fullmm);  } @@ -837,27 +897,31 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,  })  #endif -extern pgd_t swapper_pg_dir[2048]; -extern pmd_t swapper_low_pmd_dir[2048]; +extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; +extern pmd_t swapper_low_pmd_dir[PTRS_PER_PMD]; -extern void paging_init(void); -extern unsigned long find_ecache_flush_span(unsigned long size); +void paging_init(void); +unsigned long find_ecache_flush_span(unsigned long size);  struct seq_file; -extern void mmu_info(struct seq_file *); +void mmu_info(struct seq_file *);  struct vm_area_struct; -extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *); +void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);  #ifdef CONFIG_TRANSPARENT_HUGEPAGE -extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, -				 pmd_t *pmd); +void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, +			  pmd_t *pmd); + +#define __HAVE_ARCH_PMDP_INVALIDATE +extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, +			    pmd_t *pmdp);  #define __HAVE_ARCH_PGTABLE_DEPOSIT -extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, -				       pgtable_t pgtable); +void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, +				pgtable_t pgtable);  #define __HAVE_ARCH_PGTABLE_WITHDRAW -extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp); +pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);  #endif  /* Encode and de-code a swap entry */ @@ -873,24 +937,12 @@ extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);  #define __swp_entry_to_pte(x)		((pte_t) { (x).val })  /* File offset in PTE support. */ -extern unsigned long pte_file(pte_t); +unsigned long pte_file(pte_t);  #define pte_to_pgoff(pte)	(pte_val(pte) >> PAGE_SHIFT) -extern pte_t pgoff_to_pte(unsigned long); +pte_t pgoff_to_pte(unsigned long);  #define PTE_FILE_MAX_BITS	(64UL - PAGE_SHIFT - 1UL) -extern unsigned long sparc64_valid_addr_bitmap[]; - -/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ -static inline bool kern_addr_valid(unsigned long addr) -{ -	unsigned long paddr = __pa(addr); - -	if ((paddr >> 41UL) != 0UL) -		return false; -	return test_bit(paddr >> 22, sparc64_valid_addr_bitmap); -} - -extern int page_in_phys_avail(unsigned long paddr); +int page_in_phys_avail(unsigned long paddr);  /*   * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in @@ -900,8 +952,8 @@ extern int page_in_phys_avail(unsigned long paddr);  #define GET_IOSPACE(pfn)		(pfn >> (BITS_PER_LONG - 4))  #define GET_PFN(pfn)			(pfn & 0x0fffffffffffffffUL) -extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, -			   unsigned long, pgprot_t); +int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, +		    unsigned long, pgprot_t);  static inline int io_remap_pfn_range(struct vm_area_struct *vma,  				     unsigned long from, unsigned long pfn, @@ -929,20 +981,20 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma,  /* We provide a special get_unmapped_area for framebuffer mmaps to try and use   * the largest alignment possible such that larget PTEs can be used.   */ -extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long, -					  unsigned long, unsigned long, -					  unsigned long); +unsigned long get_fb_unmapped_area(struct file *filp, unsigned long, +				   unsigned long, unsigned long, +				   unsigned long);  #define HAVE_ARCH_FB_UNMAPPED_AREA -extern void pgtable_cache_init(void); -extern void sun4v_register_fault_status(void); -extern void sun4v_ktsb_register(void); -extern void __init cheetah_ecache_flush_init(void); -extern void sun4v_patch_tlb_handlers(void); +void pgtable_cache_init(void); +void sun4v_register_fault_status(void); +void sun4v_ktsb_register(void); +void __init cheetah_ecache_flush_init(void); +void sun4v_patch_tlb_handlers(void);  extern unsigned long cmdline_memory_size; -extern asmlinkage void do_sparc64_fault(struct pt_regs *regs); +asmlinkage void do_sparc64_fault(struct pt_regs *regs);  #endif /* !(__ASSEMBLY__) */ diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h index 2c7baa4c450..a564817bbc2 100644 --- a/arch/sparc/include/asm/processor_32.h +++ b/arch/sparc/include/asm/processor_32.h @@ -74,7 +74,7 @@ struct thread_struct {  }  /* Return saved PC of a blocked thread. */ -extern unsigned long thread_saved_pc(struct task_struct *t); +unsigned long thread_saved_pc(struct task_struct *t);  /* Do necessary setup to start up a newly executed thread. */  static inline void start_thread(struct pt_regs * regs, unsigned long pc, @@ -107,7 +107,7 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc,  /* Free all resources held by a thread. */  #define release_thread(tsk)		do { } while(0) -extern unsigned long get_wchan(struct task_struct *); +unsigned long get_wchan(struct task_struct *);  #define task_pt_regs(tsk) ((tsk)->thread.kregs)  #define KSTK_EIP(tsk)  ((tsk)->thread.kregs->pc) @@ -116,6 +116,7 @@ extern unsigned long get_wchan(struct task_struct *);  #ifdef __KERNEL__  extern struct task_struct *last_task_used_math; +int do_mathemu(struct pt_regs *regs, struct task_struct *fpt);  #define cpu_relax()	barrier()  extern void (*sparc_idle)(void); diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h index 4c3f7f01c70..7028fe1a7c0 100644 --- a/arch/sparc/include/asm/processor_64.h +++ b/arch/sparc/include/asm/processor_64.h @@ -95,7 +95,7 @@ struct thread_struct {  /* Return saved PC of a blocked thread. */  struct task_struct; -extern unsigned long thread_saved_pc(struct task_struct *); +unsigned long thread_saved_pc(struct task_struct *);  /* On Uniprocessor, even in RMO processes see TSO semantics */  #ifdef CONFIG_SMP @@ -194,7 +194,7 @@ do { \  /* Free all resources held by a thread. */  #define release_thread(tsk)		do { } while (0) -extern unsigned long get_wchan(struct task_struct *task); +unsigned long get_wchan(struct task_struct *task);  #define task_pt_regs(tsk) (task_thread_info(tsk)->kregs)  #define KSTK_EIP(tsk)  (task_pt_regs(tsk)->tpc) @@ -253,6 +253,8 @@ static inline void prefetchw(const void *x)  #define HAVE_ARCH_PICK_MMAP_LAYOUT +int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap); +  #endif /* !(__ASSEMBLY__) */  #endif /* !(__ASM_SPARC64_PROCESSOR_H) */ diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h index 67c62578d17..d955c8df62d 100644 --- a/arch/sparc/include/asm/prom.h +++ b/arch/sparc/include/asm/prom.h @@ -36,40 +36,28 @@ struct of_irq_controller {  	void		*data;  }; -extern struct device_node *of_find_node_by_cpuid(int cpuid); -extern int of_set_property(struct device_node *node, const char *name, void *val, int len); +struct device_node *of_find_node_by_cpuid(int cpuid); +int of_set_property(struct device_node *node, const char *name, void *val, int len);  extern struct mutex of_set_property_mutex; -extern int of_getintprop_default(struct device_node *np, -				 const char *name, +int of_getintprop_default(struct device_node *np, +			  const char *name,  				 int def); -extern int of_find_in_proplist(const char *list, const char *match, int len); -#ifdef CONFIG_NUMA -extern int of_node_to_nid(struct device_node *dp); -#define of_node_to_nid of_node_to_nid -#endif +int of_find_in_proplist(const char *list, const char *match, int len); -extern void prom_build_devicetree(void); -extern void of_populate_present_mask(void); -extern void of_fill_in_cpu_data(void); +void prom_build_devicetree(void); +void of_populate_present_mask(void); +void of_fill_in_cpu_data(void);  struct resource; -extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); -extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); +void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); +void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);  extern struct device_node *of_console_device;  extern char *of_console_path;  extern char *of_console_options; -extern void irq_trans_init(struct device_node *dp); -extern char *build_path_component(struct device_node *dp); - -/* SPARC has local implementations */ -extern int of_address_to_resource(struct device_node *dev, int index, -				  struct resource *r); -#define of_address_to_resource of_address_to_resource - -void __iomem *of_iomap(struct device_node *node, int index); -#define of_iomap of_iomap +void irq_trans_init(struct device_node *dp); +char *build_path_component(struct device_node *dp);  #endif /* __KERNEL__ */  #endif /* _SPARC_PROM_H */ diff --git a/arch/sparc/include/asm/ptrace.h b/arch/sparc/include/asm/ptrace.h index bdfafd7af46..bac6a946ee0 100644 --- a/arch/sparc/include/asm/ptrace.h +++ b/arch/sparc/include/asm/ptrace.h @@ -73,7 +73,7 @@ static inline long regs_return_value(struct pt_regs *regs)  	return regs->u_regs[UREG_I0];  }  #ifdef CONFIG_SMP -extern unsigned long profile_pc(struct pt_regs *); +unsigned long profile_pc(struct pt_regs *);  #else  #define profile_pc(regs) instruction_pointer(regs)  #endif diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h index 5e35e051731..f5fffd84d0d 100644 --- a/arch/sparc/include/asm/setup.h +++ b/arch/sparc/include/asm/setup.h @@ -4,8 +4,9 @@  #ifndef _SPARC_SETUP_H  #define _SPARC_SETUP_H -#include <uapi/asm/setup.h> +#include <linux/interrupt.h> +#include <uapi/asm/setup.h>  extern char reboot_command[]; @@ -22,9 +23,43 @@ static inline int con_is_present(void)  {  	return serial_console ? 0 : 1;  } + +/* from irq_32.c */ +extern volatile unsigned char *fdc_status; +extern char *pdma_vaddr; +extern unsigned long pdma_size; +extern volatile int doing_pdma; + +/* This is software state */ +extern char *pdma_base; +extern unsigned long pdma_areasize; + +int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler); + +/* setup_32.c */ +extern unsigned long cmdline_memory_size; + +/* devices.c */ +void __init device_scan(void); + +/* unaligned_32.c */ +unsigned long safe_compute_effective_address(struct pt_regs *, unsigned int); + +#endif + +#ifdef CONFIG_SPARC64 +/* unaligned_64.c */ +int handle_ldf_stq(u32 insn, struct pt_regs *regs); +void handle_ld_nf(u32 insn, struct pt_regs *regs); + +/* init_64.c */ +extern atomic_t dcpage_flushes; +extern atomic_t dcpage_flushes_xcall; + +extern int sysctl_tsb_ratio;  #endif -extern void sun_do_break(void); +void sun_do_break(void);  extern int stop_a_enabled;  extern int scons_pwroff; diff --git a/arch/sparc/include/asm/sfp-machine_32.h b/arch/sparc/include/asm/sfp-machine_32.h index 01d9c3b5a73..838c9d58f3b 100644 --- a/arch/sparc/include/asm/sfp-machine_32.h +++ b/arch/sparc/include/asm/sfp-machine_32.h @@ -79,9 +79,9 @@    __asm__ ("addcc %r7,%8,%2\n\t"					\  	   "addxcc %r5,%6,%1\n\t"					\  	   "addx %r3,%4,%0\n"						\ -	   : "=r" ((USItype)(r2)),					\ -	     "=&r" ((USItype)(r1)),					\ -	     "=&r" ((USItype)(r0))					\ +	   : "=r" (r2),							\ +	     "=&r" (r1),						\ +	     "=&r" (r0)							\  	   : "%rJ" ((USItype)(x2)),					\  	     "rI" ((USItype)(y2)),					\  	     "%rJ" ((USItype)(x1)),					\ @@ -94,9 +94,9 @@    __asm__ ("subcc %r7,%8,%2\n\t"					\  	    "subxcc %r5,%6,%1\n\t"					\  	    "subx %r3,%4,%0\n"						\ -	   : "=r" ((USItype)(r2)),					\ -	     "=&r" ((USItype)(r1)),					\ -	     "=&r" ((USItype)(r0))					\ +	   : "=r" (r2),							\ +	     "=&r" (r1),						\ +	     "=&r" (r0)							\  	   : "%rJ" ((USItype)(x2)),					\  	     "rI" ((USItype)(y2)),					\  	     "%rJ" ((USItype)(x1)),					\ @@ -115,8 +115,8 @@  	    "addxcc %r6,%7,%0\n\t"					\  	    "addxcc %r4,%5,%%g2\n\t"					\  	    "addx %r2,%3,%%g1\n\t"					\ -	   : "=&r" ((USItype)(r1)),					\ -	     "=&r" ((USItype)(r0))					\ +	   : "=&r" (r1),						\ +	     "=&r" (r0)							\  	   : "%rJ" ((USItype)(x3)),					\  	     "rI" ((USItype)(y3)),					\  	     "%rJ" ((USItype)(x2)),					\ @@ -140,8 +140,8 @@  	    "subxcc %r6,%7,%0\n\t"					\  	    "subxcc %r4,%5,%%g2\n\t"					\  	    "subx %r2,%3,%%g1\n\t"					\ -	   : "=&r" ((USItype)(r1)),					\ -	     "=&r" ((USItype)(r0))					\ +	   : "=&r" (r1),						\ +	     "=&r" (r0)							\  	   : "%rJ" ((USItype)(x3)),					\  	     "rI" ((USItype)(y3)),					\  	     "%rJ" ((USItype)(x2)),					\ @@ -164,10 +164,10 @@  	   "addxcc %2,%%g0,%2\n\t"					\  	   "addxcc %1,%%g0,%1\n\t"					\  	   "addx %0,%%g0,%0\n\t"					\ -	   : "=&r" ((USItype)(x3)),					\ -	     "=&r" ((USItype)(x2)),					\ -	     "=&r" ((USItype)(x1)),					\ -	     "=&r" ((USItype)(x0))					\ +	   : "=&r" (x3),						\ +	     "=&r" (x2),						\ +	     "=&r" (x1),						\ +	     "=&r" (x0)							\  	   : "rI" ((USItype)(i)),					\  	     "0" ((USItype)(x3)),					\  	     "1" ((USItype)(x2)),					\ diff --git a/arch/sparc/include/asm/smp_32.h b/arch/sparc/include/asm/smp_32.h index 3c8917f054d..7c24e08a88d 100644 --- a/arch/sparc/include/asm/smp_32.h +++ b/arch/sparc/include/asm/smp_32.h @@ -93,15 +93,15 @@ static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2,  				    arg1, arg2, arg3, arg4);  } -extern void arch_send_call_function_single_ipi(int cpu); -extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); +void arch_send_call_function_single_ipi(int cpu); +void arch_send_call_function_ipi_mask(const struct cpumask *mask);  static inline int cpu_logical_map(int cpu)  {  	return cpu;  } -extern int hard_smp_processor_id(void); +int hard_smp_processor_id(void);  #define raw_smp_processor_id()		(current_thread_info()->cpu) diff --git a/arch/sparc/include/asm/smp_64.h b/arch/sparc/include/asm/smp_64.h index dd3bef4b989..26d9e772686 100644 --- a/arch/sparc/include/asm/smp_64.h +++ b/arch/sparc/include/asm/smp_64.h @@ -32,31 +32,36 @@  DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);  extern cpumask_t cpu_core_map[NR_CPUS]; -extern int sparc64_multi_core; -extern void arch_send_call_function_single_ipi(int cpu); -extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); +void arch_send_call_function_single_ipi(int cpu); +void arch_send_call_function_ipi_mask(const struct cpumask *mask);  /*   *	General functions that each host system must provide.   */ -extern int hard_smp_processor_id(void); +int hard_smp_processor_id(void);  #define raw_smp_processor_id() (current_thread_info()->cpu) -extern void smp_fill_in_sib_core_maps(void); -extern void cpu_play_dead(void); +void smp_fill_in_sib_core_maps(void); +void cpu_play_dead(void); -extern void smp_fetch_global_regs(void); -extern void smp_fetch_global_pmu(void); +void smp_fetch_global_regs(void); +void smp_fetch_global_pmu(void);  struct seq_file;  void smp_bogo(struct seq_file *);  void smp_info(struct seq_file *); +void smp_callin(void); +void cpu_panic(void); +void smp_synchronize_tick_client(void); +void smp_capture(void); +void smp_release(void); +  #ifdef CONFIG_HOTPLUG_CPU -extern int __cpu_disable(void); -extern void __cpu_die(unsigned int cpu); +int __cpu_disable(void); +void __cpu_die(unsigned int cpu);  #endif  #endif /* !(__ASSEMBLY__) */ diff --git a/arch/sparc/include/asm/sparsemem.h b/arch/sparc/include/asm/sparsemem.h index b99d4e4b6d2..e5e1752d5d7 100644 --- a/arch/sparc/include/asm/sparsemem.h +++ b/arch/sparc/include/asm/sparsemem.h @@ -3,9 +3,11 @@  #ifdef __KERNEL__ +#include <asm/page.h> +  #define SECTION_SIZE_BITS       30 -#define MAX_PHYSADDR_BITS       42 -#define MAX_PHYSMEM_BITS        42 +#define MAX_PHYSADDR_BITS       MAX_PHYS_ADDRESS_BITS +#define MAX_PHYSMEM_BITS        MAX_PHYS_ADDRESS_BITS  #endif /* !(__KERNEL__) */ diff --git a/arch/sparc/include/asm/spitfire.h b/arch/sparc/include/asm/spitfire.h index 6b67e50fb9b..3fc58691dbd 100644 --- a/arch/sparc/include/asm/spitfire.h +++ b/arch/sparc/include/asm/spitfire.h @@ -62,7 +62,7 @@ extern enum ultra_tlb_layout tlb_type;  extern int sun4v_chip_type;  extern int cheetah_pcache_forced_on; -extern void cheetah_enable_pcache(void); +void cheetah_enable_pcache(void);  #define sparc64_highest_locked_tlbent()	\  	(tlb_type == spitfire ? \ diff --git a/arch/sparc/include/asm/stacktrace.h b/arch/sparc/include/asm/stacktrace.h index 6cee39adf6d..c30d066f304 100644 --- a/arch/sparc/include/asm/stacktrace.h +++ b/arch/sparc/include/asm/stacktrace.h @@ -1,6 +1,6 @@  #ifndef _SPARC64_STACKTRACE_H  #define _SPARC64_STACKTRACE_H -extern void stack_trace_flush(void); +void stack_trace_flush(void);  #endif /* _SPARC64_STACKTRACE_H */ diff --git a/arch/sparc/include/asm/starfire.h b/arch/sparc/include/asm/starfire.h index d56ce60a599..c100dc27a0a 100644 --- a/arch/sparc/include/asm/starfire.h +++ b/arch/sparc/include/asm/starfire.h @@ -11,10 +11,10 @@  extern int this_is_starfire; -extern void check_if_starfire(void); -extern int starfire_hard_smp_processor_id(void); -extern void starfire_hookup(int); -extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid); +void check_if_starfire(void); +int starfire_hard_smp_processor_id(void); +void starfire_hookup(int); +unsigned int starfire_translate(unsigned long imap, unsigned int upaid);  #endif  #endif diff --git a/arch/sparc/include/asm/string_32.h b/arch/sparc/include/asm/string_32.h index 12f67857152..69974e92461 100644 --- a/arch/sparc/include/asm/string_32.h +++ b/arch/sparc/include/asm/string_32.h @@ -15,7 +15,7 @@  #ifdef __KERNEL__ -extern void __memmove(void *,const void *,__kernel_size_t); +void __memmove(void *,const void *,__kernel_size_t);  #ifndef EXPORT_SYMTAB_STROPS @@ -40,8 +40,8 @@ extern void __memmove(void *,const void *,__kernel_size_t);  #undef memscan  #define memscan(__arg0, __char, __arg2)						\  ({										\ -	extern void *__memscan_zero(void *, size_t);				\ -	extern void *__memscan_generic(void *, int, size_t);			\ +	void *__memscan_zero(void *, size_t);					\ +	void *__memscan_generic(void *, int, size_t);				\  	void *__retval, *__addr = (__arg0);					\  	size_t __size = (__arg2);						\  										\ @@ -54,14 +54,14 @@ extern void __memmove(void *,const void *,__kernel_size_t);  })  #define __HAVE_ARCH_MEMCMP -extern int memcmp(const void *,const void *,__kernel_size_t); +int memcmp(const void *,const void *,__kernel_size_t);  /* Now the str*() stuff... */  #define __HAVE_ARCH_STRLEN -extern __kernel_size_t strlen(const char *); +__kernel_size_t strlen(const char *);  #define __HAVE_ARCH_STRNCMP -extern int strncmp(const char *, const char *, __kernel_size_t); +int strncmp(const char *, const char *, __kernel_size_t);  #endif /* !EXPORT_SYMTAB_STROPS */ diff --git a/arch/sparc/include/asm/string_64.h b/arch/sparc/include/asm/string_64.h index 9623bc21315..5936b8ff3c0 100644 --- a/arch/sparc/include/asm/string_64.h +++ b/arch/sparc/include/asm/string_64.h @@ -19,7 +19,7 @@  /* First the mem*() things. */  #define __HAVE_ARCH_MEMMOVE -extern void *memmove(void *, const void *, __kernel_size_t); +void *memmove(void *, const void *, __kernel_size_t);  #define __HAVE_ARCH_MEMCPY  #define memcpy(t, f, n) __builtin_memcpy(t, f, n) @@ -32,8 +32,8 @@ extern void *memmove(void *, const void *, __kernel_size_t);  #undef memscan  #define memscan(__arg0, __char, __arg2)					\  ({									\ -	extern void *__memscan_zero(void *, size_t);			\ -	extern void *__memscan_generic(void *, int, size_t);		\ +	void *__memscan_zero(void *, size_t);				\ +	void *__memscan_generic(void *, int, size_t);			\  	void *__retval, *__addr = (__arg0);				\  	size_t __size = (__arg2);					\  									\ @@ -46,14 +46,14 @@ extern void *memmove(void *, const void *, __kernel_size_t);  })  #define __HAVE_ARCH_MEMCMP -extern int memcmp(const void *,const void *,__kernel_size_t); +int memcmp(const void *,const void *,__kernel_size_t);  /* Now the str*() stuff... */  #define __HAVE_ARCH_STRLEN -extern __kernel_size_t strlen(const char *); +__kernel_size_t strlen(const char *);  #define __HAVE_ARCH_STRNCMP -extern int strncmp(const char *, const char *, __kernel_size_t); +int strncmp(const char *, const char *, __kernel_size_t);  #endif /* !EXPORT_SYMTAB_STROPS */ diff --git a/arch/sparc/include/asm/switch_to_32.h b/arch/sparc/include/asm/switch_to_32.h index e32e82b76ee..16f10374feb 100644 --- a/arch/sparc/include/asm/switch_to_32.h +++ b/arch/sparc/include/asm/switch_to_32.h @@ -99,8 +99,8 @@ extern struct thread_info *current_set[NR_CPUS];  	  "o0", "o1", "o2", "o3",                   "o7");	\  	} while(0) -extern void fpsave(unsigned long *fpregs, unsigned long *fsr, -		   void *fpqueue, unsigned long *fpqdepth); -extern void synchronize_user_stack(void); +void fpsave(unsigned long *fpregs, unsigned long *fsr, +	    void *fpqueue, unsigned long *fpqdepth); +void synchronize_user_stack(void);  #endif /* __SPARC_SWITCH_TO_H */ diff --git a/arch/sparc/include/asm/switch_to_64.h b/arch/sparc/include/asm/switch_to_64.h index 8d284801f23..10e76332dc9 100644 --- a/arch/sparc/include/asm/switch_to_64.h +++ b/arch/sparc/include/asm/switch_to_64.h @@ -65,7 +65,7 @@ do {	save_and_clear_fpu();						\  	  "o0", "o1", "o2", "o3", "o4", "o5",       "o7");		\  } while(0) -extern void synchronize_user_stack(void); -extern void fault_in_user_windows(void); +void synchronize_user_stack(void); +void fault_in_user_windows(void);  #endif /* __SPARC64_SWITCH_TO_64_H */ diff --git a/arch/sparc/include/asm/syscalls.h b/arch/sparc/include/asm/syscalls.h index bf8972adea1..b0a0db8ea61 100644 --- a/arch/sparc/include/asm/syscalls.h +++ b/arch/sparc/include/asm/syscalls.h @@ -3,9 +3,9 @@  struct pt_regs; -extern asmlinkage long sparc_do_fork(unsigned long clone_flags, -				     unsigned long stack_start, -				     struct pt_regs *regs, -				     unsigned long stack_size); +asmlinkage long sparc_do_fork(unsigned long clone_flags, +			      unsigned long stack_start, +			      struct pt_regs *regs, +			      unsigned long stack_size);  #endif /* _SPARC64_SYSCALLS_H */ diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h index dd3807599bb..96efa7adc22 100644 --- a/arch/sparc/include/asm/thread_info_32.h +++ b/arch/sparc/include/asm/thread_info_32.h @@ -105,8 +105,6 @@ register struct thread_info *current_thread_info_reg asm("g6");  #define TI_W_SAVED	0x250  /* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */ -#define PREEMPT_ACTIVE		0x4000000 -  /*   * thread information flag bit numbers   */ diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h index d5e50425107..a5f01ac6d0f 100644 --- a/arch/sparc/include/asm/thread_info_64.h +++ b/arch/sparc/include/asm/thread_info_64.h @@ -111,8 +111,6 @@ struct thread_info {  #define THREAD_SHIFT PAGE_SHIFT  #endif /* PAGE_SHIFT == 13 */ -#define PREEMPT_ACTIVE		0x10000000 -  /*   * macros/functions for gaining access to the thread information structure   */ @@ -192,7 +190,7 @@ register struct thread_info *current_thread_info_reg asm("g6");  #define TIF_UNALIGNED		5	/* allowed to do unaligned accesses */  /* flag bit 6 is available */  #define TIF_32BIT		7	/* 32-bit binary */ -/* flag bit 8 is available */ +#define TIF_NOHZ		8	/* in adaptive nohz mode */  #define TIF_SECCOMP		9	/* secure computing */  #define TIF_SYSCALL_AUDIT	10	/* syscall auditing active */  #define TIF_SYSCALL_TRACEPOINT	11	/* syscall tracepoint instrumentation */ @@ -210,6 +208,7 @@ register struct thread_info *current_thread_info_reg asm("g6");  #define _TIF_NEED_RESCHED	(1<<TIF_NEED_RESCHED)  #define _TIF_UNALIGNED		(1<<TIF_UNALIGNED)  #define _TIF_32BIT		(1<<TIF_32BIT) +#define _TIF_NOHZ		(1<<TIF_NOHZ)  #define _TIF_SECCOMP		(1<<TIF_SECCOMP)  #define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT)  #define _TIF_SYSCALL_TRACEPOINT	(1<<TIF_SYSCALL_TRACEPOINT) diff --git a/arch/sparc/include/asm/timer_32.h b/arch/sparc/include/asm/timer_32.h index 72f40a546de..f8e708a0aa5 100644 --- a/arch/sparc/include/asm/timer_32.h +++ b/arch/sparc/include/asm/timer_32.h @@ -32,13 +32,13 @@ static inline unsigned int timer_value(unsigned int value)  	return (value + 1) << TIMER_VALUE_SHIFT;  } -extern __volatile__ unsigned int *master_l10_counter; +extern volatile u32 __iomem *master_l10_counter; -extern irqreturn_t notrace timer_interrupt(int dummy, void *dev_id); +irqreturn_t notrace timer_interrupt(int dummy, void *dev_id);  #ifdef CONFIG_SMP  DECLARE_PER_CPU(struct clock_event_device, sparc32_clockevent); -extern void register_percpu_ce(int cpu); +void register_percpu_ce(int cpu);  #endif  #endif /* !(_SPARC_TIMER_H) */ diff --git a/arch/sparc/include/asm/timer_64.h b/arch/sparc/include/asm/timer_64.h index 01197d8215c..fce41503400 100644 --- a/arch/sparc/include/asm/timer_64.h +++ b/arch/sparc/include/asm/timer_64.h @@ -23,8 +23,8 @@ struct sparc64_tick_ops {  extern struct sparc64_tick_ops *tick_ops; -extern unsigned long sparc64_get_clock_tick(unsigned int cpu); -extern void setup_sparc64_timer(void); -extern void __init time_init(void); +unsigned long sparc64_get_clock_tick(unsigned int cpu); +void setup_sparc64_timer(void); +void __init time_init(void);  #endif /* _SPARC64_TIMER_H */ diff --git a/arch/sparc/include/asm/tlb_64.h b/arch/sparc/include/asm/tlb_64.h index 190e18913cc..4cb392f75d2 100644 --- a/arch/sparc/include/asm/tlb_64.h +++ b/arch/sparc/include/asm/tlb_64.h @@ -8,19 +8,19 @@  #include <asm/mmu_context.h>  #ifdef CONFIG_SMP -extern void smp_flush_tlb_pending(struct mm_struct *, +void smp_flush_tlb_pending(struct mm_struct *,  				  unsigned long, unsigned long *);  #endif  #ifdef CONFIG_SMP -extern void smp_flush_tlb_mm(struct mm_struct *mm); +void smp_flush_tlb_mm(struct mm_struct *mm);  #define do_flush_tlb_mm(mm) smp_flush_tlb_mm(mm)  #else  #define do_flush_tlb_mm(mm) __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT)  #endif -extern void __flush_tlb_pending(unsigned long, unsigned long, unsigned long *); -extern void flush_tlb_pending(void); +void __flush_tlb_pending(unsigned long, unsigned long, unsigned long *); +void flush_tlb_pending(void);  #define tlb_start_vma(tlb, vma) do { } while (0)  #define tlb_end_vma(tlb, vma)	do { } while (0) diff --git a/arch/sparc/include/asm/tlbflush_64.h b/arch/sparc/include/asm/tlbflush_64.h index f0d6a9700f4..816d8202fa0 100644 --- a/arch/sparc/include/asm/tlbflush_64.h +++ b/arch/sparc/include/asm/tlbflush_64.h @@ -1,7 +1,6 @@  #ifndef _SPARC64_TLBFLUSH_H  #define _SPARC64_TLBFLUSH_H -#include <linux/mm.h>  #include <asm/mmu_context.h>  /* TSB flush operations. */ @@ -15,9 +14,9 @@ struct tlb_batch {  	unsigned long vaddrs[TLB_BATCH_NR];  }; -extern void flush_tsb_kernel_range(unsigned long start, unsigned long end); -extern void flush_tsb_user(struct tlb_batch *tb); -extern void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr); +void flush_tsb_kernel_range(unsigned long start, unsigned long end); +void flush_tsb_user(struct tlb_batch *tb); +void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr);  /* TLB flush operations. */ @@ -37,15 +36,15 @@ static inline void flush_tlb_range(struct vm_area_struct *vma,  #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE -extern void flush_tlb_pending(void); -extern void arch_enter_lazy_mmu_mode(void); -extern void arch_leave_lazy_mmu_mode(void); +void flush_tlb_pending(void); +void arch_enter_lazy_mmu_mode(void); +void arch_leave_lazy_mmu_mode(void);  #define arch_flush_lazy_mmu_mode()      do {} while (0)  /* Local cpu only.  */ -extern void __flush_tlb_all(void); -extern void __flush_tlb_page(unsigned long context, unsigned long vaddr); -extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); +void __flush_tlb_all(void); +void __flush_tlb_page(unsigned long context, unsigned long vaddr); +void __flush_tlb_kernel_range(unsigned long start, unsigned long end);  #ifndef CONFIG_SMP @@ -61,8 +60,8 @@ static inline void global_flush_tlb_page(struct mm_struct *mm, unsigned long vad  #else /* CONFIG_SMP */ -extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end); -extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr); +void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end); +void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr);  #define flush_tlb_kernel_range(start, end) \  do {	flush_tsb_kernel_range(start,end); \ diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h index 1754390a426..ed8f071132e 100644 --- a/arch/sparc/include/asm/topology_64.h +++ b/arch/sparc/include/asm/topology_64.h @@ -18,7 +18,7 @@ static inline int cpu_to_node(int cpu)  struct pci_bus;  #ifdef CONFIG_PCI -extern int pcibus_to_node(struct pci_bus *pbus); +int pcibus_to_node(struct pci_bus *pbus);  #else  static inline int pcibus_to_node(struct pci_bus *pbus)  { @@ -42,8 +42,6 @@ static inline int pcibus_to_node(struct pci_bus *pbus)  #define topology_core_id(cpu)			(cpu_data(cpu).core_id)  #define topology_core_cpumask(cpu)		(&cpu_core_map[cpu])  #define topology_thread_cpumask(cpu)		(&per_cpu(cpu_sibling_map, cpu)) -#define mc_capable()				(sparc64_multi_core) -#define smt_capable()				(sparc64_multi_core)  #endif /* CONFIG_SMP */  extern cpumask_t cpu_core_map[NR_CPUS]; diff --git a/arch/sparc/include/asm/trap_block.h b/arch/sparc/include/asm/trap_block.h index 7e26b2db621..6fd4436d32f 100644 --- a/arch/sparc/include/asm/trap_block.h +++ b/arch/sparc/include/asm/trap_block.h @@ -51,11 +51,11 @@ struct trap_per_cpu {  	unsigned long		__per_cpu_base;  } __attribute__((aligned(64)));  extern struct trap_per_cpu trap_block[NR_CPUS]; -extern void init_cur_cpu_trap(struct thread_info *); -extern void setup_tba(void); +void init_cur_cpu_trap(struct thread_info *); +void setup_tba(void);  extern int ncpus_probed; -extern unsigned long real_hard_smp_processor_id(void); +unsigned long real_hard_smp_processor_id(void);  struct cpuid_patch_entry {  	unsigned int	addr; diff --git a/arch/sparc/include/asm/tsb.h b/arch/sparc/include/asm/tsb.h index e696432b950..90916f955ca 100644 --- a/arch/sparc/include/asm/tsb.h +++ b/arch/sparc/include/asm/tsb.h @@ -142,98 +142,40 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;  	or		REG1, %lo(swapper_pg_dir), REG1; \  	sllx		VADDR, 64 - (PGDIR_SHIFT + PGDIR_BITS), REG2; \  	srlx		REG2, 64 - PAGE_SHIFT, REG2; \ -	andn		REG2, 0x3, REG2; \ -	lduw		[REG1 + REG2], REG1; \ +	andn		REG2, 0x7, REG2; \ +	ldx		[REG1 + REG2], REG1; \  	brz,pn		REG1, FAIL_LABEL; \  	 sllx		VADDR, 64 - (PMD_SHIFT + PMD_BITS), REG2; \  	srlx		REG2, 64 - PAGE_SHIFT, REG2; \ -	sllx		REG1, PGD_PADDR_SHIFT, REG1; \ -	andn		REG2, 0x3, REG2; \ -	lduwa		[REG1 + REG2] ASI_PHYS_USE_EC, REG1; \ +	andn		REG2, 0x7, REG2; \ +	ldxa		[REG1 + REG2] ASI_PHYS_USE_EC, REG1; \  	brz,pn		REG1, FAIL_LABEL; \  	 sllx		VADDR, 64 - PMD_SHIFT, REG2; \ -	srlx		REG2, 64 - (PAGE_SHIFT - 1), REG2; \ -	sllx		REG1, PMD_PADDR_SHIFT, REG1; \ +	srlx		REG2, 64 - PAGE_SHIFT, REG2; \  	andn		REG2, 0x7, REG2; \  	add		REG1, REG2, REG1; -	/* These macros exists only to make the PMD translator below -	 * easier to read.  It hides the ELF section switch for the -	 * sun4v code patching. -	 */ -#define OR_PTE_BIT_1INSN(REG, NAME)			\ -661:	or		REG, _PAGE_##NAME##_4U, REG;	\ -	.section	.sun4v_1insn_patch, "ax";	\ -	.word		661b;				\ -	or		REG, _PAGE_##NAME##_4V, REG;	\ -	.previous; - -#define OR_PTE_BIT_2INSN(REG, TMP, NAME)		\ -661:	sethi		%hi(_PAGE_##NAME##_4U), TMP;	\ -	or		REG, TMP, REG;			\ -	.section	.sun4v_2insn_patch, "ax";	\ -	.word		661b;				\ -	mov		-1, TMP;			\ -	or		REG, _PAGE_##NAME##_4V, REG;	\ -	.previous; - -	/* Load into REG the PTE value for VALID, CACHE, and SZHUGE.  */ -#define BUILD_PTE_VALID_SZHUGE_CACHE(REG)				   \ -661:	sethi		%uhi(_PAGE_VALID|_PAGE_SZHUGE_4U), REG;		   \ -	.section	.sun4v_1insn_patch, "ax";			   \ -	.word		661b;						   \ -	sethi		%uhi(_PAGE_VALID), REG;				   \ -	.previous;							   \ -	sllx		REG, 32, REG;					   \ -661:	or		REG, _PAGE_CP_4U|_PAGE_CV_4U, REG;		   \ -	.section	.sun4v_1insn_patch, "ax";			   \ -	.word		661b;						   \ -	or		REG, _PAGE_CP_4V|_PAGE_CV_4V|_PAGE_SZHUGE_4V, REG; \ -	.previous; -  	/* PMD has been loaded into REG1, interpret the value, seeing  	 * if it is a HUGE PMD or a normal one.  If it is not valid  	 * then jump to FAIL_LABEL.  If it is a HUGE PMD, and it  	 * translates to a valid PTE, branch to PTE_LABEL.  	 * -	 * We translate the PMD by hand, one bit at a time, -	 * constructing the huge PTE. -	 * -	 * So we construct the PTE in REG2 as follows: -	 * -	 * 1) Extract the PMD PFN from REG1 and place it into REG2. -	 * -	 * 2) Translate PMD protection bits in REG1 into REG2, one bit -	 *    at a time using andcc tests on REG1 and OR's into REG2. -	 * -	 *    Only two bits to be concerned with here, EXEC and WRITE. -	 *    Now REG1 is freed up and we can use it as a temporary. -	 * -	 * 3) Construct the VALID, CACHE, and page size PTE bits in -	 *    REG1, OR with REG2 to form final PTE. +	 * We have to propagate the 4MB bit of the virtual address +	 * because we are fabricating 8MB pages using 4MB hw pages.  	 */  #ifdef CONFIG_TRANSPARENT_HUGEPAGE  #define USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, PTE_LABEL) \ -	brz,pn		REG1, FAIL_LABEL;				      \ -	 andcc		REG1, PMD_ISHUGE, %g0;				      \ -	be,pt		%xcc, 700f;					      \ -	 and		REG1, PMD_HUGE_PRESENT|PMD_HUGE_ACCESSED, REG2;	      \ -	cmp		REG2, PMD_HUGE_PRESENT|PMD_HUGE_ACCESSED;	      \ -	bne,pn		%xcc, FAIL_LABEL;				      \ -	 andn		REG1, PMD_HUGE_PROTBITS, REG2;			      \ -	sllx		REG2, PMD_PADDR_SHIFT, REG2;			      \ -	/* REG2 now holds PFN << PAGE_SHIFT */				      \ -	andcc		REG1, PMD_HUGE_WRITE, %g0;			      \ -	bne,a,pt	%xcc, 1f;					      \ -	 OR_PTE_BIT_1INSN(REG2, W);					      \ -1:	andcc		REG1, PMD_HUGE_EXEC, %g0;			      \ -	be,pt		%xcc, 1f;					      \ -	 nop;								      \ -	OR_PTE_BIT_2INSN(REG2, REG1, EXEC);				      \ -	/* REG1 can now be clobbered, build final PTE */		      \ -1:	BUILD_PTE_VALID_SZHUGE_CACHE(REG1);				      \ -	ba,pt		%xcc, PTE_LABEL;				      \ -	 or		REG1, REG2, REG1;				      \ +	brz,pn		REG1, FAIL_LABEL;		\ +	 sethi		%uhi(_PAGE_PMD_HUGE), REG2;	\ +	sllx		REG2, 32, REG2;			\ +	andcc		REG1, REG2, %g0;		\ +	be,pt		%xcc, 700f;			\ +	 sethi		%hi(4 * 1024 * 1024), REG2;	\ +	brgez,pn	REG1, FAIL_LABEL;		\ +	 andn		REG1, REG2, REG1;		\ +	and		VADDR, REG2, REG2;		\ +	brlz,pt		REG1, PTE_LABEL;		\ +	 or		REG1, REG2, REG1;		\  700:  #else  #define USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, PTE_LABEL) \ @@ -253,18 +195,16 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;  #define USER_PGTABLE_WALK_TL1(VADDR, PHYS_PGD, REG1, REG2, FAIL_LABEL)	\  	sllx		VADDR, 64 - (PGDIR_SHIFT + PGDIR_BITS), REG2; \  	srlx		REG2, 64 - PAGE_SHIFT, REG2; \ -	andn		REG2, 0x3, REG2; \ -	lduwa		[PHYS_PGD + REG2] ASI_PHYS_USE_EC, REG1; \ +	andn		REG2, 0x7, REG2; \ +	ldxa		[PHYS_PGD + REG2] ASI_PHYS_USE_EC, REG1; \  	brz,pn		REG1, FAIL_LABEL; \  	 sllx		VADDR, 64 - (PMD_SHIFT + PMD_BITS), REG2; \  	srlx		REG2, 64 - PAGE_SHIFT, REG2; \ -	sllx		REG1, PGD_PADDR_SHIFT, REG1; \ -	andn		REG2, 0x3, REG2; \ -	lduwa		[REG1 + REG2] ASI_PHYS_USE_EC, REG1; \ +	andn		REG2, 0x7, REG2; \ +	ldxa		[REG1 + REG2] ASI_PHYS_USE_EC, REG1; \  	USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, 800f) \  	sllx		VADDR, 64 - PMD_SHIFT, REG2; \ -	srlx		REG2, 64 - (PAGE_SHIFT - 1), REG2; \ -	sllx		REG1, PMD_PADDR_SHIFT, REG1; \ +	srlx		REG2, 64 - PAGE_SHIFT, REG2; \  	andn		REG2, 0x7, REG2; \  	add		REG1, REG2, REG1; \  	ldxa		[REG1] ASI_PHYS_USE_EC, REG1; \ diff --git a/arch/sparc/include/asm/uaccess.h b/arch/sparc/include/asm/uaccess.h index 0167d26d0d1..bd56c28fff9 100644 --- a/arch/sparc/include/asm/uaccess.h +++ b/arch/sparc/include/asm/uaccess.h @@ -9,6 +9,6 @@  #define user_addr_max() \  	(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) -extern long strncpy_from_user(char *dest, const char __user *src, long count); +long strncpy_from_user(char *dest, const char __user *src, long count);  #endif diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h index 53a28dd59f5..9634d086fc5 100644 --- a/arch/sparc/include/asm/uaccess_32.h +++ b/arch/sparc/include/asm/uaccess_32.h @@ -78,9 +78,9 @@ struct exception_table_entry  };  /* Returns 0 if exception not found and fixup otherwise.  */ -extern unsigned long search_extables_range(unsigned long addr, unsigned long *g2); +unsigned long search_extables_range(unsigned long addr, unsigned long *g2); -extern void __ret_efault(void); +void __ret_efault(void);  /* Uh, these should become the main single-value transfer routines..   * They automatically use the right size if we just have the right @@ -152,7 +152,7 @@ __asm__ __volatile__(							\         : "=&r" (ret) : "r" (x), "m" (*__m(addr)),			\  	 "i" (-EFAULT)) -extern int __put_user_bad(void); +int __put_user_bad(void);  #define __get_user_check(x,addr,size,type) ({ \  register int __gu_ret; \ @@ -244,9 +244,9 @@ __asm__ __volatile__(							\  	".previous\n\t"							\         : "=&r" (x) : "m" (*__m(addr)), "i" (retval)) -extern int __get_user_bad(void); +int __get_user_bad(void); -extern unsigned long __copy_user(void __user *to, const void __user *from, unsigned long size); +unsigned long __copy_user(void __user *to, const void __user *from, unsigned long size);  static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)  { @@ -306,8 +306,8 @@ static inline unsigned long clear_user(void __user *addr, unsigned long n)  		return n;  } -extern __must_check long strlen_user(const char __user *str); -extern __must_check long strnlen_user(const char __user *str, long n); +__must_check long strlen_user(const char __user *str); +__must_check long strnlen_user(const char __user *str, long n);  #endif  /* __ASSEMBLY__ */ diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h index e562d3caee5..c990a5e577f 100644 --- a/arch/sparc/include/asm/uaccess_64.h +++ b/arch/sparc/include/asm/uaccess_64.h @@ -76,8 +76,8 @@ struct exception_table_entry {          unsigned int insn, fixup;  }; -extern void __ret_efault(void); -extern void __retl_efault(void); +void __ret_efault(void); +void __retl_efault(void);  /* Uh, these should become the main single-value transfer routines..   * They automatically use the right size if we just have the right @@ -134,7 +134,7 @@ __asm__ __volatile__(							\         : "=r" (ret) : "r" (x), "r" (__m(addr)),				\  	 "i" (-EFAULT)) -extern int __put_user_bad(void); +int __put_user_bad(void);  #define __get_user_nocheck(data,addr,size,type) ({ \  register int __gu_ret; \ @@ -204,13 +204,13 @@ __asm__ __volatile__(							\  	".previous\n\t"							\         : "=r" (x) : "r" (__m(addr)), "i" (retval)) -extern int __get_user_bad(void); +int __get_user_bad(void); -extern unsigned long __must_check ___copy_from_user(void *to, -						    const void __user *from, -						    unsigned long size); -extern unsigned long copy_from_user_fixup(void *to, const void __user *from, -					  unsigned long size); +unsigned long __must_check ___copy_from_user(void *to, +					     const void __user *from, +					     unsigned long size); +unsigned long copy_from_user_fixup(void *to, const void __user *from, +				   unsigned long size);  static inline unsigned long __must_check  copy_from_user(void *to, const void __user *from, unsigned long size)  { @@ -223,11 +223,11 @@ copy_from_user(void *to, const void __user *from, unsigned long size)  }  #define __copy_from_user copy_from_user -extern unsigned long __must_check ___copy_to_user(void __user *to, -						  const void *from, -						  unsigned long size); -extern unsigned long copy_to_user_fixup(void __user *to, const void *from, -					unsigned long size); +unsigned long __must_check ___copy_to_user(void __user *to, +					   const void *from, +					   unsigned long size); +unsigned long copy_to_user_fixup(void __user *to, const void *from, +				 unsigned long size);  static inline unsigned long __must_check  copy_to_user(void __user *to, const void *from, unsigned long size)  { @@ -239,11 +239,11 @@ copy_to_user(void __user *to, const void *from, unsigned long size)  }  #define __copy_to_user copy_to_user -extern unsigned long __must_check ___copy_in_user(void __user *to, -						  const void __user *from, -						  unsigned long size); -extern unsigned long copy_in_user_fixup(void __user *to, void __user *from, -					unsigned long size); +unsigned long __must_check ___copy_in_user(void __user *to, +					   const void __user *from, +					   unsigned long size); +unsigned long copy_in_user_fixup(void __user *to, void __user *from, +				 unsigned long size);  static inline unsigned long __must_check  copy_in_user(void __user *to, void __user *from, unsigned long size)  { @@ -255,20 +255,20 @@ copy_in_user(void __user *to, void __user *from, unsigned long size)  }  #define __copy_in_user copy_in_user -extern unsigned long __must_check __clear_user(void __user *, unsigned long); +unsigned long __must_check __clear_user(void __user *, unsigned long);  #define clear_user __clear_user -extern __must_check long strlen_user(const char __user *str); -extern __must_check long strnlen_user(const char __user *str, long n); +__must_check long strlen_user(const char __user *str); +__must_check long strnlen_user(const char __user *str, long n); -#define __copy_to_user_inatomic ___copy_to_user -#define __copy_from_user_inatomic ___copy_from_user +#define __copy_to_user_inatomic __copy_to_user +#define __copy_from_user_inatomic __copy_from_user  struct pt_regs; -extern unsigned long compute_effective_address(struct pt_regs *, -					       unsigned int insn, -					       unsigned int rd); +unsigned long compute_effective_address(struct pt_regs *, +					unsigned int insn, +					unsigned int rd);  #endif  /* __ASSEMBLY__ */ diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index dfa53fdd5cb..0aac1e8f296 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h @@ -25,7 +25,6 @@  #define __ARCH_WANT_SYS_ALARM  #define __ARCH_WANT_SYS_GETHOSTNAME  #define __ARCH_WANT_SYS_PAUSE -#define __ARCH_WANT_SYS_SGETMASK  #define __ARCH_WANT_SYS_SIGNAL  #define __ARCH_WANT_SYS_TIME  #define __ARCH_WANT_SYS_UTIME diff --git a/arch/sparc/include/asm/vio.h b/arch/sparc/include/asm/vio.h index 432afa83886..e0f6c399f1d 100644 --- a/arch/sparc/include/asm/vio.h +++ b/arch/sparc/include/asm/vio.h @@ -372,14 +372,14 @@ do {	if (vio->debug & VIO_DEBUG_##TYPE) \  		       vio->vdev->channel_id, ## a); \  } while (0) -extern int __vio_register_driver(struct vio_driver *drv, struct module *owner, +int __vio_register_driver(struct vio_driver *drv, struct module *owner,  				 const char *mod_name);  /*   * vio_register_driver must be a macro so that KBUILD_MODNAME can be expanded   */  #define vio_register_driver(driver)		\  	__vio_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) -extern void vio_unregister_driver(struct vio_driver *drv); +void vio_unregister_driver(struct vio_driver *drv);  static inline struct vio_driver *to_vio_driver(struct device_driver *drv)  { @@ -391,21 +391,21 @@ static inline struct vio_dev *to_vio_dev(struct device *dev)  	return container_of(dev, struct vio_dev, dev);  } -extern int vio_ldc_send(struct vio_driver_state *vio, void *data, int len); -extern void vio_link_state_change(struct vio_driver_state *vio, int event); -extern void vio_conn_reset(struct vio_driver_state *vio); -extern int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt); -extern int vio_validate_sid(struct vio_driver_state *vio, -			    struct vio_msg_tag *tp); -extern u32 vio_send_sid(struct vio_driver_state *vio); -extern int vio_ldc_alloc(struct vio_driver_state *vio, -			 struct ldc_channel_config *base_cfg, void *event_arg); -extern void vio_ldc_free(struct vio_driver_state *vio); -extern int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev, -			   u8 dev_class, struct vio_version *ver_table, -			   int ver_table_size, struct vio_driver_ops *ops, -			   char *name); - -extern void vio_port_up(struct vio_driver_state *vio); +int vio_ldc_send(struct vio_driver_state *vio, void *data, int len); +void vio_link_state_change(struct vio_driver_state *vio, int event); +void vio_conn_reset(struct vio_driver_state *vio); +int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt); +int vio_validate_sid(struct vio_driver_state *vio, +		     struct vio_msg_tag *tp); +u32 vio_send_sid(struct vio_driver_state *vio); +int vio_ldc_alloc(struct vio_driver_state *vio, +		  struct ldc_channel_config *base_cfg, void *event_arg); +void vio_ldc_free(struct vio_driver_state *vio); +int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev, +		    u8 dev_class, struct vio_version *ver_table, +		    int ver_table_size, struct vio_driver_ops *ops, +		    char *name); + +void vio_port_up(struct vio_driver_state *vio);  #endif /* _SPARC64_VIO_H */ diff --git a/arch/sparc/include/asm/visasm.h b/arch/sparc/include/asm/visasm.h index 39ca301920d..b2667375928 100644 --- a/arch/sparc/include/asm/visasm.h +++ b/arch/sparc/include/asm/visasm.h @@ -57,7 +57,8 @@ static inline void save_and_clear_fpu(void) {  "		" : : "i" (FPRS_FEF|FPRS_DU) :  		"o5", "g1", "g2", "g3", "g7", "cc");  } -extern int vis_emul(struct pt_regs *, unsigned int); + +int vis_emul(struct pt_regs *, unsigned int);  #endif  #endif /* _SPARC64_ASI_H */ diff --git a/arch/sparc/include/asm/xor_64.h b/arch/sparc/include/asm/xor_64.h index ee8edc68423..50c88285603 100644 --- a/arch/sparc/include/asm/xor_64.h +++ b/arch/sparc/include/asm/xor_64.h @@ -20,13 +20,13 @@  #include <asm/spitfire.h> -extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); -extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, -		      unsigned long *); -extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *, -		      unsigned long *, unsigned long *); -extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *, -		      unsigned long *, unsigned long *, unsigned long *); +void xor_vis_2(unsigned long, unsigned long *, unsigned long *); +void xor_vis_3(unsigned long, unsigned long *, unsigned long *, +	       unsigned long *); +void xor_vis_4(unsigned long, unsigned long *, unsigned long *, +	       unsigned long *, unsigned long *); +void xor_vis_5(unsigned long, unsigned long *, unsigned long *, +	       unsigned long *, unsigned long *, unsigned long *);  /* XXX Ugh, write cheetah versions... -DaveM */ @@ -38,13 +38,13 @@ static struct xor_block_template xor_block_VIS = {          .do_5	= xor_vis_5,  }; -extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *); -extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *, -			  unsigned long *); -extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *, -			  unsigned long *, unsigned long *); -extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *, -			  unsigned long *, unsigned long *, unsigned long *); +void xor_niagara_2(unsigned long, unsigned long *, unsigned long *); +void xor_niagara_3(unsigned long, unsigned long *, unsigned long *, +		   unsigned long *); +void xor_niagara_4(unsigned long, unsigned long *, unsigned long *, +		   unsigned long *, unsigned long *); +void xor_niagara_5(unsigned long, unsigned long *, unsigned long *, +		   unsigned long *, unsigned long *, unsigned long *);  static struct xor_block_template xor_block_niagara = {          .name	= "Niagara", diff --git a/arch/sparc/include/uapi/asm/errno.h b/arch/sparc/include/uapi/asm/errno.h index c351aba997b..20423e17285 100644 --- a/arch/sparc/include/uapi/asm/errno.h +++ b/arch/sparc/include/uapi/asm/errno.h @@ -40,7 +40,7 @@  #define EPROCLIM        67      /* SUNOS: Too many processes */  #define	EUSERS		68	/* Too many users */  #define	EDQUOT		69	/* Quota exceeded */ -#define	ESTALE		70	/* Stale NFS file handle */ +#define	ESTALE		70	/* Stale file handle */  #define	EREMOTE		71	/* Object is remote */  #define	ENOSTR		72	/* Device not a stream */  #define	ETIME		73	/* Timer expired */ diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h index 4e1d66c3ce7..54d9608681b 100644 --- a/arch/sparc/include/uapi/asm/socket.h +++ b/arch/sparc/include/uapi/asm/socket.h @@ -72,6 +72,10 @@  #define SO_BUSY_POLL		0x0030 +#define SO_MAX_PACING_RATE	0x0031 + +#define SO_BPF_EXTENSIONS	0x0032 +  /* Security levels - as per NRL IPv6 - don't actually do anything */  #define SO_SECURITY_AUTHENTICATION		0x5001  #define SO_SECURITY_ENCRYPTION_TRANSPORT	0x5002 diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h index 62ced589bcf..42f2bca1d33 100644 --- a/arch/sparc/include/uapi/asm/unistd.h +++ b/arch/sparc/include/uapi/asm/unistd.h @@ -408,8 +408,11 @@  #define __NR_kern_features	340  #define __NR_kcmp		341  #define __NR_finit_module	342 +#define __NR_sched_setattr	343 +#define __NR_sched_getattr	344 +#define __NR_renameat2		345 -#define NR_syscalls		343 +#define NR_syscalls		346  /* Bitmask values returned from kern_features system call.  */  #define KERN_FEATURE_MIXED_MODE_STACK	0x00000001  | 
