summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/lcd-as-e200v2-fuze-fuzev2.S4
-rw-r--r--firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S3
-rw-r--r--firmware/target/arm/ata-as-arm.S8
-rw-r--r--firmware/target/arm/ipod/lcd-as-gray.S8
-rw-r--r--firmware/target/arm/ipod/video/lcd-as-video.S6
-rw-r--r--firmware/target/arm/iriver/h10/lcd-as-h10.S4
-rw-r--r--firmware/target/arm/lcd-as-memframe.S6
-rw-r--r--firmware/target/arm/memcpy-arm.S2
-rw-r--r--firmware/target/arm/memmove-arm.S2
-rw-r--r--firmware/target/arm/memset-arm.S2
-rw-r--r--firmware/target/arm/memset16-arm.S2
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S2
-rw-r--r--firmware/target/arm/pbell/vibe500/lcd-as-vibe500.S4
-rw-r--r--firmware/target/arm/pcm-pp.c11
-rw-r--r--firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S4
-rw-r--r--firmware/target/arm/samsung/yh820/lcd-as-yh820.S4
-rw-r--r--firmware/target/arm/samsung/yh920/lcd-as-yh920.S2
-rw-r--r--firmware/target/arm/samsung/yh925/lcd-as-yh925.S4
-rw-r--r--firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S4
-rw-r--r--firmware/target/arm/thread-arm.c10
20 files changed, 54 insertions, 38 deletions
diff --git a/firmware/target/arm/as3525/lcd-as-e200v2-fuze-fuzev2.S b/firmware/target/arm/as3525/lcd-as-e200v2-fuze-fuzev2.S
index f71216c674..690641c850 100644
--- a/firmware/target/arm/as3525/lcd-as-e200v2-fuze-fuzev2.S
+++ b/firmware/target/arm/as3525/lcd-as-e200v2-fuze-fuzev2.S
@@ -241,7 +241,7 @@ lcd_write_yuv420_lines:
241 tst r7, #DBOP_BUSY @ fifo not empty? 241 tst r7, #DBOP_BUSY @ fifo not empty?
242 beq 1b @ 242 beq 1b @
243 243
244 ldmfd sp!, { r4-r11, pc } @ restore registers and return 244 ldmpc regs=r4-r11 @ restore registers and return
245 .ltorg @ dump constant pool 245 .ltorg @ dump constant pool
246 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 246 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
247 247
@@ -545,6 +545,6 @@ lcd_write_yuv420_lines_odither:
545 tst r7, #DBOP_BUSY @ fifo not empty? 545 tst r7, #DBOP_BUSY @ fifo not empty?
546 beq 1b @ 546 beq 1b @
547 547
548 ldmfd sp!, { r4-r11, pc } @ restore registers and return 548 ldmpc regs=r4-r11 @ restore registers and return
549 .ltorg @ dump constant pool 549 .ltorg @ dump constant pool
550 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 550 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S b/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
index 942ddf79f8..431dc62da0 100644
--- a/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
+++ b/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
@@ -19,6 +19,7 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "config.h"
22#include "as3525.h" 23#include "as3525.h"
23 24
24 .text 25 .text
@@ -90,5 +91,5 @@ lcd_grey_data:
90 ands r5, r5, #(1<<10) @ wait until push fifo empties 91 ands r5, r5, #(1<<10) @ wait until push fifo empties
91 beq 1b 92 beq 1b
92 93
93 ldmfd sp!, {r4-r7, pc} 94 ldmpc regs=r4-r7
94 .size lcd_grey_data,.-lcd_grey_data 95 .size lcd_grey_data,.-lcd_grey_data
diff --git a/firmware/target/arm/ata-as-arm.S b/firmware/target/arm/ata-as-arm.S
index b1cafc2221..101bc4dcc1 100644
--- a/firmware/target/arm/ata-as-arm.S
+++ b/firmware/target/arm/ata-as-arm.S
@@ -146,7 +146,7 @@ copy_read_sectors:
146 146
147 strb r3, [r0], #1 /* store final byte */ 147 strb r3, [r0], #1 /* store final byte */
148 148
149 ldmfd sp!, {r4, r5, pc} 149 ldmpc regs=r4-r5
150 150
151 /* 16-bit aligned */ 151 /* 16-bit aligned */
152.r_aligned: 152.r_aligned:
@@ -195,7 +195,7 @@ copy_read_sectors:
195 ldrneh r3, [r2] 195 ldrneh r3, [r2]
196 strneh r3, [r0], #2 196 strneh r3, [r0], #2
197 197
198 ldmfd sp!, {r4, r5, pc} 198 ldmpc regs=r4-r5
199 199
200.r_end: 200.r_end:
201 .size copy_read_sectors,.r_end-copy_read_sectors 201 .size copy_read_sectors,.r_end-copy_read_sectors
@@ -300,7 +300,7 @@ copy_write_sectors:
300 orr r3, r3, r4, lsl #8 300 orr r3, r3, r4, lsl #8
301 strh r3, [r2] /* write final halfword */ 301 strh r3, [r2] /* write final halfword */
302 302
303 ldmfd sp!, {r4, r5, pc} 303 ldmpc regs=r4-r5
304 304
305 /* 16-bit aligned */ 305 /* 16-bit aligned */
306.w_aligned: 306.w_aligned:
@@ -349,7 +349,7 @@ copy_write_sectors:
349 ldrneh r3, [r0], #2 349 ldrneh r3, [r0], #2
350 strneh r3, [r2] 350 strneh r3, [r2]
351 351
352 ldmfd sp!, {r4, r5, pc} 352 ldmpc regs=r4-r5
353 353
354.w_end: 354.w_end:
355 .size copy_write_sectors,.w_end-copy_write_sectors 355 .size copy_write_sectors,.w_end-copy_write_sectors
diff --git a/firmware/target/arm/ipod/lcd-as-gray.S b/firmware/target/arm/ipod/lcd-as-gray.S
index 1364c1f965..cfd179a714 100644
--- a/firmware/target/arm/ipod/lcd-as-gray.S
+++ b/firmware/target/arm/ipod/lcd-as-gray.S
@@ -97,7 +97,7 @@ lcd_write_data_shifted:
97 subs r1, r1, #1 97 subs r1, r1, #1
98 bne .sloop 98 bne .sloop
99 99
100 ldmfd sp!, {r4, pc} 100 ldmpc regs=r4
101 .size lcd_write_data_shifted,.-lcd_write_data_shifted 101 .size lcd_write_data_shifted,.-lcd_write_data_shifted
102 102
103#elif defined IPOD_MINI 103#elif defined IPOD_MINI
@@ -132,7 +132,7 @@ lcd_write_data_shifted:
132 subs r1, r1, #1 132 subs r1, r1, #1
133 bne .sloop 133 bne .sloop
134 134
135 ldr pc, [sp], #4 135 ldrpc
136 .size lcd_write_data_shifted,.-lcd_write_data_shifted 136 .size lcd_write_data_shifted,.-lcd_write_data_shifted
137 137
138#endif 138#endif
@@ -179,7 +179,7 @@ lcd_mono_data:
179 subs r1, r1, #1 179 subs r1, r1, #1
180 bne .mloop 180 bne .mloop
181 181
182 ldmfd sp!, {r4, pc} 182 ldmpc regs=r4
183 183
184.dibits: 184.dibits:
185 .byte 0x00, 0x03, 0x0C, 0x0F, 0x30, 0x33, 0x3C, 0x3F 185 .byte 0x00, 0x03, 0x0C, 0x0F, 0x30, 0x33, 0x3C, 0x3F
@@ -267,6 +267,6 @@ lcd_grey_data:
267 subs r2, r2, #1 267 subs r2, r2, #1
268 bne .greyloop 268 bne .greyloop
269 269
270 ldmfd sp!, {r4-r7, pc} 270 ldmpc regs=r4-r7
271 .size lcd_grey_data,.-lcd_grey_data 271 .size lcd_grey_data,.-lcd_grey_data
272 272
diff --git a/firmware/target/arm/ipod/video/lcd-as-video.S b/firmware/target/arm/ipod/video/lcd-as-video.S
index fa88dbc940..47155b8c75 100644
--- a/firmware/target/arm/ipod/video/lcd-as-video.S
+++ b/firmware/target/arm/ipod/video/lcd-as-video.S
@@ -19,6 +19,8 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "config.h"
23
22 .section .icode, "ax", %progbits 24 .section .icode, "ax", %progbits
23 25
24/**************************************************************************** 26/****************************************************************************
@@ -60,7 +62,7 @@ lcd_write_data: /* r1 = pixel count, must be even */
60 ldrne r3, [r0], #4 62 ldrne r3, [r0], #4
61 strne r3, [lr] 63 strne r3, [lr]
62 64
63 ldmfd sp!, {r4, pc} 65 ldmpc regs=r4
64 66
65/**************************************************************************** 67/****************************************************************************
66 * extern void lcd_write_yuv420_lines(unsigned char const * const src[3], 68 * extern void lcd_write_yuv420_lines(unsigned char const * const src[3],
@@ -294,7 +296,7 @@ lcd_write_yuv420_lines:
294 296
295 ldr r3, [sp, #12] 297 ldr r3, [sp, #12]
296 add sp, sp, r3 /* deallocate buffer */ 298 add sp, sp, r3 /* deallocate buffer */
297 ldmfd sp!, { r4-r10, pc } /* restore registers */ 299 ldmpc regs=r4-r10 /* restore registers */
298 300
299 .ltorg 301 .ltorg
300 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 302 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
diff --git a/firmware/target/arm/iriver/h10/lcd-as-h10.S b/firmware/target/arm/iriver/h10/lcd-as-h10.S
index b3f12e46b6..8e851d8441 100644
--- a/firmware/target/arm/iriver/h10/lcd-as-h10.S
+++ b/firmware/target/arm/iriver/h10/lcd-as-h10.S
@@ -232,7 +232,7 @@ lcd_write_yuv420_lines:
232 subs r1, r1, #2 @ subtract block from width 232 subs r1, r1, #2 @ subtract block from width
233 bgt 10b @ loop line @ 233 bgt 10b @ loop line @
234 @ 234 @
235 ldmfd sp!, { r4-r11, pc } @ restore registers and return 235 ldmpc regs=r4-r11 @ restore registers and return
236 .ltorg @ dump constant pool 236 .ltorg @ dump constant pool
237 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 237 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
238 238
@@ -533,6 +533,6 @@ lcd_write_yuv420_lines_odither:
533 subs r1, r1, #2 @ subtract block from width 533 subs r1, r1, #2 @ subtract block from width
534 bgt 10b @ loop line @ 534 bgt 10b @ loop line @
535 @ 535 @
536 ldmfd sp!, { r4-r11, pc } @ restore registers and return 536 ldmpc regs=r4-r11 @ restore registers and return
537 .ltorg @ dump constant pool 537 .ltorg @ dump constant pool
538 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 538 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/lcd-as-memframe.S b/firmware/target/arm/lcd-as-memframe.S
index 4532bab221..87cbb611ca 100644
--- a/firmware/target/arm/lcd-as-memframe.S
+++ b/firmware/target/arm/lcd-as-memframe.S
@@ -101,7 +101,7 @@ lcd_copy_buffer_rect: @
101 add r0, r0, r4, lsl #1 @ 101 add r0, r0, r4, lsl #1 @
102 subs r3, r3, #1 @ next line 102 subs r3, r3, #1 @ next line
103 bgt 10b @ copy line @ 103 bgt 10b @ copy line @
104 ldmfd sp!, { r4-r11, pc } @ restore regs and return 104 ldmpc regs=r4-r11 @ restore regs and return
105 .ltorg @ dump constant pool 105 .ltorg @ dump constant pool
106 .size lcd_copy_buffer_rect, .-lcd_copy_buffer_rect 106 .size lcd_copy_buffer_rect, .-lcd_copy_buffer_rect
107 107
@@ -344,7 +344,7 @@ lcd_write_yuv420_lines:
344 subs r2, r2, #2 @ subtract block from width 344 subs r2, r2, #2 @ subtract block from width
345 bgt 10b @ loop line @ 345 bgt 10b @ loop line @
346 @ 346 @
347 ldmfd sp!, { r4-r10, pc } @ restore registers and return 347 ldmpc regs=r4-r10 @ restore registers and return
348 .ltorg @ dump constant pool 348 .ltorg @ dump constant pool
349 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 349 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
350 350
@@ -691,6 +691,6 @@ lcd_write_yuv420_lines_odither:
691 subs r2, r2, #2 @ subtract block from width 691 subs r2, r2, #2 @ subtract block from width
692 bgt 10b @ loop line @ 692 bgt 10b @ loop line @
693 @ 693 @
694 ldmfd sp!, { r4-r11, pc } @ restore registers and return 694 ldmpc regs=r4-r11 @ restore registers and return
695 .ltorg @ dump constant pool 695 .ltorg @ dump constant pool
696 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 696 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/memcpy-arm.S b/firmware/target/arm/memcpy-arm.S
index d17d659a28..2a55fb5656 100644
--- a/firmware/target/arm/memcpy-arm.S
+++ b/firmware/target/arm/memcpy-arm.S
@@ -98,7 +98,7 @@ memcpy:
98 strcsb r4, [r0], #1 98 strcsb r4, [r0], #1
99 strcsb ip, [r0] 99 strcsb ip, [r0]
100 100
101 ldmfd sp!, {r0, r4, pc} 101 ldmpc regs="r0, r4"
102 102
1039: rsb ip, ip, #4 1039: rsb ip, ip, #4
104 cmp ip, #2 104 cmp ip, #2
diff --git a/firmware/target/arm/memmove-arm.S b/firmware/target/arm/memmove-arm.S
index ce056d956b..d8cab048be 100644
--- a/firmware/target/arm/memmove-arm.S
+++ b/firmware/target/arm/memmove-arm.S
@@ -112,7 +112,7 @@ memmove:
112 strneb r3, [r0, #-1]! 112 strneb r3, [r0, #-1]!
113 strcsb r4, [r0, #-1]! 113 strcsb r4, [r0, #-1]!
114 strcsb ip, [r0, #-1] 114 strcsb ip, [r0, #-1]
115 ldmfd sp!, {r0, r4, pc} 115 ldmpc regs="r0, r4"
116 116
1179: cmp ip, #2 1179: cmp ip, #2
118 ldrgtb r3, [r1, #-1]! 118 ldrgtb r3, [r1, #-1]!
diff --git a/firmware/target/arm/memset-arm.S b/firmware/target/arm/memset-arm.S
index 5dbde7a1d7..682da874ce 100644
--- a/firmware/target/arm/memset-arm.S
+++ b/firmware/target/arm/memset-arm.S
@@ -69,7 +69,7 @@ memset:
69 stmgedb r0!, {r1, r3, ip, lr} 69 stmgedb r0!, {r1, r3, ip, lr}
70 stmgedb r0!, {r1, r3, ip, lr} 70 stmgedb r0!, {r1, r3, ip, lr}
71 bgt 3b 71 bgt 3b
72 ldreq pc, [sp], #4 @ Now <64 bytes to go. 72 ldrpc cond=eq @ Now <64 bytes to go.
73/* 73/*
74 * No need to correct the count; we're only testing bits from now on 74 * No need to correct the count; we're only testing bits from now on
75 */ 75 */
diff --git a/firmware/target/arm/memset16-arm.S b/firmware/target/arm/memset16-arm.S
index 63d626480e..5c787b1bed 100644
--- a/firmware/target/arm/memset16-arm.S
+++ b/firmware/target/arm/memset16-arm.S
@@ -59,7 +59,7 @@ memset16:
59 stmgeia r0!, {r1, r3, ip, lr} 59 stmgeia r0!, {r1, r3, ip, lr}
60 stmgeia r0!, {r1, r3, ip, lr} 60 stmgeia r0!, {r1, r3, ip, lr}
61 bgt 2b 61 bgt 2b
62 ldreq pc, [sp], #4 @ Now <64 bytes to go. 62 ldrpc cond=eq @ Now <64 bytes to go.
63/* 63/*
64 * No need to correct the count; we're only testing bits from now on 64 * No need to correct the count; we're only testing bits from now on
65 */ 65 */
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S b/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
index 6db6c7efad..09778014c1 100644
--- a/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
@@ -99,6 +99,6 @@ lcd_grey_data:
99 subs r2, r2, #1 99 subs r2, r2, #1
100 bne .greyloop 100 bne .greyloop
101 101
102 ldmfd sp!, {r4-r7, pc} 102 ldmpc regs=r4-r7
103 .size lcd_grey_data,.-lcd_grey_data 103 .size lcd_grey_data,.-lcd_grey_data
104 104
diff --git a/firmware/target/arm/pbell/vibe500/lcd-as-vibe500.S b/firmware/target/arm/pbell/vibe500/lcd-as-vibe500.S
index d5d51575a7..9079be6aa7 100644
--- a/firmware/target/arm/pbell/vibe500/lcd-as-vibe500.S
+++ b/firmware/target/arm/pbell/vibe500/lcd-as-vibe500.S
@@ -243,7 +243,7 @@ lcd_write_yuv420_lines:
243 subs r1, r1, #2 @ subtract block from width 243 subs r1, r1, #2 @ subtract block from width
244 bgt 10b @ loop line @ 244 bgt 10b @ loop line @
245 @ 245 @
246 ldmfd sp!, { r4-r11, pc } @ restore registers and return 246 ldmpc regs=r4-r11 @ restore registers and return
247 .ltorg @ dump constant pool 247 .ltorg @ dump constant pool
248 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 248 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
249 249
@@ -551,6 +551,6 @@ lcd_write_yuv420_lines_odither:
551 subs r1, r1, #2 @ subtract block from width 551 subs r1, r1, #2 @ subtract block from width
552 bgt 10b @ loop line @ 552 bgt 10b @ loop line @
553 @ 553 @
554 ldmfd sp!, { r4-r11, pc } @ restore registers and return 554 ldmpc regs=r4-r11 @ restore registers and return
555 .ltorg @ dump constant pool 555 .ltorg @ dump constant pool
556 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 556 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c
index 6289b4c730..bffc69f771 100644
--- a/firmware/target/arm/pcm-pp.c
+++ b/firmware/target/arm/pcm-pp.c
@@ -74,9 +74,14 @@ void fiq_handler(void) ICODE_ATTR __attribute__((naked));
74void fiq_handler(void) 74void fiq_handler(void)
75{ 75{
76 asm volatile ( 76 asm volatile (
77 "ldr pc, [pc, #-4] \n" 77#if ARM_ARCH == 4 && defined(USE_THUMB)
78 "fiq_function: \n" 78 "ldr r12, [pc, #-4] \n"
79 ".word 0 \n" 79 "bx r12 \n"
80#else
81 "ldr pc, [pc, #-4] \n"
82#endif
83 "fiq_function: \n"
84 ".word 0 \n"
80 ); 85 );
81} 86}
82 87
diff --git a/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S b/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
index 73ad84ae45..7be807ae98 100644
--- a/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
+++ b/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
@@ -248,7 +248,7 @@ lcd_write_yuv420_lines:
248 subs r1, r1, #2 @ subtract block from width 248 subs r1, r1, #2 @ subtract block from width
249 bgt 10b @ loop line @ 249 bgt 10b @ loop line @
250 @ 250 @
251 ldmfd sp!, { r4-r11, pc } @ restore registers and return 251 ldmpc regs=r4-r11 @ restore registers and return
252 .ltorg @ dump constant pool 252 .ltorg @ dump constant pool
253 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 253 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
254 254
@@ -565,6 +565,6 @@ lcd_write_yuv420_lines_odither:
565 subs r1, r1, #2 @ subtract block from width 565 subs r1, r1, #2 @ subtract block from width
566 bgt 10b @ loop line @ 566 bgt 10b @ loop line @
567 @ 567 @
568 ldmfd sp!, { r4-r11, pc } @ restore registers and return 568 ldmpc regs=r4-r11 @ restore registers and return
569 .ltorg @ dump constant pool 569 .ltorg @ dump constant pool
570 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 570 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/samsung/yh820/lcd-as-yh820.S b/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
index 581a4f3fc3..d8dfccc37b 100644
--- a/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
+++ b/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
@@ -238,7 +238,7 @@ lcd_write_yuv420_lines:
238 subs r1, r1, #2 @ subtract block from width 238 subs r1, r1, #2 @ subtract block from width
239 bgt 10b @ loop line @ 239 bgt 10b @ loop line @
240 @ 240 @
241 ldmfd sp!, { r4-r10, pc } @ restore registers and return 241 ldmpc regs=r4-r10 @ restore registers and return
242 .ltorg @ dump constant pool 242 .ltorg @ dump constant pool
243 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 243 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
244 244
@@ -545,6 +545,6 @@ lcd_write_yuv420_lines_odither:
545 subs r1, r1, #2 @ subtract block from width 545 subs r1, r1, #2 @ subtract block from width
546 bgt 10b @ loop line @ 546 bgt 10b @ loop line @
547 @ 547 @
548 ldmfd sp!, { r4-r11, pc } @ restore registers and return 548 ldmpc regs=r4-r11 @ restore registers and return
549 .ltorg @ dump constant pool 549 .ltorg @ dump constant pool
550 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 550 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/samsung/yh920/lcd-as-yh920.S b/firmware/target/arm/samsung/yh920/lcd-as-yh920.S
index 2c7f5110bf..130addf460 100644
--- a/firmware/target/arm/samsung/yh920/lcd-as-yh920.S
+++ b/firmware/target/arm/samsung/yh920/lcd-as-yh920.S
@@ -113,6 +113,6 @@ lcd_grey_data:
113 subs r2, r2, #1 113 subs r2, r2, #1
114 bne .greyloop 114 bne .greyloop
115 115
116 ldmfd sp!, {r4-r5, pc} 116 ldmpc regs=r4-r5
117 .size lcd_grey_data,.-lcd_grey_data 117 .size lcd_grey_data,.-lcd_grey_data
118 118
diff --git a/firmware/target/arm/samsung/yh925/lcd-as-yh925.S b/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
index b3f12e46b6..8e851d8441 100644
--- a/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
+++ b/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
@@ -232,7 +232,7 @@ lcd_write_yuv420_lines:
232 subs r1, r1, #2 @ subtract block from width 232 subs r1, r1, #2 @ subtract block from width
233 bgt 10b @ loop line @ 233 bgt 10b @ loop line @
234 @ 234 @
235 ldmfd sp!, { r4-r11, pc } @ restore registers and return 235 ldmpc regs=r4-r11 @ restore registers and return
236 .ltorg @ dump constant pool 236 .ltorg @ dump constant pool
237 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 237 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
238 238
@@ -533,6 +533,6 @@ lcd_write_yuv420_lines_odither:
533 subs r1, r1, #2 @ subtract block from width 533 subs r1, r1, #2 @ subtract block from width
534 bgt 10b @ loop line @ 534 bgt 10b @ loop line @
535 @ 535 @
536 ldmfd sp!, { r4-r11, pc } @ restore registers and return 536 ldmpc regs=r4-r11 @ restore registers and return
537 .ltorg @ dump constant pool 537 .ltorg @ dump constant pool
538 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 538 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S b/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
index 581a4f3fc3..d8dfccc37b 100644
--- a/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
+++ b/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
@@ -238,7 +238,7 @@ lcd_write_yuv420_lines:
238 subs r1, r1, #2 @ subtract block from width 238 subs r1, r1, #2 @ subtract block from width
239 bgt 10b @ loop line @ 239 bgt 10b @ loop line @
240 @ 240 @
241 ldmfd sp!, { r4-r10, pc } @ restore registers and return 241 ldmpc regs=r4-r10 @ restore registers and return
242 .ltorg @ dump constant pool 242 .ltorg @ dump constant pool
243 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines 243 .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
244 244
@@ -545,6 +545,6 @@ lcd_write_yuv420_lines_odither:
545 subs r1, r1, #2 @ subtract block from width 545 subs r1, r1, #2 @ subtract block from width
546 bgt 10b @ loop line @ 546 bgt 10b @ loop line @
547 @ 547 @
548 ldmfd sp!, { r4-r11, pc } @ restore registers and return 548 ldmpc regs=r4-r11 @ restore registers and return
549 .ltorg @ dump constant pool 549 .ltorg @ dump constant pool
550 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither 550 .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither
diff --git a/firmware/target/arm/thread-arm.c b/firmware/target/arm/thread-arm.c
index c2d91cec25..9ea3d0bef9 100644
--- a/firmware/target/arm/thread-arm.c
+++ b/firmware/target/arm/thread-arm.c
@@ -77,7 +77,15 @@ static inline void load_context(const void* addr)
77 asm volatile( 77 asm volatile(
78 "ldr r0, [%0, #40] \n" /* Load start pointer */ 78 "ldr r0, [%0, #40] \n" /* Load start pointer */
79 "cmp r0, #0 \n" /* Check for NULL */ 79 "cmp r0, #0 \n" /* Check for NULL */
80 "ldmneia %0, { r0, pc } \n" /* If not already running, jump to start */ 80
81 /* If not already running, jump to start */
82#if ARM_ARCH == 4 && defined(USE_THUMB)
83 "ldmneia %0, { r0, r12 } \n"
84 "bxne r12 \n"
85#else
86 "ldmneia %0, { r0, pc } \n"
87#endif
88
81 "ldmia %0, { r4-r11, sp, lr } \n" /* Load regs r4 to r14 from context */ 89 "ldmia %0, { r4-r11, sp, lr } \n" /* Load regs r4 to r14 from context */
82 : : "r" (addr) : "r0" /* only! */ 90 : : "r" (addr) : "r0" /* only! */
83 ); 91 );