64bit fixes from blueswirl

git-svn-id: svn://coreboot.org/openbios/openbios-devel@83 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Stefan Reinauer
2006-09-14 15:06:38 +00:00
parent 84c8ff3704
commit 1a34b8a360
8 changed files with 47 additions and 29 deletions

View File

@@ -18,27 +18,45 @@
(__bswap32((x) & 0xffffffff) << 32) )
#ifdef CONFIG_LITTLE_ENDIAN
#define __cpu_to_le64(x) ((u64) (x))
#define __le64_to_cpu(x) ((u64) (x))
#define __cpu_to_le32(x) ((u32) (x))
#define __le32_to_cpu(x) ((u32) (x))
#define __cpu_to_le16(x) ((u16) (x))
#define __le16_to_cpu(x) ((u16) (x))
#define __cpu_to_be64(x) (__bswap64((u64) (x)))
#define __be64_to_cpu(x) (__bswap64((u64) (x)))
#define __cpu_to_be32(x) (__bswap32((u32) (x)))
#define __be32_to_cpu(x) (__bswap32((u32) (x)))
#define __cpu_to_be16(x) (__bswap16((u16) (x)))
#define __be16_to_cpu(x) (__bswap16((u16) (x)))
#endif
#ifdef CONFIG_BIG_ENDIAN
#define __cpu_to_le64(x) (__bswap64((u64) (x)))
#define __le64_to_cpu(x) (__bswap64((u64) (x)))
#define __cpu_to_le32(x) (__bswap32((u32) (x)))
#define __le32_to_cpu(x) (__bswap32((u32) (x)))
#define __cpu_to_le16(x) (__bswap16((u16) (x)))
#define __le16_to_cpu(x) (__bswap16((u16) (x)))
#define __cpu_to_be64(x) ((u64) (x))
#define __be64_to_cpu(x) ((u64) (x))
#define __cpu_to_be32(x) ((u32) (x))
#define __be32_to_cpu(x) ((u32) (x))
#define __cpu_to_be16(x) ((u16) (x))
#define __be16_to_cpu(x) ((u16) (x))
#endif
#if BITS==32
#define __becell_to_cpu(x) (__be32_to_cpu(x))
#define __lecell_to_cpu(x) (__le32_to_cpu(x))
#define __cpu_to_becell(x) (__cpu_to_be32(x))
#define __cpu_to_lecell(x) (__cpu_to_le32(x))
#else
#define __becell_to_cpu(x) (__be64_to_cpu(x))
#define __lecell_to_cpu(x) (__le64_to_cpu(x))
#define __cpu_to_becell(x) (__cpu_to_be64(x))
#define __cpu_to_lecell(x) (__cpu_to_le64(x))
#endif
#endif

View File

@@ -61,8 +61,8 @@ extern void close_dev( ihandle_t ih );
extern void set_property( phandle_t ph, const char *name,
const char *buf, int len );
extern void set_int_property( phandle_t ph, const char *name,
int val );
extern int get_int_property( phandle_t ph, const char *name,
cell val );
extern cell get_int_property( phandle_t ph, const char *name,
int *retlen );
extern char *get_property( phandle_t ph, const char *name,
int *retlen );
@@ -76,7 +76,7 @@ static inline phandle_t dt_find_type( const char *type ) {
}
/* forth bindings */
extern int feval( const char *str );
extern cell feval( const char *str );
extern void bind_xtfunc( const char *name, xt_t xt,
ucell arg, void (*func)(void) );
extern void bind_func( const char *name, void (*func)(void) );
@@ -85,7 +85,7 @@ extern void push_str( const char *str );
extern char *pop_fstr_copy( void );
extern int _fword( const char *word, xt_t *cache_xt );
extern int _eword( const char *word, xt_t *cache_xt, int nargs );
extern cell _eword( const char *word, xt_t *cache_xt, int nargs );
extern int _selfword( const char *method, xt_t *cache_xt );
extern int _parword( const char *method, xt_t *cache_xt );