aboutsummaryrefslogtreecommitdiffstats
path: root/ports
diff options
context:
space:
mode:
Diffstat (limited to 'ports')
-rw-r--r--ports/ARM7-AT91SAM7X/chcore.c3
-rw-r--r--ports/ARM7-AT91SAM7X/crt0.s3
-rw-r--r--ports/ARM7-LPC214x/chcore.c5
-rw-r--r--ports/ARM7-LPC214x/crt0.s3
4 files changed, 9 insertions, 5 deletions
diff --git a/ports/ARM7-AT91SAM7X/chcore.c b/ports/ARM7-AT91SAM7X/chcore.c
index 053cc4831..af8bad20f 100644
--- a/ports/ARM7-AT91SAM7X/chcore.c
+++ b/ports/ARM7-AT91SAM7X/chcore.c
@@ -46,7 +46,8 @@ __attribute__((naked, weak))
void chSysHalt(void) {
#ifdef THUMB
- asm("b _halt16");
+ asm volatile ("ldr r0, =_halt16");
+ asm volatile ("bx r0");
#else
asm("b _halt32");
#endif
diff --git a/ports/ARM7-AT91SAM7X/crt0.s b/ports/ARM7-AT91SAM7X/crt0.s
index 73f84319c..dcee3587c 100644
--- a/ports/ARM7-AT91SAM7X/crt0.s
+++ b/ports/ARM7-AT91SAM7X/crt0.s
@@ -32,7 +32,7 @@
.equ I_BIT, 0x80
.equ F_BIT, 0x40
-.text
+.section .startup
.code 32
.balign 4
/*
@@ -66,6 +66,7 @@ _fiq:
/*
* Reset handler.
*/
+.text
ResetHandler:
/*
* Stack pointers initialization.
diff --git a/ports/ARM7-LPC214x/chcore.c b/ports/ARM7-LPC214x/chcore.c
index fb627500b..8803c47e3 100644
--- a/ports/ARM7-LPC214x/chcore.c
+++ b/ports/ARM7-LPC214x/chcore.c
@@ -46,8 +46,9 @@ __attribute__((naked, weak))
void chSysHalt(void) {
#ifdef THUMB
- asm("b _halt16");
+ asm volatile ("ldr r0, =_halt16");
+ asm volatile ("bx r0");
#else
- asm("b _halt32");
+ asm volatile ("b _halt32");
#endif
}
diff --git a/ports/ARM7-LPC214x/crt0.s b/ports/ARM7-LPC214x/crt0.s
index 3aea74abf..ca81adb55 100644
--- a/ports/ARM7-LPC214x/crt0.s
+++ b/ports/ARM7-LPC214x/crt0.s
@@ -32,7 +32,7 @@
.equ I_BIT, 0x80
.equ F_BIT, 0x40
-.text
+.section .startup
.code 32
.balign 4
/*
@@ -66,6 +66,7 @@ _fiq:
/*
* Reset handler.
*/
+.text
ResetHandler:
/*
* Stack pointers initialization.