forked from len0rd/rockbox
Using ARM Unified Assembler Language
Change-Id: Iae32a8ba8eff6087330e458fafc912a12fee4509
This commit is contained in:
parent
a64cad847e
commit
86429dbf1e
23 changed files with 139 additions and 127 deletions
|
|
@ -139,9 +139,9 @@ copy_read_sectors:
|
|||
.r_end2_u:
|
||||
|
||||
tst r1, #1 /* one halfword left? */
|
||||
ldrneh r4, [r2]
|
||||
ldrhne r4, [r2]
|
||||
orrne r3, r3, r4, lsl #8
|
||||
strneh r3, [r0], #2
|
||||
strhne r3, [r0], #2
|
||||
movne r3, r4, lsr #8
|
||||
|
||||
strb r3, [r0], #1 /* store final byte */
|
||||
|
|
@ -151,8 +151,8 @@ copy_read_sectors:
|
|||
/* 16-bit aligned */
|
||||
.r_aligned:
|
||||
tst r0, #2 /* 32 bit aligned? */
|
||||
ldrneh r3, [r2] /* no: read first halfword */
|
||||
strneh r3, [r0], #2 /* store */
|
||||
ldrhne r3, [r2] /* no: read first halfword */
|
||||
strhne r3, [r0], #2 /* store */
|
||||
subne r1, r1, #1 /* one halfword taken */
|
||||
|
||||
sub r1, r1, #8 /* adjust for zero-check and doing 8 halfwords/loop */
|
||||
|
|
@ -186,14 +186,14 @@ copy_read_sectors:
|
|||
.r_end4_a:
|
||||
|
||||
tst r1, #2 /* 2 or more halfwords left? */
|
||||
ldrneh r3, [r2]
|
||||
ldrneh r4, [r2]
|
||||
ldrhne r3, [r2]
|
||||
ldrhne r4, [r2]
|
||||
orrne r3, r3, r4, lsl #16
|
||||
strne r3, [r0], #4
|
||||
|
||||
tst r1, #1 /* one halfword left? */
|
||||
ldrneh r3, [r2]
|
||||
strneh r3, [r0], #2
|
||||
ldrhne r3, [r2]
|
||||
strhne r3, [r0], #2
|
||||
|
||||
ldmpc regs=r4-r5
|
||||
|
||||
|
|
@ -291,9 +291,9 @@ copy_write_sectors:
|
|||
.w_end2_u:
|
||||
|
||||
tst r1, #1 /* one halfword left? */
|
||||
ldrneh r4, [r0], #2
|
||||
ldrhne r4, [r0], #2
|
||||
orrne r3, r3, r4, lsl #8
|
||||
strneh r3, [r2]
|
||||
strhne r3, [r2]
|
||||
movne r3, r3, lsr #16
|
||||
|
||||
ldrb r4, [r0], #1 /* load final byte */
|
||||
|
|
@ -305,8 +305,8 @@ copy_write_sectors:
|
|||
/* 16-bit aligned */
|
||||
.w_aligned:
|
||||
tst r0, #2 /* 32 bit aligned? */
|
||||
ldrneh r3, [r0], #2 /* no: load first halfword */
|
||||
strneh r3, [r2] /* write */
|
||||
ldrhne r3, [r0], #2 /* no: load first halfword */
|
||||
strhne r3, [r2] /* write */
|
||||
subne r1, r1, #1 /* one halfword taken */
|
||||
|
||||
sub r1, r1, #8 /* adjust for zero-check and doing 8 halfwords/loop */
|
||||
|
|
@ -341,13 +341,13 @@ copy_write_sectors:
|
|||
|
||||
tst r1, #2 /* 2 or more halfwords left? */
|
||||
ldrne r3, [r0], #4
|
||||
strneh r3, [r2]
|
||||
strhne r3, [r2]
|
||||
movne r3, r3, lsr #16
|
||||
strneh r3, [r2]
|
||||
strhne r3, [r2]
|
||||
|
||||
tst r1, #1 /* one halfword left? */
|
||||
ldrneh r3, [r0], #2
|
||||
strneh r3, [r2]
|
||||
ldrhne r3, [r0], #2
|
||||
strhne r3, [r2]
|
||||
|
||||
ldmpc regs=r4-r5
|
||||
|
||||
|
|
|
|||
|
|
@ -40,24 +40,24 @@ lcd_write_data: /* r1 = pixel count, must be even */
|
|||
|
||||
subs r1, r1, #16
|
||||
.loop16:
|
||||
ldmgeia r0!, {r2-r3}
|
||||
stmgeia lr, {r2-r3}
|
||||
ldmgeia r0!, {r2-r3}
|
||||
stmgeia lr, {r2-r3}
|
||||
ldmgeia r0!, {r2-r3}
|
||||
stmgeia lr, {r2-r3}
|
||||
ldmgeia r0!, {r2-r3}
|
||||
stmgeia lr, {r2-r3}
|
||||
subges r1, r1, #16
|
||||
ldmiage r0!, {r2-r3}
|
||||
stmiage lr, {r2-r3}
|
||||
ldmiage r0!, {r2-r3}
|
||||
stmiage lr, {r2-r3}
|
||||
ldmiage r0!, {r2-r3}
|
||||
stmiage lr, {r2-r3}
|
||||
ldmiage r0!, {r2-r3}
|
||||
stmiage lr, {r2-r3}
|
||||
subsge r1, r1, #16
|
||||
bge .loop16
|
||||
|
||||
/* no need to correct the count, we're just checking bits from now */
|
||||
tst r1, #8
|
||||
ldmneia r0!, {r2-r4, r12}
|
||||
stmneia lr, {r2-r4, r12}
|
||||
ldmiane r0!, {r2-r4, r12}
|
||||
stmiane lr, {r2-r4, r12}
|
||||
tst r1, #4
|
||||
ldmneia r0!, {r2-r3}
|
||||
stmneia lr, {r2-r3}
|
||||
ldmiane r0!, {r2-r3}
|
||||
stmiane lr, {r2-r3}
|
||||
tst r1, #2
|
||||
ldrne r3, [r0], #4
|
||||
strne r3, [lr]
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ void fiq_handler(void)
|
|||
* r0-r3 and r12 is a working register.
|
||||
*/
|
||||
asm volatile (
|
||||
".syntax unified \n"
|
||||
"sub lr, lr, #4 \n"
|
||||
"stmfd sp!, { r0-r3, lr } \n" /* stack scratch regs and lr */
|
||||
"mov r14, #0 \n" /* Was the callback called? */
|
||||
|
|
@ -251,7 +252,7 @@ void fiq_handler(void)
|
|||
"stmia r11, { r8-r9 } \n" /* save p and size */
|
||||
|
||||
"cmp r14, #0 \n" /* Callback called? */
|
||||
"ldmeqfd sp!, { r0-r3, pc }^ \n" /* no? -> exit */
|
||||
"ldmfdeq sp!, { r0-r3, pc }^ \n" /* no? -> exit */
|
||||
|
||||
"ldr r1, =pcm_play_status_callback \n"
|
||||
"ldr r1, [r1] \n"
|
||||
|
|
@ -268,7 +269,7 @@ void fiq_handler(void)
|
|||
"mov lr, pc \n"
|
||||
"ldr pc, =pcm_play_dma_complete_callback \n"
|
||||
"cmp r0, #0 \n" /* any more to play? */
|
||||
"ldmneia r11, { r8-r9 } \n" /* load new p and size */
|
||||
"ldmiane r11, { r8-r9 } \n" /* load new p and size */
|
||||
"cmpne r9, #0x0f \n" /* did we actually get enough data? */
|
||||
"bhi .fill_fifo \n" /* not stop and enough? refill */
|
||||
"ldmfd sp!, { r0-r3, pc }^ \n" /* exit */
|
||||
|
|
|
|||
|
|
@ -327,6 +327,7 @@ void fiq_playback(void)
|
|||
*/
|
||||
asm volatile (
|
||||
/* No external calls */
|
||||
".syntax unified \n"
|
||||
"sub lr, lr, #4 \n" /* Prepare return address */
|
||||
"stmfd sp!, { lr } \n" /* stack lr so we can use it */
|
||||
"ldr r12, =0xcf001040 \n" /* Some magic from iPodLinux ... */
|
||||
|
|
@ -349,8 +350,8 @@ void fiq_playback(void)
|
|||
"bhi 0b \n" /* ... yes, continue */
|
||||
|
||||
"cmp r9, #0 \n" /* either FIFO full or size empty? */
|
||||
"stmneia r11, { r8-r9 } \n" /* save p and size, if not empty */
|
||||
"ldmnefd sp!, { pc }^ \n" /* RFE if not empty */
|
||||
"stmiane r11, { r8-r9 } \n" /* save p and size, if not empty */
|
||||
"ldmfdne sp!, { pc }^ \n" /* RFE if not empty */
|
||||
|
||||
/* Making external calls */
|
||||
"1: \n"
|
||||
|
|
@ -363,7 +364,7 @@ void fiq_playback(void)
|
|||
"mov lr, pc \n" /* long call (not in same section) */
|
||||
"bx r3 \n"
|
||||
"cmp r0, #0 \n" /* more data? */
|
||||
"ldmeqfd sp!, { r0-r3, pc }^ \n" /* no? -> exit */
|
||||
"ldmfdeq sp!, { r0-r3, pc }^ \n" /* no? -> exit */
|
||||
|
||||
"ldr r14, [r10, #0x1c] \n" /* read IISFIFO_CFG to check FIFO status */
|
||||
"ands r14, r14, #(0xe<<23) \n" /* r14 = (IIS_TX_FREE_COUNT & ~1) << 23 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue