1
0
Fork 0
forked from len0rd/rockbox

Jean-Philippe Bernardy: TCC730 adjustments

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5556 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2005-01-10 22:02:26 +00:00
parent 7c5169d4c5
commit b42509b14f

View file

@ -100,7 +100,7 @@ static inline unsigned short SWAB16(unsigned short value)
/* /*
result[15..8] = value[ 7..0]; result[15..8] = value[ 7..0];
result[ 7..0] = value[15..8]; result[ 7..0] = value[15..8];
*/ */
{ {
short result; short result;
asm volatile ("swap.b\t%1,%0" : "=r"(result) : "r"(value)); asm volatile ("swap.b\t%1,%0" : "=r"(result) : "r"(value));
@ -111,7 +111,7 @@ static inline unsigned long SWAW32(unsigned long value)
/* /*
result[31..16] = value[15.. 0]; result[31..16] = value[15.. 0];
result[15.. 0] = value[31..16]; result[15.. 0] = value[31..16];
*/ */
{ {
long result; long result;
asm volatile ("swap.w\t%1,%0" : "=r"(result) : "r"(value)); asm volatile ("swap.w\t%1,%0" : "=r"(result) : "r"(value));
@ -124,7 +124,7 @@ static inline unsigned long SWAB32(unsigned long value)
result[23..16] = value[15.. 8]; result[23..16] = value[15.. 8];
result[15.. 8] = value[23..16]; result[15.. 8] = value[23..16];
result[ 7.. 0] = value[31..24]; result[ 7.. 0] = value[31..24];
*/ */
{ {
asm volatile ("swap.b\t%0,%0\n" asm volatile ("swap.b\t%0,%0\n"
"swap.w\t%0,%0\n" "swap.w\t%0,%0\n"
@ -159,7 +159,7 @@ static inline unsigned short SWAB16(unsigned short value)
/* /*
result[15..8] = value[ 7..0]; result[15..8] = value[ 7..0];
result[ 7..0] = value[15..8]; result[ 7..0] = value[15..8];
*/ */
{ {
return (value >> 8) | (value << 8); return (value >> 8) | (value << 8);
} }
@ -170,13 +170,54 @@ static inline unsigned long SWAB32(unsigned long value)
result[23..16] = value[15.. 8]; result[23..16] = value[15.. 8];
result[15.. 8] = value[23..16]; result[15.. 8] = value[23..16];
result[ 7.. 0] = value[31..24]; result[ 7.. 0] = value[31..24];
*/ */
{ {
unsigned short hi = SWAB16(value >> 16); unsigned short hi = SWAB16(value >> 16);
unsigned short lo = SWAB16(value & 0xffff); unsigned short lo = SWAB16(value & 0xffff);
return (lo << 16) | hi; return (lo << 16) | hi;
} }
#elif CONFIG_CPU == TCC730
extern void* interrupt_vector[16] __attribute__ ((section(".idata")));
extern void ddma_transfer(int dir, int mem, long intAddr, void* extAddr,
int num);
static inline void clear_watchdog(void)
{
WDTCON = 0x0A;
}
#define HIGHEST_IRQ_LEVEL (1<<15)
static inline int set_irq_level(int level)
{
return 0;
}
static inline unsigned short SWAB16(unsigned short value)
/*
result[15..8] = value[ 7..0];
result[ 7..0] = value[15..8];
*/
{
return (value >> 8) | (value << 8);
}
static inline unsigned long SWAB32(unsigned long 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];
*/
{
unsigned short hi = SWAB16(value >> 16);
unsigned long lo = SWAB16(value & 0xffff);
return (lo << 16) | hi;
}
#endif #endif
#endif #endif