summaryrefslogtreecommitdiff
path: root/src/radeon_macros.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@ppcg5.localdomain>2008-06-11 19:33:02 +1000
committerDave Airlie <airlied@ppcg5.localdomain>2008-06-11 20:26:06 +1000
commitf29976d12cc2020cd80c90fa3fd4b25c031559ba (patch)
tree5cf3617d34070d9a600b20a543b421dd53e81d20 /src/radeon_macros.h
parent09eb220971b5d2bfd7d1ff6f552060967a133152 (diff)
radeon: add lots of endian bits into the atombios parser
Diffstat (limited to 'src/radeon_macros.h')
-rw-r--r--src/radeon_macros.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/radeon_macros.h b/src/radeon_macros.h
index f19bc3e7..3675dc51 100644
--- a/src/radeon_macros.h
+++ b/src/radeon_macros.h
@@ -51,6 +51,16 @@
#include "compiler.h"
+#include <byteswap.h>
+
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+#define le32_to_cpu(x) bswap_32(x)
+#define le16_to_cpu(x) bswap_16(x)
+#else
+#define le32_to_cpu(x) (x)
+#define le16_to_cpu(x) (x)
+#endif
+
#define RADEON_BIOS8(v) (info->VBIOS[v])
#define RADEON_BIOS16(v) (info->VBIOS[v] | \
(info->VBIOS[(v) + 1] << 8))