diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-08 21:58:43 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-07-08 21:58:43 +1000 |
commit | 61f82ace0210251beb0bcc492218a75a193e1deb (patch) | |
tree | ce52271828fe27cab43cabc7b5adeba421bde1d7 /src/AtomBios/includes/Decoder.h | |
parent | b4d1a47b5c6eafda5e274398eebe2701b030f22e (diff) |
atombios: add support for other endians.
This is a cleaned up (in as much as atombios can be..) of benh's patch.
airlied - removed benh's debugging for now, it might need to be put back later..
Diffstat (limited to 'src/AtomBios/includes/Decoder.h')
-rw-r--r-- | src/AtomBios/includes/Decoder.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/AtomBios/includes/Decoder.h b/src/AtomBios/includes/Decoder.h index 24c25fc2..1e143f02 100644 --- a/src/AtomBios/includes/Decoder.h +++ b/src/AtomBios/includes/Decoder.h @@ -47,12 +47,32 @@ NEG:27.08.2002 Initiated. #define PARSER_VERSION_MAJOR 0x00000000 #define PARSER_VERSION_MINOR 0x0000000E #define PARSER_VERSION (PARSER_VERSION_MAJOR | PARSER_VERSION_MINOR) -#include "CD_binding.h" + #include "CD_Common_Types.h" + +#include "atombios.h" + +/* these depends on some struct defined in atombios.h */ +#include "CD_binding.h" #include "CD_hw_services.h" #include "CD_Structs.h" -#include "CD_Definitions.h" #include "CD_Opcodes.h" +#include "CD_Definitions.h" + +#if ATOM_BIG_ENDIAN +extern UINT16 ATOM_BSWAP16(UINT16 x); +extern UINT32 ATOM_BSWAP32(UINT32 x); + +#define CPU_TO_UINT16LE(x) ATOM_BSWAP16(x) +#define CPU_TO_UINT32LE(x) ATOM_BSWAP32(x) +#define UINT16LE_TO_CPU(x) ATOM_BSWAP16(x) +#define UINT32LE_TO_CPU(x) ATOM_BSWAP32(x) +#else +#define CPU_TO_UINT16LE(x) (x) +#define CPU_TO_UINT32LE(x) (x) +#define UINT16LE_TO_CPU(x) (x) +#define UINT32LE_TO_CPU(x) (x) +#endif #define SOURCE_ONLY_CMD_TYPE 0//0xFE #define SOURCE_DESTINATION_CMD_TYPE 1//0xFD |