From 5b820b073e7754eebeee151b094ae798885146df Mon Sep 17 00:00:00 2001 From: rmoore1 Date: Wed, 7 Dec 2005 23:08:22 +0000 Subject: [PATCH] Move resource ASL strings to utils, used by both debugger and disassembler --- source/components/disassembler/dmutils.c | 130 +--------------------- source/components/resources/rsdump.c | 3 +- source/components/utilities/utresrc.c | 132 ++++++++++++++++++++++- source/include/acdisasm.h | 26 +---- source/include/acutils.h | 28 ++++- 5 files changed, 166 insertions(+), 153 deletions(-) diff --git a/source/components/disassembler/dmutils.c b/source/components/disassembler/dmutils.c index 5c3aabfd1..04f05667d 100644 --- a/source/components/disassembler/dmutils.c +++ b/source/components/disassembler/dmutils.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dmutils - AML disassembler utilities - * $Revision: 1.19 $ + * $Revision: 1.20 $ * ******************************************************************************/ @@ -141,6 +141,7 @@ const char *AcpiGbl_FENames[ACPI_NUM_FIELD_NAMES] = }; /* FE = Field Element */ #endif +/* Operators for Match() */ const char *AcpiGbl_MatchOps[ACPI_NUM_MATCH_OPS] = { @@ -152,7 +153,6 @@ const char *AcpiGbl_MatchOps[ACPI_NUM_MATCH_OPS] = "MGT" }; - /* Access type decoding */ const char *AcpiGbl_AccessTypes[ACPI_NUM_ACCESS_TYPES] = @@ -165,7 +165,6 @@ const char *AcpiGbl_AccessTypes[ACPI_NUM_ACCESS_TYPES] = "BufferAcc", }; - /* Lock rule decoding */ const char *AcpiGbl_LockRule[ACPI_NUM_LOCK_RULES] = @@ -183,14 +182,7 @@ const char *AcpiGbl_UpdateRules[ACPI_NUM_UPDATE_RULES] = "WriteAsZeros" }; -/* - * Strings used to decode resource descriptors - */ -const char *AcpiGbl_IoDecode[2] = -{ - "Decode10", - "Decode16" -}; +/* Strings used to decode resource descriptors */ const char *AcpiGbl_WordDecode[4] = { @@ -200,128 +192,12 @@ const char *AcpiGbl_WordDecode[4] = "Unknown-resource-type" }; -const char *AcpiGbl_ConsumeDecode[2] = -{ - "ResourceProducer", - "ResourceConsumer" -}; - -const char *AcpiGbl_MinDecode[2] = -{ - "MinNotFixed", - "MinFixed" -}; - -const char *AcpiGbl_MaxDecode[2] = -{ - "MaxNotFixed", - "MaxFixed" -}; - -const char *AcpiGbl_DECDecode[2] = -{ - "PosDecode", - "SubDecode" -}; - const char *AcpiGbl_IrqDecode[2] = { "IRQNoFlags", "IRQ" }; -const char *AcpiGbl_HEDecode[2] = -{ - "Level", - "Edge" -}; - -const char *AcpiGbl_LLDecode[2] = -{ - "ActiveHigh", - "ActiveLow" -}; - -const char *AcpiGbl_SHRDecode[2] = -{ - "Exclusive", - "Shared" -}; - -const char *AcpiGbl_TYPDecode[4] = -{ - "Compatibility", - "TypeA", - "TypeB", - "TypeF" -}; - -const char *AcpiGbl_BMDecode[2] = -{ - "NotBusMaster", - "BusMaster" -}; - -const char *AcpiGbl_SIZDecode[4] = -{ - "Transfer8", - "Transfer8_16", - "Transfer16", - "InvalidSize" -}; - -/* Type Specific Flags */ - -const char *AcpiGbl_TTPDecode[2] = -{ - "TypeStatic", - "TypeTranslation" -}; - -const char *AcpiGbl_MTPDecode[4] = -{ - "AddressRangeMemory", - "AddressRangeReserved", - "AddressRangeACPI", - "AddressRangeNVS" -}; - -const char *AcpiGbl_MEMDecode[4] = -{ - "NonCacheable", - "Cacheable", - "WriteCombining", - "Prefetchable" -}; - -const char *AcpiGbl_RWDecode[2] = -{ - "ReadOnly", - "ReadWrite" -}; - -const char *AcpiGbl_TRSDecode[2] = -{ - "DenseTranslation", - "SparseTranslation" -}; - -const char *AcpiGbl_RNGDecode[4] = -{ - "InvalidRanges", - "NonISAOnlyRanges", - "ISAOnlyRanges", - "EntireRange" -}; - -const char *AcpiGbl_ConfigDecode[4] = -{ - "0 - Good Configuration", - "1 - Acceptable Configuration", - "2 - Suboptimal Configuration", - "3 - ***Invalid Configuration***", -}; - #ifdef ACPI_ASL_COMPILER /******************************************************************************* diff --git a/source/components/resources/rsdump.c b/source/components/resources/rsdump.c index c76bd5e3c..c15b6eccf 100644 --- a/source/components/resources/rsdump.c +++ b/source/components/resources/rsdump.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: rsdump - Functions to display the resource structures. - * $Revision: 1.57 $ + * $Revision: 1.58 $ * ******************************************************************************/ @@ -119,7 +119,6 @@ #include "acpi.h" #include "acresrc.h" -#include "acdisasm.h" #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rsdump") diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c index 243711bea..90b7ad622 100644 --- a/source/components/utilities/utresrc.c +++ b/source/components/utilities/utresrc.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utresrc - Resource managment utilities - * $Revision: 1.5 $ + * $Revision: 1.6 $ * ******************************************************************************/ @@ -125,6 +125,135 @@ ACPI_MODULE_NAME ("utmisc") +#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) + +/* + * Strings used to decode resource descriptors. + * Used by both the disasssembler and the debugger resource dump routines + */ +const char *AcpiGbl_BMDecode[2] = +{ + "NotBusMaster", + "BusMaster" +}; + +const char *AcpiGbl_ConfigDecode[4] = +{ + "0 - Good Configuration", + "1 - Acceptable Configuration", + "2 - Suboptimal Configuration", + "3 - ***Invalid Configuration***", +}; + +const char *AcpiGbl_ConsumeDecode[2] = +{ + "ResourceProducer", + "ResourceConsumer" +}; + +const char *AcpiGbl_DECDecode[2] = +{ + "PosDecode", + "SubDecode" +}; + +const char *AcpiGbl_HEDecode[2] = +{ + "Level", + "Edge" +}; + +const char *AcpiGbl_IoDecode[2] = +{ + "Decode10", + "Decode16" +}; + +const char *AcpiGbl_LLDecode[2] = +{ + "ActiveHigh", + "ActiveLow" +}; + +const char *AcpiGbl_MaxDecode[2] = +{ + "MaxNotFixed", + "MaxFixed" +}; + +const char *AcpiGbl_MEMDecode[4] = +{ + "NonCacheable", + "Cacheable", + "WriteCombining", + "Prefetchable" +}; + +const char *AcpiGbl_MinDecode[2] = +{ + "MinNotFixed", + "MinFixed" +}; + +const char *AcpiGbl_MTPDecode[4] = +{ + "AddressRangeMemory", + "AddressRangeReserved", + "AddressRangeACPI", + "AddressRangeNVS" +}; + +const char *AcpiGbl_RNGDecode[4] = +{ + "InvalidRanges", + "NonISAOnlyRanges", + "ISAOnlyRanges", + "EntireRange" +}; + +const char *AcpiGbl_RWDecode[2] = +{ + "ReadOnly", + "ReadWrite" +}; + +const char *AcpiGbl_SHRDecode[2] = +{ + "Exclusive", + "Shared" +}; + +const char *AcpiGbl_SIZDecode[4] = +{ + "Transfer8", + "Transfer8_16", + "Transfer16", + "InvalidSize" +}; + +const char *AcpiGbl_TRSDecode[2] = +{ + "DenseTranslation", + "SparseTranslation" +}; + +const char *AcpiGbl_TTPDecode[2] = +{ + "TypeStatic", + "TypeTranslation" +}; + +const char *AcpiGbl_TYPDecode[4] = +{ + "Compatibility", + "TypeA", + "TypeB", + "TypeF" +}; + +#endif + + /* * Base sizes of the raw AML resource descriptors, indexed by resource type. * Zero indicates a reserved (and therefore invalid) resource type. @@ -211,6 +340,7 @@ static const UINT8 AcpiGbl_ResourceTypes[] = }; + /******************************************************************************* * * FUNCTION: AcpiUtValidateResource diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index a2887d1da..305d22f07 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acdisasm.h - AML disassembler - * $Revision: 1.25 $ + * $Revision: 1.26 $ * *****************************************************************************/ @@ -133,27 +133,11 @@ typedef struct acpi_external_list } ACPI_EXTERNAL_LIST; extern ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList; -extern const char *AcpiGbl_IoDecode[2]; -extern const char *AcpiGbl_WordDecode[4]; -extern const char *AcpiGbl_ConsumeDecode[2]; -extern const char *AcpiGbl_ConfigDecode[4]; -extern const char *AcpiGbl_MinDecode[2]; -extern const char *AcpiGbl_MaxDecode[2]; -extern const char *AcpiGbl_DECDecode[2]; -extern const char *AcpiGbl_RNGDecode[4]; -extern const char *AcpiGbl_MEMDecode[4]; -extern const char *AcpiGbl_RWDecode[2]; -extern const char *AcpiGbl_IrqDecode[2]; -extern const char *AcpiGbl_HEDecode[2]; -extern const char *AcpiGbl_LLDecode[2]; -extern const char *AcpiGbl_SHRDecode[2]; -extern const char *AcpiGbl_TYPDecode[4]; -extern const char *AcpiGbl_BMDecode[2]; -extern const char *AcpiGbl_SIZDecode[4]; -extern const char *AcpiGbl_TTPDecode[2]; -extern const char *AcpiGbl_MTPDecode[4]; -extern const char *AcpiGbl_TRSDecode[2]; +/* Strings used for decoding flags to ASL keywords */ + +extern const char *AcpiGbl_WordDecode[4]; +extern const char *AcpiGbl_IrqDecode[2]; extern const char *AcpiGbl_LockRule[ACPI_NUM_LOCK_RULES]; extern const char *AcpiGbl_AccessTypes[ACPI_NUM_ACCESS_TYPES]; extern const char *AcpiGbl_UpdateRules[ACPI_NUM_UPDATE_RULES]; diff --git a/source/include/acutils.h b/source/include/acutils.h index 99960a8eb..272660dc6 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures - * $Revision: 1.183 $ + * $Revision: 1.184 $ * *****************************************************************************/ @@ -118,7 +118,31 @@ #define _ACUTILS_H -extern const UINT8 AcpiGbl_ResourceAmlSizes[]; +extern const UINT8 AcpiGbl_ResourceAmlSizes[]; + +/* Strings used by the disassembler and debugger resource dump routines */ + +#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) + +extern const char *AcpiGbl_BMDecode[2]; +extern const char *AcpiGbl_ConfigDecode[4]; +extern const char *AcpiGbl_ConsumeDecode[2]; +extern const char *AcpiGbl_DECDecode[2]; +extern const char *AcpiGbl_HEDecode[2]; +extern const char *AcpiGbl_IoDecode[2]; +extern const char *AcpiGbl_LLDecode[2]; +extern const char *AcpiGbl_MaxDecode[2]; +extern const char *AcpiGbl_MEMDecode[4]; +extern const char *AcpiGbl_MinDecode[2]; +extern const char *AcpiGbl_MTPDecode[4]; +extern const char *AcpiGbl_RNGDecode[4]; +extern const char *AcpiGbl_RWDecode[2]; +extern const char *AcpiGbl_SHRDecode[2]; +extern const char *AcpiGbl_SIZDecode[4]; +extern const char *AcpiGbl_TRSDecode[2]; +extern const char *AcpiGbl_TTPDecode[2]; +extern const char *AcpiGbl_TYPDecode[4]; +#endif /* Types for Resource descriptor entries */