summaryrefslogtreecommitdiff
path: root/firmware/common
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/common
parentfbf52ae8fe04f27368392b71a3572dc2bb00788f (diff)
downloadrockbox-e1dd10ddfb49bfdd05fa8997bc097df93a9c9466.zip
rockbox-e1dd10ddfb49bfdd05fa8997bc097df93a9c9466.tar.gz
rockbox-e1dd10ddfb49bfdd05fa8997bc097df93a9c9466.tar.bz2
rockbox-e1dd10ddfb49bfdd05fa8997bc097df93a9c9466.tar.xz
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/common')
-rw-r--r--firmware/common/memswap128.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/firmware/common/memswap128.c b/firmware/common/memswap128.c
new file mode 100644
index 0000000..af1fe15
--- /dev/null
+++ b/firmware/common/memswap128.c
@@ -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.
+ *
+ ****************************************************************************/
+#include "config.h"
+#include <string.h>
+#include <inttypes.h>
+
+void memswap128(void *a, void *b, size_t len)
+{
+ for (len >>= 4; len > 0; len--, a += 16, b += 16)
+ {
+ int32_t a0 = *((int32_t *)a + 0);
+ int32_t a1 = *((int32_t *)a + 1);
+ int32_t a2 = *((int32_t *)a + 2);
+ int32_t a3 = *((int32_t *)a + 3);
+ int32_t b0 = *((int32_t *)b + 0);
+ int32_t b1 = *((int32_t *)b + 1);
+ int32_t b2 = *((int32_t *)b + 2);
+ int32_t b3 = *((int32_t *)b + 3);
+ *((int32_t *)b + 0) = a0;
+ *((int32_t *)b + 1) = a1;
+ *((int32_t *)b + 2) = a2;
+ *((int32_t *)b + 3) = a3;
+ *((int32_t *)a + 0) = b0;
+ *((int32_t *)a + 1) = b1;
+ *((int32_t *)a + 2) = b2;
+ *((int32_t *)a + 3) = b3;
+ }
+}