diff options
Diffstat (limited to 'arch/score/include')
| -rw-r--r-- | arch/score/include/asm/Kbuild | 11 | ||||
| -rw-r--r-- | arch/score/include/asm/atomic.h | 1 | ||||
| -rw-r--r-- | arch/score/include/asm/bitops.h | 8 | ||||
| -rw-r--r-- | arch/score/include/asm/bug.h | 11 | ||||
| -rw-r--r-- | arch/score/include/asm/checksum.h | 93 | ||||
| -rw-r--r-- | arch/score/include/asm/cmpxchg.h | 49 | ||||
| -rw-r--r-- | arch/score/include/asm/cputime.h | 6 | ||||
| -rw-r--r-- | arch/score/include/asm/dma-mapping.h | 6 | ||||
| -rw-r--r-- | arch/score/include/asm/elf.h | 5 | ||||
| -rw-r--r-- | arch/score/include/asm/exec.h | 6 | ||||
| -rw-r--r-- | arch/score/include/asm/io.h | 1 | ||||
| -rw-r--r-- | arch/score/include/asm/irqflags.h | 2 | ||||
| -rw-r--r-- | arch/score/include/asm/module.h | 6 | ||||
| -rw-r--r-- | arch/score/include/asm/pgalloc.h | 11 | ||||
| -rw-r--r-- | arch/score/include/asm/pgtable.h | 3 | ||||
| -rw-r--r-- | arch/score/include/asm/processor.h | 2 | ||||
| -rw-r--r-- | arch/score/include/asm/ptrace.h | 75 | ||||
| -rw-r--r-- | arch/score/include/asm/setup.h | 7 | ||||
| -rw-r--r-- | arch/score/include/asm/switch_to.h | 13 | ||||
| -rw-r--r-- | arch/score/include/asm/syscalls.h | 3 | ||||
| -rw-r--r-- | arch/score/include/asm/system.h | 90 | ||||
| -rw-r--r-- | arch/score/include/asm/thread_info.h | 16 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/Kbuild | 34 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/auxvec.h (renamed from arch/score/include/asm/auxvec.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/bitsperlong.h (renamed from arch/score/include/asm/bitsperlong.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/byteorder.h (renamed from arch/score/include/asm/byteorder.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/errno.h (renamed from arch/score/include/asm/errno.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/fcntl.h (renamed from arch/score/include/asm/fcntl.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/ioctl.h (renamed from arch/score/include/asm/ioctl.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/ioctls.h (renamed from arch/score/include/asm/ioctls.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/ipcbuf.h (renamed from arch/score/include/asm/ipcbuf.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/kvm_para.h | 1 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/mman.h (renamed from arch/score/include/asm/mman.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/msgbuf.h (renamed from arch/score/include/asm/msgbuf.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/param.h (renamed from arch/score/include/asm/param.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/poll.h (renamed from arch/score/include/asm/poll.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/posix_types.h (renamed from arch/score/include/asm/posix_types.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/ptrace.h | 76 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/resource.h (renamed from arch/score/include/asm/resource.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/sembuf.h (renamed from arch/score/include/asm/sembuf.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/setup.h | 9 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/shmbuf.h (renamed from arch/score/include/asm/shmbuf.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/sigcontext.h (renamed from arch/score/include/asm/sigcontext.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/siginfo.h (renamed from arch/score/include/asm/siginfo.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/signal.h (renamed from arch/score/include/asm/signal.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/socket.h (renamed from arch/score/include/asm/socket.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/sockios.h (renamed from arch/score/include/asm/sockios.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/stat.h (renamed from arch/score/include/asm/stat.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/statfs.h (renamed from arch/score/include/asm/statfs.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/swab.h (renamed from arch/score/include/asm/swab.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/termbits.h (renamed from arch/score/include/asm/termbits.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/termios.h (renamed from arch/score/include/asm/termios.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/types.h (renamed from arch/score/include/asm/types.h) | 0 | ||||
| -rw-r--r-- | arch/score/include/uapi/asm/unistd.h (renamed from arch/score/include/asm/unistd.h) | 8 | 
54 files changed, 280 insertions, 273 deletions
diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index b367abd4620..2f947aba4bd 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild @@ -1,3 +1,12 @@ -include include/asm-generic/Kbuild.asm  header-y += + + +generic-y += barrier.h +generic-y += clkdev.h +generic-y += cputime.h +generic-y += hash.h +generic-y += mcs_spinlock.h +generic-y += preempt.h +generic-y += trace_clock.h +generic-y += xor.h diff --git a/arch/score/include/asm/atomic.h b/arch/score/include/asm/atomic.h index 84eb8ddf9f3..edf33dbded1 100644 --- a/arch/score/include/asm/atomic.h +++ b/arch/score/include/asm/atomic.h @@ -1,6 +1,7 @@  #ifndef _ASM_SCORE_ATOMIC_H  #define _ASM_SCORE_ATOMIC_H +#include <asm/cmpxchg.h>  #include <asm-generic/atomic.h>  #endif /* _ASM_SCORE_ATOMIC_H */ diff --git a/arch/score/include/asm/bitops.h b/arch/score/include/asm/bitops.h index 2763b050fca..c1bf8d6d0fb 100644 --- a/arch/score/include/asm/bitops.h +++ b/arch/score/include/asm/bitops.h @@ -2,13 +2,7 @@  #define _ASM_SCORE_BITOPS_H  #include <asm/byteorder.h> /* swab32 */ -#include <asm/system.h> /* save_flags */ - -/* - * clear_bit() doesn't provide any barrier for the compiler. - */ -#define smp_mb__before_clear_bit()	barrier() -#define smp_mb__after_clear_bit()	barrier() +#include <asm/barrier.h>  #include <asm-generic/bitops.h>  #include <asm-generic/bitops/__fls.h> diff --git a/arch/score/include/asm/bug.h b/arch/score/include/asm/bug.h index bb76a330bcf..fd7164af1f0 100644 --- a/arch/score/include/asm/bug.h +++ b/arch/score/include/asm/bug.h @@ -3,4 +3,15 @@  #include <asm-generic/bug.h> +struct pt_regs; +extern void __die(const char *, struct pt_regs *, const char *, +	const char *, unsigned long) __attribute__((noreturn)); +extern void __die_if_kernel(const char *, struct pt_regs *, const char *, +	const char *, unsigned long); + +#define die(msg, regs)							\ +	__die(msg, regs, __FILE__ ":", __func__, __LINE__) +#define die_if_kernel(msg, regs)					\ +	__die_if_kernel(msg, regs, __FILE__ ":", __func__, __LINE__) +  #endif /* _ASM_SCORE_BUG_H */ diff --git a/arch/score/include/asm/checksum.h b/arch/score/include/asm/checksum.h index f909ac3144a..961bd64015a 100644 --- a/arch/score/include/asm/checksum.h +++ b/arch/score/include/asm/checksum.h @@ -184,48 +184,57 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,  				__wsum sum)  {  	__asm__ __volatile__( -		".set\tnoreorder\t\t\t# csum_ipv6_magic\n\t" -		".set\tnoat\n\t" -		"addu\t%0, %5\t\t\t# proto (long in network byte order)\n\t" -		"sltu\t$1, %0, %5\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %6\t\t\t# csum\n\t" -		"sltu\t$1, %0, %6\n\t" -		"lw\t%1, 0(%2)\t\t\t# four words source address\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %1\n\t" -		"sltu\t$1, %0, %1\n\t" -		"lw\t%1, 4(%2)\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %1\n\t" -		"sltu\t$1, %0, %1\n\t" -		"lw\t%1, 8(%2)\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %1\n\t" -		"sltu\t$1, %0, %1\n\t" -		"lw\t%1, 12(%2)\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %1\n\t" -		"sltu\t$1, %0, %1\n\t" -		"lw\t%1, 0(%3)\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %1\n\t" -		"sltu\t$1, %0, %1\n\t" -		"lw\t%1, 4(%3)\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %1\n\t" -		"sltu\t$1, %0, %1\n\t" -		"lw\t%1, 8(%3)\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %1\n\t" -		"sltu\t$1, %0, %1\n\t" -		"lw\t%1, 12(%3)\n\t" -		"addu\t%0, $1\n\t" -		"addu\t%0, %1\n\t" -		"sltu\t$1, %0, %1\n\t" -		"addu\t%0, $1\t\t\t# Add final carry\n\t" -		".set\tnoat\n\t" -		".set\tnoreorder" +		".set\tvolatile\t\t\t# csum_ipv6_magic\n\t" +		"add\t%0, %0, %5\t\t\t# proto (long in network byte order)\n\t" +		"cmp.c\t%5, %0\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0, %6\t\t\t# csum\n\t" +		"cmp.c\t%6, %0\n\t" +		"lw\t%1, [%2, 0]\t\t\t# four words source address\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0, %1\n\t" +		"cmp.c\t%1, %0\n\t" +		"1:lw\t%1, [%2, 4]\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0, %1\n\t" +		"cmp.c\t%1, %0\n\t" +		"lw\t%1, [%2,8]\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0, %1\n\t" +		"cmp.c\t%1, %0\n\t" +		"lw\t%1, [%2, 12]\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0,%1\n\t" +		"cmp.c\t%1, %0\n\t" +		"lw\t%1, [%3, 0]\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0, %1\n\t" +		"cmp.c\t%1, %0\n\t" +		"lw\t%1, [%3, 4]\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0, %1\n\t" +		"cmp.c\t%1, %0\n\t" +		"lw\t%1, [%3, 8]\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0, %1\n\t" +		"cmp.c\t%1, %0\n\t" +		"lw\t%1, [%3, 12]\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:add\t%0, %0, %1\n\t" +		"cmp.c\t%1, %0\n\t" +		"bleu 1f\n\t" +		"addi\t%0, 0x1\n\t" +		"1:\n\t" +		".set\toptimize"  		: "=r" (sum), "=r" (proto)  		: "r" (saddr), "r" (daddr),  		  "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); diff --git a/arch/score/include/asm/cmpxchg.h b/arch/score/include/asm/cmpxchg.h new file mode 100644 index 00000000000..f384839c3ee --- /dev/null +++ b/arch/score/include/asm/cmpxchg.h @@ -0,0 +1,49 @@ +#ifndef _ASM_SCORE_CMPXCHG_H +#define _ASM_SCORE_CMPXCHG_H + +#include <linux/irqflags.h> + +struct __xchg_dummy { unsigned long a[100]; }; +#define __xg(x) ((struct __xchg_dummy *)(x)) + +static inline +unsigned long __xchg(volatile unsigned long *m, unsigned long val) +{ +	unsigned long retval; +	unsigned long flags; + +	local_irq_save(flags); +	retval = *m; +	*m = val; +	local_irq_restore(flags); +	return retval; +} + +#define xchg(ptr, v)						\ +	((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr),	\ +					(unsigned long)(v))) + +static inline unsigned long __cmpxchg(volatile unsigned long *m, +				unsigned long old, unsigned long new) +{ +	unsigned long retval; +	unsigned long flags; + +	local_irq_save(flags); +	retval = *m; +	if (retval == old) +		*m = new; +	local_irq_restore(flags); +	return retval; +} + +#define cmpxchg(ptr, o, n)					\ +	((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr),	\ +					(unsigned long)(o),	\ +					(unsigned long)(n))) + +#define __HAVE_ARCH_CMPXCHG	1 + +#include <asm-generic/cmpxchg-local.h> + +#endif /* _ASM_SCORE_CMPXCHG_H */ diff --git a/arch/score/include/asm/cputime.h b/arch/score/include/asm/cputime.h deleted file mode 100644 index 1fced99f0d6..00000000000 --- a/arch/score/include/asm/cputime.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_SCORE_CPUTIME_H -#define _ASM_SCORE_CPUTIME_H - -#include <asm-generic/cputime.h> - -#endif /* _ASM_SCORE_CPUTIME_H */ diff --git a/arch/score/include/asm/dma-mapping.h b/arch/score/include/asm/dma-mapping.h deleted file mode 100644 index f9c0193c7a5..00000000000 --- a/arch/score/include/asm/dma-mapping.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_SCORE_DMA_MAPPING_H -#define _ASM_SCORE_DMA_MAPPING_H - -#include <asm-generic/dma-mapping-broken.h> - -#endif /* _ASM_SCORE_DMA_MAPPING_H */ diff --git a/arch/score/include/asm/elf.h b/arch/score/include/asm/elf.h index f478ce94181..6a9421c693c 100644 --- a/arch/score/include/asm/elf.h +++ b/arch/score/include/asm/elf.h @@ -52,11 +52,6 @@ typedef elf_fpreg_t	elf_fpregset_t;  #define ELF_DATA	ELFDATA2LSB  #define ELF_ARCH	EM_SCORE7 -#define SET_PERSONALITY(ex)					\ -do {								\ -	set_personality(PER_LINUX);				\ -} while (0) -  struct task_struct;  struct pt_regs; diff --git a/arch/score/include/asm/exec.h b/arch/score/include/asm/exec.h new file mode 100644 index 00000000000..f9f3cd59c86 --- /dev/null +++ b/arch/score/include/asm/exec.h @@ -0,0 +1,6 @@ +#ifndef _ASM_SCORE_EXEC_H +#define _ASM_SCORE_EXEC_H + +extern unsigned long arch_align_stack(unsigned long sp); + +#endif /* _ASM_SCORE_EXEC_H */ diff --git a/arch/score/include/asm/io.h b/arch/score/include/asm/io.h index fbbfd7132e3..574c8827abe 100644 --- a/arch/score/include/asm/io.h +++ b/arch/score/include/asm/io.h @@ -5,5 +5,4 @@  #define virt_to_bus	virt_to_phys  #define bus_to_virt	phys_to_virt -  #endif /* _ASM_SCORE_IO_H */ diff --git a/arch/score/include/asm/irqflags.h b/arch/score/include/asm/irqflags.h index 5c7563891e2..37c6ac9dd6e 100644 --- a/arch/score/include/asm/irqflags.h +++ b/arch/score/include/asm/irqflags.h @@ -29,7 +29,7 @@ static inline unsigned long arch_local_save_flags(void)  static inline unsigned long arch_local_irq_save(void)  { -	unsigned long flags +	unsigned long flags;  	asm volatile(  		"	mfcr	r8, cr0		\n" diff --git a/arch/score/include/asm/module.h b/arch/score/include/asm/module.h index f0b5dc0bd02..abf395bbfab 100644 --- a/arch/score/include/asm/module.h +++ b/arch/score/include/asm/module.h @@ -3,6 +3,7 @@  #include <linux/list.h>  #include <asm/uaccess.h> +#include <asm-generic/module.h>  struct mod_arch_specific {  	/* Data Bus Error exception tables */ @@ -13,11 +14,6 @@ struct mod_arch_specific {  typedef uint8_t Elf64_Byte;		/* Type for a 8-bit quantity. */ -#define Elf_Shdr	Elf32_Shdr -#define Elf_Sym		Elf32_Sym -#define Elf_Ehdr	Elf32_Ehdr -#define Elf_Addr	Elf32_Addr -  /* Given an address, look for it in the exception tables. */  #ifdef CONFIG_MODULES  const struct exception_table_entry *search_module_dbetables(unsigned long addr); diff --git a/arch/score/include/asm/pgalloc.h b/arch/score/include/asm/pgalloc.h index 059a61b7071..2e067657db9 100644 --- a/arch/score/include/asm/pgalloc.h +++ b/arch/score/include/asm/pgalloc.h @@ -2,7 +2,7 @@  #define _ASM_SCORE_PGALLOC_H  #include <linux/mm.h> - +#include <linux/highmem.h>  static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,  	pte_t *pte)  { @@ -54,9 +54,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,  	struct page *pte;  	pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER); -	if (pte) { -		clear_highpage(pte); -		pgtable_page_ctor(pte); +	if (!pte) +		return NULL; +	clear_highpage(pte); +	if (!pgtable_page_ctor(pte)) { +		__free_page(pte); +		return NULL;  	}  	return pte;  } diff --git a/arch/score/include/asm/pgtable.h b/arch/score/include/asm/pgtable.h index 2fd46980768..db96ad9afc0 100644 --- a/arch/score/include/asm/pgtable.h +++ b/arch/score/include/asm/pgtable.h @@ -113,9 +113,6 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }  #define pte_clear(mm, addr, xp)		\  	do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) -#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)		\ -		remap_pfn_range(vma, vaddr, pfn, size, prot) -  /*   * The "pgd_xxx()" functions here are trivial for a folded two-level   * setup: the pgd is never bad, and a pmd always exists (as it's folded diff --git a/arch/score/include/asm/processor.h b/arch/score/include/asm/processor.h index 7e22f216d77..d9a922d8711 100644 --- a/arch/score/include/asm/processor.h +++ b/arch/score/include/asm/processor.h @@ -13,7 +13,6 @@ struct task_struct;   */  extern void (*cpu_wait)(void); -extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);  extern unsigned long thread_saved_pc(struct task_struct *tsk);  extern void start_thread(struct pt_regs *regs,  			unsigned long pc, unsigned long sp); @@ -26,7 +25,6 @@ extern unsigned long get_wchan(struct task_struct *p);  #define cpu_relax()		barrier()  #define release_thread(thread)	do {} while (0) -#define prepare_to_copy(tsk)	do {} while (0)  /*   * User space process size: 2GB. This is hardcoded into a few places, diff --git a/arch/score/include/asm/ptrace.h b/arch/score/include/asm/ptrace.h index e89dc9b1ef4..abc279d96b7 100644 --- a/arch/score/include/asm/ptrace.h +++ b/arch/score/include/asm/ptrace.h @@ -1,78 +1,8 @@  #ifndef _ASM_SCORE_PTRACE_H  #define _ASM_SCORE_PTRACE_H -#define PTRACE_GETREGS		12 -#define PTRACE_SETREGS		13 +#include <uapi/asm/ptrace.h> -#define PC		32 -#define CONDITION	33 -#define ECR		34 -#define EMA		35 -#define CEH		36 -#define CEL		37 -#define COUNTER		38 -#define LDCR		39 -#define STCR		40 -#define PSR		41 - -#define SINGLESTEP16_INSN	0x7006 -#define SINGLESTEP32_INSN	0x840C8000 -#define BREAKPOINT16_INSN	0x7002		/* work on SPG300 */ -#define BREAKPOINT32_INSN	0x84048000	/* work on SPG300 */ - -/* Define instruction mask */ -#define INSN32_MASK	0x80008000 - -#define J32	0x88008000	/* 1_00010_0000000000_1_000000000000000 */ -#define J32M	0xFC008000	/* 1_11111_0000000000_1_000000000000000 */ - -#define B32	0x90008000	/* 1_00100_0000000000_1_000000000000000 */ -#define B32M	0xFC008000 -#define BL32	0x90008001	/* 1_00100_0000000000_1_000000000000001 */ -#define BL32M	B32 -#define BR32	0x80008008	/* 1_00000_0000000000_1_00000000_000100_0 */ -#define BR32M	0xFFE0807E -#define BRL32	0x80008009	/* 1_00000_0000000000_1_00000000_000100_1 */ -#define BRL32M	BR32M - -#define B32_SET	(J32 | B32 | BL32 | BR32 | BRL32) - -#define J16	0x3000		/* 0_011_....... */ -#define J16M	0xF000 -#define B16	0x4000		/* 0_100_....... */ -#define B16M	0xF000 -#define BR16	0x0004		/* 0_000.......0100 */ -#define BR16M	0xF00F -#define B16_SET (J16 | B16 | BR16) - - -/* - * This struct defines the way the registers are stored on the stack during a - * system call/exception. As usual the registers k0/k1 aren't being saved. - */ -struct pt_regs { -	unsigned long pad0[6];	/* stack arguments */ -	unsigned long orig_r4; -	unsigned long orig_r7; -	long is_syscall; - -	unsigned long regs[32]; - -	unsigned long cel; -	unsigned long ceh; - -	unsigned long sr0;	/* cnt */ -	unsigned long sr1;	/* lcr */ -	unsigned long sr2;	/* scr */ - -	unsigned long cp0_epc; -	unsigned long cp0_ema; -	unsigned long cp0_psr; -	unsigned long cp0_ecr; -	unsigned long cp0_condition; -}; - -#ifdef __KERNEL__  struct task_struct; @@ -83,6 +13,7 @@ struct task_struct;  #define instruction_pointer(regs)	((unsigned long)(regs)->cp0_epc)  #define profile_pc(regs)		instruction_pointer(regs) +#define user_stack_pointer(r)		((unsigned long)(r)->regs[0])  extern void do_syscall_trace(struct pt_regs *regs, int entryexit);  extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *); @@ -91,6 +22,4 @@ extern int read_tsk_short(struct task_struct *, unsigned long,  #define arch_has_single_step()	(1) -#endif /* __KERNEL__ */ -  #endif /* _ASM_SCORE_PTRACE_H */ diff --git a/arch/score/include/asm/setup.h b/arch/score/include/asm/setup.h index 3cb944dc68d..1f3aa7262fa 100644 --- a/arch/score/include/asm/setup.h +++ b/arch/score/include/asm/setup.h @@ -1,11 +1,8 @@  #ifndef _ASM_SCORE_SETUP_H  #define _ASM_SCORE_SETUP_H -#define COMMAND_LINE_SIZE	256 -#define MEMORY_START		0 -#define MEMORY_SIZE		0x2000000 +#include <uapi/asm/setup.h> -#ifdef __KERNEL__  extern void pagetable_init(void);  extern void pgd_init(unsigned long page); @@ -36,6 +33,4 @@ extern void debug_exception_vector(void);  extern void general_exception_vector(void);  extern void interrupt_exception_vector(void); -#endif /* __KERNEL__ */ -  #endif /* _ASM_SCORE_SETUP_H */ diff --git a/arch/score/include/asm/switch_to.h b/arch/score/include/asm/switch_to.h new file mode 100644 index 00000000000..031756b59ec --- /dev/null +++ b/arch/score/include/asm/switch_to.h @@ -0,0 +1,13 @@ +#ifndef _ASM_SCORE_SWITCH_TO_H +#define _ASM_SCORE_SWITCH_TO_H + +extern void *resume(void *last, void *next, void *next_ti); + +#define switch_to(prev, next, last)				\ +do {								\ +	(last) = resume(prev, next, task_thread_info(next));	\ +} while (0) + +#define finish_arch_switch(prev)	do {} while (0) + +#endif /* _ASM_SCORE_SWITCH_TO_H */ diff --git a/arch/score/include/asm/syscalls.h b/arch/score/include/asm/syscalls.h index 1dd5e0d6b0c..98d1df92fbd 100644 --- a/arch/score/include/asm/syscalls.h +++ b/arch/score/include/asm/syscalls.h @@ -1,9 +1,6 @@  #ifndef _ASM_SCORE_SYSCALLS_H  #define _ASM_SCORE_SYSCALLS_H -asmlinkage long score_clone(struct pt_regs *regs); -asmlinkage long score_execve(struct pt_regs *regs); -asmlinkage long score_sigaltstack(struct pt_regs *regs);  asmlinkage long score_rt_sigreturn(struct pt_regs *regs);  #include <asm-generic/syscalls.h> diff --git a/arch/score/include/asm/system.h b/arch/score/include/asm/system.h deleted file mode 100644 index 589d5c7e171..00000000000 --- a/arch/score/include/asm/system.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef _ASM_SCORE_SYSTEM_H -#define _ASM_SCORE_SYSTEM_H - -#include <linux/types.h> -#include <linux/irqflags.h> - -struct pt_regs; -struct task_struct; - -extern void *resume(void *last, void *next, void *next_ti); - -#define switch_to(prev, next, last)				\ -do {								\ -	(last) = resume(prev, next, task_thread_info(next));	\ -} while (0) - -#define finish_arch_switch(prev)	do {} while (0) - -typedef void (*vi_handler_t)(void); -extern unsigned long arch_align_stack(unsigned long sp); - -#define mb()		barrier() -#define rmb()		barrier() -#define wmb()		barrier() -#define smp_mb()	barrier() -#define smp_rmb()	barrier() -#define smp_wmb()	barrier() - -#define read_barrier_depends()		do {} while (0) -#define smp_read_barrier_depends()	do {} while (0) - -#define set_mb(var, value) 		do {var = value; wmb(); } while (0) - -#define __HAVE_ARCH_CMPXCHG	1 - -#include <asm-generic/cmpxchg-local.h> - -#ifndef __ASSEMBLY__ - -struct __xchg_dummy { unsigned long a[100]; }; -#define __xg(x) ((struct __xchg_dummy *)(x)) - -static inline -unsigned long __xchg(volatile unsigned long *m, unsigned long val) -{ -	unsigned long retval; -	unsigned long flags; - -	local_irq_save(flags); -	retval = *m; -	*m = val; -	local_irq_restore(flags); -	return retval; -} - -#define xchg(ptr, v)						\ -	((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr),	\ -					(unsigned long)(v))) - -static inline unsigned long __cmpxchg(volatile unsigned long *m, -				unsigned long old, unsigned long new) -{ -	unsigned long retval; -	unsigned long flags; - -	local_irq_save(flags); -	retval = *m; -	if (retval == old) -		*m = new; -	local_irq_restore(flags); -	return retval; -} - -#define cmpxchg(ptr, o, n)					\ -	((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr),	\ -					(unsigned long)(o),	\ -					(unsigned long)(n))) - -extern void __die(const char *, struct pt_regs *, const char *, -	const char *, unsigned long) __attribute__((noreturn)); -extern void __die_if_kernel(const char *, struct pt_regs *, const char *, -	const char *, unsigned long); - -#define die(msg, regs)							\ -	__die(msg, regs, __FILE__ ":", __func__, __LINE__) -#define die_if_kernel(msg, regs)					\ -	__die_if_kernel(msg, regs, __FILE__ ":", __func__, __LINE__) - -#endif /* !__ASSEMBLY__ */ -#endif /* _ASM_SCORE_SYSTEM_H */ diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h index 8570d08f58c..656b7ada932 100644 --- a/arch/score/include/asm/thread_info.h +++ b/arch/score/include/asm/thread_info.h @@ -11,10 +11,9 @@  #include <linux/const.h>  /* thread information allocation */ -#define THREAD_SIZE_ORDER 	(1) -#define THREAD_SIZE 		(PAGE_SIZE << THREAD_SIZE_ORDER) -#define THREAD_MASK 		(THREAD_SIZE - _AC(1,UL)) -#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR +#define THREAD_SIZE_ORDER	(1) +#define THREAD_SIZE		(PAGE_SIZE << THREAD_SIZE_ORDER) +#define THREAD_MASK		(THREAD_SIZE - _AC(1,UL))  #ifndef __ASSEMBLY__ @@ -71,13 +70,8 @@ struct thread_info {  register struct thread_info *__current_thread_info __asm__("r28");  #define current_thread_info()	__current_thread_info -#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL) -#define free_thread_info(info) kfree(info) -  #endif /* !__ASSEMBLY__ */ -#define PREEMPT_ACTIVE		0x10000000 -  /*   * thread information flags   * - these are process state flags that various assembly files may need to @@ -90,16 +84,12 @@ register struct thread_info *__current_thread_info __asm__("r28");  #define TIF_NEED_RESCHED	2	/* rescheduling necessary */  #define TIF_NOTIFY_RESUME	5	/* callback before returning to user */  #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in do_signal() */ -#define TIF_POLLING_NRFLAG	17	/* true if poll_idle() is polling -						 TIF_NEED_RESCHED */  #define TIF_MEMDIE		18	/* is terminating due to OOM killer */  #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)  #define _TIF_SIGPENDING		(1<<TIF_SIGPENDING)  #define _TIF_NEED_RESCHED	(1<<TIF_NEED_RESCHED)  #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME) -#define _TIF_RESTORE_SIGMASK	(1<<TIF_RESTORE_SIGMASK) -#define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)  #define _TIF_WORK_MASK		(0x0000ffff) diff --git a/arch/score/include/uapi/asm/Kbuild b/arch/score/include/uapi/asm/Kbuild new file mode 100644 index 00000000000..040178cdb3e --- /dev/null +++ b/arch/score/include/uapi/asm/Kbuild @@ -0,0 +1,34 @@ +# UAPI Header export list +include include/uapi/asm-generic/Kbuild.asm + +header-y += auxvec.h +header-y += bitsperlong.h +header-y += byteorder.h +header-y += errno.h +header-y += fcntl.h +header-y += ioctl.h +header-y += ioctls.h +header-y += ipcbuf.h +header-y += kvm_para.h +header-y += mman.h +header-y += msgbuf.h +header-y += param.h +header-y += poll.h +header-y += posix_types.h +header-y += ptrace.h +header-y += resource.h +header-y += sembuf.h +header-y += setup.h +header-y += shmbuf.h +header-y += sigcontext.h +header-y += siginfo.h +header-y += signal.h +header-y += socket.h +header-y += sockios.h +header-y += stat.h +header-y += statfs.h +header-y += swab.h +header-y += termbits.h +header-y += termios.h +header-y += types.h +header-y += unistd.h diff --git a/arch/score/include/asm/auxvec.h b/arch/score/include/uapi/asm/auxvec.h index f69151565ae..f69151565ae 100644 --- a/arch/score/include/asm/auxvec.h +++ b/arch/score/include/uapi/asm/auxvec.h diff --git a/arch/score/include/asm/bitsperlong.h b/arch/score/include/uapi/asm/bitsperlong.h index 86ff337aa45..86ff337aa45 100644 --- a/arch/score/include/asm/bitsperlong.h +++ b/arch/score/include/uapi/asm/bitsperlong.h diff --git a/arch/score/include/asm/byteorder.h b/arch/score/include/uapi/asm/byteorder.h index 88cbebc7921..88cbebc7921 100644 --- a/arch/score/include/asm/byteorder.h +++ b/arch/score/include/uapi/asm/byteorder.h diff --git a/arch/score/include/asm/errno.h b/arch/score/include/uapi/asm/errno.h index 29ff39d5ab4..29ff39d5ab4 100644 --- a/arch/score/include/asm/errno.h +++ b/arch/score/include/uapi/asm/errno.h diff --git a/arch/score/include/asm/fcntl.h b/arch/score/include/uapi/asm/fcntl.h index 03968a3103a..03968a3103a 100644 --- a/arch/score/include/asm/fcntl.h +++ b/arch/score/include/uapi/asm/fcntl.h diff --git a/arch/score/include/asm/ioctl.h b/arch/score/include/uapi/asm/ioctl.h index a351d2194bf..a351d2194bf 100644 --- a/arch/score/include/asm/ioctl.h +++ b/arch/score/include/uapi/asm/ioctl.h diff --git a/arch/score/include/asm/ioctls.h b/arch/score/include/uapi/asm/ioctls.h index ed01d2b9aea..ed01d2b9aea 100644 --- a/arch/score/include/asm/ioctls.h +++ b/arch/score/include/uapi/asm/ioctls.h diff --git a/arch/score/include/asm/ipcbuf.h b/arch/score/include/uapi/asm/ipcbuf.h index e082ceff181..e082ceff181 100644 --- a/arch/score/include/asm/ipcbuf.h +++ b/arch/score/include/uapi/asm/ipcbuf.h diff --git a/arch/score/include/uapi/asm/kvm_para.h b/arch/score/include/uapi/asm/kvm_para.h new file mode 100644 index 00000000000..14fab8f0b95 --- /dev/null +++ b/arch/score/include/uapi/asm/kvm_para.h @@ -0,0 +1 @@ +#include <asm-generic/kvm_para.h> diff --git a/arch/score/include/asm/mman.h b/arch/score/include/uapi/asm/mman.h index 84d85ddfed8..84d85ddfed8 100644 --- a/arch/score/include/asm/mman.h +++ b/arch/score/include/uapi/asm/mman.h diff --git a/arch/score/include/asm/msgbuf.h b/arch/score/include/uapi/asm/msgbuf.h index 7506721e29f..7506721e29f 100644 --- a/arch/score/include/asm/msgbuf.h +++ b/arch/score/include/uapi/asm/msgbuf.h diff --git a/arch/score/include/asm/param.h b/arch/score/include/uapi/asm/param.h index 916b8690b6a..916b8690b6a 100644 --- a/arch/score/include/asm/param.h +++ b/arch/score/include/uapi/asm/param.h diff --git a/arch/score/include/asm/poll.h b/arch/score/include/uapi/asm/poll.h index 18532db0286..18532db0286 100644 --- a/arch/score/include/asm/poll.h +++ b/arch/score/include/uapi/asm/poll.h diff --git a/arch/score/include/asm/posix_types.h b/arch/score/include/uapi/asm/posix_types.h index b88acf80048..b88acf80048 100644 --- a/arch/score/include/asm/posix_types.h +++ b/arch/score/include/uapi/asm/posix_types.h diff --git a/arch/score/include/uapi/asm/ptrace.h b/arch/score/include/uapi/asm/ptrace.h new file mode 100644 index 00000000000..f59771a3f12 --- /dev/null +++ b/arch/score/include/uapi/asm/ptrace.h @@ -0,0 +1,76 @@ +#ifndef _UAPI_ASM_SCORE_PTRACE_H +#define _UAPI_ASM_SCORE_PTRACE_H + +#define PTRACE_GETREGS		12 +#define PTRACE_SETREGS		13 + +#define PC		32 +#define CONDITION	33 +#define ECR		34 +#define EMA		35 +#define CEH		36 +#define CEL		37 +#define COUNTER		38 +#define LDCR		39 +#define STCR		40 +#define PSR		41 + +#define SINGLESTEP16_INSN	0x7006 +#define SINGLESTEP32_INSN	0x840C8000 +#define BREAKPOINT16_INSN	0x7002		/* work on SPG300 */ +#define BREAKPOINT32_INSN	0x84048000	/* work on SPG300 */ + +/* Define instruction mask */ +#define INSN32_MASK	0x80008000 + +#define J32	0x88008000	/* 1_00010_0000000000_1_000000000000000 */ +#define J32M	0xFC008000	/* 1_11111_0000000000_1_000000000000000 */ + +#define B32	0x90008000	/* 1_00100_0000000000_1_000000000000000 */ +#define B32M	0xFC008000 +#define BL32	0x90008001	/* 1_00100_0000000000_1_000000000000001 */ +#define BL32M	B32 +#define BR32	0x80008008	/* 1_00000_0000000000_1_00000000_000100_0 */ +#define BR32M	0xFFE0807E +#define BRL32	0x80008009	/* 1_00000_0000000000_1_00000000_000100_1 */ +#define BRL32M	BR32M + +#define B32_SET	(J32 | B32 | BL32 | BR32 | BRL32) + +#define J16	0x3000		/* 0_011_....... */ +#define J16M	0xF000 +#define B16	0x4000		/* 0_100_....... */ +#define B16M	0xF000 +#define BR16	0x0004		/* 0_000.......0100 */ +#define BR16M	0xF00F +#define B16_SET (J16 | B16 | BR16) + + +/* + * This struct defines the way the registers are stored on the stack during a + * system call/exception. As usual the registers k0/k1 aren't being saved. + */ +struct pt_regs { +	unsigned long pad0[6];	/* stack arguments */ +	unsigned long orig_r4; +	unsigned long orig_r7; +	long is_syscall; + +	unsigned long regs[32]; + +	unsigned long cel; +	unsigned long ceh; + +	unsigned long sr0;	/* cnt */ +	unsigned long sr1;	/* lcr */ +	unsigned long sr2;	/* scr */ + +	unsigned long cp0_epc; +	unsigned long cp0_ema; +	unsigned long cp0_psr; +	unsigned long cp0_ecr; +	unsigned long cp0_condition; +}; + + +#endif /* _UAPI_ASM_SCORE_PTRACE_H */ diff --git a/arch/score/include/asm/resource.h b/arch/score/include/uapi/asm/resource.h index 9ce22bc7b47..9ce22bc7b47 100644 --- a/arch/score/include/asm/resource.h +++ b/arch/score/include/uapi/asm/resource.h diff --git a/arch/score/include/asm/sembuf.h b/arch/score/include/uapi/asm/sembuf.h index dae5e835ce9..dae5e835ce9 100644 --- a/arch/score/include/asm/sembuf.h +++ b/arch/score/include/uapi/asm/sembuf.h diff --git a/arch/score/include/uapi/asm/setup.h b/arch/score/include/uapi/asm/setup.h new file mode 100644 index 00000000000..ab9dbdb59bb --- /dev/null +++ b/arch/score/include/uapi/asm/setup.h @@ -0,0 +1,9 @@ +#ifndef _UAPI_ASM_SCORE_SETUP_H +#define _UAPI_ASM_SCORE_SETUP_H + +#define COMMAND_LINE_SIZE	256 +#define MEMORY_START		0 +#define MEMORY_SIZE		0x2000000 + + +#endif /* _UAPI_ASM_SCORE_SETUP_H */ diff --git a/arch/score/include/asm/shmbuf.h b/arch/score/include/uapi/asm/shmbuf.h index c85b2429ba2..c85b2429ba2 100644 --- a/arch/score/include/asm/shmbuf.h +++ b/arch/score/include/uapi/asm/shmbuf.h diff --git a/arch/score/include/asm/sigcontext.h b/arch/score/include/uapi/asm/sigcontext.h index 5ffda39ddb9..5ffda39ddb9 100644 --- a/arch/score/include/asm/sigcontext.h +++ b/arch/score/include/uapi/asm/sigcontext.h diff --git a/arch/score/include/asm/siginfo.h b/arch/score/include/uapi/asm/siginfo.h index 87ca35607a2..87ca35607a2 100644 --- a/arch/score/include/asm/siginfo.h +++ b/arch/score/include/uapi/asm/siginfo.h diff --git a/arch/score/include/asm/signal.h b/arch/score/include/uapi/asm/signal.h index 2605bc06b64..2605bc06b64 100644 --- a/arch/score/include/asm/signal.h +++ b/arch/score/include/uapi/asm/signal.h diff --git a/arch/score/include/asm/socket.h b/arch/score/include/uapi/asm/socket.h index 612a70e385b..612a70e385b 100644 --- a/arch/score/include/asm/socket.h +++ b/arch/score/include/uapi/asm/socket.h diff --git a/arch/score/include/asm/sockios.h b/arch/score/include/uapi/asm/sockios.h index ba825648018..ba825648018 100644 --- a/arch/score/include/asm/sockios.h +++ b/arch/score/include/uapi/asm/sockios.h diff --git a/arch/score/include/asm/stat.h b/arch/score/include/uapi/asm/stat.h index 5037055500a..5037055500a 100644 --- a/arch/score/include/asm/stat.h +++ b/arch/score/include/uapi/asm/stat.h diff --git a/arch/score/include/asm/statfs.h b/arch/score/include/uapi/asm/statfs.h index 36e41004e99..36e41004e99 100644 --- a/arch/score/include/asm/statfs.h +++ b/arch/score/include/uapi/asm/statfs.h diff --git a/arch/score/include/asm/swab.h b/arch/score/include/uapi/asm/swab.h index fadc3cc6d8a..fadc3cc6d8a 100644 --- a/arch/score/include/asm/swab.h +++ b/arch/score/include/uapi/asm/swab.h diff --git a/arch/score/include/asm/termbits.h b/arch/score/include/uapi/asm/termbits.h index 9a95c141243..9a95c141243 100644 --- a/arch/score/include/asm/termbits.h +++ b/arch/score/include/uapi/asm/termbits.h diff --git a/arch/score/include/asm/termios.h b/arch/score/include/uapi/asm/termios.h index 40984e811ad..40984e811ad 100644 --- a/arch/score/include/asm/termios.h +++ b/arch/score/include/uapi/asm/termios.h diff --git a/arch/score/include/asm/types.h b/arch/score/include/uapi/asm/types.h index 2140032778e..2140032778e 100644 --- a/arch/score/include/asm/types.h +++ b/arch/score/include/uapi/asm/types.h diff --git a/arch/score/include/asm/unistd.h b/arch/score/include/uapi/asm/unistd.h index 4aa957364d4..9cb4260a5f3 100644 --- a/arch/score/include/asm/unistd.h +++ b/arch/score/include/uapi/asm/unistd.h @@ -1,13 +1,11 @@ -#if !defined(_ASM_SCORE_UNISTD_H) || defined(__SYSCALL) -#define _ASM_SCORE_UNISTD_H -  #define __ARCH_HAVE_MMU  #define __ARCH_WANT_SYSCALL_NO_AT  #define __ARCH_WANT_SYSCALL_NO_FLAGS  #define __ARCH_WANT_SYSCALL_OFF_T  #define __ARCH_WANT_SYSCALL_DEPRECATED +#define __ARCH_WANT_SYS_CLONE +#define __ARCH_WANT_SYS_FORK +#define __ARCH_WANT_SYS_VFORK  #include <asm-generic/unistd.h> - -#endif /* _ASM_SCORE_UNISTD_H */  | 
