Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next

Pull sparc fixes from David Miller:
 "Sparc sparse fixes from Sam Ravnborg"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: (67 commits)
  sparc64: fix sparse warnings in int_64.c
  sparc64: fix sparse warning in ftrace.c
  sparc64: fix sparse warning in kprobes.c
  sparc64: fix sparse warning in kgdb_64.c
  sparc64: fix sparse warnings in compat_audit.c
  sparc64: fix sparse warnings in init_64.c
  sparc64: fix sparse warnings in aes_glue.c
  sparc: fix sparse warnings in smp_32.c + smp_64.c
  sparc64: fix sparse warnings in perf_event.c
  sparc64: fix sparse warnings in kprobes.c
  sparc64: fix sparse warning in tsb.c
  sparc64: clean up compat_sigset_t.seta handling
  sparc64: fix sparse "Should it be static?" warnings in signal32.c
  sparc64: fix sparse warnings in sys_sparc32.c
  sparc64: fix sparse warning in pci.c
  sparc64: fix sparse warnings in smp_64.c
  sparc64: fix sparse warning in prom_64.c
  sparc64: fix sparse warning in btext.c
  sparc64: fix sparse warnings in sys_sparc_64.c + unaligned_64.c
  sparc64: fix sparse warning in process_64.c
  ...

Conflicts:
	arch/sparc/include/asm/pgtable_64.h
This commit is contained in:
Linus Torvalds 2014-06-19 07:50:07 -10:00
commit c4222e4635
160 changed files with 1606 additions and 1880 deletions

View File

@ -124,7 +124,7 @@ extern void aes_sparc64_ctr_crypt_256(const u64 *key, const u64 *input,
u64 *output, unsigned int len, u64 *output, unsigned int len,
u64 *iv); u64 *iv);
struct aes_ops aes128_ops = { static struct aes_ops aes128_ops = {
.encrypt = aes_sparc64_encrypt_128, .encrypt = aes_sparc64_encrypt_128,
.decrypt = aes_sparc64_decrypt_128, .decrypt = aes_sparc64_decrypt_128,
.load_encrypt_keys = aes_sparc64_load_encrypt_keys_128, .load_encrypt_keys = aes_sparc64_load_encrypt_keys_128,
@ -136,7 +136,7 @@ struct aes_ops aes128_ops = {
.ctr_crypt = aes_sparc64_ctr_crypt_128, .ctr_crypt = aes_sparc64_ctr_crypt_128,
}; };
struct aes_ops aes192_ops = { static struct aes_ops aes192_ops = {
.encrypt = aes_sparc64_encrypt_192, .encrypt = aes_sparc64_encrypt_192,
.decrypt = aes_sparc64_decrypt_192, .decrypt = aes_sparc64_decrypt_192,
.load_encrypt_keys = aes_sparc64_load_encrypt_keys_192, .load_encrypt_keys = aes_sparc64_load_encrypt_keys_192,
@ -148,7 +148,7 @@ struct aes_ops aes192_ops = {
.ctr_crypt = aes_sparc64_ctr_crypt_192, .ctr_crypt = aes_sparc64_ctr_crypt_192,
}; };
struct aes_ops aes256_ops = { static struct aes_ops aes256_ops = {
.encrypt = aes_sparc64_encrypt_256, .encrypt = aes_sparc64_encrypt_256,
.decrypt = aes_sparc64_decrypt_256, .decrypt = aes_sparc64_decrypt_256,
.load_encrypt_keys = aes_sparc64_load_encrypt_keys_256, .load_encrypt_keys = aes_sparc64_load_encrypt_keys_256,

View File

@ -20,11 +20,11 @@
#define ATOMIC_INIT(i) { (i) } #define ATOMIC_INIT(i) { (i) }
extern int __atomic_add_return(int, atomic_t *); int __atomic_add_return(int, atomic_t *);
extern int atomic_cmpxchg(atomic_t *, int, int); int atomic_cmpxchg(atomic_t *, int, int);
#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
extern int __atomic_add_unless(atomic_t *, int, int); int __atomic_add_unless(atomic_t *, int, int);
extern void atomic_set(atomic_t *, int); void atomic_set(atomic_t *, int);
#define atomic_read(v) (*(volatile int *)&(v)->counter) #define atomic_read(v) (*(volatile int *)&(v)->counter)

View File

@ -20,15 +20,15 @@
#define atomic_set(v, i) (((v)->counter) = i) #define atomic_set(v, i) (((v)->counter) = i)
#define atomic64_set(v, i) (((v)->counter) = i) #define atomic64_set(v, i) (((v)->counter) = i)
extern void atomic_add(int, atomic_t *); void atomic_add(int, atomic_t *);
extern void atomic64_add(long, atomic64_t *); void atomic64_add(long, atomic64_t *);
extern void atomic_sub(int, atomic_t *); void atomic_sub(int, atomic_t *);
extern void atomic64_sub(long, atomic64_t *); void atomic64_sub(long, atomic64_t *);
extern int atomic_add_ret(int, atomic_t *); int atomic_add_ret(int, atomic_t *);
extern long atomic64_add_ret(long, atomic64_t *); long atomic64_add_ret(long, atomic64_t *);
extern int atomic_sub_ret(int, atomic_t *); int atomic_sub_ret(int, atomic_t *);
extern long atomic64_sub_ret(long, atomic64_t *); long atomic64_sub_ret(long, atomic64_t *);
#define atomic_dec_return(v) atomic_sub_ret(1, v) #define atomic_dec_return(v) atomic_sub_ret(1, v)
#define atomic64_dec_return(v) atomic64_sub_ret(1, v) #define atomic64_dec_return(v) atomic64_sub_ret(1, v)
@ -107,6 +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) #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
extern long atomic64_dec_if_positive(atomic64_t *v); long atomic64_dec_if_positive(atomic64_t *v);
#endif /* !(__ARCH_SPARC64_ATOMIC__) */ #endif /* !(__ARCH_SPARC64_ATOMIC__) */

View File

@ -1,5 +1,12 @@
#ifndef ___ASM_SPARC_AUXIO_H #ifndef ___ASM_SPARC_AUXIO_H
#define ___ASM_SPARC_AUXIO_H #define ___ASM_SPARC_AUXIO_H
#ifndef __ASSEMBLY__
extern void __iomem *auxio_register;
#endif /* ifndef __ASSEMBLY__ */
#if defined(__sparc__) && defined(__arch64__) #if defined(__sparc__) && defined(__arch64__)
#include <asm/auxio_64.h> #include <asm/auxio_64.h>
#else #else

View File

@ -34,8 +34,8 @@
* NOTE: these routines are implementation dependent-- * NOTE: these routines are implementation dependent--
* understand the hardware you are querying! * understand the hardware you are querying!
*/ */
extern void set_auxio(unsigned char bits_on, unsigned char bits_off); void set_auxio(unsigned char bits_on, unsigned char bits_off);
extern unsigned char get_auxio(void); /* .../asm/floppy.h */ unsigned char get_auxio(void); /* .../asm/floppy.h */
/* /*
* The following routines are provided for driver-compatibility * The following routines are provided for driver-compatibility
@ -78,7 +78,7 @@ do { \
/* AUXIO2 (Power Off Control) */ /* 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_DETECT_FAILURE 32
#define AUXIO_POWER_CLEAR_FAILURE 2 #define AUXIO_POWER_CLEAR_FAILURE 2

View File

@ -75,8 +75,6 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void __iomem *auxio_register;
#define AUXIO_LTE_ON 1 #define AUXIO_LTE_ON 1
#define AUXIO_LTE_OFF 0 #define AUXIO_LTE_OFF 0
@ -84,7 +82,7 @@ extern void __iomem *auxio_register;
* *
* on - AUXIO_LTE_ON or AUXIO_LTE_OFF * 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_ON 1
#define AUXIO_LED_OFF 0 #define AUXIO_LED_OFF 0
@ -93,7 +91,7 @@ extern void auxio_set_lte(int on);
* *
* on - AUXIO_LED_ON or AUXIO_LED_OFF * on - AUXIO_LED_ON or AUXIO_LED_OFF
*/ */
extern void auxio_set_led(int on); void auxio_set_led(int on);
#endif /* ifndef __ASSEMBLY__ */ #endif /* ifndef __ASSEMBLY__ */

View File

@ -20,8 +20,8 @@ struct bit_map {
int num_colors; int num_colors;
}; };
extern int bit_map_string_get(struct bit_map *t, int len, int align); 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); 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); void bit_map_init(struct bit_map *t, unsigned long *map, int size);
#endif /* defined(_SPARC_BITEXT_H) */ #endif /* defined(_SPARC_BITEXT_H) */

View File

@ -18,9 +18,9 @@
#error only <linux/bitops.h> can be included directly #error only <linux/bitops.h> can be included directly
#endif #endif
extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask); unsigned long ___set_bit(unsigned long *addr, unsigned long mask);
extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); unsigned long ___clear_bit(unsigned long *addr, unsigned long mask);
extern unsigned long ___change_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' * Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0'

View File

@ -15,12 +15,12 @@
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/barrier.h> #include <asm/barrier.h>
extern int test_and_set_bit(unsigned long nr, volatile unsigned long *addr); 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); 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); int test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
extern void set_bit(unsigned long nr, volatile unsigned long *addr); void set_bit(unsigned long nr, volatile unsigned long *addr);
extern void clear_bit(unsigned long nr, volatile unsigned long *addr); void clear_bit(unsigned long nr, volatile unsigned long *addr);
extern void change_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> #include <asm-generic/bitops/non-atomic.h>
@ -30,8 +30,8 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr);
#ifdef __KERNEL__ #ifdef __KERNEL__
extern int ffs(int x); int ffs(int x);
extern unsigned long __ffs(unsigned long); unsigned long __ffs(unsigned long);
#include <asm-generic/bitops/ffz.h> #include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
@ -41,10 +41,10 @@ extern unsigned long __ffs(unsigned long);
* of bits set) of a N-bit word * of bits set) of a N-bit word
*/ */
extern unsigned long __arch_hweight64(__u64 w); unsigned long __arch_hweight64(__u64 w);
extern unsigned int __arch_hweight32(unsigned int w); unsigned int __arch_hweight32(unsigned int w);
extern unsigned int __arch_hweight16(unsigned int w); unsigned int __arch_hweight16(unsigned int w);
extern unsigned int __arch_hweight8(unsigned int w); unsigned int __arch_hweight8(unsigned int w);
#include <asm-generic/bitops/const_hweight.h> #include <asm-generic/bitops/const_hweight.h>
#include <asm-generic/bitops/lock.h> #include <asm-generic/bitops/lock.h>

View File

@ -1,6 +1,6 @@
#ifndef _SPARC_BTEXT_H #ifndef _SPARC_BTEXT_H
#define _SPARC_BTEXT_H #define _SPARC_BTEXT_H
extern int btext_find_display(void); int btext_find_display(void);
#endif /* _SPARC_BTEXT_H */ #endif /* _SPARC_BTEXT_H */

View File

@ -5,7 +5,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#ifdef CONFIG_DEBUG_BUGVERBOSE #ifdef CONFIG_DEBUG_BUGVERBOSE
extern void do_BUG(const char *file, int line); void do_BUG(const char *file, int line);
#define BUG() do { \ #define BUG() do { \
do_BUG(__FILE__, __LINE__); \ do_BUG(__FILE__, __LINE__); \
__builtin_trap(); \ __builtin_trap(); \
@ -20,6 +20,6 @@ extern void do_BUG(const char *file, int line);
#include <asm-generic/bug.h> #include <asm-generic/bug.h>
struct pt_regs; 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 #endif

View File

@ -36,7 +36,7 @@
#define flush_page_for_dma(addr) \ #define flush_page_for_dma(addr) \
sparc32_cachetlb_ops->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 ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
#define flush_dcache_page(page) sparc_flush_page_to_ram(page) #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 * way the windows are all clean for the next process and the stack
* frames are up to date. * frames are up to date.
*/ */
extern void flush_user_windows(void); void flush_user_windows(void);
extern void kill_user_windows(void); void kill_user_windows(void);
extern void flushw_all(void); void flushw_all(void);
#endif /* _SPARC_CACHEFLUSH_H */ #endif /* _SPARC_CACHEFLUSH_H */

View File

@ -10,7 +10,7 @@
/* Cache flush operations. */ /* Cache flush operations. */
#define flushw_all() __asm__ __volatile__("flushw") #define flushw_all() __asm__ __volatile__("flushw")
extern void __flushw_user(void); void __flushw_user(void);
#define flushw_user() __flushw_user() #define flushw_user() __flushw_user()
#define flush_user_windows 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 * use block commit stores (which invalidate icache lines) during
* module load, so we need this. * module load, so we need this.
*/ */
extern void flush_icache_range(unsigned long start, unsigned long end); void flush_icache_range(unsigned long start, unsigned long end);
extern void __flush_icache_page(unsigned long); void __flush_icache_page(unsigned long);
extern void __flush_dcache_page(void *addr, int flush_icache); void __flush_dcache_page(void *addr, int flush_icache);
extern void flush_dcache_page_impl(struct page *page); void flush_dcache_page_impl(struct page *page);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern void smp_flush_dcache_page_impl(struct page *page, int cpu); 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 flush_dcache_page_all(struct mm_struct *mm, struct page *page);
#else #else
#define smp_flush_dcache_page_impl(page,cpu) flush_dcache_page_impl(page) #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) #define flush_dcache_page_all(mm,page) flush_dcache_page_impl(page)
#endif #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 #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_page(vma, pg) do { } while(0)
#define flush_icache_user_range(vma,pg,adr,len) 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 *, void flush_ptrace_access(struct vm_area_struct *, struct page *,
unsigned long uaddr, void *kaddr, unsigned long uaddr, void *kaddr,
unsigned long len, int write); unsigned long len, int write);
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { \ do { \

View File

@ -29,7 +29,7 @@
* *
* it's best to have buff aligned on a 32-bit boundary * 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 /* the same as csum_partial, but copies from fs:src while it
* checksums * checksums
@ -38,7 +38,7 @@ extern __wsum csum_partial(const void *buff, int len, __wsum sum);
* better 64-bit) boundary * 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 static inline __wsum
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)

View File

@ -29,7 +29,7 @@
* *
* it's best to have buff aligned on a 32-bit boundary * 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 /* the same as csum_partial, but copies from user space while it
* checksums * 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 * here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary * better 64-bit) boundary
*/ */
extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, __wsum csum_partial_copy_nocheck(const void *src, void *dst,
int len, __wsum sum); int len, __wsum sum);
extern long __csum_partial_copy_from_user(const void __user *src, long __csum_partial_copy_from_user(const void __user *src,
void *dst, int len, void *dst, int len,
__wsum sum); __wsum sum);
static inline __wsum static inline __wsum
csum_partial_copy_from_user(const void __user *src, 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 * Copy and checksum to user
*/ */
#define HAVE_CSUM_COPY_USER #define HAVE_CSUM_COPY_USER
extern long __csum_partial_copy_to_user(const void *src, long __csum_partial_copy_to_user(const void *src,
void __user *dst, int len, void __user *dst, int len,
__wsum sum); __wsum sum);
static inline __wsum static inline __wsum
csum_and_copy_to_user(const void *src, 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 /* ihl is always 5 or greater, almost always is 5, and iph is word aligned
* the majority of the time. * 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. */ /* Fold a partial checksum without adding pseudo headers. */
static inline __sum16 csum_fold(__wsum sum) 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, static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
unsigned int len, unsigned int len,
unsigned short proto, unsigned short proto,
__wsum sum) __wsum sum)
{ {
__asm__ __volatile__( __asm__ __volatile__(
" addcc %1, %0, %0\n" " 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 * returns a 16-bit checksum, already complemented
*/ */
static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
unsigned short len, unsigned short len,
unsigned short proto, unsigned short proto,
__wsum sum) __wsum sum)
{ {
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
} }

View File

@ -20,7 +20,7 @@ static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned lon
return val; 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) 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 #define __HAVE_ARCH_CMPXCHG 1
/* bug catcher for when unsupported size is used - won't link */ /* 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 */ /* 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 */ /* don't worry...optimizer will get rid of most of this */
static inline unsigned long static inline unsigned long

View File

@ -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)))) #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, static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
int size) 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 /* This function doesn't exist, so you'll get a linker error
if something tries to do an invalid cmpxchg(). */ 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 static inline unsigned long
__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)

View File

@ -1,5 +1,15 @@
#ifndef ___ASM_SPARC_CPUDATA_H #ifndef ___ASM_SPARC_CPUDATA_H
#define ___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__) #if defined(__sparc__) && defined(__arch64__)
#include <asm/cpudata_64.h> #include <asm/cpudata_64.h>
#else #else

View File

@ -8,9 +8,6 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/percpu.h>
#include <linux/threads.h>
typedef struct { typedef struct {
/* Dcache line 1 */ /* Dcache line 1 */
unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ 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 cpu_data(__cpu) per_cpu(__cpu_data, (__cpu))
#define local_cpu_data() __get_cpu_var(__cpu_data) #define local_cpu_data() __get_cpu_var(__cpu_data)
extern const struct seq_operations cpuinfo_op;
#endif /* !(__ASSEMBLY__) */ #endif /* !(__ASSEMBLY__) */
#include <asm/trap_block.h> #include <asm/trap_block.h>

View File

@ -20,8 +20,8 @@ static inline void __delay(unsigned long loops)
} }
/* This is too messy with inline asm on the Sparc. */ /* This is too messy with inline asm on the Sparc. */
extern void __udelay(unsigned long usecs, unsigned long lpj); void __udelay(unsigned long usecs, unsigned long lpj);
extern void __ndelay(unsigned long nsecs, unsigned long lpj); void __ndelay(unsigned long nsecs, unsigned long lpj);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#define __udelay_val cpu_data(smp_processor_id()).udelay_val #define __udelay_val cpu_data(smp_processor_id()).udelay_val

View File

@ -8,8 +8,8 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void __delay(unsigned long loops); void __delay(unsigned long loops);
extern void udelay(unsigned long usecs); void udelay(unsigned long usecs);
#define mdelay(n) udelay((n) * 1000) #define mdelay(n) udelay((n) * 1000)
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */

View File

@ -19,7 +19,7 @@ struct dev_archdata {
int numa_node; int numa_node;
}; };
extern void of_propagate_archdata(struct platform_device *bus); void of_propagate_archdata(struct platform_device *bus);
struct pdev_archdata { struct pdev_archdata {
struct resource resource[PROMREG_MAX]; struct resource resource[PROMREG_MAX];

View File

@ -7,7 +7,7 @@
#define DMA_ERROR_CODE (~(dma_addr_t)0x0) #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_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) #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)

View File

@ -22,14 +22,14 @@ struct ebus_dma_info {
unsigned char name[64]; unsigned char name[64];
}; };
extern int ebus_dma_register(struct ebus_dma_info *p); int ebus_dma_register(struct ebus_dma_info *p);
extern int ebus_dma_irq_enable(struct ebus_dma_info *p, int on); int ebus_dma_irq_enable(struct ebus_dma_info *p, int on);
extern void ebus_dma_unregister(struct ebus_dma_info *p); 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_request(struct ebus_dma_info *p, dma_addr_t bus_addr,
size_t len); size_t len);
extern void ebus_dma_prepare(struct ebus_dma_info *p, int write); void ebus_dma_prepare(struct ebus_dma_info *p, int write);
extern unsigned int ebus_dma_residue(struct ebus_dma_info *p); unsigned int ebus_dma_residue(struct ebus_dma_info *p);
extern unsigned int ebus_dma_addr(struct ebus_dma_info *p); 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_enable(struct ebus_dma_info *p, int on);
#endif /* __ASM_SPARC_EBUS_DMA_H */ #endif /* __ASM_SPARC_EBUS_DMA_H */

View File

@ -9,11 +9,12 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/idprom.h> #include <asm/idprom.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/auxio.h> #include <asm/auxio.h>
#include <asm/setup.h>
#include <asm/page.h>
#include <asm/irq.h> #include <asm/irq.h>
/* We don't need no stinkin' I/O port allocation crap. */ /* 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. */ /* You'll only ever find one controller on a SparcStation anyways. */
static struct sun_flpy_controller *sun_fdc = NULL; static struct sun_flpy_controller *sun_fdc = NULL;
extern volatile unsigned char *fdc_status;
struct sun_floppy_ops { struct sun_floppy_ops {
unsigned char (*fd_inb)(int port); 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 * underruns. If non-zero, doing_pdma encodes the direction of
* the transfer for debugging. 1=read 2=write * 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. */ /* Common routines to all controller types on the Sparc. */
static inline void virtual_dma_init(void) static inline void virtual_dma_init(void)
@ -263,8 +256,7 @@ static inline void sun_fd_enable_dma(void)
pdma_areasize = pdma_size; pdma_areasize = pdma_size;
} }
extern int sparc_floppy_request_irq(unsigned int irq, int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler);
irq_handler_t irq_handler);
static int sun_fd_request_irq(void) static int sun_fd_request_irq(void)
{ {

View File

@ -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_current = { -1U, 0, 0, NULL};
static struct sun_pci_dma_op sun_pci_dma_pending = { -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) static unsigned char sun_pci_fd_inb(unsigned long port)
{ {

View File

@ -6,7 +6,7 @@
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void _mcount(void); void _mcount(void);
#endif #endif
#endif #endif
@ -22,4 +22,8 @@ struct dyn_arch_ftrace {
}; };
#endif /* CONFIG_DYNAMIC_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 */ #endif /* _ASM_SPARC64_FTRACE */

View File

@ -31,7 +31,7 @@ extern unsigned long highstart_pfn, highend_pfn;
extern pgprot_t kmap_prot; extern pgprot_t kmap_prot;
extern pte_t *pkmap_page_table; 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 * 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)) #define PKMAP_END (PKMAP_ADDR(LAST_PKMAP))
extern void *kmap_high(struct page *page); void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page); void kunmap_high(struct page *page);
static inline void *kmap(struct page *page) static inline void *kmap(struct page *page)
{ {
@ -68,8 +68,8 @@ static inline void kunmap(struct page *page)
kunmap_high(page); kunmap_high(page);
} }
extern void *kmap_atomic(struct page *page); void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr); void __kunmap_atomic(void *kvaddr);
#define flush_cache_kmaps() flush_cache_all() #define flush_cache_kmaps() flush_cache_all()

View File

@ -19,7 +19,7 @@ struct hvtramp_descr {
struct hvtramp_mapping maps[1]; struct hvtramp_mapping maps[1];
}; };
extern void hv_cpu_startup(unsigned long hvdescr_pa); void hv_cpu_startup(unsigned long hvdescr_pa);
#endif #endif

View File

@ -98,7 +98,7 @@
#define HV_FAST_MACH_EXIT 0x00 #define HV_FAST_MACH_EXIT 0x00
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void sun4v_mach_exit(unsigned long exit_code); void sun4v_mach_exit(unsigned long exit_code);
#endif #endif
/* Domain services. */ /* Domain services. */
@ -127,9 +127,9 @@ extern void sun4v_mach_exit(unsigned long exit_code);
#define HV_FAST_MACH_DESC 0x01 #define HV_FAST_MACH_DESC 0x01
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_mach_desc(unsigned long buffer_pa, unsigned long sun4v_mach_desc(unsigned long buffer_pa,
unsigned long buf_len, unsigned long buf_len,
unsigned long *real_buf_len); unsigned long *real_buf_len);
#endif #endif
/* mach_sir() /* mach_sir()
@ -148,7 +148,7 @@ extern unsigned long sun4v_mach_desc(unsigned long buffer_pa,
#define HV_FAST_MACH_SIR 0x02 #define HV_FAST_MACH_SIR 0x02
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void sun4v_mach_sir(void); void sun4v_mach_sir(void);
#endif #endif
/* mach_set_watchdog() /* mach_set_watchdog()
@ -204,8 +204,8 @@ extern void sun4v_mach_sir(void);
#define HV_FAST_MACH_SET_WATCHDOG 0x05 #define HV_FAST_MACH_SET_WATCHDOG 0x05
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_mach_set_watchdog(unsigned long timeout, unsigned long sun4v_mach_set_watchdog(unsigned long timeout,
unsigned long *orig_timeout); unsigned long *orig_timeout);
#endif #endif
/* CPU services. /* CPU services.
@ -250,10 +250,10 @@ extern unsigned long sun4v_mach_set_watchdog(unsigned long timeout,
#define HV_FAST_CPU_START 0x10 #define HV_FAST_CPU_START 0x10
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_cpu_start(unsigned long cpuid, unsigned long sun4v_cpu_start(unsigned long cpuid,
unsigned long pc, unsigned long pc,
unsigned long rtba, unsigned long rtba,
unsigned long arg0); unsigned long arg0);
#endif #endif
/* cpu_stop() /* cpu_stop()
@ -278,7 +278,7 @@ extern unsigned long sun4v_cpu_start(unsigned long cpuid,
#define HV_FAST_CPU_STOP 0x11 #define HV_FAST_CPU_STOP 0x11
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_cpu_stop(unsigned long cpuid); unsigned long sun4v_cpu_stop(unsigned long cpuid);
#endif #endif
/* cpu_yield() /* cpu_yield()
@ -295,7 +295,7 @@ extern unsigned long sun4v_cpu_stop(unsigned long cpuid);
#define HV_FAST_CPU_YIELD 0x12 #define HV_FAST_CPU_YIELD 0x12
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_cpu_yield(void); unsigned long sun4v_cpu_yield(void);
#endif #endif
/* cpu_qconf() /* cpu_qconf()
@ -341,9 +341,9 @@ extern unsigned long sun4v_cpu_yield(void);
#define HV_CPU_QUEUE_NONRES_ERROR 0x3f #define HV_CPU_QUEUE_NONRES_ERROR 0x3f
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_cpu_qconf(unsigned long type, unsigned long sun4v_cpu_qconf(unsigned long type,
unsigned long queue_paddr, unsigned long queue_paddr,
unsigned long num_queue_entries); unsigned long num_queue_entries);
#endif #endif
/* cpu_qinfo() /* cpu_qinfo()
@ -394,7 +394,9 @@ extern unsigned long sun4v_cpu_qconf(unsigned long type,
#define HV_FAST_CPU_MONDO_SEND 0x42 #define HV_FAST_CPU_MONDO_SEND 0x42
#ifndef __ASSEMBLY__ #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 #endif
/* cpu_myid() /* 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 #define HV_CPU_STATE_ERROR 0x03
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern long sun4v_cpu_state(unsigned long cpuid); long sun4v_cpu_state(unsigned long cpuid);
#endif #endif
/* cpu_set_rtba() /* cpu_set_rtba()
@ -625,8 +627,8 @@ struct hv_fault_status {
#define HV_FAST_MMU_TSB_CTX0 0x20 #define HV_FAST_MMU_TSB_CTX0 0x20
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions, unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions,
unsigned long tsb_desc_ra); unsigned long tsb_desc_ra);
#endif #endif
/* mmu_tsb_ctxnon0() /* 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 #define HV_FAST_MMU_DEMAP_ALL 0x24
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void sun4v_mmu_demap_all(void); void sun4v_mmu_demap_all(void);
#endif #endif
/* mmu_map_perm_addr() /* mmu_map_perm_addr()
@ -740,10 +742,10 @@ extern void sun4v_mmu_demap_all(void);
#define HV_FAST_MMU_MAP_PERM_ADDR 0x25 #define HV_FAST_MMU_MAP_PERM_ADDR 0x25
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr, unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr,
unsigned long set_to_zero, unsigned long set_to_zero,
unsigned long tte, unsigned long tte,
unsigned long flags); unsigned long flags);
#endif #endif
/* mmu_fault_area_conf() /* 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 #define HV_FAST_TOD_GET 0x50
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_tod_get(unsigned long *time); unsigned long sun4v_tod_get(unsigned long *time);
#endif #endif
/* tod_set() /* tod_set()
@ -962,7 +964,7 @@ extern unsigned long sun4v_tod_get(unsigned long *time);
#define HV_FAST_TOD_SET 0x51 #define HV_FAST_TOD_SET 0x51
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_tod_set(unsigned long time); unsigned long sun4v_tod_set(unsigned long time);
#endif #endif
/* Console services */ /* Console services */
@ -1038,14 +1040,14 @@ extern unsigned long sun4v_tod_set(unsigned long time);
#define HV_FAST_CONS_WRITE 0x63 #define HV_FAST_CONS_WRITE 0x63
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern long sun4v_con_getchar(long *status); long sun4v_con_getchar(long *status);
extern long sun4v_con_putchar(long c); long sun4v_con_putchar(long c);
extern long sun4v_con_read(unsigned long buffer, long sun4v_con_read(unsigned long buffer,
unsigned long size, unsigned long size,
unsigned long *bytes_read); unsigned long *bytes_read);
extern unsigned long sun4v_con_write(unsigned long buffer, unsigned long sun4v_con_write(unsigned long buffer,
unsigned long size, unsigned long size,
unsigned long *bytes_written); unsigned long *bytes_written);
#endif #endif
/* mach_set_soft_state() /* mach_set_soft_state()
@ -1080,8 +1082,8 @@ extern unsigned long sun4v_con_write(unsigned long buffer,
#define HV_SOFT_STATE_TRANSITION 0x02 #define HV_SOFT_STATE_TRANSITION 0x02
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_mach_set_soft_state(unsigned long soft_state, unsigned long sun4v_mach_set_soft_state(unsigned long soft_state,
unsigned long msg_string_ra); unsigned long msg_string_ra);
#endif #endif
/* mach_get_soft_state() /* 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 #define HV_FAST_SVC_CLRSTATUS 0x84
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_svc_send(unsigned long svc_id, unsigned long sun4v_svc_send(unsigned long svc_id,
unsigned long buffer, unsigned long buffer,
unsigned long buffer_size, unsigned long buffer_size,
unsigned long *sent_bytes); unsigned long *sent_bytes);
extern unsigned long sun4v_svc_recv(unsigned long svc_id, unsigned long sun4v_svc_recv(unsigned long svc_id,
unsigned long buffer, unsigned long buffer,
unsigned long buffer_size, unsigned long buffer_size,
unsigned long *recv_bytes); unsigned long *recv_bytes);
extern unsigned long sun4v_svc_getstatus(unsigned long svc_id, unsigned long sun4v_svc_getstatus(unsigned long svc_id,
unsigned long *status_bits); unsigned long *status_bits);
extern unsigned long sun4v_svc_setstatus(unsigned long svc_id, unsigned long sun4v_svc_setstatus(unsigned long svc_id,
unsigned long status_bits); unsigned long status_bits);
extern unsigned long sun4v_svc_clrstatus(unsigned long svc_id, unsigned long sun4v_svc_clrstatus(unsigned long svc_id,
unsigned long status_bits); unsigned long status_bits);
#endif #endif
/* Trap trace services. /* Trap trace services.
@ -1458,8 +1460,8 @@ struct hv_trap_trace_entry {
#define HV_FAST_INTR_DEVINO2SYSINO 0xa0 #define HV_FAST_INTR_DEVINO2SYSINO 0xa0
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_devino_to_sysino(unsigned long devhandle, unsigned long sun4v_devino_to_sysino(unsigned long devhandle,
unsigned long devino); unsigned long devino);
#endif #endif
/* intr_getenabled() /* intr_getenabled()
@ -1476,7 +1478,7 @@ extern unsigned long sun4v_devino_to_sysino(unsigned long devhandle,
#define HV_FAST_INTR_GETENABLED 0xa1 #define HV_FAST_INTR_GETENABLED 0xa1
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_intr_getenabled(unsigned long sysino); unsigned long sun4v_intr_getenabled(unsigned long sysino);
#endif #endif
/* intr_setenabled() /* intr_setenabled()
@ -1492,7 +1494,8 @@ extern unsigned long sun4v_intr_getenabled(unsigned long sysino);
#define HV_FAST_INTR_SETENABLED 0xa2 #define HV_FAST_INTR_SETENABLED 0xa2
#ifndef __ASSEMBLY__ #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 #endif
/* intr_getstate() /* intr_getstate()
@ -1508,7 +1511,7 @@ extern unsigned long sun4v_intr_setenabled(unsigned long sysino, unsigned long i
#define HV_FAST_INTR_GETSTATE 0xa3 #define HV_FAST_INTR_GETSTATE 0xa3
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_intr_getstate(unsigned long sysino); unsigned long sun4v_intr_getstate(unsigned long sysino);
#endif #endif
/* intr_setstate() /* intr_setstate()
@ -1528,7 +1531,7 @@ extern unsigned long sun4v_intr_getstate(unsigned long sysino);
#define HV_FAST_INTR_SETSTATE 0xa4 #define HV_FAST_INTR_SETSTATE 0xa4
#ifndef __ASSEMBLY__ #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 #endif
/* intr_gettarget() /* intr_gettarget()
@ -1546,7 +1549,7 @@ extern unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long int
#define HV_FAST_INTR_GETTARGET 0xa5 #define HV_FAST_INTR_GETTARGET 0xa5
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_intr_gettarget(unsigned long sysino); unsigned long sun4v_intr_gettarget(unsigned long sysino);
#endif #endif
/* intr_settarget() /* intr_settarget()
@ -1563,7 +1566,7 @@ extern unsigned long sun4v_intr_gettarget(unsigned long sysino);
#define HV_FAST_INTR_SETTARGET 0xa6 #define HV_FAST_INTR_SETTARGET 0xa6
#ifndef __ASSEMBLY__ #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 #endif
/* vintr_get_cookie() /* 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 #define HV_FAST_VINTR_SET_TARGET 0xae
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle, unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle,
unsigned long dev_ino, unsigned long dev_ino,
unsigned long *cookie); unsigned long *cookie);
extern unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle, unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle,
unsigned long dev_ino, unsigned long dev_ino,
unsigned long cookie); unsigned long cookie);
extern unsigned long sun4v_vintr_get_valid(unsigned long dev_handle, unsigned long sun4v_vintr_get_valid(unsigned long dev_handle,
unsigned long dev_ino, unsigned long dev_ino,
unsigned long *valid); unsigned long *valid);
extern unsigned long sun4v_vintr_set_valid(unsigned long dev_handle, unsigned long sun4v_vintr_set_valid(unsigned long dev_handle,
unsigned long dev_ino, unsigned long dev_ino,
unsigned long valid); unsigned long valid);
extern unsigned long sun4v_vintr_get_state(unsigned long dev_handle, unsigned long sun4v_vintr_get_state(unsigned long dev_handle,
unsigned long dev_ino, unsigned long dev_ino,
unsigned long *state); unsigned long *state);
extern unsigned long sun4v_vintr_set_state(unsigned long dev_handle, unsigned long sun4v_vintr_set_state(unsigned long dev_handle,
unsigned long dev_ino, unsigned long dev_ino,
unsigned long state); unsigned long state);
extern unsigned long sun4v_vintr_get_target(unsigned long dev_handle, unsigned long sun4v_vintr_get_target(unsigned long dev_handle,
unsigned long dev_ino, unsigned long dev_ino,
unsigned long *cpuid); unsigned long *cpuid);
extern unsigned long sun4v_vintr_set_target(unsigned long dev_handle, unsigned long sun4v_vintr_set_target(unsigned long dev_handle,
unsigned long dev_ino, unsigned long dev_ino,
unsigned long cpuid); unsigned long cpuid);
#endif #endif
/* PCI IO services. /* PCI IO services.
@ -2627,50 +2630,50 @@ struct ldc_mtable_entry {
#define HV_FAST_LDC_REVOKE 0xef #define HV_FAST_LDC_REVOKE 0xef
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_ldc_tx_qconf(unsigned long channel, unsigned long sun4v_ldc_tx_qconf(unsigned long channel,
unsigned long ra, unsigned long ra,
unsigned long num_entries); unsigned long num_entries);
extern unsigned long sun4v_ldc_tx_qinfo(unsigned long channel, unsigned long sun4v_ldc_tx_qinfo(unsigned long channel,
unsigned long *ra, unsigned long *ra,
unsigned long *num_entries); unsigned long *num_entries);
extern unsigned long sun4v_ldc_tx_get_state(unsigned long channel, unsigned long sun4v_ldc_tx_get_state(unsigned long channel,
unsigned long *head_off, unsigned long *head_off,
unsigned long *tail_off, unsigned long *tail_off,
unsigned long *chan_state); unsigned long *chan_state);
extern unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel, unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel,
unsigned long tail_off); unsigned long tail_off);
extern unsigned long sun4v_ldc_rx_qconf(unsigned long channel, unsigned long sun4v_ldc_rx_qconf(unsigned long channel,
unsigned long ra, unsigned long ra,
unsigned long num_entries); unsigned long num_entries);
extern unsigned long sun4v_ldc_rx_qinfo(unsigned long channel, unsigned long sun4v_ldc_rx_qinfo(unsigned long channel,
unsigned long *ra, unsigned long *ra,
unsigned long *num_entries); unsigned long *num_entries);
extern unsigned long sun4v_ldc_rx_get_state(unsigned long channel, unsigned long sun4v_ldc_rx_get_state(unsigned long channel,
unsigned long *head_off, unsigned long *head_off,
unsigned long *tail_off, unsigned long *tail_off,
unsigned long *chan_state); unsigned long *chan_state);
extern unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel, unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel,
unsigned long head_off); unsigned long head_off);
extern unsigned long sun4v_ldc_set_map_table(unsigned long channel, unsigned long sun4v_ldc_set_map_table(unsigned long channel,
unsigned long ra, unsigned long ra,
unsigned long num_entries); unsigned long num_entries);
extern unsigned long sun4v_ldc_get_map_table(unsigned long channel, unsigned long sun4v_ldc_get_map_table(unsigned long channel,
unsigned long *ra, unsigned long *ra,
unsigned long *num_entries); unsigned long *num_entries);
extern unsigned long sun4v_ldc_copy(unsigned long channel, unsigned long sun4v_ldc_copy(unsigned long channel,
unsigned long dir_code, unsigned long dir_code,
unsigned long tgt_raddr, unsigned long tgt_raddr,
unsigned long lcl_raddr, unsigned long lcl_raddr,
unsigned long len, unsigned long len,
unsigned long *actual_len); unsigned long *actual_len);
extern unsigned long sun4v_ldc_mapin(unsigned long channel, unsigned long sun4v_ldc_mapin(unsigned long channel,
unsigned long cookie, unsigned long cookie,
unsigned long *ra, unsigned long *ra,
unsigned long *perm); unsigned long *perm);
extern unsigned long sun4v_ldc_unmap(unsigned long ra); unsigned long sun4v_ldc_unmap(unsigned long ra);
extern unsigned long sun4v_ldc_revoke(unsigned long channel, unsigned long sun4v_ldc_revoke(unsigned long channel,
unsigned long cookie, unsigned long cookie,
unsigned long mte_cookie); unsigned long mte_cookie);
#endif #endif
/* Performance counter services. */ /* Performance counter services. */
@ -2727,14 +2730,14 @@ extern unsigned long sun4v_ldc_revoke(unsigned long channel,
#define HV_FAST_N2_SET_PERFREG 0x105 #define HV_FAST_N2_SET_PERFREG 0x105
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_niagara_getperf(unsigned long reg, unsigned long sun4v_niagara_getperf(unsigned long reg,
unsigned long *val); unsigned long *val);
extern unsigned long sun4v_niagara_setperf(unsigned long reg, unsigned long sun4v_niagara_setperf(unsigned long reg,
unsigned long val); unsigned long val);
extern unsigned long sun4v_niagara2_getperf(unsigned long reg, unsigned long sun4v_niagara2_getperf(unsigned long reg,
unsigned long *val); unsigned long *val);
extern unsigned long sun4v_niagara2_setperf(unsigned long reg, unsigned long sun4v_niagara2_setperf(unsigned long reg,
unsigned long val); unsigned long val);
#endif #endif
/* MMU statistics services. /* MMU statistics services.
@ -2829,8 +2832,8 @@ struct hv_mmu_statistics {
#define HV_FAST_MMUSTAT_INFO 0x103 #define HV_FAST_MMUSTAT_INFO 0x103
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_mmustat_conf(unsigned long ra, unsigned long *orig_ra); 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_info(unsigned long *ra);
#endif #endif
/* NCS crypto services */ /* NCS crypto services */
@ -2919,9 +2922,9 @@ struct hv_ncs_qtail_update_arg {
#define HV_FAST_NCS_REQUEST 0x110 #define HV_FAST_NCS_REQUEST 0x110
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_ncs_request(unsigned long request, unsigned long sun4v_ncs_request(unsigned long request,
unsigned long arg_ra, unsigned long arg_ra,
unsigned long arg_size); unsigned long arg_size);
#endif #endif
#define HV_FAST_FIRE_GET_PERFREG 0x120 #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 #define HV_FAST_REBOOT_DATA_SET 0x172
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_reboot_data_set(unsigned long ra, unsigned long sun4v_reboot_data_set(unsigned long ra,
unsigned long len); unsigned long len);
#endif #endif
#define HV_FAST_VT_GET_PERFREG 0x184 #define HV_FAST_VT_GET_PERFREG 0x184
#define HV_FAST_VT_SET_PERFREG 0x185 #define HV_FAST_VT_SET_PERFREG 0x185
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_vt_get_perfreg(unsigned long reg_num, unsigned long sun4v_vt_get_perfreg(unsigned long reg_num,
unsigned long *reg_val); unsigned long *reg_val);
extern unsigned long sun4v_vt_set_perfreg(unsigned long reg_num, unsigned long sun4v_vt_set_perfreg(unsigned long reg_num,
unsigned long reg_val); unsigned long reg_val);
#endif #endif
/* Function numbers for HV_CORE_TRAP. */ /* 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 #define HV_GRP_DIAG 0x0300
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long sun4v_get_version(unsigned long group, unsigned long sun4v_get_version(unsigned long group,
unsigned long *major, unsigned long *major,
unsigned long *minor); unsigned long *minor);
extern unsigned long sun4v_set_version(unsigned long group, unsigned long sun4v_set_version(unsigned long group,
unsigned long major, unsigned long major,
unsigned long minor, unsigned long minor,
unsigned long *actual_minor); unsigned long *actual_minor);
extern int sun4v_hvapi_register(unsigned long group, unsigned long major, int sun4v_hvapi_register(unsigned long group, unsigned long major,
unsigned long *minor); unsigned long *minor);
extern void sun4v_hvapi_unregister(unsigned long group); void sun4v_hvapi_unregister(unsigned long group);
extern int sun4v_hvapi_get(unsigned long group, int sun4v_hvapi_get(unsigned long group,
unsigned long *major, unsigned long *major,
unsigned long *minor); unsigned long *minor);
extern void sun4v_hvapi_init(void); void sun4v_hvapi_init(void);
#endif #endif
#endif /* !(_SPARC64_HYPERVISOR_H) */ #endif /* !(_SPARC64_HYPERVISOR_H) */

View File

@ -20,6 +20,6 @@ struct idprom {
}; };
extern struct idprom *idprom; extern struct idprom *idprom;
extern void idprom_init(void); void idprom_init(void);
#endif /* !(_SPARC_IDPROM_H) */ #endif /* !(_SPARC_IDPROM_H) */

View File

@ -43,7 +43,7 @@
struct iounit_struct { struct iounit_struct {
unsigned long bmap[(IOUNIT_DMA_SIZE >> (PAGE_SHIFT + 3)) / sizeof(unsigned long)]; unsigned long bmap[(IOUNIT_DMA_SIZE >> (PAGE_SHIFT + 3)) / sizeof(unsigned long)];
spinlock_t lock; spinlock_t lock;
iopte_t *page_table; iopte_t __iomem *page_table;
unsigned long rotor[3]; unsigned long rotor[3];
unsigned long limit[4]; unsigned long limit[4];
}; };

View File

@ -2,200 +2,22 @@
#define __SPARC_IO_H #define __SPARC_IO_H
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h>
#include <linux/ioport.h> /* struct resource */ #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;
}
static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
{
*(__force volatile u8 *)addr = b;
}
static inline void __raw_writew(u16 w, volatile void __iomem *addr)
{
*(__force volatile u16 *)addr = w;
}
static inline void __raw_writel(u32 l, volatile void __iomem *addr)
{
*(__force volatile u32 *)addr = l;
}
static inline u8 __readb(const volatile void __iomem *addr)
{
return *(__force volatile u8 *)addr;
}
static inline u16 __readw(const volatile void __iomem *addr)
{
return flip_word(*(__force volatile u16 *)addr);
}
static inline u32 __readl(const volatile void __iomem *addr)
{
return flip_dword(*(__force volatile u32 *)addr);
}
static inline void __writeb(u8 b, volatile void __iomem *addr)
{
*(__force volatile u8 *)addr = b;
}
static inline void __writew(u16 w, volatile void __iomem *addr)
{
*(__force volatile u16 *)addr = flip_word(w);
}
static inline void __writel(u32 l, volatile void __iomem *addr)
{
*(__force volatile u32 *)addr = flip_dword(l);
}
#define readb(__addr) __readb(__addr)
#define readw(__addr) __readw(__addr)
#define readl(__addr) __readl(__addr)
#define readb_relaxed(__addr) readb(__addr) #define readb_relaxed(__addr) readb(__addr)
#define readw_relaxed(__addr) readw(__addr) #define readw_relaxed(__addr) readw(__addr)
#define readl_relaxed(__addr) readl(__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 #define IO_SPACE_LIMIT 0xffffffff
/* #define memset_io(d,c,sz) _memset_io(d,c,sz)
* SBus accessors. #define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz)
* #define memcpy_toio(d,s,sz) _memcpy_toio(d,s,sz)
* 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)
{
return *(__force volatile u8 *)addr;
}
static inline u16 _sbus_readw(const volatile void __iomem *addr) #include <asm-generic/io.h>
{
return *(__force volatile u16 *)addr;
}
static inline u32 _sbus_readl(const volatile void __iomem *addr) static inline void _memset_io(volatile void __iomem *dst,
{ int c, __kernel_size_t n)
return *(__force volatile u32 *)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)
{
*(__force volatile u16 *)addr = w;
}
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)
{
while(n--) {
sbus_writeb(c, __dst);
__dst++;
}
}
static inline void
_memset_io(volatile void __iomem *dst, int c, __kernel_size_t n)
{ {
volatile void __iomem *d = dst; volatile void __iomem *d = dst;
@ -205,25 +27,8 @@ _memset_io(volatile void __iomem *dst, int c, __kernel_size_t n)
} }
} }
#define memset_io(d,c,sz) _memset_io(d,c,sz) static inline void _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;
while (n--) {
char tmp = sbus_readb(src);
*d++ = tmp;
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; char *d = dst;
@ -234,26 +39,8 @@ _memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n)
} }
} }
#define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz) static inline void _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;
while (n--) {
char tmp = *s++;
sbus_writeb(tmp, d);
d++;
}
}
#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; const char *s = src;
volatile void __iomem *d = dst; volatile void __iomem *d = dst;
@ -265,7 +52,77 @@ _memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n)
} }
} }
#define memcpy_toio(d,s,sz) _memcpy_toio(d,s,sz) /*
* 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)
{
return *(__force volatile u8 *)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)
{
return *(__force volatile u32 *)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)
{
*(__force volatile u16 *)addr = w;
}
static inline void sbus_writel(u32 l, volatile void __iomem *addr)
{
*(__force volatile u32 *)addr = l;
}
static inline void sbus_memset_io(volatile void __iomem *__dst, int c,
__kernel_size_t n)
{
while(n--) {
sbus_writeb(c, __dst);
__dst++;
}
}
static inline void sbus_memcpy_fromio(void *dst,
const volatile void __iomem *src,
__kernel_size_t n)
{
char *d = dst;
while (n--) {
char tmp = sbus_readb(src);
*d++ = tmp;
src++;
}
}
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;
while (n--) {
char tmp = *s++;
sbus_writeb(tmp, d);
d++;
}
}
#ifdef __KERNEL__ #ifdef __KERNEL__
@ -273,58 +130,20 @@ _memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n)
* Bus number may be embedded in the higher bits of the physical address. * Bus number may be embedded in the higher bits of the physical address.
* This is why we have no bus number argument to ioremap(). * 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_nocache(X,Y) ioremap((X),(Y))
#define ioremap_wc(X,Y) ioremap((X),(Y)) #define ioremap_wc(X,Y) ioremap((X),(Y))
extern void iounmap(volatile void __iomem *addr); 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);
}
/* Create a virtual mapping cookie for an IO port range */ /* Create a virtual mapping cookie for an IO port range */
extern void __iomem *ioport_map(unsigned long port, unsigned int nr); void __iomem *ioport_map(unsigned long port, unsigned int nr);
extern void ioport_unmap(void __iomem *); void ioport_unmap(void __iomem *);
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
struct pci_dev; 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, * 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 */ return 0; /* actually, sparc_cpu_model==sun4d */
} }
struct device; struct device;
extern void sbus_set_sbus64(struct device *, int); void sbus_set_sbus64(struct device *, int);
#endif #endif
#define __ARCH_HAS_NO_PAGE_ZERO_MAPPED 1 #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) */ #endif /* !(__SPARC_IO_H) */

View File

@ -15,7 +15,6 @@
/* BIO layer definitions. */ /* BIO layer definitions. */
extern unsigned long kern_base, kern_size; 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) 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 inl_p(__addr) inl(__addr)
#define outl_p(__l, __addr) outl(__l, __addr) #define outl_p(__l, __addr) outl(__l, __addr)
extern void outsb(unsigned long, const void *, unsigned long); void outsb(unsigned long, const void *, unsigned long);
extern void outsw(unsigned long, const void *, unsigned long); void outsw(unsigned long, const void *, unsigned long);
extern void outsl(unsigned long, const void *, unsigned long); void outsl(unsigned long, const void *, unsigned long);
extern void insb(unsigned long, void *, unsigned long); void insb(unsigned long, void *, unsigned long);
extern void insw(unsigned long, void *, unsigned long); void insw(unsigned long, void *, unsigned long);
extern void insl(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) 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) #define iowrite32be(val,X) __raw_writel(val,X)
/* Create a virtual mapping cookie for an IO port range */ /* Create a virtual mapping cookie for an IO port range */
extern void __iomem *ioport_map(unsigned long port, unsigned int nr); void __iomem *ioport_map(unsigned long port, unsigned int nr);
extern void ioport_unmap(void __iomem *); void ioport_unmap(void __iomem *);
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
struct pci_dev; 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) static inline int sbus_can_dma_64bit(void)
{ {
@ -525,7 +524,7 @@ static inline int sbus_can_burst64(void)
return 1; return 1;
} }
struct device; 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 * Convert a physical pointer to a virtual kernel pointer for /dev/mem

View File

@ -99,7 +99,7 @@ struct iommu_regs {
#define IOPTE_WAZ 0x00000001 /* Write as zeros */ #define IOPTE_WAZ 0x00000001 /* Write as zeros */
struct iommu_struct { struct iommu_struct {
struct iommu_regs *regs; struct iommu_regs __iomem *regs;
iopte_t *page_table; iopte_t *page_table;
/* For convenience */ /* For convenience */
unsigned long start; /* First managed virtual address */ unsigned long start; /* First managed virtual address */
@ -108,14 +108,14 @@ struct iommu_struct {
struct bit_map usemap; 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, &regs->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, &regs->pageflush);
} }
#endif /* !(_SPARC_IOMMU_H) */ #endif /* !(_SPARC_IOMMU_H) */

View File

@ -58,8 +58,8 @@ struct strbuf {
volatile unsigned long __flushflag_buf[(64+(64-1)) / sizeof(long)]; volatile unsigned long __flushflag_buf[(64+(64-1)) / sizeof(long)];
}; };
extern int iommu_table_init(struct iommu *iommu, int tsbsize, int iommu_table_init(struct iommu *iommu, int tsbsize,
u32 dma_offset, u32 dma_addr_mask, u32 dma_offset, u32 dma_addr_mask,
int numa_node); int numa_node);
#endif /* !(_SPARC64_IOMMU_H) */ #endif /* !(_SPARC64_IOMMU_H) */

View File

@ -16,7 +16,8 @@
#define irq_canonicalize(irq) (irq) #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 #define NO_IRQ 0xffffffff

View File

@ -39,32 +39,32 @@
*/ */
#define NR_IRQS 255 #define NR_IRQS 255
extern void irq_install_pre_handler(int irq, void irq_install_pre_handler(int irq,
void (*func)(unsigned int, void *, void *), void (*func)(unsigned int, void *, void *),
void *arg1, void *arg2); void *arg1, void *arg2);
#define irq_canonicalize(irq) (irq) #define irq_canonicalize(irq) (irq)
extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino);
extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino); unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino);
extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p, unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p,
unsigned int msi_devino_start, unsigned int msi_devino_start,
unsigned int msi_devino_end); unsigned int msi_devino_end);
extern void sun4v_destroy_msi(unsigned int irq); void sun4v_destroy_msi(unsigned int irq);
extern unsigned int sun4u_build_msi(u32 portid, unsigned int *irq_p, unsigned int sun4u_build_msi(u32 portid, unsigned int *irq_p,
unsigned int msi_devino_start, unsigned int msi_devino_start,
unsigned int msi_devino_end, unsigned int msi_devino_end,
unsigned long imap_base, unsigned long imap_base,
unsigned long iclr_base); unsigned long iclr_base);
extern void sun4u_destroy_msi(unsigned int irq); void sun4u_destroy_msi(unsigned int irq);
extern unsigned char irq_alloc(unsigned int dev_handle, unsigned char irq_alloc(unsigned int dev_handle,
unsigned int dev_ino); unsigned int dev_ino);
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
extern void irq_free(unsigned int irq); void irq_free(unsigned int irq);
#endif #endif
extern void __init init_IRQ(void); void __init init_IRQ(void);
extern void fixup_irqs(void); void fixup_irqs(void);
static inline void set_softint(unsigned long bits) static inline void set_softint(unsigned long bits)
{ {

View File

@ -15,9 +15,9 @@
#include <linux/types.h> #include <linux/types.h>
#include <asm/psr.h> #include <asm/psr.h>
extern void arch_local_irq_restore(unsigned long); void arch_local_irq_restore(unsigned long);
extern unsigned long arch_local_irq_save(void); unsigned long arch_local_irq_save(void);
extern void arch_local_irq_enable(void); void arch_local_irq_enable(void);
static inline notrace unsigned long arch_local_save_flags(void) static inline notrace unsigned long arch_local_save_flags(void)
{ {

View File

@ -3,7 +3,7 @@
struct pt_regs; struct pt_regs;
extern void bad_trap(struct pt_regs *, long); void bad_trap(struct pt_regs *, long);
/* Grossly misnamed. */ /* Grossly misnamed. */
enum die_val { enum die_val {

View File

@ -28,9 +28,12 @@ enum regnames {
#define NUMREGBYTES ((GDB_CSR + 1) * 4) #define NUMREGBYTES ((GDB_CSR + 1) * 4)
#else #else
#define NUMREGBYTES ((GDB_Y + 1) * 8) #define NUMREGBYTES ((GDB_Y + 1) * 8)
struct pt_regs;
asmlinkage void kgdb_trap(unsigned long trap_level, struct pt_regs *regs);
#endif #endif
extern void arch_kgdb_breakpoint(void); void arch_kgdb_breakpoint(void);
#define BREAK_INSTR_SIZE 4 #define BREAK_INSTR_SIZE 4
#define CACHE_FLUSH_IS_SAFE 1 #define CACHE_FLUSH_IS_SAFE 1

View File

@ -43,7 +43,9 @@ struct kprobe_ctlblk {
struct prev_kprobe prev_kprobe; struct prev_kprobe prev_kprobe;
}; };
extern int kprobe_exceptions_notify(struct notifier_block *self, int kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data); unsigned long val, void *data);
extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 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 */ #endif /* _SPARC64_KPROBES_H */

View File

@ -4,9 +4,9 @@
#include <asm/hypervisor.h> #include <asm/hypervisor.h>
extern int ldom_domaining_enabled; extern int ldom_domaining_enabled;
extern void ldom_set_var(const char *var, const char *value); void ldom_set_var(const char *var, const char *value);
extern void ldom_reboot(const char *boot_command); void ldom_reboot(const char *boot_command);
extern void ldom_power_off(void); void ldom_power_off(void);
/* The event handler will be evoked when link state changes /* The event handler will be evoked when link state changes
* or data becomes available on the receive side. * or data becomes available on the receive side.
@ -51,30 +51,30 @@ struct ldc_channel_config {
struct ldc_channel; struct ldc_channel;
/* Allocate state for a channel. */ /* Allocate state for a channel. */
extern struct ldc_channel *ldc_alloc(unsigned long id, struct ldc_channel *ldc_alloc(unsigned long id,
const struct ldc_channel_config *cfgp, const struct ldc_channel_config *cfgp,
void *event_arg); void *event_arg);
/* Shut down and free state for a channel. */ /* 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. */ /* 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 /* For non-RAW protocols we need to complete a handshake before
* communication can proceed. ldc_connect() does that, if the * communication can proceed. ldc_connect() does that, if the
* handshake completes successfully, an LDC_EVENT_UP event will * handshake completes successfully, an LDC_EVENT_UP event will
* be sent up to the driver. * be sent up to the driver.
*/ */
extern int ldc_connect(struct ldc_channel *lp); int ldc_connect(struct ldc_channel *lp);
extern int ldc_disconnect(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. */ /* Read and write operations. Only valid when the link is up. */
extern int ldc_write(struct ldc_channel *lp, const void *buf, int ldc_write(struct ldc_channel *lp, const void *buf,
unsigned int size); unsigned int size);
extern int ldc_read(struct ldc_channel *lp, 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_SHADOW 0x01
#define LDC_MAP_DIRECT 0x02 #define LDC_MAP_DIRECT 0x02
@ -92,22 +92,22 @@ struct ldc_trans_cookie {
}; };
struct scatterlist; struct scatterlist;
extern int ldc_map_sg(struct ldc_channel *lp, int ldc_map_sg(struct ldc_channel *lp,
struct scatterlist *sg, int num_sg, struct scatterlist *sg, int num_sg,
struct ldc_trans_cookie *cookies, int ncookies, struct ldc_trans_cookie *cookies, int ncookies,
unsigned int map_perm); unsigned int map_perm);
extern int ldc_map_single(struct ldc_channel *lp, int ldc_map_single(struct ldc_channel *lp,
void *buf, unsigned int len, void *buf, unsigned int len,
struct ldc_trans_cookie *cookies, int ncookies, struct ldc_trans_cookie *cookies, int ncookies,
unsigned int map_perm); unsigned int map_perm);
extern void ldc_unmap(struct ldc_channel *lp, struct ldc_trans_cookie *cookies, void ldc_unmap(struct ldc_channel *lp, struct ldc_trans_cookie *cookies,
int ncookies); int ncookies);
extern int ldc_copy(struct ldc_channel *lp, int copy_dir, int ldc_copy(struct ldc_channel *lp, int copy_dir,
void *buf, unsigned int len, unsigned long offset, void *buf, unsigned int len, unsigned long offset,
struct ldc_trans_cookie *cookies, int ncookies); struct ldc_trans_cookie *cookies, int ncookies);
static inline int ldc_get_dring_entry(struct ldc_channel *lp, static inline int ldc_get_dring_entry(struct ldc_channel *lp,
void *buf, unsigned int len, 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); 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, void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len,
struct ldc_trans_cookie *cookies, struct ldc_trans_cookie *cookies,
int *ncookies, unsigned int map_perm); int *ncookies, unsigned int map_perm);
extern void ldc_free_exp_dring(struct ldc_channel *lp, void *buf, void ldc_free_exp_dring(struct ldc_channel *lp, void *buf,
unsigned int len, unsigned int len,
struct ldc_trans_cookie *cookies, int ncookies); struct ldc_trans_cookie *cookies, int ncookies);
#endif /* _SPARC64_LDC_H */ #endif /* _SPARC64_LDC_H */

View File

@ -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_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)) #define LEON_BYPASS_STORE_PA(x, v) leon_store_reg((unsigned long)(x), (unsigned long)(v))
extern void leon_switch_mm(void); void leon_switch_mm(void);
extern void leon_init_IRQ(void); void leon_init_IRQ(void);
static inline unsigned long sparc_leon3_get_dcachecfg(void) static inline unsigned long sparc_leon3_get_dcachecfg(void)
{ {
@ -196,14 +196,14 @@ static inline int sparc_leon3_cpuid(void)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
struct vm_area_struct; struct vm_area_struct;
extern unsigned long leon_swprobe(unsigned long vaddr, unsigned long *paddr); unsigned long leon_swprobe(unsigned long vaddr, unsigned long *paddr);
extern void leon_flush_icache_all(void); void leon_flush_icache_all(void);
extern void leon_flush_dcache_all(void); void leon_flush_dcache_all(void);
extern void leon_flush_cache_all(void); void leon_flush_cache_all(void);
extern void leon_flush_tlb_all(void); void leon_flush_tlb_all(void);
extern int leon_flush_during_switch; extern int leon_flush_during_switch;
extern int leon_flush_needed(void); int leon_flush_needed(void);
extern void leon_flush_pcache_all(struct vm_area_struct *vma, unsigned long page); void leon_flush_pcache_all(struct vm_area_struct *vma, unsigned long page);
/* struct that hold LEON3 cache configuration registers */ /* struct that hold LEON3 cache configuration registers */
struct leon3_cacheregs { struct leon3_cacheregs {
@ -217,29 +217,29 @@ struct leon3_cacheregs {
struct device_node; struct device_node;
struct task_struct; struct task_struct;
extern unsigned int leon_build_device_irq(unsigned int real_irq, unsigned int leon_build_device_irq(unsigned int real_irq,
irq_flow_handler_t flow_handler, irq_flow_handler_t flow_handler,
const char *name, int do_ack); const char *name, int do_ack);
extern void leon_update_virq_handling(unsigned int virq, void leon_update_virq_handling(unsigned int virq,
irq_flow_handler_t flow_handler, irq_flow_handler_t flow_handler,
const char *name, int do_ack); const char *name, int do_ack);
extern void leon_init_timers(void); void leon_init_timers(void);
extern void leon_trans_init(struct device_node *dp); void leon_trans_init(struct device_node *dp);
extern void leon_node_init(struct device_node *dp, struct device_node ***nextp); void leon_node_init(struct device_node *dp, struct device_node ***nextp);
extern void init_leon(void); void init_leon(void);
extern void poke_leonsparc(void); void poke_leonsparc(void);
extern void leon3_getCacheRegs(struct leon3_cacheregs *regs); void leon3_getCacheRegs(struct leon3_cacheregs *regs);
extern int leon3_ticker_irq; extern int leon3_ticker_irq;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern int leon_smp_nrcpus(void); int leon_smp_nrcpus(void);
extern void leon_clear_profile_irq(int cpu); void leon_clear_profile_irq(int cpu);
extern void leon_smp_done(void); void leon_smp_done(void);
extern void leon_boot_cpus(void); void leon_boot_cpus(void);
extern int leon_boot_one_cpu(int i, struct task_struct *); int leon_boot_one_cpu(int i, struct task_struct *);
void leon_init_smp(void); void leon_init_smp(void);
void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu); 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 smpleon_ipi[];
extern unsigned int linux_trap_ipi15_leon[]; extern unsigned int linux_trap_ipi15_leon[];

View File

@ -16,7 +16,7 @@ struct leon_pci_info {
int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
}; };
extern void leon_pci_init(struct platform_device *ofdev, void leon_pci_init(struct platform_device *ofdev,
struct leon_pci_info *info); struct leon_pci_info *info);
#endif /* _ASM_LEON_PCI_H_ */ #endif /* _ASM_LEON_PCI_H_ */

View File

@ -1,5 +1,10 @@
#ifndef ___ASM_SPARC_MC146818RTC_H #ifndef ___ASM_SPARC_MC146818RTC_H
#define ___ASM_SPARC_MC146818RTC_H #define ___ASM_SPARC_MC146818RTC_H
#include <linux/spinlock.h>
extern spinlock_t rtc_lock;
#if defined(__sparc__) && defined(__arch64__) #if defined(__sparc__) && defined(__arch64__)
#include <asm/mc146818rtc_64.h> #include <asm/mc146818rtc_64.h>
#else #else

View File

@ -12,13 +12,13 @@ struct mdesc_handle;
* the first argument to all of the operational calls that work * the first argument to all of the operational calls that work
* on mdescs. * on mdescs.
*/ */
extern struct mdesc_handle *mdesc_grab(void); struct mdesc_handle *mdesc_grab(void);
extern void mdesc_release(struct mdesc_handle *); void mdesc_release(struct mdesc_handle *);
#define MDESC_NODE_NULL (~(u64)0) #define MDESC_NODE_NULL (~(u64)0)
extern u64 mdesc_node_by_name(struct mdesc_handle *handle, u64 mdesc_node_by_name(struct mdesc_handle *handle,
u64 from_node, const char *name); u64 from_node, const char *name);
#define mdesc_for_each_node_by_name(__hdl, __node, __name) \ #define mdesc_for_each_node_by_name(__hdl, __node, __name) \
for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \ for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \
(__node) != MDESC_NODE_NULL; \ (__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(). * These same rules apply to mdesc_node_name().
*/ */
extern const void *mdesc_get_property(struct mdesc_handle *handle, const void *mdesc_get_property(struct mdesc_handle *handle,
u64 node, const char *name, int *lenp); u64 node, const char *name, int *lenp);
extern const char *mdesc_node_name(struct mdesc_handle *hp, u64 node); const char *mdesc_node_name(struct mdesc_handle *hp, u64 node);
/* MD arc iteration, the standard sequence is: /* 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_FWD "fwd"
#define MDESC_ARC_TYPE_BACK "back" #define MDESC_ARC_TYPE_BACK "back"
extern u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from, u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from,
const char *arc_type); const char *arc_type);
#define mdesc_for_each_arc(__arc, __hdl, __node, __type) \ #define mdesc_for_each_arc(__arc, __hdl, __node, __type) \
for (__arc = mdesc_next_arc(__hdl, __node, __type); \ for (__arc = mdesc_next_arc(__hdl, __node, __type); \
(__arc) != MDESC_NODE_NULL; \ (__arc) != MDESC_NODE_NULL; \
__arc = mdesc_next_arc(__hdl, __arc, __type)) __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 { struct mdesc_notifier_client {
void (*add)(struct mdesc_handle *handle, u64 node); void (*add)(struct mdesc_handle *handle, u64 node);
@ -69,12 +69,12 @@ struct mdesc_notifier_client {
struct mdesc_notifier_client *next; 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); void mdesc_fill_in_cpu_data(cpumask_t *mask);
extern void mdesc_populate_present_mask(cpumask_t *mask); void mdesc_populate_present_mask(cpumask_t *mask);
extern void mdesc_get_page_sizes(cpumask_t *mask, unsigned long *pgsz_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 #endif

View File

@ -67,9 +67,9 @@ struct tsb {
unsigned long pte; unsigned long pte;
} __attribute__((aligned(TSB_ENTRY_ALIGNMENT))); } __attribute__((aligned(TSB_ENTRY_ALIGNMENT)));
extern void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte); void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte);
extern void tsb_flush(unsigned long ent, unsigned long tag); void tsb_flush(unsigned long ent, unsigned long tag);
extern void tsb_init(struct tsb *tsb, unsigned long size); void tsb_init(struct tsb *tsb, unsigned long size);
struct tsb_config { struct tsb_config {
struct tsb *tsb; struct tsb *tsb;

View File

@ -17,20 +17,20 @@ extern spinlock_t ctx_alloc_lock;
extern unsigned long tlb_context_cache; extern unsigned long tlb_context_cache;
extern unsigned long mmu_context_bmap[]; 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 #ifdef CONFIG_SMP
extern void smp_new_mmu_context_version(void); void smp_new_mmu_context_version(void);
#else #else
#define smp_new_mmu_context_version() do { } while (0) #define smp_new_mmu_context_version() do { } while (0)
#endif #endif
extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
extern void destroy_context(struct mm_struct *mm); void destroy_context(struct mm_struct *mm);
extern void __tsb_context_switch(unsigned long pgd_pa, void __tsb_context_switch(unsigned long pgd_pa,
struct tsb_config *tsb_base, struct tsb_config *tsb_base,
struct tsb_config *tsb_huge, struct tsb_config *tsb_huge,
unsigned long tsb_descr_pa); unsigned long tsb_descr_pa);
static inline void tsb_context_switch(struct mm_struct *mm) 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])); , __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 #ifdef CONFIG_SMP
extern void smp_tsb_sync(struct mm_struct *mm); void smp_tsb_sync(struct mm_struct *mm);
#else #else
#define smp_tsb_sync(__mm) do { } while (0) #define smp_tsb_sync(__mm) do { } while (0)
#endif #endif
@ -66,7 +68,7 @@ extern void smp_tsb_sync(struct mm_struct *mm);
: "r" (CTX_HWBITS((__mm)->context)), \ : "r" (CTX_HWBITS((__mm)->context)), \
"r" (SECONDARY_CONTEXT), "i" (ASI_DMMU), "i" (ASI_MMU)) "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. */ /* Switch the current MM context. */
static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk) static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk)

View File

@ -1,13 +1,13 @@
#ifndef __NMI_H #ifndef __NMI_H
#define __NMI_H #define __NMI_H
extern int __init nmi_init(void); int __init nmi_init(void);
extern void perfctr_irq(int irq, struct pt_regs *regs); void perfctr_irq(int irq, struct pt_regs *regs);
extern void nmi_adjust_hz(unsigned int new_hz); void nmi_adjust_hz(unsigned int new_hz);
extern atomic_t nmi_active; extern atomic_t nmi_active;
extern void start_nmi_watchdog(void *unused); void start_nmi_watchdog(void *unused);
extern void stop_nmi_watchdog(void *unused); void stop_nmi_watchdog(void *unused);
#endif /* __NMI_H */ #endif /* __NMI_H */

View File

@ -43,28 +43,28 @@ extern struct linux_nodeops *prom_nodeops;
/* You must call prom_init() before using any of the library services, /* You must call prom_init() before using any of the library services,
* preferably as early as possible. Pass it the romvec pointer. * 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. */ /* 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. */ /* Miscellaneous routines, don't really fit in any category per se. */
/* Reboot the machine with the command line passed. */ /* 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. */ /* 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' /* Enter the prom, with possibility of continuation with the 'go'
* command in newer proms. * 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 /* Enter the prom, with no chance of continuation for the stand-alone
* which calls this. * 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. /* Set the PROM 'sync' callback function to the passed function pointer.
* When the user gives the 'sync' command at the prom prompt while the * 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 * XXX The arguments are different on V0 vs. V2->higher proms, grrr! XXX
*/ */
typedef void (*sync_func_t)(void); 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 /* 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 * gets passed a buffer where you would like it stuffed. The return value
* is the format type of this idprom or 0xff on error. * 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. */ /* Get the prom major version. */
extern int prom_version(void); int prom_version(void);
/* Get the prom plugin revision. */ /* Get the prom plugin revision. */
extern int prom_getrev(void); int prom_getrev(void);
/* Get the prom firmware revision. */ /* Get the prom firmware revision. */
extern int prom_getprev(void); int prom_getprev(void);
/* Write a buffer of characters to the console. */ /* 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. */ /* Prom's internal routines, don't use in kernel/boot code. */
extern __printf(1, 2) void prom_printf(const char *fmt, ...); __printf(1, 2) void prom_printf(const char *fmt, ...);
extern void prom_write(const char *buf, unsigned int len); void prom_write(const char *buf, unsigned int len);
/* Multiprocessor operations... */ /* Multiprocessor operations... */
/* Start the CPU with the given device tree node, context table, and context /* Start the CPU with the given device tree node, context table, and context
* at the passed program counter. * at the passed program counter.
*/ */
extern int prom_startcpu(int cpunode, struct linux_prom_registers *context_table, int prom_startcpu(int cpunode, struct linux_prom_registers *context_table,
int context, char *program_counter); int context, char *program_counter);
/* Initialize the memory lists based upon the prom version. */ /* Initialize the memory lists based upon the prom version. */
void prom_meminit(void); void prom_meminit(void);
@ -111,65 +111,65 @@ void prom_meminit(void);
/* PROM device tree traversal functions... */ /* PROM device tree traversal functions... */
/* Get the child node of the given node, or zero if no child exists. */ /* 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 /* Get the next sibling node of the given node, or zero if no further
* siblings exist. * 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. /* Get the length, at the passed node, of the given property type.
* Returns -1 on error (ie. no such property at this node). * 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 /* Fetch the requested property using the given buffer. Returns
* the number of bytes the prom put into your buffer or -1 on error. * 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, int __must_check prom_getproperty(phandle thisnode, const char *property,
char *prop_buffer, int propbuf_size); char *prop_buffer, int propbuf_size);
/* Acquire an integer property. */ /* 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. */ /* 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. */ /* 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. */ /* 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 /* Search all siblings starting at the passed node for "name" matching
* the given string. Returns the node on success, zero on failure. * 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 /* Returns the next property after the passed property for the given
* node. Returns null string on failure. * 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 */ /* 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. /* Set the indicated property at the given node with the passed value.
* Returns the number of bytes of your value that the prom took. * 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 prom_setprop(phandle node, const char *prop_name, char *prop_value,
int value_size); int value_size);
extern phandle prom_inst2pkg(int); phandle prom_inst2pkg(int);
/* Dorking with Bus ranges... */ /* Dorking with Bus ranges... */
/* Apply promlib probes OBIO ranges to registers. */ /* 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. */ /* Apply ranges of any prom node (and optionally parent node as well) to registers. */
extern void prom_apply_generic_ranges(phandle node, phandle parent, void prom_apply_generic_ranges(phandle node, phandle parent,
struct linux_prom_registers *sbusregs, int nregs); struct linux_prom_registers *sbusregs, int nregs);
void prom_ranges_init(void); void prom_ranges_init(void);

View File

@ -62,100 +62,100 @@ struct linux_mem_p1275 {
/* You must call prom_init() before using any of the library services, /* You must call prom_init() before using any of the library services,
* preferably as early as possible. Pass it the romvec pointer. * 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. */ /* 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. */ /* Miscellaneous routines, don't really fit in any category per se. */
/* Reboot the machine with the command line passed. */ /* 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. */ /* 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' /* Enter the prom, with possibility of continuation with the 'go'
* command in newer proms. * 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 /* Enter the prom, with no chance of continuation for the stand-alone
* which calls this. * which calls this.
*/ */
extern void prom_halt(void) __attribute__ ((noreturn)); void prom_halt(void) __attribute__ ((noreturn));
/* Halt and power-off the machine. */ /* 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 /* 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 * gets passed a buffer where you would like it stuffed. The return value
* is the format type of this idprom or 0xff on error. * 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. */ /* 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. */ /* Prom's internal routines, don't use in kernel/boot code. */
extern __printf(1, 2) void prom_printf(const char *fmt, ...); __printf(1, 2) void prom_printf(const char *fmt, ...);
extern void prom_write(const char *buf, unsigned int len); void prom_write(const char *buf, unsigned int len);
/* Multiprocessor operations... */ /* Multiprocessor operations... */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* Start the CPU with the given device tree node at the passed program /* Start the CPU with the given device tree node at the passed program
* counter with the given arg passed in via register %o0. * 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 /* Start the CPU with the given cpu ID at the passed program
* counter with the given arg passed in via register %o0. * 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. */ /* 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. */ /* Stop the current CPU. */
extern void prom_stopself(void); void prom_stopself(void);
/* Idle the current CPU. */ /* Idle the current CPU. */
extern void prom_idleself(void); void prom_idleself(void);
/* Resume the CPU with the passed device tree node. */ /* Resume the CPU with the passed device tree node. */
extern void prom_resumecpu(int cpunode); void prom_resumecpu(int cpunode);
#endif #endif
/* Power management interfaces. */ /* Power management interfaces. */
/* Put the current CPU to sleep. */ /* Put the current CPU to sleep. */
extern void prom_sleepself(void); void prom_sleepself(void);
/* Put the entire system to sleep. */ /* Put the entire system to sleep. */
extern int prom_sleepsystem(void); int prom_sleepsystem(void);
/* Initiate a wakeup event. */ /* Initiate a wakeup event. */
extern int prom_wakeupsystem(void); int prom_wakeupsystem(void);
/* MMU and memory related OBP interfaces. */ /* MMU and memory related OBP interfaces. */
/* Get unique string identifying SIMM at given physical address. */ /* Get unique string identifying SIMM at given physical address. */
extern int prom_getunumber(int syndrome_code, int prom_getunumber(int syndrome_code,
unsigned long phys_addr, unsigned long phys_addr,
char *buf, int buflen); char *buf, int buflen);
/* Retain physical memory to the caller across soft resets. */ /* Retain physical memory to the caller across soft resets. */
extern int prom_retain(const char *name, unsigned long size, int prom_retain(const char *name, unsigned long size,
unsigned long align, unsigned long *paddr); unsigned long align, unsigned long *paddr);
/* Load explicit I/D TLB entries into the calling processor. */ /* Load explicit I/D TLB entries into the calling processor. */
extern long prom_itlb_load(unsigned long index, long prom_itlb_load(unsigned long index,
unsigned long tte_data, unsigned long tte_data,
unsigned long vaddr); unsigned long vaddr);
extern long prom_dtlb_load(unsigned long index, long prom_dtlb_load(unsigned long index,
unsigned long tte_data, unsigned long tte_data,
unsigned long vaddr); unsigned long vaddr);
/* Map/Unmap client program address ranges. First the format of /* Map/Unmap client program address ranges. First the format of
* the mapping mode argument. * 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_IE 0x0100 /* Invert-Endianness */
#define PROM_MAP_DEFAULT (PROM_MAP_WRITE | PROM_MAP_READ | PROM_MAP_EXEC | PROM_MAP_CACHED) #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, int prom_map(int mode, unsigned long size,
unsigned long vaddr, unsigned long paddr); unsigned long vaddr, unsigned long paddr);
extern void prom_unmap(unsigned long size, unsigned long vaddr); void prom_unmap(unsigned long size, unsigned long vaddr);
/* PROM device tree traversal functions... */ /* PROM device tree traversal functions... */
/* Get the child node of the given node, or zero if no child exists. */ /* 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 /* Get the next sibling node of the given node, or zero if no further
* siblings exist. * 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. /* Get the length, at the passed node, of the given property type.
* Returns -1 on error (ie. no such property at this node). * 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 /* Fetch the requested property using the given buffer. Returns
* the number of bytes the prom put into your buffer or -1 on error. * the number of bytes the prom put into your buffer or -1 on error.
*/ */
extern int prom_getproperty(phandle thisnode, const char *property, int prom_getproperty(phandle thisnode, const char *property,
char *prop_buffer, int propbuf_size); char *prop_buffer, int propbuf_size);
/* Acquire an integer property. */ /* 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. */ /* 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. */ /* 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. */ /* Acquire a string property, null string on error. */
extern void prom_getstring(phandle node, const char *prop, char *buf, void prom_getstring(phandle node, const char *prop, char *buf,
int bufsize); int bufsize);
/* Does the passed node have the given "name"? YES=1 NO=0 */ /* 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 /* Search all siblings starting at the passed node for "name" matching
* the given string. Returns the node on success, zero on failure. * 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. /* 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. * 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 /* Returns the next property after the passed property for the given
* node. Returns null string on failure. Buffer should be at least 32B long. * 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. */ /* 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 */ /* 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. /* Set the indicated property at the given node with the passed value.
* Returns the number of bytes of your value that the prom took. * 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 prom_setprop(phandle node, const char *prop_name, char *prop_value,
int value_size); int value_size);
extern phandle prom_inst2pkg(int); phandle prom_inst2pkg(int);
extern void prom_sun4v_guest_soft_state(void); 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. */ /* Client interface level routines. */
extern void p1275_cmd_direct(unsigned long *); void p1275_cmd_direct(unsigned long *);
#endif /* !(__SPARC64_OPLIB_H) */ #endif /* !(__SPARC64_OPLIB_H) */

View File

@ -1,5 +1,8 @@
#ifndef ___ASM_SPARC_PAGE_H #ifndef ___ASM_SPARC_PAGE_H
#define ___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__) #if defined(__sparc__) && defined(__arch64__)
#include <asm/page_64.h> #include <asm/page_64.h>
#else #else

View File

@ -31,17 +31,17 @@
#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE) #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
struct pt_regs; struct pt_regs;
extern void hugetlb_setup(struct pt_regs *regs); void hugetlb_setup(struct pt_regs *regs);
#endif #endif
#define WANT_PAGE_VIRTUAL #define WANT_PAGE_VIRTUAL
extern void _clear_page(void *page); void _clear_page(void *page);
#define clear_page(X) _clear_page((void *)(X)) #define clear_page(X) _clear_page((void *)(X))
struct page; 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) #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 /* Unlike sparc32, sparc64's parameter passing API is more
* sane in that structures which as small enough are passed * sane in that structures which as small enough are passed

View File

@ -52,7 +52,7 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
/* Return the index of the PCI controller for device 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) static inline int pci_proc_domain(struct pci_bus *bus)
{ {
return 1; return 1;
@ -64,9 +64,9 @@ static inline int pci_proc_domain(struct pci_bus *bus)
#define HAVE_ARCH_PCI_GET_UNMAPPED_AREA #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA
#define get_pci_unmapped_area get_fb_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, int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, enum pci_mmap_state mmap_state,
int write_combine); int write_combine);
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
{ {
@ -74,9 +74,9 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
} }
#define HAVE_ARCH_PCI_RESOURCE_TO_USER #define HAVE_ARCH_PCI_RESOURCE_TO_USER
extern void pci_resource_to_user(const struct pci_dev *dev, int bar, void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc, const struct resource *rsrc,
resource_size_t *start, resource_size_t *end); resource_size_t *start, resource_size_t *end);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __SPARC64_PCI_H */ #endif /* __SPARC64_PCI_H */

View File

@ -30,10 +30,10 @@ struct linux_pcic {
}; };
#ifdef CONFIG_PCIC_PCI #ifdef CONFIG_PCIC_PCI
extern int pcic_present(void); int pcic_present(void);
extern int pcic_probe(void); int pcic_probe(void);
extern void pci_time_init(void); void pci_time_init(void);
extern void sun4m_pci_init_IRQ(void); void sun4m_pci_init_IRQ(void);
#else #else
static inline int pcic_present(void) { return 0; } static inline int pcic_present(void) { return 0; }
static inline int pcic_probe(void) { return 0; } static inline int pcic_probe(void) { return 0; }

View File

@ -12,8 +12,8 @@ struct pcr_ops {
}; };
extern const struct pcr_ops *pcr_ops; extern const struct pcr_ops *pcr_ops;
extern void deferred_pcr_work_irq(int irq, struct pt_regs *regs); void deferred_pcr_work_irq(int irq, struct pt_regs *regs);
extern void schedule_deferred_pcr_work(void); void schedule_deferred_pcr_work(void);
#define PCR_PIC_PRIV 0x00000001 /* PIC access is privileged */ #define PCR_PIC_PRIV 0x00000001 /* PIC access is privileged */
#define PCR_STRACE 0x00000002 /* Trace supervisor events */ #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_PICNHT 0x00020000 /* PIC non-hypervisor trap */
#define PCR_N4_NTC 0x00040000 /* Next-To-Commit wrap */ #define PCR_N4_NTC 0x00040000 /* Next-To-Commit wrap */
extern int pcr_arch_init(void); int pcr_arch_init(void);
#endif /* __PCR_H */ #endif /* __PCR_H */

View File

@ -14,6 +14,8 @@ struct page;
void *srmmu_get_nocache(int size, int align); void *srmmu_get_nocache(int size, int align);
void srmmu_free_nocache(void *addr, int size); void srmmu_free_nocache(void *addr, int size);
extern struct resource sparc_iomap;
#define check_pgt_cache() do { } while (0) #define check_pgt_cache() do { } while (0)
pgd_t *get_pgd_fast(void); pgd_t *get_pgd_fast(void);

View File

@ -38,12 +38,12 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
kmem_cache_free(pgtable_cache, pmd); kmem_cache_free(pgtable_cache, pmd);
} }
extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
unsigned long address); unsigned long address);
extern pgtable_t pte_alloc_one(struct mm_struct *mm, pgtable_t pte_alloc_one(struct mm_struct *mm,
unsigned long address); unsigned long address);
extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte); void pte_free_kernel(struct mm_struct *mm, pte_t *pte);
extern void pte_free(struct mm_struct *mm, pgtable_t ptepage); 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_kernel(MM, PMD, PTE) pmd_set(MM, PMD, PTE)
#define pmd_populate(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) #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 #ifdef CONFIG_SMP
struct mmu_gather; 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) static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, bool is_page)
{ {

View File

@ -25,8 +25,9 @@
struct vm_area_struct; struct vm_area_struct;
struct page; struct page;
extern void load_mmu(void); void load_mmu(void);
extern unsigned long calc_highpages(void); unsigned long calc_highpages(void);
unsigned long __init bootmem_init(unsigned long *pages_avail);
#define pte_ERROR(e) __builtin_trap() #define pte_ERROR(e) __builtin_trap()
#define pmd_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) */ * srmmu.c will assign the real one (which is dynamically sized) */
#define swapper_pg_dir NULL #define swapper_pg_dir NULL
extern void paging_init(void); void paging_init(void);
extern unsigned long ptr_in_current_pgd; 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_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4))
#define GET_PFN(pfn) (pfn & 0x0fffffffUL) #define GET_PFN(pfn) (pfn & 0x0fffffffUL)
extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long,
unsigned long, pgprot_t); unsigned long, pgprot_t);
static inline int io_remap_pfn_range(struct vm_area_struct *vma, static inline int io_remap_pfn_range(struct vm_area_struct *vma,
unsigned long from, unsigned long pfn, unsigned long from, unsigned long pfn,

View File

@ -210,9 +210,9 @@ static inline bool kern_addr_valid(unsigned long addr)
#ifndef __ASSEMBLY__ #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;
extern pgprot_t PAGE_KERNEL_LOCKED; extern pgprot_t PAGE_KERNEL_LOCKED;
@ -780,8 +780,8 @@ static inline int pmd_present(pmd_t pmd)
!__kern_addr_valid(pud_val(pud))) !__kern_addr_valid(pud_val(pud)))
#ifdef CONFIG_TRANSPARENT_HUGEPAGE #ifdef CONFIG_TRANSPARENT_HUGEPAGE
extern void set_pmd_at(struct mm_struct *mm, unsigned long addr, void set_pmd_at(struct mm_struct *mm, unsigned long addr,
pmd_t *pmdp, pmd_t pmd); pmd_t *pmdp, pmd_t pmd);
#else #else
static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
pmd_t *pmdp, pmd_t pmd) pmd_t *pmdp, pmd_t pmd)
@ -840,8 +840,8 @@ static inline unsigned long __pmd_page(pmd_t pmd)
#define pte_unmap(pte) do { } while (0) #define pte_unmap(pte) do { } while (0)
/* Actual page table PTE updates. */ /* Actual page table PTE updates. */
extern void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
pte_t *ptep, pte_t orig, int fullmm); pte_t *ptep, pte_t orig, int fullmm);
#define __HAVE_ARCH_PMDP_GET_AND_CLEAR #define __HAVE_ARCH_PMDP_GET_AND_CLEAR
static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
@ -900,28 +900,28 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
extern pmd_t swapper_low_pmd_dir[PTRS_PER_PMD]; extern pmd_t swapper_low_pmd_dir[PTRS_PER_PMD];
extern void paging_init(void); void paging_init(void);
extern unsigned long find_ecache_flush_span(unsigned long size); unsigned long find_ecache_flush_span(unsigned long size);
struct seq_file; struct seq_file;
extern void mmu_info(struct seq_file *); void mmu_info(struct seq_file *);
struct vm_area_struct; 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 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
pmd_t *pmd); pmd_t *pmd);
#define __HAVE_ARCH_PMDP_INVALIDATE #define __HAVE_ARCH_PMDP_INVALIDATE
extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
pmd_t *pmdp); pmd_t *pmdp);
#define __HAVE_ARCH_PGTABLE_DEPOSIT #define __HAVE_ARCH_PGTABLE_DEPOSIT
extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
pgtable_t pgtable); pgtable_t pgtable);
#define __HAVE_ARCH_PGTABLE_WITHDRAW #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 #endif
/* Encode and de-code a swap entry */ /* Encode and de-code a swap entry */
@ -937,12 +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 }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
/* File offset in PTE support. */ /* 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) #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) #define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 1UL)
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 * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in
@ -952,8 +952,8 @@ extern int page_in_phys_avail(unsigned long paddr);
#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) #define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4))
#define GET_PFN(pfn) (pfn & 0x0fffffffffffffffUL) #define GET_PFN(pfn) (pfn & 0x0fffffffffffffffUL)
extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long,
unsigned long, pgprot_t); unsigned long, pgprot_t);
static inline int io_remap_pfn_range(struct vm_area_struct *vma, static inline int io_remap_pfn_range(struct vm_area_struct *vma,
unsigned long from, unsigned long pfn, unsigned long from, unsigned long pfn,
@ -981,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 /* 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. * 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 get_fb_unmapped_area(struct file *filp, unsigned long,
unsigned long, unsigned long, unsigned long, unsigned long,
unsigned long); unsigned long);
#define HAVE_ARCH_FB_UNMAPPED_AREA #define HAVE_ARCH_FB_UNMAPPED_AREA
extern void pgtable_cache_init(void); void pgtable_cache_init(void);
extern void sun4v_register_fault_status(void); void sun4v_register_fault_status(void);
extern void sun4v_ktsb_register(void); void sun4v_ktsb_register(void);
extern void __init cheetah_ecache_flush_init(void); void __init cheetah_ecache_flush_init(void);
extern void sun4v_patch_tlb_handlers(void); void sun4v_patch_tlb_handlers(void);
extern unsigned long cmdline_memory_size; 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__) */ #endif /* !(__ASSEMBLY__) */

View File

@ -74,7 +74,7 @@ struct thread_struct {
} }
/* Return saved PC of a blocked thread. */ /* 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. */ /* Do necessary setup to start up a newly executed thread. */
static inline void start_thread(struct pt_regs * regs, unsigned long pc, 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. */ /* Free all resources held by a thread. */
#define release_thread(tsk) do { } while(0) #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 task_pt_regs(tsk) ((tsk)->thread.kregs)
#define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc) #define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc)
@ -116,6 +116,7 @@ extern unsigned long get_wchan(struct task_struct *);
#ifdef __KERNEL__ #ifdef __KERNEL__
extern struct task_struct *last_task_used_math; extern struct task_struct *last_task_used_math;
int do_mathemu(struct pt_regs *regs, struct task_struct *fpt);
#define cpu_relax() barrier() #define cpu_relax() barrier()
extern void (*sparc_idle)(void); extern void (*sparc_idle)(void);

View File

@ -95,7 +95,7 @@ struct thread_struct {
/* Return saved PC of a blocked thread. */ /* Return saved PC of a blocked thread. */
struct task_struct; 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 */ /* On Uniprocessor, even in RMO processes see TSO semantics */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
@ -194,7 +194,7 @@ do { \
/* Free all resources held by a thread. */ /* Free all resources held by a thread. */
#define release_thread(tsk) do { } while (0) #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 task_pt_regs(tsk) (task_thread_info(tsk)->kregs)
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc) #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 #define HAVE_ARCH_PICK_MMAP_LAYOUT
int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap);
#endif /* !(__ASSEMBLY__) */ #endif /* !(__ASSEMBLY__) */
#endif /* !(__ASM_SPARC64_PROCESSOR_H) */ #endif /* !(__ASM_SPARC64_PROCESSOR_H) */

View File

@ -36,28 +36,28 @@ struct of_irq_controller {
void *data; void *data;
}; };
extern struct device_node *of_find_node_by_cpuid(int cpuid); 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); int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern struct mutex of_set_property_mutex; extern struct mutex of_set_property_mutex;
extern int of_getintprop_default(struct device_node *np, int of_getintprop_default(struct device_node *np,
const char *name, const char *name,
int def); int def);
extern int of_find_in_proplist(const char *list, const char *match, int len); int of_find_in_proplist(const char *list, const char *match, int len);
extern void prom_build_devicetree(void); void prom_build_devicetree(void);
extern void of_populate_present_mask(void); void of_populate_present_mask(void);
extern void of_fill_in_cpu_data(void); void of_fill_in_cpu_data(void);
struct resource; struct resource;
extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 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 of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
extern struct device_node *of_console_device; extern struct device_node *of_console_device;
extern char *of_console_path; extern char *of_console_path;
extern char *of_console_options; extern char *of_console_options;
extern void irq_trans_init(struct device_node *dp); void irq_trans_init(struct device_node *dp);
extern char *build_path_component(struct device_node *dp); char *build_path_component(struct device_node *dp);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _SPARC_PROM_H */ #endif /* _SPARC_PROM_H */

View File

@ -73,7 +73,7 @@ static inline long regs_return_value(struct pt_regs *regs)
return regs->u_regs[UREG_I0]; return regs->u_regs[UREG_I0];
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern unsigned long profile_pc(struct pt_regs *); unsigned long profile_pc(struct pt_regs *);
#else #else
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#endif #endif

View File

@ -4,8 +4,9 @@
#ifndef _SPARC_SETUP_H #ifndef _SPARC_SETUP_H
#define _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[]; extern char reboot_command[];
@ -22,9 +23,43 @@ static inline int con_is_present(void)
{ {
return serial_console ? 0 : 1; 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 #endif
extern void sun_do_break(void); #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
void sun_do_break(void);
extern int stop_a_enabled; extern int stop_a_enabled;
extern int scons_pwroff; extern int scons_pwroff;

View File

@ -79,9 +79,9 @@
__asm__ ("addcc %r7,%8,%2\n\t" \ __asm__ ("addcc %r7,%8,%2\n\t" \
"addxcc %r5,%6,%1\n\t" \ "addxcc %r5,%6,%1\n\t" \
"addx %r3,%4,%0\n" \ "addx %r3,%4,%0\n" \
: "=r" ((USItype)(r2)), \ : "=r" (r2), \
"=&r" ((USItype)(r1)), \ "=&r" (r1), \
"=&r" ((USItype)(r0)) \ "=&r" (r0) \
: "%rJ" ((USItype)(x2)), \ : "%rJ" ((USItype)(x2)), \
"rI" ((USItype)(y2)), \ "rI" ((USItype)(y2)), \
"%rJ" ((USItype)(x1)), \ "%rJ" ((USItype)(x1)), \
@ -94,9 +94,9 @@
__asm__ ("subcc %r7,%8,%2\n\t" \ __asm__ ("subcc %r7,%8,%2\n\t" \
"subxcc %r5,%6,%1\n\t" \ "subxcc %r5,%6,%1\n\t" \
"subx %r3,%4,%0\n" \ "subx %r3,%4,%0\n" \
: "=r" ((USItype)(r2)), \ : "=r" (r2), \
"=&r" ((USItype)(r1)), \ "=&r" (r1), \
"=&r" ((USItype)(r0)) \ "=&r" (r0) \
: "%rJ" ((USItype)(x2)), \ : "%rJ" ((USItype)(x2)), \
"rI" ((USItype)(y2)), \ "rI" ((USItype)(y2)), \
"%rJ" ((USItype)(x1)), \ "%rJ" ((USItype)(x1)), \
@ -115,8 +115,8 @@
"addxcc %r6,%7,%0\n\t" \ "addxcc %r6,%7,%0\n\t" \
"addxcc %r4,%5,%%g2\n\t" \ "addxcc %r4,%5,%%g2\n\t" \
"addx %r2,%3,%%g1\n\t" \ "addx %r2,%3,%%g1\n\t" \
: "=&r" ((USItype)(r1)), \ : "=&r" (r1), \
"=&r" ((USItype)(r0)) \ "=&r" (r0) \
: "%rJ" ((USItype)(x3)), \ : "%rJ" ((USItype)(x3)), \
"rI" ((USItype)(y3)), \ "rI" ((USItype)(y3)), \
"%rJ" ((USItype)(x2)), \ "%rJ" ((USItype)(x2)), \
@ -140,8 +140,8 @@
"subxcc %r6,%7,%0\n\t" \ "subxcc %r6,%7,%0\n\t" \
"subxcc %r4,%5,%%g2\n\t" \ "subxcc %r4,%5,%%g2\n\t" \
"subx %r2,%3,%%g1\n\t" \ "subx %r2,%3,%%g1\n\t" \
: "=&r" ((USItype)(r1)), \ : "=&r" (r1), \
"=&r" ((USItype)(r0)) \ "=&r" (r0) \
: "%rJ" ((USItype)(x3)), \ : "%rJ" ((USItype)(x3)), \
"rI" ((USItype)(y3)), \ "rI" ((USItype)(y3)), \
"%rJ" ((USItype)(x2)), \ "%rJ" ((USItype)(x2)), \
@ -164,10 +164,10 @@
"addxcc %2,%%g0,%2\n\t" \ "addxcc %2,%%g0,%2\n\t" \
"addxcc %1,%%g0,%1\n\t" \ "addxcc %1,%%g0,%1\n\t" \
"addx %0,%%g0,%0\n\t" \ "addx %0,%%g0,%0\n\t" \
: "=&r" ((USItype)(x3)), \ : "=&r" (x3), \
"=&r" ((USItype)(x2)), \ "=&r" (x2), \
"=&r" ((USItype)(x1)), \ "=&r" (x1), \
"=&r" ((USItype)(x0)) \ "=&r" (x0) \
: "rI" ((USItype)(i)), \ : "rI" ((USItype)(i)), \
"0" ((USItype)(x3)), \ "0" ((USItype)(x3)), \
"1" ((USItype)(x2)), \ "1" ((USItype)(x2)), \

View File

@ -93,15 +93,15 @@ static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2,
arg1, arg2, arg3, arg4); arg1, arg2, arg3, arg4);
} }
extern void arch_send_call_function_single_ipi(int cpu); 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_ipi_mask(const struct cpumask *mask);
static inline int cpu_logical_map(int cpu) static inline int cpu_logical_map(int cpu)
{ {
return 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) #define raw_smp_processor_id() (current_thread_info()->cpu)

View File

@ -33,29 +33,35 @@
DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
extern cpumask_t cpu_core_map[NR_CPUS]; extern cpumask_t cpu_core_map[NR_CPUS];
extern void arch_send_call_function_single_ipi(int cpu); 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_ipi_mask(const struct cpumask *mask);
/* /*
* General functions that each host system must provide. * 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) #define raw_smp_processor_id() (current_thread_info()->cpu)
extern void smp_fill_in_sib_core_maps(void); void smp_fill_in_sib_core_maps(void);
extern void cpu_play_dead(void); void cpu_play_dead(void);
extern void smp_fetch_global_regs(void); void smp_fetch_global_regs(void);
extern void smp_fetch_global_pmu(void); void smp_fetch_global_pmu(void);
struct seq_file; struct seq_file;
void smp_bogo(struct seq_file *); void smp_bogo(struct seq_file *);
void smp_info(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 #ifdef CONFIG_HOTPLUG_CPU
extern int __cpu_disable(void); int __cpu_disable(void);
extern void __cpu_die(unsigned int cpu); void __cpu_die(unsigned int cpu);
#endif #endif
#endif /* !(__ASSEMBLY__) */ #endif /* !(__ASSEMBLY__) */

View File

@ -62,7 +62,7 @@ extern enum ultra_tlb_layout tlb_type;
extern int sun4v_chip_type; extern int sun4v_chip_type;
extern int cheetah_pcache_forced_on; extern int cheetah_pcache_forced_on;
extern void cheetah_enable_pcache(void); void cheetah_enable_pcache(void);
#define sparc64_highest_locked_tlbent() \ #define sparc64_highest_locked_tlbent() \
(tlb_type == spitfire ? \ (tlb_type == spitfire ? \

View File

@ -1,6 +1,6 @@
#ifndef _SPARC64_STACKTRACE_H #ifndef _SPARC64_STACKTRACE_H
#define _SPARC64_STACKTRACE_H #define _SPARC64_STACKTRACE_H
extern void stack_trace_flush(void); void stack_trace_flush(void);
#endif /* _SPARC64_STACKTRACE_H */ #endif /* _SPARC64_STACKTRACE_H */

View File

@ -11,10 +11,10 @@
extern int this_is_starfire; extern int this_is_starfire;
extern void check_if_starfire(void); void check_if_starfire(void);
extern int starfire_hard_smp_processor_id(void); int starfire_hard_smp_processor_id(void);
extern void starfire_hookup(int); void starfire_hookup(int);
extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid); unsigned int starfire_translate(unsigned long imap, unsigned int upaid);
#endif #endif
#endif #endif

View File

@ -15,7 +15,7 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
extern void __memmove(void *,const void *,__kernel_size_t); void __memmove(void *,const void *,__kernel_size_t);
#ifndef EXPORT_SYMTAB_STROPS #ifndef EXPORT_SYMTAB_STROPS
@ -40,8 +40,8 @@ extern void __memmove(void *,const void *,__kernel_size_t);
#undef memscan #undef memscan
#define memscan(__arg0, __char, __arg2) \ #define memscan(__arg0, __char, __arg2) \
({ \ ({ \
extern void *__memscan_zero(void *, size_t); \ void *__memscan_zero(void *, size_t); \
extern void *__memscan_generic(void *, int, size_t); \ void *__memscan_generic(void *, int, size_t); \
void *__retval, *__addr = (__arg0); \ void *__retval, *__addr = (__arg0); \
size_t __size = (__arg2); \ size_t __size = (__arg2); \
\ \
@ -54,14 +54,14 @@ extern void __memmove(void *,const void *,__kernel_size_t);
}) })
#define __HAVE_ARCH_MEMCMP #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... */ /* Now the str*() stuff... */
#define __HAVE_ARCH_STRLEN #define __HAVE_ARCH_STRLEN
extern __kernel_size_t strlen(const char *); __kernel_size_t strlen(const char *);
#define __HAVE_ARCH_STRNCMP #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 */ #endif /* !EXPORT_SYMTAB_STROPS */

View File

@ -19,7 +19,7 @@
/* First the mem*() things. */ /* First the mem*() things. */
#define __HAVE_ARCH_MEMMOVE #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 __HAVE_ARCH_MEMCPY
#define memcpy(t, f, n) __builtin_memcpy(t, f, n) #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 #undef memscan
#define memscan(__arg0, __char, __arg2) \ #define memscan(__arg0, __char, __arg2) \
({ \ ({ \
extern void *__memscan_zero(void *, size_t); \ void *__memscan_zero(void *, size_t); \
extern void *__memscan_generic(void *, int, size_t); \ void *__memscan_generic(void *, int, size_t); \
void *__retval, *__addr = (__arg0); \ void *__retval, *__addr = (__arg0); \
size_t __size = (__arg2); \ size_t __size = (__arg2); \
\ \
@ -46,14 +46,14 @@ extern void *memmove(void *, const void *, __kernel_size_t);
}) })
#define __HAVE_ARCH_MEMCMP #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... */ /* Now the str*() stuff... */
#define __HAVE_ARCH_STRLEN #define __HAVE_ARCH_STRLEN
extern __kernel_size_t strlen(const char *); __kernel_size_t strlen(const char *);
#define __HAVE_ARCH_STRNCMP #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 */ #endif /* !EXPORT_SYMTAB_STROPS */

View File

@ -99,8 +99,8 @@ extern struct thread_info *current_set[NR_CPUS];
"o0", "o1", "o2", "o3", "o7"); \ "o0", "o1", "o2", "o3", "o7"); \
} while(0) } while(0)
extern void fpsave(unsigned long *fpregs, unsigned long *fsr, void fpsave(unsigned long *fpregs, unsigned long *fsr,
void *fpqueue, unsigned long *fpqdepth); void *fpqueue, unsigned long *fpqdepth);
extern void synchronize_user_stack(void); void synchronize_user_stack(void);
#endif /* __SPARC_SWITCH_TO_H */ #endif /* __SPARC_SWITCH_TO_H */

View File

@ -65,7 +65,7 @@ do { save_and_clear_fpu(); \
"o0", "o1", "o2", "o3", "o4", "o5", "o7"); \ "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \
} while(0) } while(0)
extern void synchronize_user_stack(void); void synchronize_user_stack(void);
extern void fault_in_user_windows(void); void fault_in_user_windows(void);
#endif /* __SPARC64_SWITCH_TO_64_H */ #endif /* __SPARC64_SWITCH_TO_64_H */

View File

@ -3,9 +3,9 @@
struct pt_regs; struct pt_regs;
extern asmlinkage long sparc_do_fork(unsigned long clone_flags, asmlinkage long sparc_do_fork(unsigned long clone_flags,
unsigned long stack_start, unsigned long stack_start,
struct pt_regs *regs, struct pt_regs *regs,
unsigned long stack_size); unsigned long stack_size);
#endif /* _SPARC64_SYSCALLS_H */ #endif /* _SPARC64_SYSCALLS_H */

View File

@ -32,13 +32,13 @@ static inline unsigned int timer_value(unsigned int value)
return (value + 1) << TIMER_VALUE_SHIFT; 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 #ifdef CONFIG_SMP
DECLARE_PER_CPU(struct clock_event_device, sparc32_clockevent); DECLARE_PER_CPU(struct clock_event_device, sparc32_clockevent);
extern void register_percpu_ce(int cpu); void register_percpu_ce(int cpu);
#endif #endif
#endif /* !(_SPARC_TIMER_H) */ #endif /* !(_SPARC_TIMER_H) */

View File

@ -23,8 +23,8 @@ struct sparc64_tick_ops {
extern struct sparc64_tick_ops *tick_ops; extern struct sparc64_tick_ops *tick_ops;
extern unsigned long sparc64_get_clock_tick(unsigned int cpu); unsigned long sparc64_get_clock_tick(unsigned int cpu);
extern void setup_sparc64_timer(void); void setup_sparc64_timer(void);
extern void __init time_init(void); void __init time_init(void);
#endif /* _SPARC64_TIMER_H */ #endif /* _SPARC64_TIMER_H */

View File

@ -8,19 +8,19 @@
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern void smp_flush_tlb_pending(struct mm_struct *, void smp_flush_tlb_pending(struct mm_struct *,
unsigned long, unsigned long *); unsigned long, unsigned long *);
#endif #endif
#ifdef CONFIG_SMP #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) #define do_flush_tlb_mm(mm) smp_flush_tlb_mm(mm)
#else #else
#define do_flush_tlb_mm(mm) __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT) #define do_flush_tlb_mm(mm) __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT)
#endif #endif
extern void __flush_tlb_pending(unsigned long, unsigned long, unsigned long *); void __flush_tlb_pending(unsigned long, unsigned long, unsigned long *);
extern void flush_tlb_pending(void); void flush_tlb_pending(void);
#define tlb_start_vma(tlb, vma) do { } while (0) #define tlb_start_vma(tlb, vma) do { } while (0)
#define tlb_end_vma(tlb, vma) do { } while (0) #define tlb_end_vma(tlb, vma) do { } while (0)

View File

@ -14,9 +14,9 @@ struct tlb_batch {
unsigned long vaddrs[TLB_BATCH_NR]; unsigned long vaddrs[TLB_BATCH_NR];
}; };
extern void flush_tsb_kernel_range(unsigned long start, unsigned long end); void flush_tsb_kernel_range(unsigned long start, unsigned long end);
extern void flush_tsb_user(struct tlb_batch *tb); void flush_tsb_user(struct tlb_batch *tb);
extern void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr); void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr);
/* TLB flush operations. */ /* TLB flush operations. */
@ -36,15 +36,15 @@ static inline void flush_tlb_range(struct vm_area_struct *vma,
#define __HAVE_ARCH_ENTER_LAZY_MMU_MODE #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
extern void flush_tlb_pending(void); void flush_tlb_pending(void);
extern void arch_enter_lazy_mmu_mode(void); void arch_enter_lazy_mmu_mode(void);
extern void arch_leave_lazy_mmu_mode(void); void arch_leave_lazy_mmu_mode(void);
#define arch_flush_lazy_mmu_mode() do {} while (0) #define arch_flush_lazy_mmu_mode() do {} while (0)
/* Local cpu only. */ /* Local cpu only. */
extern void __flush_tlb_all(void); void __flush_tlb_all(void);
extern void __flush_tlb_page(unsigned long context, unsigned long vaddr); 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_kernel_range(unsigned long start, unsigned long end);
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
@ -60,8 +60,8 @@ static inline void global_flush_tlb_page(struct mm_struct *mm, unsigned long vad
#else /* CONFIG_SMP */ #else /* CONFIG_SMP */
extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end); 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_page(struct mm_struct *mm, unsigned long vaddr);
#define flush_tlb_kernel_range(start, end) \ #define flush_tlb_kernel_range(start, end) \
do { flush_tsb_kernel_range(start,end); \ do { flush_tsb_kernel_range(start,end); \

View File

@ -18,7 +18,7 @@ static inline int cpu_to_node(int cpu)
struct pci_bus; struct pci_bus;
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
extern int pcibus_to_node(struct pci_bus *pbus); int pcibus_to_node(struct pci_bus *pbus);
#else #else
static inline int pcibus_to_node(struct pci_bus *pbus) static inline int pcibus_to_node(struct pci_bus *pbus)
{ {

View File

@ -51,11 +51,11 @@ struct trap_per_cpu {
unsigned long __per_cpu_base; unsigned long __per_cpu_base;
} __attribute__((aligned(64))); } __attribute__((aligned(64)));
extern struct trap_per_cpu trap_block[NR_CPUS]; extern struct trap_per_cpu trap_block[NR_CPUS];
extern void init_cur_cpu_trap(struct thread_info *); void init_cur_cpu_trap(struct thread_info *);
extern void setup_tba(void); void setup_tba(void);
extern int ncpus_probed; 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 { struct cpuid_patch_entry {
unsigned int addr; unsigned int addr;

View File

@ -9,6 +9,6 @@
#define user_addr_max() \ #define user_addr_max() \
(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) (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 #endif

View File

@ -78,9 +78,9 @@ struct exception_table_entry
}; };
/* Returns 0 if exception not found and fixup otherwise. */ /* 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.. /* Uh, these should become the main single-value transfer routines..
* They automatically use the right size if we just have the right * 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)), \ : "=&r" (ret) : "r" (x), "m" (*__m(addr)), \
"i" (-EFAULT)) "i" (-EFAULT))
extern int __put_user_bad(void); int __put_user_bad(void);
#define __get_user_check(x,addr,size,type) ({ \ #define __get_user_check(x,addr,size,type) ({ \
register int __gu_ret; \ register int __gu_ret; \
@ -244,9 +244,9 @@ __asm__ __volatile__( \
".previous\n\t" \ ".previous\n\t" \
: "=&r" (x) : "m" (*__m(addr)), "i" (retval)) : "=&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) 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; return n;
} }
extern __must_check long strlen_user(const char __user *str); __must_check long strlen_user(const char __user *str);
extern __must_check long strnlen_user(const char __user *str, long n); __must_check long strnlen_user(const char __user *str, long n);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */

View File

@ -76,8 +76,8 @@ struct exception_table_entry {
unsigned int insn, fixup; unsigned int insn, fixup;
}; };
extern void __ret_efault(void); void __ret_efault(void);
extern void __retl_efault(void); void __retl_efault(void);
/* Uh, these should become the main single-value transfer routines.. /* Uh, these should become the main single-value transfer routines..
* They automatically use the right size if we just have the right * 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)), \ : "=r" (ret) : "r" (x), "r" (__m(addr)), \
"i" (-EFAULT)) "i" (-EFAULT))
extern int __put_user_bad(void); int __put_user_bad(void);
#define __get_user_nocheck(data,addr,size,type) ({ \ #define __get_user_nocheck(data,addr,size,type) ({ \
register int __gu_ret; \ register int __gu_ret; \
@ -204,13 +204,13 @@ __asm__ __volatile__( \
".previous\n\t" \ ".previous\n\t" \
: "=r" (x) : "r" (__m(addr)), "i" (retval)) : "=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, unsigned long __must_check ___copy_from_user(void *to,
const void __user *from, const void __user *from,
unsigned long size); unsigned long size);
extern unsigned long copy_from_user_fixup(void *to, const void __user *from, unsigned long copy_from_user_fixup(void *to, const void __user *from,
unsigned long size); unsigned long size);
static inline unsigned long __must_check static inline unsigned long __must_check
copy_from_user(void *to, const void __user *from, unsigned long size) 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 #define __copy_from_user copy_from_user
extern unsigned long __must_check ___copy_to_user(void __user *to, unsigned long __must_check ___copy_to_user(void __user *to,
const void *from, const void *from,
unsigned long size); unsigned long size);
extern unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long copy_to_user_fixup(void __user *to, const void *from,
unsigned long size); unsigned long size);
static inline unsigned long __must_check static inline unsigned long __must_check
copy_to_user(void __user *to, const void *from, unsigned long size) 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 #define __copy_to_user copy_to_user
extern unsigned long __must_check ___copy_in_user(void __user *to, unsigned long __must_check ___copy_in_user(void __user *to,
const void __user *from, const void __user *from,
unsigned long size); unsigned long size);
extern unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long copy_in_user_fixup(void __user *to, void __user *from,
unsigned long size); unsigned long size);
static inline unsigned long __must_check static inline unsigned long __must_check
copy_in_user(void __user *to, void __user *from, unsigned long size) 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 #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 #define clear_user __clear_user
extern __must_check long strlen_user(const char __user *str); __must_check long strlen_user(const char __user *str);
extern __must_check long strnlen_user(const char __user *str, long n); __must_check long strnlen_user(const char __user *str, long n);
#define __copy_to_user_inatomic __copy_to_user #define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user #define __copy_from_user_inatomic __copy_from_user
struct pt_regs; struct pt_regs;
extern unsigned long compute_effective_address(struct pt_regs *, unsigned long compute_effective_address(struct pt_regs *,
unsigned int insn, unsigned int insn,
unsigned int rd); unsigned int rd);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */

View File

@ -372,14 +372,14 @@ do { if (vio->debug & VIO_DEBUG_##TYPE) \
vio->vdev->channel_id, ## a); \ vio->vdev->channel_id, ## a); \
} while (0) } 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); const char *mod_name);
/* /*
* vio_register_driver must be a macro so that KBUILD_MODNAME can be expanded * vio_register_driver must be a macro so that KBUILD_MODNAME can be expanded
*/ */
#define vio_register_driver(driver) \ #define vio_register_driver(driver) \
__vio_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) __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) 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); return container_of(dev, struct vio_dev, dev);
} }
extern int vio_ldc_send(struct vio_driver_state *vio, void *data, int len); 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); void vio_link_state_change(struct vio_driver_state *vio, int event);
extern void vio_conn_reset(struct vio_driver_state *vio); void vio_conn_reset(struct vio_driver_state *vio);
extern int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt); int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt);
extern int vio_validate_sid(struct vio_driver_state *vio, int vio_validate_sid(struct vio_driver_state *vio,
struct vio_msg_tag *tp); struct vio_msg_tag *tp);
extern u32 vio_send_sid(struct vio_driver_state *vio); u32 vio_send_sid(struct vio_driver_state *vio);
extern int vio_ldc_alloc(struct vio_driver_state *vio, int vio_ldc_alloc(struct vio_driver_state *vio,
struct ldc_channel_config *base_cfg, void *event_arg); struct ldc_channel_config *base_cfg, void *event_arg);
extern void vio_ldc_free(struct vio_driver_state *vio); void vio_ldc_free(struct vio_driver_state *vio);
extern int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev, int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev,
u8 dev_class, struct vio_version *ver_table, u8 dev_class, struct vio_version *ver_table,
int ver_table_size, struct vio_driver_ops *ops, int ver_table_size, struct vio_driver_ops *ops,
char *name); char *name);
extern void vio_port_up(struct vio_driver_state *vio); void vio_port_up(struct vio_driver_state *vio);
#endif /* _SPARC64_VIO_H */ #endif /* _SPARC64_VIO_H */

View File

@ -57,7 +57,8 @@ static inline void save_and_clear_fpu(void) {
" " : : "i" (FPRS_FEF|FPRS_DU) : " " : : "i" (FPRS_FEF|FPRS_DU) :
"o5", "g1", "g2", "g3", "g7", "cc"); "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
#endif /* _SPARC64_ASI_H */ #endif /* _SPARC64_ASI_H */

View File

@ -20,13 +20,13 @@
#include <asm/spitfire.h> #include <asm/spitfire.h>
extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
unsigned long *); unsigned long *);
extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *, void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
unsigned long *, unsigned long *); unsigned long *, unsigned long *);
extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *, void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
unsigned long *, unsigned long *, unsigned long *); unsigned long *, unsigned long *, unsigned long *);
/* XXX Ugh, write cheetah versions... -DaveM */ /* XXX Ugh, write cheetah versions... -DaveM */
@ -38,13 +38,13 @@ static struct xor_block_template xor_block_VIS = {
.do_5 = xor_vis_5, .do_5 = xor_vis_5,
}; };
extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *); void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *, void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
unsigned long *); unsigned long *);
extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *, void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
unsigned long *, unsigned long *); unsigned long *, unsigned long *);
extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *, void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
unsigned long *, unsigned long *, unsigned long *); unsigned long *, unsigned long *, unsigned long *);
static struct xor_block_template xor_block_niagara = { static struct xor_block_template xor_block_niagara = {
.name = "Niagara", .name = "Niagara",

View File

@ -42,7 +42,6 @@ obj-y += time_$(BITS).o
obj-$(CONFIG_SPARC32) += windows.o obj-$(CONFIG_SPARC32) += windows.o
obj-y += cpu.o obj-y += cpu.o
obj-$(CONFIG_SPARC32) += devices.o obj-$(CONFIG_SPARC32) += devices.o
obj-$(CONFIG_SPARC32) += tadpole.o
obj-y += ptrace_$(BITS).o obj-y += ptrace_$(BITS).o
obj-y += unaligned_$(BITS).o obj-y += unaligned_$(BITS).o
obj-y += una_asm_$(BITS).o obj-y += una_asm_$(BITS).o

View File

@ -3,6 +3,8 @@
#include <linux/audit.h> #include <linux/audit.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include "kernel.h"
static unsigned dir_class[] = { static unsigned dir_class[] = {
#include <asm-generic/audit_dir_write.h> #include <asm-generic/audit_dir_write.h>
~0U ~0U
@ -40,7 +42,6 @@ int audit_classify_arch(int arch)
int audit_classify_syscall(int abi, unsigned syscall) int audit_classify_syscall(int abi, unsigned syscall)
{ {
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
extern int sparc32_classify_syscall(unsigned);
if (abi == AUDIT_ARCH_SPARC) if (abi == AUDIT_ARCH_SPARC)
return sparc32_classify_syscall(syscall); return sparc32_classify_syscall(syscall);
#endif #endif
@ -61,11 +62,6 @@ int audit_classify_syscall(int abi, unsigned syscall)
static int __init audit_classes_init(void) static int __init audit_classes_init(void)
{ {
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
extern __u32 sparc32_dir_class[];
extern __u32 sparc32_write_class[];
extern __u32 sparc32_read_class[];
extern __u32 sparc32_chattr_class[];
extern __u32 sparc32_signal_class[];
audit_register_class(AUDIT_CLASS_WRITE_32, sparc32_write_class); audit_register_class(AUDIT_CLASS_WRITE_32, sparc32_write_class);
audit_register_class(AUDIT_CLASS_READ_32, sparc32_read_class); audit_register_class(AUDIT_CLASS_READ_32, sparc32_read_class);
audit_register_class(AUDIT_CLASS_DIR_WRITE_32, sparc32_dir_class); audit_register_class(AUDIT_CLASS_DIR_WRITE_32, sparc32_dir_class);

View File

@ -9,12 +9,15 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/export.h> #include <linux/export.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/auxio.h> #include <asm/auxio.h>
#include <asm/string.h> /* memset(), Linux has no bzero() */ #include <asm/string.h> /* memset(), Linux has no bzero() */
#include <asm/cpu_type.h> #include <asm/cpu_type.h>
#include "kernel.h"
/* Probe and map in the Auxiliary I/O register */ /* Probe and map in the Auxiliary I/O register */
/* auxio_register is not static because it is referenced /* auxio_register is not static because it is referenced
@ -103,7 +106,7 @@ EXPORT_SYMBOL(set_auxio);
/* sun4m power control register (AUXIO2) */ /* sun4m power control register (AUXIO2) */
volatile unsigned char * auxio_power_register = NULL; volatile u8 __iomem *auxio_power_register = NULL;
void __init auxio_power_probe(void) void __init auxio_power_probe(void)
{ {
@ -127,8 +130,8 @@ void __init auxio_power_probe(void)
r.flags = regs.which_io & 0xF; r.flags = regs.which_io & 0xF;
r.start = regs.phys_addr; r.start = regs.phys_addr;
r.end = regs.phys_addr + regs.reg_size - 1; r.end = regs.phys_addr + regs.reg_size - 1;
auxio_power_register = (unsigned char *) of_ioremap(&r, 0, auxio_power_register =
regs.reg_size, "auxpower"); (u8 __iomem *)of_ioremap(&r, 0, regs.reg_size, "auxpower");
/* Display a quick message on the console. */ /* Display a quick message on the console. */
if (auxio_power_register) if (auxio_power_register)

View File

@ -137,7 +137,7 @@ static void scrollscreen(void)
} }
#endif /* ndef NO_SCROLL */ #endif /* ndef NO_SCROLL */
void btext_drawchar(char c) static void btext_drawchar(char c)
{ {
int cline = 0; int cline = 0;
#ifdef NO_SCROLL #ifdef NO_SCROLL

View File

@ -1,5 +1,6 @@
#define __32bit_syscall_numbers__ #define __32bit_syscall_numbers__
#include <asm/unistd.h> #include <asm/unistd.h>
#include "kernel.h"
unsigned sparc32_dir_class[] = { unsigned sparc32_dir_class[] = {
#include <asm-generic/audit_dir_write.h> #include <asm-generic/audit_dir_write.h>

View File

@ -22,6 +22,7 @@
#include <asm/cpudata.h> #include <asm/cpudata.h>
#include "kernel.h" #include "kernel.h"
#include "entry.h"
DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
EXPORT_PER_CPU_SYMBOL(__cpu_data); EXPORT_PER_CPU_SYMBOL(__cpu_data);

View File

@ -2,8 +2,8 @@
#define _CPUMAP_H #define _CPUMAP_H
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern void cpu_map_rebuild(void); void cpu_map_rebuild(void);
extern int map_to_cpu(unsigned int index); int map_to_cpu(unsigned int index);
#define cpu_map_init() cpu_map_rebuild() #define cpu_map_init() cpu_map_rebuild()
#else #else
#define cpu_map_init() do {} while (0) #define cpu_map_init() do {} while (0)

View File

@ -19,8 +19,9 @@
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/cpudata.h> #include <asm/cpudata.h>
#include <asm/cpu_type.h> #include <asm/cpu_type.h>
#include <asm/setup.h>
extern void clock_stop_probe(void); /* tadpole.c */ #include "kernel.h"
static char *cpu_mid_prop(void) static char *cpu_mid_prop(void)
{ {
@ -131,11 +132,6 @@ void __init device_scan(void)
} }
#endif /* !CONFIG_SMP */ #endif /* !CONFIG_SMP */
{ auxio_probe();
extern void auxio_probe(void); auxio_power_probe();
extern void auxio_power_probe(void);
auxio_probe();
auxio_power_probe();
}
clock_stop_probe();
} }

View File

@ -6,40 +6,39 @@
#include <linux/init.h> #include <linux/init.h>
/* irq */ /* irq */
extern void handler_irq(int irq, struct pt_regs *regs); void handler_irq(int irq, struct pt_regs *regs);
#ifdef CONFIG_SPARC32 #ifdef CONFIG_SPARC32
/* traps */ /* traps */
extern void do_hw_interrupt(struct pt_regs *regs, unsigned long type); void do_hw_interrupt(struct pt_regs *regs, unsigned long type);
extern void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, void do_illegal_instruction(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr); unsigned long npc, unsigned long psr);
extern void do_priv_instruction(struct pt_regs *regs, unsigned long pc, void do_priv_instruction(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr); unsigned long npc, unsigned long psr);
extern void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc, void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long npc, unsigned long psr);
unsigned long psr); void do_fpd_trap(struct pt_regs *regs, unsigned long pc,
extern void do_fpd_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc, unsigned long psr);
void do_fpe_trap(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
void handle_tag_overflow(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
void handle_watchpoint(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
void handle_reg_access(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
void handle_cp_disabled(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr); unsigned long npc, unsigned long psr);
extern void do_fpe_trap(struct pt_regs *regs, unsigned long pc, void handle_cp_exception(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr); unsigned long npc, unsigned long psr);
extern void handle_tag_overflow(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
extern void handle_watchpoint(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
extern void handle_reg_access(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
extern void handle_cp_disabled(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
extern void handle_cp_exception(struct pt_regs *regs, unsigned long pc,
unsigned long npc, unsigned long psr);
/* entry.S */ /* entry.S */
extern void fpsave(unsigned long *fpregs, unsigned long *fsr, void fpsave(unsigned long *fpregs, unsigned long *fsr,
void *fpqueue, unsigned long *fpqdepth); void *fpqueue, unsigned long *fpqdepth);
extern void fpload(unsigned long *fpregs, unsigned long *fsr); void fpload(unsigned long *fpregs, unsigned long *fsr);
#else /* CONFIG_SPARC32 */ #else /* CONFIG_SPARC32 */
@ -66,123 +65,123 @@ struct pause_patch_entry {
extern struct pause_patch_entry __pause_3insn_patch, extern struct pause_patch_entry __pause_3insn_patch,
__pause_3insn_patch_end; __pause_3insn_patch_end;
extern void __init per_cpu_patch(void); void __init per_cpu_patch(void);
extern void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *, void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *,
struct sun4v_1insn_patch_entry *); struct sun4v_1insn_patch_entry *);
extern void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *, void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *,
struct sun4v_2insn_patch_entry *); struct sun4v_2insn_patch_entry *);
extern void __init sun4v_patch(void); void __init sun4v_patch(void);
extern void __init boot_cpu_id_too_large(int cpu); void __init boot_cpu_id_too_large(int cpu);
extern unsigned int dcache_parity_tl1_occurred; extern unsigned int dcache_parity_tl1_occurred;
extern unsigned int icache_parity_tl1_occurred; extern unsigned int icache_parity_tl1_occurred;
extern asmlinkage void sparc_breakpoint(struct pt_regs *regs); asmlinkage void sparc_breakpoint(struct pt_regs *regs);
extern void timer_interrupt(int irq, struct pt_regs *regs); void timer_interrupt(int irq, struct pt_regs *regs);
extern void do_notify_resume(struct pt_regs *regs, void do_notify_resume(struct pt_regs *regs,
unsigned long orig_i0, unsigned long orig_i0,
unsigned long thread_info_flags); unsigned long thread_info_flags);
extern asmlinkage int syscall_trace_enter(struct pt_regs *regs); asmlinkage int syscall_trace_enter(struct pt_regs *regs);
extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); asmlinkage void syscall_trace_leave(struct pt_regs *regs);
extern void bad_trap_tl1(struct pt_regs *regs, long lvl); void bad_trap_tl1(struct pt_regs *regs, long lvl);
extern void do_fpieee(struct pt_regs *regs); void do_fpieee(struct pt_regs *regs);
extern void do_fpother(struct pt_regs *regs); void do_fpother(struct pt_regs *regs);
extern void do_tof(struct pt_regs *regs); void do_tof(struct pt_regs *regs);
extern void do_div0(struct pt_regs *regs); void do_div0(struct pt_regs *regs);
extern void do_illegal_instruction(struct pt_regs *regs); void do_illegal_instruction(struct pt_regs *regs);
extern void mem_address_unaligned(struct pt_regs *regs, void mem_address_unaligned(struct pt_regs *regs,
unsigned long sfar, unsigned long sfar,
unsigned long sfsr); unsigned long sfsr);
extern void sun4v_do_mna(struct pt_regs *regs, void sun4v_do_mna(struct pt_regs *regs,
unsigned long addr, unsigned long addr,
unsigned long type_ctx); unsigned long type_ctx);
extern void do_privop(struct pt_regs *regs); void do_privop(struct pt_regs *regs);
extern void do_privact(struct pt_regs *regs); void do_privact(struct pt_regs *regs);
extern void do_cee(struct pt_regs *regs); void do_cee(struct pt_regs *regs);
extern void do_cee_tl1(struct pt_regs *regs); void do_cee_tl1(struct pt_regs *regs);
extern void do_dae_tl1(struct pt_regs *regs); void do_dae_tl1(struct pt_regs *regs);
extern void do_iae_tl1(struct pt_regs *regs); void do_iae_tl1(struct pt_regs *regs);
extern void do_div0_tl1(struct pt_regs *regs); void do_div0_tl1(struct pt_regs *regs);
extern void do_fpdis_tl1(struct pt_regs *regs); void do_fpdis_tl1(struct pt_regs *regs);
extern void do_fpieee_tl1(struct pt_regs *regs); void do_fpieee_tl1(struct pt_regs *regs);
extern void do_fpother_tl1(struct pt_regs *regs); void do_fpother_tl1(struct pt_regs *regs);
extern void do_ill_tl1(struct pt_regs *regs); void do_ill_tl1(struct pt_regs *regs);
extern void do_irq_tl1(struct pt_regs *regs); void do_irq_tl1(struct pt_regs *regs);
extern void do_lddfmna_tl1(struct pt_regs *regs); void do_lddfmna_tl1(struct pt_regs *regs);
extern void do_stdfmna_tl1(struct pt_regs *regs); void do_stdfmna_tl1(struct pt_regs *regs);
extern void do_paw(struct pt_regs *regs); void do_paw(struct pt_regs *regs);
extern void do_paw_tl1(struct pt_regs *regs); void do_paw_tl1(struct pt_regs *regs);
extern void do_vaw(struct pt_regs *regs); void do_vaw(struct pt_regs *regs);
extern void do_vaw_tl1(struct pt_regs *regs); void do_vaw_tl1(struct pt_regs *regs);
extern void do_tof_tl1(struct pt_regs *regs); void do_tof_tl1(struct pt_regs *regs);
extern void do_getpsr(struct pt_regs *regs); void do_getpsr(struct pt_regs *regs);
extern void spitfire_insn_access_exception(struct pt_regs *regs, void spitfire_insn_access_exception(struct pt_regs *regs,
unsigned long sfsr, unsigned long sfsr,
unsigned long sfar); unsigned long sfar);
extern void spitfire_insn_access_exception_tl1(struct pt_regs *regs, void spitfire_insn_access_exception_tl1(struct pt_regs *regs,
unsigned long sfsr, unsigned long sfsr,
unsigned long sfar); unsigned long sfar);
extern void spitfire_data_access_exception(struct pt_regs *regs, void spitfire_data_access_exception(struct pt_regs *regs,
unsigned long sfsr, unsigned long sfsr,
unsigned long sfar); unsigned long sfar);
extern void spitfire_data_access_exception_tl1(struct pt_regs *regs, void spitfire_data_access_exception_tl1(struct pt_regs *regs,
unsigned long sfsr, unsigned long sfsr,
unsigned long sfar); unsigned long sfar);
extern void spitfire_access_error(struct pt_regs *regs, void spitfire_access_error(struct pt_regs *regs,
unsigned long status_encoded, unsigned long status_encoded,
unsigned long afar); unsigned long afar);
extern void cheetah_fecc_handler(struct pt_regs *regs, void cheetah_fecc_handler(struct pt_regs *regs,
unsigned long afsr, unsigned long afsr,
unsigned long afar); unsigned long afar);
extern void cheetah_cee_handler(struct pt_regs *regs, void cheetah_cee_handler(struct pt_regs *regs,
unsigned long afsr, unsigned long afsr,
unsigned long afar); unsigned long afar);
extern void cheetah_deferred_handler(struct pt_regs *regs, void cheetah_deferred_handler(struct pt_regs *regs,
unsigned long afsr, unsigned long afsr,
unsigned long afar); unsigned long afar);
extern void cheetah_plus_parity_error(int type, struct pt_regs *regs); void cheetah_plus_parity_error(int type, struct pt_regs *regs);
extern void sun4v_insn_access_exception(struct pt_regs *regs, void sun4v_insn_access_exception(struct pt_regs *regs,
unsigned long addr, unsigned long addr,
unsigned long type_ctx); unsigned long type_ctx);
extern void sun4v_insn_access_exception_tl1(struct pt_regs *regs, void sun4v_insn_access_exception_tl1(struct pt_regs *regs,
unsigned long addr, unsigned long addr,
unsigned long type_ctx); unsigned long type_ctx);
extern void sun4v_data_access_exception(struct pt_regs *regs, void sun4v_data_access_exception(struct pt_regs *regs,
unsigned long addr, unsigned long addr,
unsigned long type_ctx); unsigned long type_ctx);
extern void sun4v_data_access_exception_tl1(struct pt_regs *regs, void sun4v_data_access_exception_tl1(struct pt_regs *regs,
unsigned long addr, unsigned long addr,
unsigned long type_ctx); unsigned long type_ctx);
extern void sun4v_resum_error(struct pt_regs *regs, void sun4v_resum_error(struct pt_regs *regs,
unsigned long offset); unsigned long offset);
extern void sun4v_resum_overflow(struct pt_regs *regs); void sun4v_resum_overflow(struct pt_regs *regs);
extern void sun4v_nonresum_error(struct pt_regs *regs, void sun4v_nonresum_error(struct pt_regs *regs,
unsigned long offset); unsigned long offset);
extern void sun4v_nonresum_overflow(struct pt_regs *regs); void sun4v_nonresum_overflow(struct pt_regs *regs);
extern unsigned long sun4v_err_itlb_vaddr; extern unsigned long sun4v_err_itlb_vaddr;
extern unsigned long sun4v_err_itlb_ctx; extern unsigned long sun4v_err_itlb_ctx;
extern unsigned long sun4v_err_itlb_pte; extern unsigned long sun4v_err_itlb_pte;
extern unsigned long sun4v_err_itlb_error; extern unsigned long sun4v_err_itlb_error;
extern void sun4v_itlb_error_report(struct pt_regs *regs, int tl); void sun4v_itlb_error_report(struct pt_regs *regs, int tl);
extern unsigned long sun4v_err_dtlb_vaddr; extern unsigned long sun4v_err_dtlb_vaddr;
extern unsigned long sun4v_err_dtlb_ctx; extern unsigned long sun4v_err_dtlb_ctx;
extern unsigned long sun4v_err_dtlb_pte; extern unsigned long sun4v_err_dtlb_pte;
extern unsigned long sun4v_err_dtlb_error; extern unsigned long sun4v_err_dtlb_error;
extern void sun4v_dtlb_error_report(struct pt_regs *regs, int tl); void sun4v_dtlb_error_report(struct pt_regs *regs, int tl);
extern void hypervisor_tlbop_error(unsigned long err, void hypervisor_tlbop_error(unsigned long err,
unsigned long op); unsigned long op);
extern void hypervisor_tlbop_error_xcall(unsigned long err, void hypervisor_tlbop_error_xcall(unsigned long err,
unsigned long op); unsigned long op);
/* WARNING: The error trap handlers in assembly know the precise /* WARNING: The error trap handlers in assembly know the precise
* layout of the following structure. * layout of the following structure.
@ -248,8 +247,8 @@ struct ino_bucket {
extern struct ino_bucket *ivector_table; extern struct ino_bucket *ivector_table;
extern unsigned long ivector_table_pa; extern unsigned long ivector_table_pa;
extern void init_irqwork_curcpu(void); void init_irqwork_curcpu(void);
extern void sun4v_register_mondo_queues(int this_cpu); void sun4v_register_mondo_queues(int this_cpu);
#endif /* CONFIG_SPARC32 */ #endif /* CONFIG_SPARC32 */
#endif /* _ENTRY_H */ #endif /* _ENTRY_H */

View File

@ -21,6 +21,7 @@
#include <asm/iommu.h> #include <asm/iommu.h>
#include "iommu_common.h" #include "iommu_common.h"
#include "kernel.h"
#define STC_CTXMATCH_ADDR(STC, CTX) \ #define STC_CTXMATCH_ADDR(STC, CTX) \
((STC)->strbuf_ctxmatch_base + ((CTX) << 3)) ((STC)->strbuf_ctxmatch_base + ((CTX) << 3))
@ -840,8 +841,6 @@ static struct dma_map_ops sun4u_dma_ops = {
struct dma_map_ops *dma_ops = &sun4u_dma_ops; struct dma_map_ops *dma_ops = &sun4u_dma_ops;
EXPORT_SYMBOL(dma_ops); EXPORT_SYMBOL(dma_ops);
extern int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask);
int dma_supported(struct device *dev, u64 device_mask) int dma_supported(struct device *dev, u64 device_mask)
{ {
struct iommu *iommu = dev->archdata.iommu; struct iommu *iommu = dev->archdata.iommu;

View File

@ -48,12 +48,12 @@ static inline int is_span_boundary(unsigned long entry,
return iommu_is_span_boundary(entry, nr, shift, boundary_size); return iommu_is_span_boundary(entry, nr, shift, boundary_size);
} }
extern unsigned long iommu_range_alloc(struct device *dev, unsigned long iommu_range_alloc(struct device *dev,
struct iommu *iommu, struct iommu *iommu,
unsigned long npages, unsigned long npages,
unsigned long *handle); unsigned long *handle);
extern void iommu_range_free(struct iommu *iommu, void iommu_range_free(struct iommu *iommu,
dma_addr_t dma_addr, dma_addr_t dma_addr,
unsigned long npages); unsigned long npages);
#endif /* _IOMMU_COMMON_H */ #endif /* _IOMMU_COMMON_H */

Some files were not shown because too many files have changed in this diff Show More