[ion] Set stack pointer when testing as well

Change-Id: Ibeae7961535208c224f9ac51f4cf33e3978665b3
This commit is contained in:
Hugo Saint-Vignes
2020-09-10 18:12:40 +02:00
committed by Émilie Feral
parent e199143412
commit 688394abce
5 changed files with 35 additions and 18 deletions

View File

@@ -2,19 +2,6 @@
#include "global_preferences.h"
#include <poincare/init.h>
#if PLATFORM_DEVICE
// On device, stack start address is always known. TODO : Factorize address
static void * s_stackStart = reinterpret_cast<void *>(0x20000000 + 256*1024);
#else
// Stack start will be defined in ion_main.
static void * s_stackStart = nullptr;
#endif
void * Ion::stackStart() {
assert(s_stackStart != nullptr);
return s_stackStart;
}
#define DUMMY_MAIN 0
#if DUMMY_MAIN
@@ -80,7 +67,7 @@ void ion_main(int argc, const char * const argv[]) {
* example, stack pointer could go backward after initialization and allocated
* memory pointers could be overlooked during mark procedure. */
volatile int stackTop;
s_stackStart = (void *)(&stackTop);
Ion::setStackStart((void *)(&stackTop));
#endif
AppsContainer::sharedAppsContainer()->run();