summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Hopf <mhopf@suse.de>2010-05-07 17:21:38 +0200
committerMatthias Hopf <mhopf@suse.de>2010-05-07 17:21:38 +0200
commitc65fba32727749ff0e3c5e5f860951bf3f428bbc (patch)
tree1b5ce6a748b8d382ecc1a3a88e49c0f20fc8e41b
parentb56bcf9388c9a784a296a2f0951cbed60f9de39c (diff)
Set endian information for including newer atombios.h
-rw-r--r--Makefile4
-rw-r--r--atombios_rev.h10
-rw-r--r--main.c2
3 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c192f5c..3682595 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CFLAGS = -O0 -g3 -Wall
+CFLAGS = -O0 -g3 -Wall -Wno-unknown-pragmas
SRC = main.c datastructs.c indices.c
CC = gcc
@@ -42,7 +42,7 @@ $(SRC:.c=.d): datastructs_gen.c
# Special Flags + Dependencies
-datastructs.o: CFLAGS += -Wno-unused -Wno-unknown-pragmas
+datastructs.o: CFLAGS += -Wno-unused
_always_:
@true
diff --git a/atombios_rev.h b/atombios_rev.h
index f233685..ed7fd22 100644
--- a/atombios_rev.h
+++ b/atombios_rev.h
@@ -3,6 +3,16 @@
* Plus addon information for dynamic data tables.
*/
+#include <endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define ATOM_BIG_ENDIAN 0
+#define ATOM_LITTLE_ENDIAN 1
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define ATOM_BIG_ENDIAN 1
+#define ATOM_LITTLE_ENDIAN 0
+#endif
+
/*
* Dynamic data tables:
* Modify table sizes and offset positions by replacing access code
diff --git a/main.c b/main.c
index 21970c9..f1e600f 100644
--- a/main.c
+++ b/main.c
@@ -26,7 +26,7 @@
#include "atombios_consts.h"
//include "atombios_tables.h"
-#include "atombios.h" /* FIXME: make it possible without */
+#include "atombios_rev.h"
#define MMAP_SIZE (1024*1024)