Introduce __exception_text_start and __exception_text_end. Initialize EBA
with __exception_text_start.

Signed-off-by: Michael Walle <mich...@walle.cc>
---
 arch/lm32/include/asm/sections.h |    9 +++++++++
 arch/lm32/kernel/traps.c         |   10 ++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/arch/lm32/include/asm/sections.h b/arch/lm32/include/asm/sections.h
index 2b8c516..6d3410b 100644
--- a/arch/lm32/include/asm/sections.h
+++ b/arch/lm32/include/asm/sections.h
@@ -1 +1,10 @@
+#ifndef _ASM_LM32_SECTIONS_H
+#define _ASM_LM32_SECTIONS_H
+
 #include <asm-generic/sections.h>
+
+#ifndef __ASSEMBLY__
+extern char __exception_text_start[], __exception_text_end[];
+#endif /* __ASSEMBLY__ */
+
+#endif /* _ASM_LM32_SECTIONS_H */
diff --git a/arch/lm32/kernel/traps.c b/arch/lm32/kernel/traps.c
index 9676bde..c605580 100644
--- a/arch/lm32/kernel/traps.c
+++ b/arch/lm32/kernel/traps.c
@@ -35,17 +35,11 @@
 #include <linux/module.h>
 
 #include <asm/system.h>
-#include <asm/traps.h>
-
-extern unsigned long  reset_handler;
+#include <asm/sections.h>
 
 void __init trap_init(void)
 {
-  void*  exception_vectors = &reset_handler;
-
-       if( ((unsigned long)&reset_handler % 256) != 0 )
-               printk(KERN_ERR "exception vectors are not aligned to 256 
bytes!\n");
-  asm volatile ( "wcsr EBA, %0" : : "r"(exception_vectors) );
+       __asm__ __volatile__("wcsr EBA, %0" : : "r"(__exception_text_start));
 }
 
 int kstack_depth_to_print = 48;
-- 
1.7.2.3

_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode
Twitter: www.twitter.com/milkymistvj
Ideas? http://milkymist.uservoice.com

Reply via email to