From 9c803c06eee9844a587f7b3dcea92b5b5a227e10 Mon Sep 17 00:00:00 2001 From: aystarik Date: Wed, 29 Jun 2005 20:40:37 +0000 Subject: [PATCH] Automated Cleanup date 2002.07.30.22.16.00; author rmoore1; state Exp; --- source/tools/acpiexec/aeexec.c | 7 +- source/tools/acpiexec/aemain.c | 120 ++++++++++----------------------- 2 files changed, 37 insertions(+), 90 deletions(-) diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c index 61e2dfc16..795324cea 100644 --- a/source/tools/acpiexec/aeexec.c +++ b/source/tools/acpiexec/aeexec.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: aeexec - Support routines for AcpiExec utility - * $Revision: 1.60 $ + * $Revision: 1.61 $ * *****************************************************************************/ @@ -158,7 +158,6 @@ RSDT_DESCRIPTOR_REV1 *LocalRSDT; #define RSDT_SIZE (sizeof (RSDT_DESCRIPTOR_REV1) + ((RSDT_TABLES -1) * sizeof (UINT32))) - /****************************************************************************** * * FUNCTION: AeBuildLocalTables @@ -213,7 +212,7 @@ AeBuildLocalTables (void) LocalFADT.Header.Length = sizeof (FADT_DESCRIPTOR_REV1); LocalFADT.Gpe0BlkLen = 4; LocalFADT.Gpe1BlkLen = 6; - LocalFADT.Gpe1Base = 61; + LocalFADT.Gpe1Base = 61; LocalFADT.Pm1EvtLen = 4; LocalFADT.Pm1CntLen = 4; @@ -396,7 +395,7 @@ AeRegionHandler ( RegionElement = RegionElement->NextRegion; } } - } + } /* * If the Region buffer does not exist, create it now diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index dbb622407..226881312 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: aemain - Main routine for the AcpiExec utility - * $Revision: 1.61 $ + * $Revision: 1.69 $ * *****************************************************************************/ @@ -127,86 +127,18 @@ #include "aecommon.h" +#ifdef _DEBUG +#if ACPI_MACHINE_WIDTH != 16 +#include +#endif +#endif #define _COMPONENT PARSER ACPI_MODULE_NAME ("aemain") -/* - * TBD: Debug only, remove! - */ -#ifdef _IA32 -void -AcpiCompare ( - UINT64_OVERLAY Dividend, - UINT64_OVERLAY Divisor, - UINT64_OVERLAY LibDiv, - UINT64_OVERLAY Div, - UINT64_OVERLAY LibMod, - UINT64_OVERLAY Mod) -{ - if (LibDiv.Full != Div.Full) - { - AcpiOsPrintf ("Mismatch-DIV: n=%8.8X%8.8X d=%8.8X%8.8X, lr=%8.8X%8.8X ar=%8.8X%8.8X\n", - Dividend.Part.Hi, Dividend.Part.Lo, - Divisor.Part.Hi, Divisor.Part.Lo, - LibDiv.Part.Hi, LibDiv.Part.Lo, - Div.Part.Hi, Div.Part.Lo); - } +#if ACPI_MACHINE_WIDTH == 16 - if (LibMod.Full != Mod.Full) - { - AcpiOsPrintf ("Mismatch-MOD: n=%8.8X%8.8X d=%8.8X%8.8X, lr=%8.8X%8.8X ar=%8.8X%8.8X\n", - Dividend.Part.Hi, Dividend.Part.Lo, - Divisor.Part.Hi, Divisor.Part.Lo, - LibMod.Part.Hi, LibMod.Part.Lo, - Mod.Part.Hi, Mod.Part.Lo); - } -} - - /* Check answer against the library (DEBUG ONLY) */ -/* - CompareDiv.Full = Dividend.Full / Divisor.Full; - CompareMod.Full = Dividend.Full % Divisor.Full; - AcpiCompare (Dividend, Divisor, CompareDiv, Quotient, CompareMod, Remainder); -*/ -void -AeDoDivideCheck (void) -{ - UINT32 i; - UINT64_OVERLAY CompareDiv; - UINT64_OVERLAY CompareMod; - UINT64_OVERLAY Dividend; - UINT64_OVERLAY Divisor; - UINT64_OVERLAY Quotient; - UINT64_OVERLAY Remainder; - - - for (i = 1; i < 0xFFFFFF; i++) - { - Dividend.Part.Hi = rand (); - Dividend.Part.Lo = rand (); - Divisor.Part.Hi = rand (); - Divisor.Part.Lo = rand (); - - CompareDiv.Full = Dividend.Full / Divisor.Full; - CompareMod.Full = Dividend.Full % Divisor.Full; - - AcpiUtDivide (&Dividend.Full, &Divisor.Full, &Quotient.Full, &Remainder.Full); - - AcpiCompare (Dividend, Divisor, CompareDiv, Quotient, CompareMod, Remainder); - } - -} -#else -void -AeDoDivideCheck (void) -{ -} -#endif - - -#ifdef _IA16 ACPI_STATUS AcpiGetIrqRoutingTable ( ACPI_HANDLE DeviceHandle, @@ -268,23 +200,28 @@ main ( char Buffer[32]; +#ifdef _DEBUG +#if ACPI_MACHINE_WIDTH != 16 + _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CrtSetDbgFlag(0)); +#endif +#endif + /* Init globals */ AcpiDbgLevel = NORMAL_DEFAULT; AcpiDbgLayer = 0xFFFFFFFF; + /* Init ACPI and start debugger thread */ - AeDoDivideCheck (); + AcpiInitializeSubsystem (); - printf ("ACPI AML Execution/Debug Utility "); + printf ("\nIntel ACPI Component Architecture\nAML Execution/Debug Utility"); -#ifdef _IA16 - printf ("(16-bit) "); -#else - printf ("(32-bit) "); +#if ACPI_MACHINE_WIDTH == 16 + printf ("(16-bit)"); #endif - printf ("CA version %4.4X [%s]\n", ACPI_CA_VERSION, __DATE__); + printf (" version %8.8X [%s]\n\n", (UINT32) ACPI_CA_VERSION, __DATE__); /* Get the command line options */ @@ -328,9 +265,6 @@ main ( return -1; } - /* Init ACPI and start debugger thread */ - - AcpiInitializeSubsystem (); InitFlags = (ACPI_NO_HANDLER_INIT | ACPI_NO_ACPI_ENABLE); if (!AcpiGbl_DbOpt_ini_methods) @@ -378,6 +312,13 @@ main ( goto enterloop; } + Status = AcpiInitializeObjects (InitFlags); + if (ACPI_FAILURE (Status)) + { + printf ("**** Could not InitializeObjects, %s\n", AcpiFormatException (Status)); + goto enterloop; + } + ReturnBuf.Length = 32; ReturnBuf.Pointer = Buffer; AcpiGetName (AcpiGbl_RootNode, ACPI_FULL_PATHNAME, &ReturnBuf); @@ -385,7 +326,7 @@ main ( AcpiEnableEvent (0, ACPI_EVENT_GPE, 0); } -#ifdef _IA16 +#if ACPI_MACHINE_WIDTH == 16 else { #include "16bit.h" @@ -426,6 +367,13 @@ main ( printf ("**** Could not EnableSubsystem, %s\n", AcpiFormatException (Status)); goto enterloop; } + + Status = AcpiInitializeObjects (InitFlags); + if (ACPI_FAILURE (Status)) + { + printf ("**** Could not InitializeObjects, %s\n", AcpiFormatException (Status)); + goto enterloop; + } } #endif