aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/thread_info.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 04:07:07 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 04:07:07 -0400
commit2991be725260d6fec11691a6138b9d71de949956 (patch)
tree407241b126eed902bacba4e02043930c6ce087b4 /include/asm-sh/thread_info.h
parent0f08f338083cc1d68788ccbccc44bd0502fc57ae (diff)
sh: Fixup __strnlen_user() behaviour.
Drop TIF_USERSPACE and add addr_limit to the thread_info struct. Subsequently, use that for address checking in strnlen_user() to ward off bogus -EFAULTs. Make __strnlen_user() return 0 on exception, rather than -EFAULT. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/thread_info.h')
-rw-r--r--include/asm-sh/thread_info.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
index f64dd803a014..b986a1914472 100644
--- a/include/asm-sh/thread_info.h
+++ b/include/asm-sh/thread_info.h
@@ -21,6 +21,7 @@ struct thread_info {
21 unsigned long flags; /* low level flags */ 21 unsigned long flags; /* low level flags */
22 __u32 cpu; 22 __u32 cpu;
23 int preempt_count; /* 0 => preemptable, <0 => BUG */ 23 int preempt_count; /* 0 => preemptable, <0 => BUG */
24 mm_segment_t addr_limit; /* thread address space */
24 struct restart_block restart_block; 25 struct restart_block restart_block;
25 __u8 supervisor_stack[0]; 26 __u8 supervisor_stack[0];
26}; 27};
@@ -40,6 +41,7 @@ struct thread_info {
40 .flags = 0, \ 41 .flags = 0, \
41 .cpu = 0, \ 42 .cpu = 0, \
42 .preempt_count = 1, \ 43 .preempt_count = 1, \
44 .addr_limit = KERNEL_DS, \
43 .restart_block = { \ 45 .restart_block = { \
44 .fn = do_no_restart_syscall, \ 46 .fn = do_no_restart_syscall, \
45 }, \ 47 }, \
@@ -95,7 +97,6 @@ static inline struct thread_info *current_thread_info(void)
95#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 97#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
96#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 98#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
97#define TIF_MEMDIE 18 99#define TIF_MEMDIE 18
98#define TIF_USERSPACE 31 /* true if FS sets userspace */
99 100
100#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 101#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
101#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 102#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -103,7 +104,6 @@ static inline struct thread_info *current_thread_info(void)
103#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 104#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
104#define _TIF_USEDFPU (1<<TIF_USEDFPU) 105#define _TIF_USEDFPU (1<<TIF_USEDFPU)
105#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 106#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
106#define _TIF_USERSPACE (1<<TIF_USERSPACE)
107 107
108#define _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */ 108#define _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */
109#define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */ 109#define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */