summaryrefslogtreecommitdiffstats
path: root/firmware/target
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-03-19 22:04:17 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-03-19 22:04:17 +0000
commite1dd10ddfb49bfdd05fa8997bc097df93a9c9466 (patch)
tree0c530ecb1ab68eb335edf595829bf7786e6a683e /firmware/target
parentfbf52ae8fe04f27368392b71a3572dc2bb00788f (diff)
downloadrockbox-e1dd10ddfb49bfdd05fa8997bc097df93a9c9466.tar.gz
rockbox-e1dd10ddfb49bfdd05fa8997bc097df93a9c9466.zip
SWCODEC: Get rid of extra swap buffer and get back 512K of RAM or 100K if the players RAM is <= 1MB. Make any needed changes to things to stabilize and facilitate this including removing flattening out initialization. Comment some things heavily. Fix a few logfs I didn't want to see the compiler complaining about.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12843 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/memswap128-arm.S44
-rw-r--r--firmware/target/coldfire/memswap128-coldfire.S50
2 files changed, 94 insertions, 0 deletions
diff --git a/firmware/target/arm/memswap128-arm.S b/firmware/target/arm/memswap128-arm.S
new file mode 100644
index 0000000000..f5276ef353
--- /dev/null
+++ b/firmware/target/arm/memswap128-arm.S
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2007 by Michael Sevakis
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * void memswap128(void *buf1, void *buf2, size_t len)
+ */
+ .section .icode, "ax", %progbits
+ .align 2
+ .global memswap128
+ .type memswap128, %function
+memswap128:
+ @ r0 = buf1
+ @ r1 = buf2
+ @ r2 = len
+ movs r2, r2, lsr #4 @ bytes => lines, len == 0?
+ moveq pc, lr @ not at least a line? leave
+ stmdb sp!, { r4-r10, lr } @ save registers and return address
+.loop: @
+ ldmia r0, { r3-r6 } @ read four longwords from buf1
+ ldmia r1, { r7-r10 } @ read four longwords from buf2
+ stmia r0!, { r7-r10 } @ write buf2 data to buf1, buf1 += 16
+ stmia r1!, { r3-r6 } @ write buf1 data to buf2, buf2 += 16
+ subs r2, r2, #1 @ len -= 1, len > 0 ?
+ bhi .loop @ yes? keep exchanging
+ ldmia sp!, { r4-r10, pc } @ restore registers and return
+.end:
+ .size memswap128, .end-memswap128
+
diff --git a/firmware/target/coldfire/memswap128-coldfire.S b/firmware/target/coldfire/memswap128-coldfire.S
new file mode 100644
index 0000000000..2509fd0e45
--- /dev/null
+++ b/firmware/target/coldfire/memswap128-coldfire.S
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2007 by Michael Sevakis
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * void memswap128(void *buf1, void *buf2, size_t len)
+ */
+ .section .icode, "ax", @progbits
+ .align 2
+ .global memswap128
+ .type memswap128, @function
+memswap128:
+ lea.l -28(%sp), %sp | save registers
+ movem.l %d2-%d7/%a2, (%sp) |
+ movem.l 32(%sp), %a0-%a2 | %a0 = buf1
+ | %a1 = buf2
+ | %a2 = len
+ lea.l -15(%a0, %a2.l), %a2 | %a2 = end address - 15
+ cmp.l %a0, %a2 | end address <= buf1?
+ bls.b .no_lines | not at least a line? leave
+.loop: |
+ movem.l (%a0), %d0-%d3 | read four longwords from buf1
+ movem.l (%a1), %d4-%d7 | read four longwords from buf2
+ movem.l %d4-%d7, (%a0) | write buf2 data to buf1
+ movem.l %d0-%d3, (%a1) | write buf1 data to buf2
+ lea.l 16(%a0), %a0 | buf1 += 16
+ lea.l 16(%a1), %a1 | buf2 += 16
+ cmp.l %a0, %a2 | %a0 < %d0?
+ bhi.b .loop | yes? keep exchanging
+.no_lines: |
+ movem.l (%sp), %d2-%d7/%a2 | restore registers
+ lea.l 28(%sp), %sp |
+ rts |
+.end:
+ .size memswap128, .end-memswap128