summaryrefslogtreecommitdiff
path: root/source/compiler/aslmain.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2014-03-27 23:50:54 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2014-03-27 23:50:54 +0000
commit7c6f304a2eb855cf2d71ca0638d4f3c72f436fcd (patch)
treed3e9e38245f10de28c87606c945c7fdd4bed0d76 /source/compiler/aslmain.c
parent526d99544ba42a5a2155021975b3b97da425819e (diff)
downloadsrc-test2-7c6f304a2eb855cf2d71ca0638d4f3c72f436fcd.tar.gz
src-test2-7c6f304a2eb855cf2d71ca0638d4f3c72f436fcd.zip
Notes
Diffstat (limited to 'source/compiler/aslmain.c')
-rw-r--r--source/compiler/aslmain.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c
index 6f81d21d2c05..6e92d53d54e5 100644
--- a/source/compiler/aslmain.c
+++ b/source/compiler/aslmain.c
@@ -73,6 +73,36 @@ static void
AslInitialize (
void);
+UINT8
+AcpiIsBigEndianMachine (
+ void);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiIsBigEndianMachine
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: TRUE if machine is big endian
+ * FALSE if machine is little endian
+ *
+ * DESCRIPTION: Detect whether machine is little endian or big endian.
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiIsBigEndianMachine (
+ void)
+{
+ union {
+ UINT32 Integer;
+ UINT8 Bytes[4];
+ } Overlay = {0xFF000000};
+
+ return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
+}
+
/*******************************************************************************
*
@@ -299,6 +329,18 @@ main (
int Index2;
+ /*
+ * Big-endian machines are not currently supported. ACPI tables must
+ * be little-endian, and support for big-endian machines needs to
+ * be implemented.
+ */
+ if (AcpiIsBigEndianMachine ())
+ {
+ fprintf (stderr,
+ "iASL is not currently supported on big-endian machines.\n");
+ return (-1);
+ }
+
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
/* Initialize preprocessor and compiler before command line processing */