summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 18:22:14 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 18:22:14 +0900
commita6a31139897a5e539efe7ad3b7bd351fa9673ce8 (patch)
tree6e2ad11d93ab95214694038080c79284c6da30d6 /include
parent2cb7ce3bb384f30a377f66336c78546b834604df (diff)
downloadop-kernel-dev-a6a31139897a5e539efe7ad3b7bd351fa9673ce8.zip
op-kernel-dev-a6a31139897a5e539efe7ad3b7bd351fa9673ce8.tar.gz
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')
-rw-r--r--include/asm-sh/irq.h9
-rw-r--r--include/asm-sh/thread_info.h12
2 files changed, 20 insertions, 1 deletions
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index dd05e10..0e5f365 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -719,6 +719,15 @@ static inline int generic_irq_demux(int irq)
#define irq_canonicalize(irq) (irq)
#define irq_demux(irq) __irq_demux(sh_mv.mv_irq_demux(irq))
+#ifdef CONFIG_4KSTACKS
+extern void irq_ctx_init(int cpu);
+extern void irq_ctx_exit(int cpu);
+# define __ARCH_HAS_DO_SOFTIRQ
+#else
+# define irq_ctx_init(cpu) do { } while (0)
+# define irq_ctx_exit(cpu) do { } while (0)
+#endif
+
#if defined(CONFIG_CPU_SUBTYPE_SH73180)
#include <asm/irq-sh73180.h>
#endif
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
index 605259f..3ebc3f9 100644
--- a/include/asm-sh/thread_info.h
+++ b/include/asm-sh/thread_info.h
@@ -9,8 +9,8 @@
* Copyright (C) 2002 David Howells (dhowells@redhat.com)
* - Incorporating suggestions made by Linus Torvalds and Dave Miller
*/
-
#ifdef __KERNEL__
+#include <asm/page.h>
#ifndef __ASSEMBLY__
#include <asm/processor.h>
@@ -23,13 +23,20 @@ struct thread_info {
int preempt_count; /* 0 => preemptable, <0 => BUG */
mm_segment_t addr_limit; /* thread address space */
struct restart_block restart_block;
+ unsigned long previous_sp; /* sp of previous stack in case
+ of nested IRQ stacks */
__u8 supervisor_stack[0];
};
#endif
#define PREEMPT_ACTIVE 0x10000000
+
+#ifdef CONFIG_4KSTACKS
+#define THREAD_SIZE (PAGE_SIZE)
+#else
#define THREAD_SIZE (PAGE_SIZE * 2)
+#endif
#define STACK_WARN (THREAD_SIZE / 8)
/*
@@ -52,6 +59,9 @@ struct thread_info {
#define init_thread_info (init_thread_union.thread_info)
#define init_stack (init_thread_union.stack)
+/* how to get the current stack pointer from C */
+register unsigned long current_stack_pointer asm("r15") __attribute_used__;
+
/* how to get the thread information struct from C */
static inline struct thread_info *current_thread_info(void)
{
OpenPOWER on IntegriCloud