diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-16 15:54:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-16 15:54:54 -0400 |
commit | 8be7eb359d96a6503de18b1a73fd6a24d8c983c9 (patch) | |
tree | 36795b7369a137ab6663bc018d452b58bf1d5e72 /arch/tile/include | |
parent | 3a919cf0bfb7b51205e7f8bacc491996e958b1a2 (diff) | |
parent | 7040dea4d2a0609241c7a98a944b7c432c69db2e (diff) |
Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
arch/tile: fix formatting bug in register dumps
arch/tile: fix memcpy_fromio()/memcpy_toio() signatures
arch/tile: Save and restore extra user state for tilegx
arch/tile: Change struct sigcontext to be more useful
arch/tile: finish const-ifying sys_execve()
Diffstat (limited to 'arch/tile/include')
-rw-r--r-- | arch/tile/include/arch/chip_tile64.h | 3 | ||||
-rw-r--r-- | arch/tile/include/arch/chip_tilepro.h | 3 | ||||
-rw-r--r-- | arch/tile/include/asm/compat.h | 5 | ||||
-rw-r--r-- | arch/tile/include/asm/io.h | 8 | ||||
-rw-r--r-- | arch/tile/include/asm/processor.h | 12 | ||||
-rw-r--r-- | arch/tile/include/asm/ptrace.h | 15 | ||||
-rw-r--r-- | arch/tile/include/asm/sigcontext.h | 18 | ||||
-rw-r--r-- | arch/tile/include/asm/signal.h | 1 | ||||
-rw-r--r-- | arch/tile/include/asm/syscalls.h | 21 |
9 files changed, 58 insertions, 28 deletions
diff --git a/arch/tile/include/arch/chip_tile64.h b/arch/tile/include/arch/chip_tile64.h index 1246573be59e..261aaba092d4 100644 --- a/arch/tile/include/arch/chip_tile64.h +++ b/arch/tile/include/arch/chip_tile64.h | |||
@@ -150,6 +150,9 @@ | |||
150 | /** Is the PROC_STATUS SPR supported? */ | 150 | /** Is the PROC_STATUS SPR supported? */ |
151 | #define CHIP_HAS_PROC_STATUS_SPR() 0 | 151 | #define CHIP_HAS_PROC_STATUS_SPR() 0 |
152 | 152 | ||
153 | /** Is the DSTREAM_PF SPR supported? */ | ||
154 | #define CHIP_HAS_DSTREAM_PF() 0 | ||
155 | |||
153 | /** Log of the number of mshims we have. */ | 156 | /** Log of the number of mshims we have. */ |
154 | #define CHIP_LOG_NUM_MSHIMS() 2 | 157 | #define CHIP_LOG_NUM_MSHIMS() 2 |
155 | 158 | ||
diff --git a/arch/tile/include/arch/chip_tilepro.h b/arch/tile/include/arch/chip_tilepro.h index e864c47fc89c..70017699a74c 100644 --- a/arch/tile/include/arch/chip_tilepro.h +++ b/arch/tile/include/arch/chip_tilepro.h | |||
@@ -150,6 +150,9 @@ | |||
150 | /** Is the PROC_STATUS SPR supported? */ | 150 | /** Is the PROC_STATUS SPR supported? */ |
151 | #define CHIP_HAS_PROC_STATUS_SPR() 1 | 151 | #define CHIP_HAS_PROC_STATUS_SPR() 1 |
152 | 152 | ||
153 | /** Is the DSTREAM_PF SPR supported? */ | ||
154 | #define CHIP_HAS_DSTREAM_PF() 0 | ||
155 | |||
153 | /** Log of the number of mshims we have. */ | 156 | /** Log of the number of mshims we have. */ |
154 | #define CHIP_LOG_NUM_MSHIMS() 2 | 157 | #define CHIP_LOG_NUM_MSHIMS() 2 |
155 | 158 | ||
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h index 345d81ce44bb..8b60ec8b2d19 100644 --- a/arch/tile/include/asm/compat.h +++ b/arch/tile/include/asm/compat.h | |||
@@ -214,8 +214,9 @@ extern int compat_setup_rt_frame(int sig, struct k_sigaction *ka, | |||
214 | struct compat_sigaction; | 214 | struct compat_sigaction; |
215 | struct compat_siginfo; | 215 | struct compat_siginfo; |
216 | struct compat_sigaltstack; | 216 | struct compat_sigaltstack; |
217 | long compat_sys_execve(char __user *path, compat_uptr_t __user *argv, | 217 | long compat_sys_execve(const char __user *path, |
218 | compat_uptr_t __user *envp); | 218 | const compat_uptr_t __user *argv, |
219 | const compat_uptr_t __user *envp); | ||
219 | long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, | 220 | long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, |
220 | struct compat_sigaction __user *oact, | 221 | struct compat_sigaction __user *oact, |
221 | size_t sigsetsize); | 222 | size_t sigsetsize); |
diff --git a/arch/tile/include/asm/io.h b/arch/tile/include/asm/io.h index 8c95bef3fa45..ee43328713ab 100644 --- a/arch/tile/include/asm/io.h +++ b/arch/tile/include/asm/io.h | |||
@@ -164,22 +164,22 @@ static inline void _tile_writeq(u64 val, unsigned long addr) | |||
164 | #define iowrite32 writel | 164 | #define iowrite32 writel |
165 | #define iowrite64 writeq | 165 | #define iowrite64 writeq |
166 | 166 | ||
167 | static inline void *memcpy_fromio(void *dst, void *src, int len) | 167 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, |
168 | size_t len) | ||
168 | { | 169 | { |
169 | int x; | 170 | int x; |
170 | BUG_ON((unsigned long)src & 0x3); | 171 | BUG_ON((unsigned long)src & 0x3); |
171 | for (x = 0; x < len; x += 4) | 172 | for (x = 0; x < len; x += 4) |
172 | *(u32 *)(dst + x) = readl(src + x); | 173 | *(u32 *)(dst + x) = readl(src + x); |
173 | return dst; | ||
174 | } | 174 | } |
175 | 175 | ||
176 | static inline void *memcpy_toio(void *dst, void *src, int len) | 176 | static inline void memcpy_toio(volatile void __iomem *dst, const void *src, |
177 | size_t len) | ||
177 | { | 178 | { |
178 | int x; | 179 | int x; |
179 | BUG_ON((unsigned long)dst & 0x3); | 180 | BUG_ON((unsigned long)dst & 0x3); |
180 | for (x = 0; x < len; x += 4) | 181 | for (x = 0; x < len; x += 4) |
181 | writel(*(u32 *)(src + x), dst + x); | 182 | writel(*(u32 *)(src + x), dst + x); |
182 | return dst; | ||
183 | } | 183 | } |
184 | 184 | ||
185 | /* | 185 | /* |
diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h index d942d09b252e..ccd5f8425688 100644 --- a/arch/tile/include/asm/processor.h +++ b/arch/tile/include/asm/processor.h | |||
@@ -103,6 +103,18 @@ struct thread_struct { | |||
103 | /* Any other miscellaneous processor state bits */ | 103 | /* Any other miscellaneous processor state bits */ |
104 | unsigned long proc_status; | 104 | unsigned long proc_status; |
105 | #endif | 105 | #endif |
106 | #if !CHIP_HAS_FIXED_INTVEC_BASE() | ||
107 | /* Interrupt base for PL0 interrupts */ | ||
108 | unsigned long interrupt_vector_base; | ||
109 | #endif | ||
110 | #if CHIP_HAS_TILE_RTF_HWM() | ||
111 | /* Tile cache retry fifo high-water mark */ | ||
112 | unsigned long tile_rtf_hwm; | ||
113 | #endif | ||
114 | #if CHIP_HAS_DSTREAM_PF() | ||
115 | /* Data stream prefetch control */ | ||
116 | unsigned long dstream_pf; | ||
117 | #endif | ||
106 | #ifdef CONFIG_HARDWALL | 118 | #ifdef CONFIG_HARDWALL |
107 | /* Is this task tied to an activated hardwall? */ | 119 | /* Is this task tied to an activated hardwall? */ |
108 | struct hardwall_info *hardwall; | 120 | struct hardwall_info *hardwall; |
diff --git a/arch/tile/include/asm/ptrace.h b/arch/tile/include/asm/ptrace.h index acdae814e016..4a02bb073979 100644 --- a/arch/tile/include/asm/ptrace.h +++ b/arch/tile/include/asm/ptrace.h | |||
@@ -51,10 +51,7 @@ typedef uint_reg_t pt_reg_t; | |||
51 | 51 | ||
52 | /* | 52 | /* |
53 | * This struct defines the way the registers are stored on the stack during a | 53 | * This struct defines the way the registers are stored on the stack during a |
54 | * system call/exception. It should be a multiple of 8 bytes to preserve | 54 | * system call or exception. "struct sigcontext" has the same shape. |
55 | * normal stack alignment rules. | ||
56 | * | ||
57 | * Must track <sys/ucontext.h> and <sys/procfs.h> | ||
58 | */ | 55 | */ |
59 | struct pt_regs { | 56 | struct pt_regs { |
60 | /* Saved main processor registers; 56..63 are special. */ | 57 | /* Saved main processor registers; 56..63 are special. */ |
@@ -80,11 +77,6 @@ struct pt_regs { | |||
80 | 77 | ||
81 | #endif /* __ASSEMBLY__ */ | 78 | #endif /* __ASSEMBLY__ */ |
82 | 79 | ||
83 | /* Flag bits in pt_regs.flags */ | ||
84 | #define PT_FLAGS_DISABLE_IRQ 1 /* on return to kernel, disable irqs */ | ||
85 | #define PT_FLAGS_CALLER_SAVES 2 /* caller-save registers are valid */ | ||
86 | #define PT_FLAGS_RESTORE_REGS 4 /* restore callee-save regs on return */ | ||
87 | |||
88 | #define PTRACE_GETREGS 12 | 80 | #define PTRACE_GETREGS 12 |
89 | #define PTRACE_SETREGS 13 | 81 | #define PTRACE_SETREGS 13 |
90 | #define PTRACE_GETFPREGS 14 | 82 | #define PTRACE_GETFPREGS 14 |
@@ -101,6 +93,11 @@ struct pt_regs { | |||
101 | 93 | ||
102 | #ifdef __KERNEL__ | 94 | #ifdef __KERNEL__ |
103 | 95 | ||
96 | /* Flag bits in pt_regs.flags */ | ||
97 | #define PT_FLAGS_DISABLE_IRQ 1 /* on return to kernel, disable irqs */ | ||
98 | #define PT_FLAGS_CALLER_SAVES 2 /* caller-save registers are valid */ | ||
99 | #define PT_FLAGS_RESTORE_REGS 4 /* restore callee-save regs on return */ | ||
100 | |||
104 | #ifndef __ASSEMBLY__ | 101 | #ifndef __ASSEMBLY__ |
105 | 102 | ||
106 | #define instruction_pointer(regs) ((regs)->pc) | 103 | #define instruction_pointer(regs) ((regs)->pc) |
diff --git a/arch/tile/include/asm/sigcontext.h b/arch/tile/include/asm/sigcontext.h index 7cd7672e3ad4..5e2d03336f53 100644 --- a/arch/tile/include/asm/sigcontext.h +++ b/arch/tile/include/asm/sigcontext.h | |||
@@ -15,13 +15,21 @@ | |||
15 | #ifndef _ASM_TILE_SIGCONTEXT_H | 15 | #ifndef _ASM_TILE_SIGCONTEXT_H |
16 | #define _ASM_TILE_SIGCONTEXT_H | 16 | #define _ASM_TILE_SIGCONTEXT_H |
17 | 17 | ||
18 | /* NOTE: we can't include <linux/ptrace.h> due to #include dependencies. */ | 18 | #include <arch/abi.h> |
19 | #include <asm/ptrace.h> | ||
20 | |||
21 | /* Must track <sys/ucontext.h> */ | ||
22 | 19 | ||
20 | /* | ||
21 | * struct sigcontext has the same shape as struct pt_regs, | ||
22 | * but is simplified since we know the fault is from userspace. | ||
23 | */ | ||
23 | struct sigcontext { | 24 | struct sigcontext { |
24 | struct pt_regs regs; | 25 | uint_reg_t gregs[53]; /* General-purpose registers. */ |
26 | uint_reg_t tp; /* Aliases gregs[TREG_TP]. */ | ||
27 | uint_reg_t sp; /* Aliases gregs[TREG_SP]. */ | ||
28 | uint_reg_t lr; /* Aliases gregs[TREG_LR]. */ | ||
29 | uint_reg_t pc; /* Program counter. */ | ||
30 | uint_reg_t ics; /* In Interrupt Critical Section? */ | ||
31 | uint_reg_t faultnum; /* Fault number. */ | ||
32 | uint_reg_t pad[5]; | ||
25 | }; | 33 | }; |
26 | 34 | ||
27 | #endif /* _ASM_TILE_SIGCONTEXT_H */ | 35 | #endif /* _ASM_TILE_SIGCONTEXT_H */ |
diff --git a/arch/tile/include/asm/signal.h b/arch/tile/include/asm/signal.h index eb0253f32202..c1ee1d61d44c 100644 --- a/arch/tile/include/asm/signal.h +++ b/arch/tile/include/asm/signal.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm-generic/signal.h> | 24 | #include <asm-generic/signal.h> |
25 | 25 | ||
26 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) | 26 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) |
27 | struct pt_regs; | ||
27 | int restore_sigcontext(struct pt_regs *, struct sigcontext __user *, long *); | 28 | int restore_sigcontext(struct pt_regs *, struct sigcontext __user *, long *); |
28 | int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); | 29 | int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); |
29 | void do_signal(struct pt_regs *regs); | 30 | void do_signal(struct pt_regs *regs); |
diff --git a/arch/tile/include/asm/syscalls.h b/arch/tile/include/asm/syscalls.h index af165a74537f..ce99ffefeacf 100644 --- a/arch/tile/include/asm/syscalls.h +++ b/arch/tile/include/asm/syscalls.h | |||
@@ -62,10 +62,12 @@ long sys_fork(void); | |||
62 | long _sys_fork(struct pt_regs *regs); | 62 | long _sys_fork(struct pt_regs *regs); |
63 | long sys_vfork(void); | 63 | long sys_vfork(void); |
64 | long _sys_vfork(struct pt_regs *regs); | 64 | long _sys_vfork(struct pt_regs *regs); |
65 | long sys_execve(char __user *filename, char __user * __user *argv, | 65 | long sys_execve(const char __user *filename, |
66 | char __user * __user *envp); | 66 | const char __user *const __user *argv, |
67 | long _sys_execve(char __user *filename, char __user * __user *argv, | 67 | const char __user *const __user *envp); |
68 | char __user * __user *envp, struct pt_regs *regs); | 68 | long _sys_execve(const char __user *filename, |
69 | const char __user *const __user *argv, | ||
70 | const char __user *const __user *envp, struct pt_regs *regs); | ||
69 | 71 | ||
70 | /* kernel/signal.c */ | 72 | /* kernel/signal.c */ |
71 | long sys_sigaltstack(const stack_t __user *, stack_t __user *); | 73 | long sys_sigaltstack(const stack_t __user *, stack_t __user *); |
@@ -86,10 +88,13 @@ int _sys_cmpxchg_badaddr(unsigned long address, struct pt_regs *); | |||
86 | #endif | 88 | #endif |
87 | 89 | ||
88 | #ifdef CONFIG_COMPAT | 90 | #ifdef CONFIG_COMPAT |
89 | long compat_sys_execve(char __user *path, compat_uptr_t __user *argv, | 91 | long compat_sys_execve(const char __user *path, |
90 | compat_uptr_t __user *envp); | 92 | const compat_uptr_t __user *argv, |
91 | long _compat_sys_execve(char __user *path, compat_uptr_t __user *argv, | 93 | const compat_uptr_t __user *envp); |
92 | compat_uptr_t __user *envp, struct pt_regs *regs); | 94 | long _compat_sys_execve(const char __user *path, |
95 | const compat_uptr_t __user *argv, | ||
96 | const compat_uptr_t __user *envp, | ||
97 | struct pt_regs *regs); | ||
93 | long compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, | 98 | long compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, |
94 | struct compat_sigaltstack __user *uoss_ptr); | 99 | struct compat_sigaltstack __user *uoss_ptr); |
95 | long _compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, | 100 | long _compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, |