Let's not mess around with SP.

This commit is contained in:
László Monda
2017-06-04 23:03:50 +02:00
parent 96b12aa69d
commit a6ed51360f

View File

@@ -1,16 +1,3 @@
#include "wormhole.h"
wormhole_t *Wormhole NO_INIT_GCC;
void* getSP(void)
{
void *sp;
__asm__ __volatile__ ("mov %0, sp" : "=r"(sp));
return sp;
}
void __attribute__ ((__section__ (".init3"), __naked__)) move_sp(void) {
void* SP = getSP();
SP -= sizeof(wormhole_t);
Wormhole = (wormhole_t*)(SP + 1);
}