aboutsummaryrefslogtreecommitdiff
path: root/libgloss/or1k
diff options
context:
space:
mode:
authorStefan Roesch <stefan.roesch@tum.de>2016-03-10 17:50:52 +0100
committerCorinna Vinschen <corinna@vinschen.de>2016-03-13 12:50:05 +0100
commit81ad4e656a11c52e35ee72065012faf036c5140d (patch)
tree75f9fb64e8a2beaf9c25067f7a0d234745ab05e7 /libgloss/or1k
parent8c5911b37c73fa542bc9d01c1aa193538f352a9c (diff)
downloadnewlib-81ad4e656a11c52e35ee72065012faf036c5140d.zip
newlib-81ad4e656a11c52e35ee72065012faf036c5140d.tar.gz
newlib-81ad4e656a11c52e35ee72065012faf036c5140d.tar.bz2
or1k: Fix multicore stack calculation
Change the type of the stack pointers to enable pointer calculations at byte granularity, which is needed for the calculation of _or1k_stack_core[c] and _or1k_exception_stack_core[c] with _or1k_stack_size and _or1k_exception_stack_size. (util.c:53-54)
Diffstat (limited to 'libgloss/or1k')
-rw-r--r--libgloss/or1k/or1k-internals.h12
-rw-r--r--libgloss/or1k/util.c16
2 files changed, 14 insertions, 14 deletions
diff --git a/libgloss/or1k/or1k-internals.h b/libgloss/or1k/or1k-internals.h
index b24ad13..3aabdb0 100644
--- a/libgloss/or1k/or1k-internals.h
+++ b/libgloss/or1k/or1k-internals.h
@@ -6,17 +6,17 @@
#include "include/or1k-support.h"
-extern uint32_t* _or1k_stack_top;
+extern uint8_t* _or1k_stack_top;
extern size_t _or1k_stack_size;
-extern uint32_t* _or1k_stack_bottom;
+extern uint8_t* _or1k_stack_bottom;
-extern uint32_t* _or1k_exception_stack_top;
+extern uint8_t* _or1k_exception_stack_top;
extern size_t _or1k_exception_stack_size;
-extern uint32_t* _or1k_exception_stack_bottom;
+extern uint8_t* _or1k_exception_stack_bottom;
#ifdef __OR1K_MULTICORE__
-extern uint32_t* *_or1k_stack_core;
-extern uint32_t* *_or1k_exception_stack_core;
+extern uint8_t* *_or1k_stack_core;
+extern uint8_t* *_or1k_exception_stack_core;
#endif
diff --git a/libgloss/or1k/util.c b/libgloss/or1k/util.c
index 5e853f3..d2ee84d 100644
--- a/libgloss/or1k/util.c
+++ b/libgloss/or1k/util.c
@@ -24,27 +24,27 @@
#ifdef __OR1K_MULTICORE__
// Define pointers to arrays
-uint32_t* *_or1k_stack_core;
-uint32_t* *_or1k_exception_stack_core;
+uint8_t* *_or1k_stack_core;
+uint8_t* *_or1k_exception_stack_core;
uint32_t* *_or1k_exception_level;
#else
// Define scalar
uint32_t _or1k_exception_level;
#endif
-uint32_t* _or1k_stack_top;
-uint32_t* _or1k_stack_bottom;
+uint8_t* _or1k_stack_top;
+uint8_t* _or1k_stack_bottom;
-uint32_t* _or1k_exception_stack_top;
-uint32_t* _or1k_exception_stack_bottom;
+uint8_t* _or1k_exception_stack_top;
+uint8_t* _or1k_exception_stack_bottom;
void _or1k_init() {
#ifdef __OR1K_MULTICORE__
uint32_t c;
// Initialize stacks
- _or1k_stack_core = _sbrk_r(0, sizeof(uint32_t*) * or1k_numcores());
- _or1k_exception_stack_core = _sbrk_r(0, sizeof(uint32_t*) * or1k_numcores());
+ _or1k_stack_core = _sbrk_r(0, sizeof(uint8_t*) * or1k_numcores());
+ _or1k_exception_stack_core = _sbrk_r(0, sizeof(uint8_t*) * or1k_numcores());
_or1k_stack_core[0] = _or1k_stack_top;
_or1k_exception_stack_core[0] = _or1k_exception_stack_top;