This commit is contained in:
NIIBE Yutaka
2012-05-26 12:50:23 +09:00
parent 1e9b73de49
commit 7dd703c28b
2 changed files with 9 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2012-05-26 Niibe Yutaka <gniibe@fsij.org>
* src/sys.c (reset): Set SCR->VCR here.
2012-05-25 Niibe Yutaka <gniibe@fsij.org>
* src/gnuk.ld.in (.sys): New section.

View File

@@ -247,6 +247,11 @@ static void __attribute__ ((naked))
reset (void)
{
asm volatile ("cpsid i\n\t" /* Mask all interrupts */
"mov.w r0, #0xed00\n\t" /* SCR */
"movt r0, #0xe000\n\t"
"mov.w r1, #0x1000\n\t" /* 08001000 */
"movt r1, #0x0800\n\t"
"str r1, [r0, #8]\n\t" /* SCR->VCR = 0x08001000 */
"ldr r0, =_text\n\t"
"ldr r1, [r0], #4\n\t"
"msr MSP, r1\n\t" /* Main (exception handler) stack */