diff options
37 files changed, 210 insertions, 176 deletions
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index 86eadceff097..29f83beeef7a 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | include include/asm-generic/Kbuild.asm | ||
| 2 | 1 | ||
| 3 | generic-y += bitsperlong.h | 2 | generic-y += bitsperlong.h |
| 4 | generic-y += cputime.h | 3 | generic-y += cputime.h |
| @@ -34,13 +33,3 @@ generic-y += termbits.h | |||
| 34 | generic-y += termios.h | 33 | generic-y += termios.h |
| 35 | generic-y += ucontext.h | 34 | generic-y += ucontext.h |
| 36 | generic-y += xor.h | 35 | generic-y += xor.h |
| 37 | |||
| 38 | header-y += cachectl.h | ||
| 39 | header-y += cpu-features.h | ||
| 40 | header-y += hw_breakpoint.h | ||
| 41 | header-y += posix_types_32.h | ||
| 42 | header-y += posix_types_64.h | ||
| 43 | header-y += ptrace_32.h | ||
| 44 | header-y += ptrace_64.h | ||
| 45 | header-y += unistd_32.h | ||
| 46 | header-y += unistd_64.h | ||
diff --git a/arch/sh/include/asm/hw_breakpoint.h b/arch/sh/include/asm/hw_breakpoint.h index 89890f61a7b9..ec9ad593c3da 100644 --- a/arch/sh/include/asm/hw_breakpoint.h +++ b/arch/sh/include/asm/hw_breakpoint.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #ifndef __ASM_SH_HW_BREAKPOINT_H | 1 | #ifndef __ASM_SH_HW_BREAKPOINT_H |
| 2 | #define __ASM_SH_HW_BREAKPOINT_H | 2 | #define __ASM_SH_HW_BREAKPOINT_H |
| 3 | 3 | ||
| 4 | #ifdef __KERNEL__ | 4 | #include <uapi/asm/hw_breakpoint.h> |
| 5 | |||
| 5 | #define __ARCH_HW_BREAKPOINT_H | 6 | #define __ARCH_HW_BREAKPOINT_H |
| 6 | 7 | ||
| 7 | #include <linux/kdebug.h> | 8 | #include <linux/kdebug.h> |
| @@ -66,5 +67,4 @@ extern int register_sh_ubc(struct sh_ubc *); | |||
| 66 | 67 | ||
| 67 | extern struct pmu perf_ops_bp; | 68 | extern struct pmu perf_ops_bp; |
| 68 | 69 | ||
| 69 | #endif /* __KERNEL__ */ | ||
| 70 | #endif /* __ASM_SH_HW_BREAKPOINT_H */ | 70 | #endif /* __ASM_SH_HW_BREAKPOINT_H */ |
diff --git a/arch/sh/include/asm/posix_types.h b/arch/sh/include/asm/posix_types.h index f08449bcbde7..1aa781079b1e 100644 --- a/arch/sh/include/asm/posix_types.h +++ b/arch/sh/include/asm/posix_types.h | |||
| @@ -1,13 +1,5 @@ | |||
| 1 | #ifdef __KERNEL__ | ||
| 2 | # ifdef CONFIG_SUPERH32 | 1 | # ifdef CONFIG_SUPERH32 |
| 3 | # include <asm/posix_types_32.h> | 2 | # include <asm/posix_types_32.h> |
| 4 | # else | 3 | # else |
| 5 | # include <asm/posix_types_64.h> | 4 | # include <asm/posix_types_64.h> |
| 6 | # endif | 5 | # endif |
| 7 | #else | ||
| 8 | # ifdef __SH5__ | ||
| 9 | # include <asm/posix_types_64.h> | ||
| 10 | # else | ||
| 11 | # include <asm/posix_types_32.h> | ||
| 12 | # endif | ||
| 13 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h index a4a38dff997a..2506c7db76b7 100644 --- a/arch/sh/include/asm/ptrace.h +++ b/arch/sh/include/asm/ptrace.h | |||
| @@ -1,42 +1,16 @@ | |||
| 1 | #ifndef __ASM_SH_PTRACE_H | ||
| 2 | #define __ASM_SH_PTRACE_H | ||
| 3 | |||
| 4 | /* | 1 | /* |
| 5 | * Copyright (C) 1999, 2000 Niibe Yutaka | 2 | * Copyright (C) 1999, 2000 Niibe Yutaka |
| 6 | */ | 3 | */ |
| 4 | #ifndef __ASM_SH_PTRACE_H | ||
| 5 | #define __ASM_SH_PTRACE_H | ||
| 7 | 6 | ||
| 8 | #define PTRACE_GETREGS 12 /* General registers */ | ||
| 9 | #define PTRACE_SETREGS 13 | ||
| 10 | |||
| 11 | #define PTRACE_GETFPREGS 14 /* FPU registers */ | ||
| 12 | #define PTRACE_SETFPREGS 15 | ||
| 13 | |||
| 14 | #define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */ | ||
| 15 | |||
| 16 | #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ | ||
| 17 | #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ | ||
| 18 | |||
| 19 | #define PTRACE_GETDSPREGS 55 /* DSP registers */ | ||
| 20 | #define PTRACE_SETDSPREGS 56 | ||
| 21 | |||
| 22 | #define PT_TEXT_END_ADDR 240 | ||
| 23 | #define PT_TEXT_ADDR 244 /* &(struct user)->start_code */ | ||
| 24 | #define PT_DATA_ADDR 248 /* &(struct user)->start_data */ | ||
| 25 | #define PT_TEXT_LEN 252 | ||
| 26 | |||
| 27 | #if defined(__SH5__) || defined(CONFIG_CPU_SH5) | ||
| 28 | #include <asm/ptrace_64.h> | ||
| 29 | #else | ||
| 30 | #include <asm/ptrace_32.h> | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifdef __KERNEL__ | ||
| 34 | 7 | ||
| 35 | #include <linux/stringify.h> | 8 | #include <linux/stringify.h> |
| 36 | #include <linux/stddef.h> | 9 | #include <linux/stddef.h> |
| 37 | #include <linux/thread_info.h> | 10 | #include <linux/thread_info.h> |
| 38 | #include <asm/addrspace.h> | 11 | #include <asm/addrspace.h> |
| 39 | #include <asm/page.h> | 12 | #include <asm/page.h> |
| 13 | #include <uapi/asm/ptrace.h> | ||
| 40 | 14 | ||
| 41 | #define user_mode(regs) (((regs)->sr & 0x40000000)==0) | 15 | #define user_mode(regs) (((regs)->sr & 0x40000000)==0) |
| 42 | #define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) | 16 | #define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) |
| @@ -140,6 +114,4 @@ static inline unsigned long profile_pc(struct pt_regs *regs) | |||
| 140 | #define profile_pc profile_pc | 114 | #define profile_pc profile_pc |
| 141 | 115 | ||
| 142 | #include <asm-generic/ptrace.h> | 116 | #include <asm-generic/ptrace.h> |
| 143 | #endif /* __KERNEL__ */ | ||
| 144 | |||
| 145 | #endif /* __ASM_SH_PTRACE_H */ | 117 | #endif /* __ASM_SH_PTRACE_H */ |
diff --git a/arch/sh/include/asm/ptrace_32.h b/arch/sh/include/asm/ptrace_32.h index 2d3e906aa722..1dd4480c5363 100644 --- a/arch/sh/include/asm/ptrace_32.h +++ b/arch/sh/include/asm/ptrace_32.h | |||
| @@ -1,79 +1,8 @@ | |||
| 1 | #ifndef __ASM_SH_PTRACE_32_H | 1 | #ifndef __ASM_SH_PTRACE_32_H |
| 2 | #define __ASM_SH_PTRACE_32_H | 2 | #define __ASM_SH_PTRACE_32_H |
| 3 | 3 | ||
| 4 | /* | 4 | #include <uapi/asm/ptrace_32.h> |
| 5 | * GCC defines register number like this: | ||
| 6 | * ----------------------------- | ||
| 7 | * 0 - 15 are integer registers | ||
| 8 | * 17 - 22 are control/special registers | ||
| 9 | * 24 - 39 fp registers | ||
| 10 | * 40 - 47 xd registers | ||
| 11 | * 48 - fpscr register | ||
| 12 | * ----------------------------- | ||
| 13 | * | ||
| 14 | * We follows above, except: | ||
| 15 | * 16 --- program counter (PC) | ||
| 16 | * 22 --- syscall # | ||
| 17 | * 23 --- floating point communication register | ||
| 18 | */ | ||
| 19 | #define REG_REG0 0 | ||
| 20 | #define REG_REG15 15 | ||
| 21 | 5 | ||
| 22 | #define REG_PC 16 | ||
| 23 | |||
| 24 | #define REG_PR 17 | ||
| 25 | #define REG_SR 18 | ||
| 26 | #define REG_GBR 19 | ||
| 27 | #define REG_MACH 20 | ||
| 28 | #define REG_MACL 21 | ||
| 29 | |||
| 30 | #define REG_SYSCALL 22 | ||
| 31 | |||
| 32 | #define REG_FPREG0 23 | ||
| 33 | #define REG_FPREG15 38 | ||
| 34 | #define REG_XFREG0 39 | ||
| 35 | #define REG_XFREG15 54 | ||
| 36 | |||
| 37 | #define REG_FPSCR 55 | ||
| 38 | #define REG_FPUL 56 | ||
| 39 | |||
| 40 | /* | ||
| 41 | * This struct defines the way the registers are stored on the | ||
| 42 | * kernel stack during a system call or other kernel entry. | ||
| 43 | */ | ||
| 44 | struct pt_regs { | ||
| 45 | unsigned long regs[16]; | ||
| 46 | unsigned long pc; | ||
| 47 | unsigned long pr; | ||
| 48 | unsigned long sr; | ||
| 49 | unsigned long gbr; | ||
| 50 | unsigned long mach; | ||
| 51 | unsigned long macl; | ||
| 52 | long tra; | ||
| 53 | }; | ||
| 54 | |||
| 55 | /* | ||
| 56 | * This struct defines the way the DSP registers are stored on the | ||
| 57 | * kernel stack during a system call or other kernel entry. | ||
| 58 | */ | ||
| 59 | struct pt_dspregs { | ||
| 60 | unsigned long a1; | ||
| 61 | unsigned long a0g; | ||
| 62 | unsigned long a1g; | ||
| 63 | unsigned long m0; | ||
| 64 | unsigned long m1; | ||
| 65 | unsigned long a0; | ||
| 66 | unsigned long x0; | ||
| 67 | unsigned long x1; | ||
| 68 | unsigned long y0; | ||
| 69 | unsigned long y1; | ||
| 70 | unsigned long dsr; | ||
| 71 | unsigned long rs; | ||
| 72 | unsigned long re; | ||
| 73 | unsigned long mod; | ||
| 74 | }; | ||
| 75 | |||
| 76 | #ifdef __KERNEL__ | ||
| 77 | 6 | ||
| 78 | #define MAX_REG_OFFSET offsetof(struct pt_regs, tra) | 7 | #define MAX_REG_OFFSET offsetof(struct pt_regs, tra) |
| 79 | static inline long regs_return_value(struct pt_regs *regs) | 8 | static inline long regs_return_value(struct pt_regs *regs) |
| @@ -81,6 +10,4 @@ static inline long regs_return_value(struct pt_regs *regs) | |||
| 81 | return regs->regs[0]; | 10 | return regs->regs[0]; |
| 82 | } | 11 | } |
| 83 | 12 | ||
| 84 | #endif /* __KERNEL__ */ | ||
| 85 | |||
| 86 | #endif /* __ASM_SH_PTRACE_32_H */ | 13 | #endif /* __ASM_SH_PTRACE_32_H */ |
diff --git a/arch/sh/include/asm/ptrace_64.h b/arch/sh/include/asm/ptrace_64.h index eb3fcceaf64b..97f4b5660f2c 100644 --- a/arch/sh/include/asm/ptrace_64.h +++ b/arch/sh/include/asm/ptrace_64.h | |||
| @@ -1,16 +1,8 @@ | |||
| 1 | #ifndef __ASM_SH_PTRACE_64_H | 1 | #ifndef __ASM_SH_PTRACE_64_H |
| 2 | #define __ASM_SH_PTRACE_64_H | 2 | #define __ASM_SH_PTRACE_64_H |
| 3 | 3 | ||
| 4 | struct pt_regs { | 4 | #include <uapi/asm/ptrace_64.h> |
| 5 | unsigned long long pc; | ||
| 6 | unsigned long long sr; | ||
| 7 | long long syscall_nr; | ||
| 8 | unsigned long long regs[63]; | ||
| 9 | unsigned long long tregs[8]; | ||
| 10 | unsigned long long pad[2]; | ||
| 11 | }; | ||
| 12 | 5 | ||
| 13 | #ifdef __KERNEL__ | ||
| 14 | 6 | ||
| 15 | #define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7]) | 7 | #define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7]) |
| 16 | static inline long regs_return_value(struct pt_regs *regs) | 8 | static inline long regs_return_value(struct pt_regs *regs) |
| @@ -18,6 +10,4 @@ static inline long regs_return_value(struct pt_regs *regs) | |||
| 18 | return regs->regs[3]; | 10 | return regs->regs[3]; |
| 19 | } | 11 | } |
| 20 | 12 | ||
| 21 | #endif /* __KERNEL__ */ | ||
| 22 | |||
| 23 | #endif /* __ASM_SH_PTRACE_64_H */ | 13 | #endif /* __ASM_SH_PTRACE_64_H */ |
diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h index 465a22df8fd0..99238108e7a5 100644 --- a/arch/sh/include/asm/setup.h +++ b/arch/sh/include/asm/setup.h | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | #ifndef _SH_SETUP_H | 1 | #ifndef _SH_SETUP_H |
| 2 | #define _SH_SETUP_H | 2 | #define _SH_SETUP_H |
| 3 | 3 | ||
| 4 | #include <asm-generic/setup.h> | 4 | #include <uapi/asm/setup.h> |
| 5 | 5 | ||
| 6 | #ifdef __KERNEL__ | ||
| 7 | /* | 6 | /* |
| 8 | * This is set up by the setup-routine at boot-time | 7 | * This is set up by the setup-routine at boot-time |
| 9 | */ | 8 | */ |
| @@ -22,6 +21,4 @@ void sh_mv_setup(void); | |||
| 22 | void check_for_initrd(void); | 21 | void check_for_initrd(void); |
| 23 | void per_cpu_trap_init(void); | 22 | void per_cpu_trap_init(void); |
| 24 | 23 | ||
| 25 | #endif /* __KERNEL__ */ | ||
| 26 | |||
| 27 | #endif /* _SH_SETUP_H */ | 24 | #endif /* _SH_SETUP_H */ |
diff --git a/arch/sh/include/asm/types.h b/arch/sh/include/asm/types.h index f8421f7ad63a..6a31053fa5e3 100644 --- a/arch/sh/include/asm/types.h +++ b/arch/sh/include/asm/types.h | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | #ifndef __ASM_SH_TYPES_H | 1 | #ifndef __ASM_SH_TYPES_H |
| 2 | #define __ASM_SH_TYPES_H | 2 | #define __ASM_SH_TYPES_H |
| 3 | 3 | ||
| 4 | #include <asm-generic/types.h> | 4 | #include <uapi/asm/types.h> |
| 5 | 5 | ||
| 6 | /* | 6 | /* |
| 7 | * These aren't exported outside the kernel to avoid name space clashes | 7 | * These aren't exported outside the kernel to avoid name space clashes |
| 8 | */ | 8 | */ |
| 9 | #ifdef __KERNEL__ | ||
| 10 | #ifndef __ASSEMBLY__ | 9 | #ifndef __ASSEMBLY__ |
| 11 | 10 | ||
| 12 | #ifdef CONFIG_SUPERH32 | 11 | #ifdef CONFIG_SUPERH32 |
| @@ -18,6 +17,4 @@ typedef u64 reg_size_t; | |||
| 18 | #endif | 17 | #endif |
| 19 | 18 | ||
| 20 | #endif /* __ASSEMBLY__ */ | 19 | #endif /* __ASSEMBLY__ */ |
| 21 | #endif /* __KERNEL__ */ | ||
| 22 | |||
| 23 | #endif /* __ASM_SH_TYPES_H */ | 20 | #endif /* __ASM_SH_TYPES_H */ |
diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h index 307201a854f3..38956dfa76f7 100644 --- a/arch/sh/include/asm/unistd.h +++ b/arch/sh/include/asm/unistd.h | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | #ifdef __KERNEL__ | ||
| 2 | # ifdef CONFIG_SUPERH32 | 1 | # ifdef CONFIG_SUPERH32 |
| 3 | # include <asm/unistd_32.h> | 2 | # include <asm/unistd_32.h> |
| 4 | # else | 3 | # else |
| @@ -38,10 +37,4 @@ | |||
| 38 | */ | 37 | */ |
| 39 | # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | 38 | # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") |
| 40 | 39 | ||
| 41 | #else | 40 | #include <uapi/asm/unistd.h> |
| 42 | # ifdef __SH5__ | ||
| 43 | # include <asm/unistd_64.h> | ||
| 44 | # else | ||
| 45 | # include <asm/unistd_32.h> | ||
| 46 | # endif | ||
| 47 | #endif | ||
diff --git a/arch/sh/include/uapi/asm/Kbuild b/arch/sh/include/uapi/asm/Kbuild index baebb3da1d44..60613ae78513 100644 --- a/arch/sh/include/uapi/asm/Kbuild +++ b/arch/sh/include/uapi/asm/Kbuild | |||
| @@ -1,3 +1,25 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
| 3 | 3 | ||
| 4 | header-y += auxvec.h | ||
| 5 | header-y += byteorder.h | ||
| 6 | header-y += cachectl.h | ||
| 7 | header-y += cpu-features.h | ||
| 8 | header-y += hw_breakpoint.h | ||
| 9 | header-y += ioctls.h | ||
| 10 | header-y += posix_types.h | ||
| 11 | header-y += posix_types_32.h | ||
| 12 | header-y += posix_types_64.h | ||
| 13 | header-y += ptrace.h | ||
| 14 | header-y += ptrace_32.h | ||
| 15 | header-y += ptrace_64.h | ||
| 16 | header-y += setup.h | ||
| 17 | header-y += sigcontext.h | ||
| 18 | header-y += signal.h | ||
| 19 | header-y += sockios.h | ||
| 20 | header-y += stat.h | ||
| 21 | header-y += swab.h | ||
| 22 | header-y += types.h | ||
| 23 | header-y += unistd.h | ||
| 24 | header-y += unistd_32.h | ||
| 25 | header-y += unistd_64.h | ||
diff --git a/arch/sh/include/asm/auxvec.h b/arch/sh/include/uapi/asm/auxvec.h index 8bcc51af9367..8bcc51af9367 100644 --- a/arch/sh/include/asm/auxvec.h +++ b/arch/sh/include/uapi/asm/auxvec.h | |||
diff --git a/arch/sh/include/asm/byteorder.h b/arch/sh/include/uapi/asm/byteorder.h index db2f5d7cb17d..db2f5d7cb17d 100644 --- a/arch/sh/include/asm/byteorder.h +++ b/arch/sh/include/uapi/asm/byteorder.h | |||
diff --git a/arch/sh/include/asm/cachectl.h b/arch/sh/include/uapi/asm/cachectl.h index 6ffb4b7a212e..6ffb4b7a212e 100644 --- a/arch/sh/include/asm/cachectl.h +++ b/arch/sh/include/uapi/asm/cachectl.h | |||
diff --git a/arch/sh/include/asm/cpu-features.h b/arch/sh/include/uapi/asm/cpu-features.h index 694abe490edb..694abe490edb 100644 --- a/arch/sh/include/asm/cpu-features.h +++ b/arch/sh/include/uapi/asm/cpu-features.h | |||
diff --git a/arch/sh/include/uapi/asm/hw_breakpoint.h b/arch/sh/include/uapi/asm/hw_breakpoint.h new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/arch/sh/include/uapi/asm/hw_breakpoint.h | |||
diff --git a/arch/sh/include/asm/ioctls.h b/arch/sh/include/uapi/asm/ioctls.h index a6769f352bf6..a6769f352bf6 100644 --- a/arch/sh/include/asm/ioctls.h +++ b/arch/sh/include/uapi/asm/ioctls.h | |||
diff --git a/arch/sh/include/uapi/asm/posix_types.h b/arch/sh/include/uapi/asm/posix_types.h new file mode 100644 index 000000000000..dc55e5adfe1e --- /dev/null +++ b/arch/sh/include/uapi/asm/posix_types.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef __KERNEL__ | ||
| 2 | # ifdef __SH5__ | ||
| 3 | # include <asm/posix_types_64.h> | ||
| 4 | # else | ||
| 5 | # include <asm/posix_types_32.h> | ||
| 6 | # endif | ||
| 7 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/sh/include/asm/posix_types_32.h b/arch/sh/include/uapi/asm/posix_types_32.h index ba0bdc423b07..ba0bdc423b07 100644 --- a/arch/sh/include/asm/posix_types_32.h +++ b/arch/sh/include/uapi/asm/posix_types_32.h | |||
diff --git a/arch/sh/include/asm/posix_types_64.h b/arch/sh/include/uapi/asm/posix_types_64.h index 244f7e950e17..244f7e950e17 100644 --- a/arch/sh/include/asm/posix_types_64.h +++ b/arch/sh/include/uapi/asm/posix_types_64.h | |||
diff --git a/arch/sh/include/uapi/asm/ptrace.h b/arch/sh/include/uapi/asm/ptrace.h new file mode 100644 index 000000000000..8b8c5aca9c28 --- /dev/null +++ b/arch/sh/include/uapi/asm/ptrace.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 1999, 2000 Niibe Yutaka | ||
| 3 | */ | ||
| 4 | #ifndef _UAPI__ASM_SH_PTRACE_H | ||
| 5 | #define _UAPI__ASM_SH_PTRACE_H | ||
| 6 | |||
| 7 | |||
| 8 | #define PTRACE_GETREGS 12 /* General registers */ | ||
| 9 | #define PTRACE_SETREGS 13 | ||
| 10 | |||
| 11 | #define PTRACE_GETFPREGS 14 /* FPU registers */ | ||
| 12 | #define PTRACE_SETFPREGS 15 | ||
| 13 | |||
| 14 | #define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */ | ||
| 15 | |||
| 16 | #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ | ||
| 17 | #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ | ||
| 18 | |||
| 19 | #define PTRACE_GETDSPREGS 55 /* DSP registers */ | ||
| 20 | #define PTRACE_SETDSPREGS 56 | ||
| 21 | |||
| 22 | #define PT_TEXT_END_ADDR 240 | ||
| 23 | #define PT_TEXT_ADDR 244 /* &(struct user)->start_code */ | ||
| 24 | #define PT_DATA_ADDR 248 /* &(struct user)->start_data */ | ||
| 25 | #define PT_TEXT_LEN 252 | ||
| 26 | |||
| 27 | #if defined(__SH5__) || defined(CONFIG_CPU_SH5) | ||
| 28 | #include <asm/ptrace_64.h> | ||
| 29 | #else | ||
| 30 | #include <asm/ptrace_32.h> | ||
| 31 | #endif | ||
| 32 | |||
| 33 | |||
| 34 | #endif /* _UAPI__ASM_SH_PTRACE_H */ | ||
diff --git a/arch/sh/include/uapi/asm/ptrace_32.h b/arch/sh/include/uapi/asm/ptrace_32.h new file mode 100644 index 000000000000..926e0cefc2bb --- /dev/null +++ b/arch/sh/include/uapi/asm/ptrace_32.h | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | #ifndef _UAPI__ASM_SH_PTRACE_32_H | ||
| 2 | #define _UAPI__ASM_SH_PTRACE_32_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * GCC defines register number like this: | ||
| 6 | * ----------------------------- | ||
| 7 | * 0 - 15 are integer registers | ||
| 8 | * 17 - 22 are control/special registers | ||
| 9 | * 24 - 39 fp registers | ||
| 10 | * 40 - 47 xd registers | ||
| 11 | * 48 - fpscr register | ||
| 12 | * ----------------------------- | ||
| 13 | * | ||
| 14 | * We follows above, except: | ||
| 15 | * 16 --- program counter (PC) | ||
| 16 | * 22 --- syscall # | ||
| 17 | * 23 --- floating point communication register | ||
| 18 | */ | ||
| 19 | #define REG_REG0 0 | ||
| 20 | #define REG_REG15 15 | ||
| 21 | |||
| 22 | #define REG_PC 16 | ||
| 23 | |||
| 24 | #define REG_PR 17 | ||
| 25 | #define REG_SR 18 | ||
| 26 | #define REG_GBR 19 | ||
| 27 | #define REG_MACH 20 | ||
| 28 | #define REG_MACL 21 | ||
| 29 | |||
| 30 | #define REG_SYSCALL 22 | ||
| 31 | |||
| 32 | #define REG_FPREG0 23 | ||
| 33 | #define REG_FPREG15 38 | ||
| 34 | #define REG_XFREG0 39 | ||
| 35 | #define REG_XFREG15 54 | ||
| 36 | |||
| 37 | #define REG_FPSCR 55 | ||
| 38 | #define REG_FPUL 56 | ||
| 39 | |||
| 40 | /* | ||
| 41 | * This struct defines the way the registers are stored on the | ||
| 42 | * kernel stack during a system call or other kernel entry. | ||
| 43 | */ | ||
| 44 | struct pt_regs { | ||
| 45 | unsigned long regs[16]; | ||
| 46 | unsigned long pc; | ||
| 47 | unsigned long pr; | ||
| 48 | unsigned long sr; | ||
| 49 | unsigned long gbr; | ||
| 50 | unsigned long mach; | ||
| 51 | unsigned long macl; | ||
| 52 | long tra; | ||
| 53 | }; | ||
| 54 | |||
| 55 | /* | ||
| 56 | * This struct defines the way the DSP registers are stored on the | ||
| 57 | * kernel stack during a system call or other kernel entry. | ||
| 58 | */ | ||
| 59 | struct pt_dspregs { | ||
| 60 | unsigned long a1; | ||
| 61 | unsigned long a0g; | ||
| 62 | unsigned long a1g; | ||
| 63 | unsigned long m0; | ||
| 64 | unsigned long m1; | ||
| 65 | unsigned long a0; | ||
| 66 | unsigned long x0; | ||
| 67 | unsigned long x1; | ||
| 68 | unsigned long y0; | ||
| 69 | unsigned long y1; | ||
| 70 | unsigned long dsr; | ||
| 71 | unsigned long rs; | ||
| 72 | unsigned long re; | ||
| 73 | unsigned long mod; | ||
| 74 | }; | ||
| 75 | |||
| 76 | |||
| 77 | #endif /* _UAPI__ASM_SH_PTRACE_32_H */ | ||
diff --git a/arch/sh/include/uapi/asm/ptrace_64.h b/arch/sh/include/uapi/asm/ptrace_64.h new file mode 100644 index 000000000000..0e52ee83e946 --- /dev/null +++ b/arch/sh/include/uapi/asm/ptrace_64.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef _UAPI__ASM_SH_PTRACE_64_H | ||
| 2 | #define _UAPI__ASM_SH_PTRACE_64_H | ||
| 3 | |||
| 4 | struct pt_regs { | ||
| 5 | unsigned long long pc; | ||
| 6 | unsigned long long sr; | ||
| 7 | long long syscall_nr; | ||
| 8 | unsigned long long regs[63]; | ||
| 9 | unsigned long long tregs[8]; | ||
| 10 | unsigned long long pad[2]; | ||
| 11 | }; | ||
| 12 | |||
| 13 | |||
| 14 | #endif /* _UAPI__ASM_SH_PTRACE_64_H */ | ||
diff --git a/arch/sh/include/uapi/asm/setup.h b/arch/sh/include/uapi/asm/setup.h new file mode 100644 index 000000000000..552df83f1a49 --- /dev/null +++ b/arch/sh/include/uapi/asm/setup.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/setup.h> | |||
diff --git a/arch/sh/include/asm/sigcontext.h b/arch/sh/include/uapi/asm/sigcontext.h index 8ce1435bc0bf..8ce1435bc0bf 100644 --- a/arch/sh/include/asm/sigcontext.h +++ b/arch/sh/include/uapi/asm/sigcontext.h | |||
diff --git a/arch/sh/include/asm/signal.h b/arch/sh/include/uapi/asm/signal.h index 9ac530a90bce..9ac530a90bce 100644 --- a/arch/sh/include/asm/signal.h +++ b/arch/sh/include/uapi/asm/signal.h | |||
diff --git a/arch/sh/include/asm/sockios.h b/arch/sh/include/uapi/asm/sockios.h index cf8b96b1f9ab..cf8b96b1f9ab 100644 --- a/arch/sh/include/asm/sockios.h +++ b/arch/sh/include/uapi/asm/sockios.h | |||
diff --git a/arch/sh/include/asm/stat.h b/arch/sh/include/uapi/asm/stat.h index e1810cc6e3da..e1810cc6e3da 100644 --- a/arch/sh/include/asm/stat.h +++ b/arch/sh/include/uapi/asm/stat.h | |||
diff --git a/arch/sh/include/asm/swab.h b/arch/sh/include/uapi/asm/swab.h index 1cd09767a7a3..1cd09767a7a3 100644 --- a/arch/sh/include/asm/swab.h +++ b/arch/sh/include/uapi/asm/swab.h | |||
diff --git a/arch/sh/include/uapi/asm/types.h b/arch/sh/include/uapi/asm/types.h new file mode 100644 index 000000000000..b9e79bc580dd --- /dev/null +++ b/arch/sh/include/uapi/asm/types.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/types.h> | |||
diff --git a/arch/sh/include/uapi/asm/unistd.h b/arch/sh/include/uapi/asm/unistd.h new file mode 100644 index 000000000000..eeef88dd53ce --- /dev/null +++ b/arch/sh/include/uapi/asm/unistd.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef __KERNEL__ | ||
| 2 | # ifdef __SH5__ | ||
| 3 | # include <asm/unistd_64.h> | ||
| 4 | # else | ||
| 5 | # include <asm/unistd_32.h> | ||
| 6 | # endif | ||
| 7 | #endif | ||
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/uapi/asm/unistd_32.h index 72fd1e061006..9e465f246dc1 100644 --- a/arch/sh/include/asm/unistd_32.h +++ b/arch/sh/include/uapi/asm/unistd_32.h | |||
| @@ -378,7 +378,8 @@ | |||
| 378 | #define __NR_setns 364 | 378 | #define __NR_setns 364 |
| 379 | #define __NR_process_vm_readv 365 | 379 | #define __NR_process_vm_readv 365 |
| 380 | #define __NR_process_vm_writev 366 | 380 | #define __NR_process_vm_writev 366 |
| 381 | #define __NR_kcmp 367 | ||
| 381 | 382 | ||
| 382 | #define NR_syscalls 367 | 383 | #define NR_syscalls 368 |
| 383 | 384 | ||
| 384 | #endif /* __ASM_SH_UNISTD_32_H */ | 385 | #endif /* __ASM_SH_UNISTD_32_H */ |
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/uapi/asm/unistd_64.h index a28edc329692..8e3a2edd284e 100644 --- a/arch/sh/include/asm/unistd_64.h +++ b/arch/sh/include/uapi/asm/unistd_64.h | |||
| @@ -398,7 +398,8 @@ | |||
| 398 | #define __NR_setns 375 | 398 | #define __NR_setns 375 |
| 399 | #define __NR_process_vm_readv 376 | 399 | #define __NR_process_vm_readv 376 |
| 400 | #define __NR_process_vm_writev 377 | 400 | #define __NR_process_vm_writev 377 |
| 401 | #define __NR_kcmp 378 | ||
| 401 | 402 | ||
| 402 | #define NR_syscalls 378 | 403 | #define NR_syscalls 379 |
| 403 | 404 | ||
| 404 | #endif /* __ASM_SH_UNISTD_64_H */ | 405 | #endif /* __ASM_SH_UNISTD_64_H */ |
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index 4b68f0f79761..fe97ae5e56f1 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S | |||
| @@ -384,3 +384,4 @@ ENTRY(sys_call_table) | |||
| 384 | .long sys_setns | 384 | .long sys_setns |
| 385 | .long sys_process_vm_readv /* 365 */ | 385 | .long sys_process_vm_readv /* 365 */ |
| 386 | .long sys_process_vm_writev | 386 | .long sys_process_vm_writev |
| 387 | .long sys_kcmp | ||
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S index 0956345b36ef..5c7b1c67bdc1 100644 --- a/arch/sh/kernel/syscalls_64.S +++ b/arch/sh/kernel/syscalls_64.S | |||
| @@ -404,3 +404,4 @@ sys_call_table: | |||
| 404 | .long sys_setns /* 375 */ | 404 | .long sys_setns /* 375 */ |
| 405 | .long sys_process_vm_readv | 405 | .long sys_process_vm_readv |
| 406 | .long sys_process_vm_writev | 406 | .long sys_process_vm_writev |
| 407 | .long sys_kcmp | ||
diff --git a/drivers/sh/intc/access.c b/drivers/sh/intc/access.c index f892ae1d212a..114390f967d2 100644 --- a/drivers/sh/intc/access.c +++ b/drivers/sh/intc/access.c | |||
| @@ -75,54 +75,61 @@ unsigned long intc_get_field_from_handle(unsigned int value, unsigned int handle | |||
| 75 | static unsigned long test_8(unsigned long addr, unsigned long h, | 75 | static unsigned long test_8(unsigned long addr, unsigned long h, |
| 76 | unsigned long ignore) | 76 | unsigned long ignore) |
| 77 | { | 77 | { |
| 78 | return intc_get_field_from_handle(__raw_readb(addr), h); | 78 | void __iomem *ptr = (void __iomem *)addr; |
| 79 | return intc_get_field_from_handle(__raw_readb(ptr), h); | ||
| 79 | } | 80 | } |
| 80 | 81 | ||
| 81 | static unsigned long test_16(unsigned long addr, unsigned long h, | 82 | static unsigned long test_16(unsigned long addr, unsigned long h, |
| 82 | unsigned long ignore) | 83 | unsigned long ignore) |
| 83 | { | 84 | { |
| 84 | return intc_get_field_from_handle(__raw_readw(addr), h); | 85 | void __iomem *ptr = (void __iomem *)addr; |
| 86 | return intc_get_field_from_handle(__raw_readw(ptr), h); | ||
| 85 | } | 87 | } |
| 86 | 88 | ||
| 87 | static unsigned long test_32(unsigned long addr, unsigned long h, | 89 | static unsigned long test_32(unsigned long addr, unsigned long h, |
| 88 | unsigned long ignore) | 90 | unsigned long ignore) |
| 89 | { | 91 | { |
| 90 | return intc_get_field_from_handle(__raw_readl(addr), h); | 92 | void __iomem *ptr = (void __iomem *)addr; |
| 93 | return intc_get_field_from_handle(__raw_readl(ptr), h); | ||
| 91 | } | 94 | } |
| 92 | 95 | ||
| 93 | static unsigned long write_8(unsigned long addr, unsigned long h, | 96 | static unsigned long write_8(unsigned long addr, unsigned long h, |
| 94 | unsigned long data) | 97 | unsigned long data) |
| 95 | { | 98 | { |
| 96 | __raw_writeb(intc_set_field_from_handle(0, data, h), addr); | 99 | void __iomem *ptr = (void __iomem *)addr; |
| 97 | (void)__raw_readb(addr); /* Defeat write posting */ | 100 | __raw_writeb(intc_set_field_from_handle(0, data, h), ptr); |
| 101 | (void)__raw_readb(ptr); /* Defeat write posting */ | ||
| 98 | return 0; | 102 | return 0; |
| 99 | } | 103 | } |
| 100 | 104 | ||
| 101 | static unsigned long write_16(unsigned long addr, unsigned long h, | 105 | static unsigned long write_16(unsigned long addr, unsigned long h, |
| 102 | unsigned long data) | 106 | unsigned long data) |
| 103 | { | 107 | { |
| 104 | __raw_writew(intc_set_field_from_handle(0, data, h), addr); | 108 | void __iomem *ptr = (void __iomem *)addr; |
| 105 | (void)__raw_readw(addr); /* Defeat write posting */ | 109 | __raw_writew(intc_set_field_from_handle(0, data, h), ptr); |
| 110 | (void)__raw_readw(ptr); /* Defeat write posting */ | ||
| 106 | return 0; | 111 | return 0; |
| 107 | } | 112 | } |
| 108 | 113 | ||
| 109 | static unsigned long write_32(unsigned long addr, unsigned long h, | 114 | static unsigned long write_32(unsigned long addr, unsigned long h, |
| 110 | unsigned long data) | 115 | unsigned long data) |
| 111 | { | 116 | { |
| 112 | __raw_writel(intc_set_field_from_handle(0, data, h), addr); | 117 | void __iomem *ptr = (void __iomem *)addr; |
| 113 | (void)__raw_readl(addr); /* Defeat write posting */ | 118 | __raw_writel(intc_set_field_from_handle(0, data, h), ptr); |
| 119 | (void)__raw_readl(ptr); /* Defeat write posting */ | ||
| 114 | return 0; | 120 | return 0; |
| 115 | } | 121 | } |
| 116 | 122 | ||
| 117 | static unsigned long modify_8(unsigned long addr, unsigned long h, | 123 | static unsigned long modify_8(unsigned long addr, unsigned long h, |
| 118 | unsigned long data) | 124 | unsigned long data) |
| 119 | { | 125 | { |
| 126 | void __iomem *ptr = (void __iomem *)addr; | ||
| 120 | unsigned long flags; | 127 | unsigned long flags; |
| 121 | unsigned int value; | 128 | unsigned int value; |
| 122 | local_irq_save(flags); | 129 | local_irq_save(flags); |
| 123 | value = intc_set_field_from_handle(__raw_readb(addr), data, h); | 130 | value = intc_set_field_from_handle(__raw_readb(ptr), data, h); |
| 124 | __raw_writeb(value, addr); | 131 | __raw_writeb(value, ptr); |
| 125 | (void)__raw_readb(addr); /* Defeat write posting */ | 132 | (void)__raw_readb(ptr); /* Defeat write posting */ |
| 126 | local_irq_restore(flags); | 133 | local_irq_restore(flags); |
| 127 | return 0; | 134 | return 0; |
| 128 | } | 135 | } |
| @@ -130,12 +137,13 @@ static unsigned long modify_8(unsigned long addr, unsigned long h, | |||
| 130 | static unsigned long modify_16(unsigned long addr, unsigned long h, | 137 | static unsigned long modify_16(unsigned long addr, unsigned long h, |
| 131 | unsigned long data) | 138 | unsigned long data) |
| 132 | { | 139 | { |
| 140 | void __iomem *ptr = (void __iomem *)addr; | ||
| 133 | unsigned long flags; | 141 | unsigned long flags; |
| 134 | unsigned int value; | 142 | unsigned int value; |
| 135 | local_irq_save(flags); | 143 | local_irq_save(flags); |
| 136 | value = intc_set_field_from_handle(__raw_readw(addr), data, h); | 144 | value = intc_set_field_from_handle(__raw_readw(ptr), data, h); |
| 137 | __raw_writew(value, addr); | 145 | __raw_writew(value, ptr); |
| 138 | (void)__raw_readw(addr); /* Defeat write posting */ | 146 | (void)__raw_readw(ptr); /* Defeat write posting */ |
| 139 | local_irq_restore(flags); | 147 | local_irq_restore(flags); |
| 140 | return 0; | 148 | return 0; |
| 141 | } | 149 | } |
| @@ -143,12 +151,13 @@ static unsigned long modify_16(unsigned long addr, unsigned long h, | |||
| 143 | static unsigned long modify_32(unsigned long addr, unsigned long h, | 151 | static unsigned long modify_32(unsigned long addr, unsigned long h, |
| 144 | unsigned long data) | 152 | unsigned long data) |
| 145 | { | 153 | { |
| 154 | void __iomem *ptr = (void __iomem *)addr; | ||
| 146 | unsigned long flags; | 155 | unsigned long flags; |
| 147 | unsigned int value; | 156 | unsigned int value; |
| 148 | local_irq_save(flags); | 157 | local_irq_save(flags); |
| 149 | value = intc_set_field_from_handle(__raw_readl(addr), data, h); | 158 | value = intc_set_field_from_handle(__raw_readl(ptr), data, h); |
| 150 | __raw_writel(value, addr); | 159 | __raw_writel(value, ptr); |
| 151 | (void)__raw_readl(addr); /* Defeat write posting */ | 160 | (void)__raw_readl(ptr); /* Defeat write posting */ |
| 152 | local_irq_restore(flags); | 161 | local_irq_restore(flags); |
| 153 | return 0; | 162 | return 0; |
| 154 | } | 163 | } |
diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c index 012df2676a26..46427b48e2f1 100644 --- a/drivers/sh/intc/chip.c +++ b/drivers/sh/intc/chip.c | |||
| @@ -83,7 +83,7 @@ static void intc_mask_ack(struct irq_data *data) | |||
| 83 | unsigned int irq = data->irq; | 83 | unsigned int irq = data->irq; |
| 84 | struct intc_desc_int *d = get_intc_desc(irq); | 84 | struct intc_desc_int *d = get_intc_desc(irq); |
| 85 | unsigned long handle = intc_get_ack_handle(irq); | 85 | unsigned long handle = intc_get_ack_handle(irq); |
| 86 | unsigned long addr; | 86 | void __iomem *addr; |
| 87 | 87 | ||
| 88 | intc_disable(data); | 88 | intc_disable(data); |
| 89 | 89 | ||
| @@ -91,7 +91,7 @@ static void intc_mask_ack(struct irq_data *data) | |||
| 91 | if (handle) { | 91 | if (handle) { |
| 92 | unsigned int value; | 92 | unsigned int value; |
| 93 | 93 | ||
| 94 | addr = INTC_REG(d, _INTC_ADDR_D(handle), 0); | 94 | addr = (void __iomem *)INTC_REG(d, _INTC_ADDR_D(handle), 0); |
| 95 | value = intc_set_field_from_handle(0, 1, handle); | 95 | value = intc_set_field_from_handle(0, 1, handle); |
| 96 | 96 | ||
| 97 | switch (_INTC_FN(handle)) { | 97 | switch (_INTC_FN(handle)) { |
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 9be296cf7295..6ee59001d61d 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
| @@ -530,7 +530,8 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
| 530 | if (s->cfg->port_reg <= 0) | 530 | if (s->cfg->port_reg <= 0) |
| 531 | return 1; | 531 | return 1; |
| 532 | 532 | ||
| 533 | return !!__raw_readb(s->cfg->port_reg); | 533 | /* Cast for ARM damage */ |
| 534 | return !!__raw_readb((void __iomem *)s->cfg->port_reg); | ||
| 534 | } | 535 | } |
| 535 | 536 | ||
| 536 | /* ********************************************************************** * | 537 | /* ********************************************************************** * |
