aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/thread_info.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 05:22:14 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 05:22:14 -0400
commita6a31139897a5e539efe7ad3b7bd351fa9673ce8 (patch)
tree6e2ad11d93ab95214694038080c79284c6da30d6 /include/asm-sh/thread_info.h
parent2cb7ce3bb384f30a377f66336c78546b834604df (diff)
sh: Add support for 4K stacks.
This enables support for 4K stacks on SH. Currently this depends on DEBUG_KERNEL, but likely all boards will switch to this as the default in the future. 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.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
index 605259f88113..3ebc3f9039eb 100644
--- a/include/asm-sh/thread_info.h
+++ b/include/asm-sh/thread_info.h
@@ -9,8 +9,8 @@
9 * Copyright (C) 2002 David Howells (dhowells@redhat.com) 9 * Copyright (C) 2002 David Howells (dhowells@redhat.com)
10 * - Incorporating suggestions made by Linus Torvalds and Dave Miller 10 * - Incorporating suggestions made by Linus Torvalds and Dave Miller
11 */ 11 */
12
13#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <asm/page.h>
14 14
15#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
16#include <asm/processor.h> 16#include <asm/processor.h>
@@ -23,13 +23,20 @@ struct thread_info {
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 mm_segment_t addr_limit; /* thread address space */
25 struct restart_block restart_block; 25 struct restart_block restart_block;
26 unsigned long previous_sp; /* sp of previous stack in case
27 of nested IRQ stacks */
26 __u8 supervisor_stack[0]; 28 __u8 supervisor_stack[0];
27}; 29};
28 30
29#endif 31#endif
30 32
31#define PREEMPT_ACTIVE 0x10000000 33#define PREEMPT_ACTIVE 0x10000000
34
35#ifdef CONFIG_4KSTACKS
36#define THREAD_SIZE (PAGE_SIZE)
37#else
32#define THREAD_SIZE (PAGE_SIZE * 2) 38#define THREAD_SIZE (PAGE_SIZE * 2)
39#endif
33#define STACK_WARN (THREAD_SIZE / 8) 40#define STACK_WARN (THREAD_SIZE / 8)
34 41
35/* 42/*
@@ -52,6 +59,9 @@ struct thread_info {
52#define init_thread_info (init_thread_union.thread_info) 59#define init_thread_info (init_thread_union.thread_info)
53#define init_stack (init_thread_union.stack) 60#define init_stack (init_thread_union.stack)
54 61
62/* how to get the current stack pointer from C */
63register unsigned long current_stack_pointer asm("r15") __attribute_used__;
64
55/* how to get the thread information struct from C */ 65/* how to get the thread information struct from C */
56static inline struct thread_info *current_thread_info(void) 66static inline struct thread_info *current_thread_info(void)
57{ 67{