forked from len0rd/rockbox
Properly fix warning by copying the swap16 and swap32 inline functions from system.h to mips/ingenic_jz47xx/system-target.h to replace the defines.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27433 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b9e7c18dda
commit
74063845c0
2 changed files with 24 additions and 4 deletions
|
|
@ -423,7 +423,7 @@ int shorten_init(ShortenContext* s, uint8_t *buf, int buf_size)
|
||||||
get_bits(&s->gb, s->bitindex);
|
get_bits(&s->gb, s->bitindex);
|
||||||
|
|
||||||
/* shorten signature */
|
/* shorten signature */
|
||||||
if ((unsigned)get_bits_long(&s->gb, 32) != bswap_32(ff_get_fourcc("ajkg"))) {
|
if (get_bits_long(&s->gb, 32) != bswap_32(ff_get_fourcc("ajkg"))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@
|
||||||
#ifndef __SYSTEM_TARGET_H_
|
#ifndef __SYSTEM_TARGET_H_
|
||||||
#define __SYSTEM_TARGET_H_
|
#define __SYSTEM_TARGET_H_
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "jz4740.h"
|
#include "jz4740.h"
|
||||||
#include "mipsregs.h"
|
#include "mipsregs.h"
|
||||||
|
|
@ -72,9 +74,27 @@ static inline void restore_interrupt(int status)
|
||||||
#define disable_irq_save() disable_interrupt_save(ST0_IE)
|
#define disable_irq_save() disable_interrupt_save(ST0_IE)
|
||||||
#define restore_irq(c0_status) restore_interrupt(c0_status)
|
#define restore_irq(c0_status) restore_interrupt(c0_status)
|
||||||
|
|
||||||
#define swap16(x) (((x) & 0xff) << 8 | ((x) >> 8) & 0xff)
|
static inline uint16_t swap16(uint16_t value)
|
||||||
#define swap32(x) (((x) & 0xff) << 24 | ((x) & 0xff00) << 8 | \
|
/*
|
||||||
((x) & 0xff0000) >> 8 | ((x) >> 24) & 0xff)
|
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_ADDRESS(addr) ((unsigned int)(addr) | 0xA0000000)
|
||||||
#define UNCACHED_ADDR(x) UNCACHED_ADDRESS((x))
|
#define UNCACHED_ADDR(x) UNCACHED_ADDRESS((x))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue