summaryrefslogtreecommitdiffstats
path: root/libgloss/or1k/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/or1k/util.c')
-rw-r--r--libgloss/or1k/util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libgloss/or1k/util.c b/libgloss/or1k/util.c
index 74071719e..5e853f359 100644
--- a/libgloss/or1k/util.c
+++ b/libgloss/or1k/util.c
@@ -23,8 +23,13 @@
#include "or1k-internals.h"
#ifdef __OR1K_MULTICORE__
+// Define pointers to arrays
uint32_t* *_or1k_stack_core;
uint32_t* *_or1k_exception_stack_core;
+uint32_t* *_or1k_exception_level;
+#else
+// Define scalar
+uint32_t _or1k_exception_level;
#endif
uint32_t* _or1k_stack_top;
@@ -68,6 +73,15 @@ void _or1k_init() {
#else
_or1k_exception_handler_table[6] = _or1k_interrupt_handler;
#endif
+
+#ifdef __OR1K_MULTICORE__
+ _or1k_exception_level = _sbrk_r(0, 4 * or1k_numcores());
+ for (c = 0; c < or1k_numcores(); c++) {
+ _or1k_exception_level[c] = 0;
+ }
+#else
+ _or1k_exception_level = 0;
+#endif
}
uint32_t or1k_critical_begin() {