summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/system-target.h
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-07-15 22:01:06 +0000
committerNils Wallménius <nils@rockbox.org>2010-07-15 22:01:06 +0000
commit6d732a32bc4472a9050b118d0920e936a4bf5408 (patch)
tree0471f9810a5b901808157b375c163b4692388982 /firmware/target/mips/ingenic_jz47xx/system-target.h
parentc272144867f94dc7e99f8333bec5dd052878ecd8 (diff)
downloadrockbox-6d732a32bc4472a9050b118d0920e936a4bf5408.tar.gz
rockbox-6d732a32bc4472a9050b118d0920e936a4bf5408.tar.bz2
rockbox-6d732a32bc4472a9050b118d0920e936a4bf5408.zip
Don't duplicate byteswap code. Invent system where NEED_GENERIC_BYTESWAPS is set if the generic functions from system.h are needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27440 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/system-target.h')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/system-target.h26
1 files changed, 3 insertions, 23 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/system-target.h b/firmware/target/mips/ingenic_jz47xx/system-target.h
index 1f8c388ec6..caf1733158 100644
--- a/firmware/target/mips/ingenic_jz47xx/system-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/system-target.h
@@ -32,6 +32,9 @@
#define CACHE_LINE_SIZE 32
#include "mmu-mips.h"
+/* no optimized byteswap functions implemented for mips, yet */
+#define NEED_GENERIC_BYTESWAPS
+
/* This one returns the old status */
static inline int set_interrupt_status(int status, int mask)
{
@@ -73,29 +76,6 @@ static inline void restore_interrupt(int status)
#define set_irq_level(status) set_interrupt_status((status), ST0_IE)
#define disable_irq_save() disable_interrupt_save(ST0_IE)
#define restore_irq(c0_status) restore_interrupt(c0_status)
-
-static inline uint16_t swap16(uint16_t value)
- /*
- result[15..8] = value[ 7..0];
- result[ 7..0] = value[15..8];
- */
-{
- return (value >> 8) | (value << 8);
-}
-
-static inline uint32_t swap32(uint32_t value)
- /*
- result[31..24] = value[ 7.. 0];
- result[23..16] = value[15.. 8];
- result[15.. 8] = value[23..16];
- result[ 7.. 0] = value[31..24];
- */
-{
- uint32_t hi = swap16(value >> 16);
- uint32_t lo = swap16(value & 0xffff);
- return (lo << 16) | hi;
-}
-
#define UNCACHED_ADDRESS(addr) ((unsigned int)(addr) | 0xA0000000)
#define UNCACHED_ADDR(x) UNCACHED_ADDRESS((x))
#define PHYSADDR(x) ((x) & 0x1fffffff)