diff options
Diffstat (limited to 'source/compiler/aslmain.c')
-rw-r--r-- | source/compiler/aslmain.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c index 6f81d21d2c05b..6e92d53d54e54 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 */ |