aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Smith <msmith@FreeBSD.org>2001-08-26 22:28:18 +0000
committerMike Smith <msmith@FreeBSD.org>2001-08-26 22:28:18 +0000
commit2ee2f9cb7457edd22680e19323177347cd0aabff (patch)
tree6e637a23360d60a81f3d110ebc3bcfe7d749faae /sys
parent4f12dbc3f61dbfa5e3322b352723078db101c3cb (diff)
downloadsrc-2ee2f9cb7457edd22680e19323177347cd0aabff.tar.gz
src-2ee2f9cb7457edd22680e19323177347cd0aabff.zip
Vendor import of the Intel ACPI CA 20010816 update.
Notes
Notes: svn path=/vendor-sys/acpica/dist/; revision=82367
Diffstat (limited to 'sys')
-rw-r--r--sys/contrib/dev/acpica/acconfig.h6
-rw-r--r--sys/contrib/dev/acpica/acglobal.h63
-rw-r--r--sys/contrib/dev/acpica/acinterp.h3
-rw-r--r--sys/contrib/dev/acpica/aclocal.h87
-rw-r--r--sys/contrib/dev/acpica/acmacros.h120
-rw-r--r--sys/contrib/dev/acpica/acobject.h8
-rw-r--r--sys/contrib/dev/acpica/acoutput.h125
-rw-r--r--sys/contrib/dev/acpica/acpixf.h31
-rw-r--r--sys/contrib/dev/acpica/actypes.h11
-rw-r--r--sys/contrib/dev/acpica/acutils.h62
-rw-r--r--sys/contrib/dev/acpica/dbdisasm.c51
-rw-r--r--sys/contrib/dev/acpica/dbdisply.c16
-rw-r--r--sys/contrib/dev/acpica/dbexec.c54
-rw-r--r--sys/contrib/dev/acpica/dbfileio.c5
-rw-r--r--sys/contrib/dev/acpica/dbinput.c8
-rw-r--r--sys/contrib/dev/acpica/dbstats.c75
-rw-r--r--sys/contrib/dev/acpica/dbutils.c20
-rw-r--r--sys/contrib/dev/acpica/dbxface.c8
-rw-r--r--sys/contrib/dev/acpica/dsfield.c8
-rw-r--r--sys/contrib/dev/acpica/dsmethod.c14
-rw-r--r--sys/contrib/dev/acpica/dsmthdat.c40
-rw-r--r--sys/contrib/dev/acpica/dsobject.c188
-rw-r--r--sys/contrib/dev/acpica/dsopcode.c53
-rw-r--r--sys/contrib/dev/acpica/dsutils.c58
-rw-r--r--sys/contrib/dev/acpica/dswexec.c36
-rw-r--r--sys/contrib/dev/acpica/dswload.c123
-rw-r--r--sys/contrib/dev/acpica/dswscope.c12
-rw-r--r--sys/contrib/dev/acpica/dswstate.c189
-rw-r--r--sys/contrib/dev/acpica/evevent.c52
-rw-r--r--sys/contrib/dev/acpica/evmisc.c22
-rw-r--r--sys/contrib/dev/acpica/evregion.c32
-rw-r--r--sys/contrib/dev/acpica/evrgnini.c14
-rw-r--r--sys/contrib/dev/acpica/evxface.c16
-rw-r--r--sys/contrib/dev/acpica/evxfevnt.c20
-rw-r--r--sys/contrib/dev/acpica/evxfregn.c18
-rw-r--r--sys/contrib/dev/acpica/exconfig.c12
-rw-r--r--sys/contrib/dev/acpica/exconvrt.c183
-rw-r--r--sys/contrib/dev/acpica/excreate.c8
-rw-r--r--sys/contrib/dev/acpica/exdump.c152
-rw-r--r--sys/contrib/dev/acpica/exdyadic.c24
-rw-r--r--sys/contrib/dev/acpica/exfield.c8
-rw-r--r--sys/contrib/dev/acpica/exfldio.c64
-rw-r--r--sys/contrib/dev/acpica/exmisc.c24
-rw-r--r--sys/contrib/dev/acpica/exmonad.c68
-rw-r--r--sys/contrib/dev/acpica/exnames.c32
-rw-r--r--sys/contrib/dev/acpica/exprep.c32
-rw-r--r--sys/contrib/dev/acpica/exregion.c20
-rw-r--r--sys/contrib/dev/acpica/exresnte.c117
-rw-r--r--sys/contrib/dev/acpica/exresolv.c30
-rw-r--r--sys/contrib/dev/acpica/exresop.c62
-rw-r--r--sys/contrib/dev/acpica/exstore.c53
-rw-r--r--sys/contrib/dev/acpica/exstoren.c10
-rw-r--r--sys/contrib/dev/acpica/exstorob.c10
-rw-r--r--sys/contrib/dev/acpica/exsystem.c4
-rw-r--r--sys/contrib/dev/acpica/exutils.c12
-rw-r--r--sys/contrib/dev/acpica/hwacpi.c30
-rw-r--r--sys/contrib/dev/acpica/hwregs.c54
-rw-r--r--sys/contrib/dev/acpica/hwsleep.c94
-rw-r--r--sys/contrib/dev/acpica/nsaccess.c63
-rw-r--r--sys/contrib/dev/acpica/nsalloc.c16
-rw-r--r--sys/contrib/dev/acpica/nsdump.c71
-rw-r--r--sys/contrib/dev/acpica/nseval.c24
-rw-r--r--sys/contrib/dev/acpica/nsinit.c59
-rw-r--r--sys/contrib/dev/acpica/nsload.c32
-rw-r--r--sys/contrib/dev/acpica/nsnames.c6
-rw-r--r--sys/contrib/dev/acpica/nsobject.c54
-rw-r--r--sys/contrib/dev/acpica/nssearch.c24
-rw-r--r--sys/contrib/dev/acpica/nsutils.c16
-rw-r--r--sys/contrib/dev/acpica/nswalk.c4
-rw-r--r--sys/contrib/dev/acpica/nsxfobj.c10
-rw-r--r--sys/contrib/dev/acpica/psargs.c17
-rw-r--r--sys/contrib/dev/acpica/psfind.c18
-rw-r--r--sys/contrib/dev/acpica/psopcode.c8
-rw-r--r--sys/contrib/dev/acpica/psparse.c33
-rw-r--r--sys/contrib/dev/acpica/psscope.c4
-rw-r--r--sys/contrib/dev/acpica/psutils.c158
-rw-r--r--sys/contrib/dev/acpica/psxface.c8
-rw-r--r--sys/contrib/dev/acpica/rscreate.c28
-rw-r--r--sys/contrib/dev/acpica/rsdump.c6
-rw-r--r--sys/contrib/dev/acpica/rsutils.c8
-rw-r--r--sys/contrib/dev/acpica/tbconvrt.c6
-rw-r--r--sys/contrib/dev/acpica/tbget.c24
-rw-r--r--sys/contrib/dev/acpica/tbinstal.c10
-rw-r--r--sys/contrib/dev/acpica/tbutils.c25
-rw-r--r--sys/contrib/dev/acpica/tbxface.c4
-rw-r--r--sys/contrib/dev/acpica/tbxfroot.c16
-rw-r--r--sys/contrib/dev/acpica/utalloc.c552
-rw-r--r--sys/contrib/dev/acpica/utcopy.c13
-rw-r--r--sys/contrib/dev/acpica/utdebug.c309
-rw-r--r--sys/contrib/dev/acpica/utdelete.c51
-rw-r--r--sys/contrib/dev/acpica/uteval.c46
-rw-r--r--sys/contrib/dev/acpica/utglobal.c73
-rw-r--r--sys/contrib/dev/acpica/utinit.c6
-rw-r--r--sys/contrib/dev/acpica/utmisc.c121
-rw-r--r--sys/contrib/dev/acpica/utobject.c140
-rw-r--r--sys/contrib/dev/acpica/utxface.c16
96 files changed, 2401 insertions, 2429 deletions
diff --git a/sys/contrib/dev/acpica/acconfig.h b/sys/contrib/dev/acpica/acconfig.h
index b7f0d0758825..f4d99b8116f0 100644
--- a/sys/contrib/dev/acpica/acconfig.h
+++ b/sys/contrib/dev/acpica/acconfig.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
- * $Revision: 66 $
+ * $Revision: 68 $
*
*****************************************************************************/
@@ -144,7 +144,7 @@
/* Version string */
-#define ACPI_CA_VERSION 0x20010717
+#define ACPI_CA_VERSION 0x20010816
/* Maximum objects in the various object caches */
@@ -153,7 +153,7 @@
#define MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
#define MAX_EXTPARSE_CACHE_DEPTH 64 /* Parse tree objects */
#define MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */
-#define MAX_WALK_CACHE_DEPTH 2 /* Objects for parse tree walks (method execution) */
+#define MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks (method execution) */
/* String size constants */
diff --git a/sys/contrib/dev/acpica/acglobal.h b/sys/contrib/dev/acpica/acglobal.h
index 232ebd5a5ff4..ee06d5e0bd51 100644
--- a/sys/contrib/dev/acpica/acglobal.h
+++ b/sys/contrib/dev/acpica/acglobal.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
- * $Revision: 102 $
+ * $Revision: 103 $
*
*****************************************************************************/
@@ -198,57 +198,31 @@ ACPI_EXTERN ACPI_MUTEX_INFO AcpiGbl_AcpiMutexInfo [NUM_MTX];
****************************************************************************/
+ACPI_EXTERN ACPI_MEMORY_LIST AcpiGbl_MemoryLists[ACPI_NUM_MEM_LISTS];
+ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_DrvNotify;
+ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_SysNotify;
ACPI_EXTERN UINT8 *AcpiGbl_Gpe0EnableRegisterSave;
ACPI_EXTERN UINT8 *AcpiGbl_Gpe1EnableRegisterSave;
ACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_BreakpointWalk;
-ACPI_EXTERN ACPI_GENERIC_STATE *AcpiGbl_GenericStateCache;
-ACPI_EXTERN ACPI_PARSE_OBJECT *AcpiGbl_ParseCache;
-ACPI_EXTERN ACPI_PARSE2_OBJECT *AcpiGbl_ExtParseCache;
-ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_ObjectCache;
-ACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_WalkStateCache;
ACPI_EXTERN ACPI_HANDLE AcpiGbl_GlobalLockSemaphore;
-
ACPI_EXTERN UINT32 AcpiGbl_GlobalLockThreadCount;
ACPI_EXTERN UINT32 AcpiGbl_RestoreAcpiChipset;
ACPI_EXTERN UINT32 AcpiGbl_OriginalMode;
ACPI_EXTERN UINT32 AcpiGbl_EdgeLevelSave;
ACPI_EXTERN UINT32 AcpiGbl_IrqEnableSave;
ACPI_EXTERN UINT32 AcpiGbl_RsdpOriginalLocation;
-
-ACPI_EXTERN UINT32 AcpiGbl_StateCacheRequests;
-ACPI_EXTERN UINT32 AcpiGbl_StateCacheHits;
-ACPI_EXTERN UINT32 AcpiGbl_ParseCacheRequests;
-ACPI_EXTERN UINT32 AcpiGbl_ParseCacheHits;
-ACPI_EXTERN UINT32 AcpiGbl_ExtParseCacheRequests;
-ACPI_EXTERN UINT32 AcpiGbl_ExtParseCacheHits;
-ACPI_EXTERN UINT32 AcpiGbl_ObjectCacheRequests;
-ACPI_EXTERN UINT32 AcpiGbl_ObjectCacheHits;
-ACPI_EXTERN UINT32 AcpiGbl_WalkStateCacheRequests;
-ACPI_EXTERN UINT32 AcpiGbl_WalkStateCacheHits;
ACPI_EXTERN UINT32 AcpiGbl_NsLookupCount;
ACPI_EXTERN UINT32 AcpiGbl_PsFindCount;
-
-
-ACPI_EXTERN UINT16 AcpiGbl_GenericStateCacheDepth;
-ACPI_EXTERN UINT16 AcpiGbl_ParseCacheDepth;
-ACPI_EXTERN UINT16 AcpiGbl_ExtParseCacheDepth;
-ACPI_EXTERN UINT16 AcpiGbl_ObjectCacheDepth;
-ACPI_EXTERN UINT16 AcpiGbl_WalkStateCacheDepth;
ACPI_EXTERN UINT16 AcpiGbl_Pm1EnableRegisterSave;
ACPI_EXTERN UINT16 AcpiGbl_NextTableOwnerId;
ACPI_EXTERN UINT16 AcpiGbl_NextMethodOwnerId;
-
ACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration;
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired;
ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall;
ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent;
-ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_DrvNotify;
-ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_SysNotify;
-
-
extern BOOLEAN AcpiGbl_Shutdown;
extern UINT32 AcpiGbl_SystemFlags;
extern UINT32 AcpiGbl_StartupFlags;
@@ -272,15 +246,12 @@ ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_RootNode;
extern UINT8 AcpiGbl_NsProperties[NUM_NS_TYPES];
extern PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
-
-/* Used to detect memory leaks (DEBUG ONLY) */
-
#ifdef ACPI_DEBUG
-ACPI_EXTERN ACPI_ALLOCATION_INFO *AcpiGbl_HeadAllocPtr;
-ACPI_EXTERN ACPI_ALLOCATION_INFO *AcpiGbl_TailAllocPtr;
+ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeCount;
+ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeSize;
+ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentNodeCount;
#endif
-
/*****************************************************************************
*
* Interpreter globals
@@ -351,27 +322,7 @@ ACPI_EXTERN BOOLEAN AcpiGbl_MethodExecuting;
ACPI_EXTERN BOOLEAN AcpiGbl_DbTerminateThreads;
#endif
-/* Memory allocation metrics - Debug Only! */
-
-#ifdef ACPI_DEBUG
-
-ACPI_EXTERN UINT32 AcpiGbl_CurrentAllocSize;
-ACPI_EXTERN UINT32 AcpiGbl_CurrentAllocCount;
-ACPI_EXTERN UINT32 AcpiGbl_RunningAllocSize;
-ACPI_EXTERN UINT32 AcpiGbl_RunningAllocCount;
-ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentAllocSize;
-ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentAllocCount;
-ACPI_EXTERN UINT32 AcpiGbl_CurrentObjectCount;
-ACPI_EXTERN UINT32 AcpiGbl_CurrentObjectSize;
-ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentObjectCount;
-ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentObjectSize;
-ACPI_EXTERN UINT32 AcpiGbl_RunningObjectCount;
-ACPI_EXTERN UINT32 AcpiGbl_RunningObjectSize;
-ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeCount;
-ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeSize;
-ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentNodeCount;
-#endif
#endif /* __ACGLOBAL_H__ */
diff --git a/sys/contrib/dev/acpica/acinterp.h b/sys/contrib/dev/acpica/acinterp.h
index 9bb7f8899e3d..a3429ce6d17a 100644
--- a/sys/contrib/dev/acpica/acinterp.h
+++ b/sys/contrib/dev/acpica/acinterp.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acinterp.h - Interpreter subcomponent prototypes and defines
- * $Revision: 105 $
+ * $Revision: 106 $
*
*****************************************************************************/
@@ -180,6 +180,7 @@ ACPI_STATUS
AcpiExConvertToString (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ResultDesc,
+ UINT32 Base,
UINT32 MaxLength,
ACPI_WALK_STATE *WalkState);
diff --git a/sys/contrib/dev/acpica/aclocal.h b/sys/contrib/dev/acpica/aclocal.h
index 70bb2996e8df..d9fb59b36bfb 100644
--- a/sys/contrib/dev/acpica/aclocal.h
+++ b/sys/contrib/dev/acpica/aclocal.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
- * $Revision: 124 $
+ * $Revision: 127 $
*
*****************************************************************************/
@@ -379,6 +379,7 @@ typedef struct acpi_namestring_info
/* Status bits. */
#define ACPI_STATUS_PMTIMER 0x0001
+#define ACPI_STATUS_BUSMASTER 0x0010
#define ACPI_STATUS_GLOBAL 0x0020
#define ACPI_STATUS_POWER_BUTTON 0x0100
#define ACPI_STATUS_SLEEP_BUTTON 0x0200
@@ -648,7 +649,11 @@ typedef struct acpi_opcode_info
typedef union acpi_parse_val
{
- UINT32 Integer; /* integer constant */
+ ACPI_INTEGER Integer; /* integer constant (Up to 64 bits) */
+ UINT64_STRUCT Integer64; /* Structure overlay for 2 32-bit Dwords */
+ UINT32 Integer32; /* integer constant, 32 bits only */
+ UINT16 Integer16; /* integer constant, 16 bits only */
+ UINT8 Integer8; /* integer constant, 8 bits only */
UINT32 Size; /* bytelist or field size */
NATIVE_CHAR *String; /* NULL terminated string */
UINT8 *Buffer; /* buffer or string */
@@ -908,7 +913,7 @@ typedef struct acpi_parse_state
typedef struct
{
- NATIVE_CHAR Buffer[ACPI_DEVICE_ID_LENGTH];
+ char Buffer[ACPI_DEVICE_ID_LENGTH];
} ACPI_DEVICE_ID;
@@ -916,6 +921,14 @@ typedef struct
/*****************************************************************************
*
+ * Miscellaneous
+ *
+ ****************************************************************************/
+
+#define ASCII_ZERO 0x30
+
+/*****************************************************************************
+ *
* Debugger
*
****************************************************************************/
@@ -942,25 +955,71 @@ typedef struct dbmethodinfo
/* Entry for a memory allocation (debug only) */
-#ifdef ACPI_DEBUG
#define MEM_MALLOC 0
#define MEM_CALLOC 1
#define MAX_MODULE_NAME 16
-typedef struct AcpiAllocationInfo
-{
- struct AcpiAllocationInfo *Previous;
- struct AcpiAllocationInfo *Next;
- void *Address;
- UINT32 Size;
- UINT32 Component;
- UINT32 Line;
- NATIVE_CHAR Module[MAX_MODULE_NAME];
+#define ACPI_COMMON_DEBUG_MEM_HEADER \
+ struct AcpiDebugMemBlock *Previous; \
+ struct AcpiDebugMemBlock *Next; \
+ UINT32 Size; \
+ UINT32 Component; \
+ UINT32 Line; \
+ NATIVE_CHAR Module[MAX_MODULE_NAME]; \
UINT8 AllocType;
-} ACPI_ALLOCATION_INFO;
+typedef struct
+{
+ ACPI_COMMON_DEBUG_MEM_HEADER
+
+} ACPI_DEBUG_MEM_HEADER;
+
+typedef struct AcpiDebugMemBlock
+{
+ ACPI_COMMON_DEBUG_MEM_HEADER
+ UINT64 UserSpace;
+
+} ACPI_DEBUG_MEM_BLOCK;
+
+
+
+#define ACPI_MEM_LIST_GLOBAL 0
+#define ACPI_MEM_LIST_NSNODE 1
+
+#define ACPI_MEM_LIST_FIRST_CACHE_LIST 2
+#define ACPI_MEM_LIST_STATE 2
+#define ACPI_MEM_LIST_PSNODE 3
+#define ACPI_MEM_LIST_PSNODE_EXT 4
+#define ACPI_MEM_LIST_OPERAND 5
+#define ACPI_MEM_LIST_WALK 6
+#define ACPI_MEM_LIST_MAX 6
+#define ACPI_NUM_MEM_LISTS 7
+
+
+typedef struct
+{
+ void *ListHead;
+ UINT16 LinkOffset;
+ UINT16 MaxCacheDepth;
+ UINT16 CacheDepth;
+ UINT16 ObjectSize;
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+
+ /* Statistics for debug memory tracking only */
+
+ UINT32 TotalAllocated;
+ UINT32 TotalFreed;
+ UINT32 CurrentTotalSize;
+ UINT32 CacheRequests;
+ UINT32 CacheHits;
+ char *ListName;
#endif
+} ACPI_MEMORY_LIST;
+
+
+
#endif /* __ACLOCAL_H__ */
diff --git a/sys/contrib/dev/acpica/acmacros.h b/sys/contrib/dev/acpica/acmacros.h
index a4dcfe7ebda6..620a8d5b9b0b 100644
--- a/sys/contrib/dev/acpica/acmacros.h
+++ b/sys/contrib/dev/acpica/acmacros.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acmacros.h - C macros for the entire subsystem.
- * $Revision: 80 $
+ * $Revision: 86 $
*
*****************************************************************************/
@@ -173,21 +173,40 @@
#define ACPI_VALID_ADDRESS(a) ((a).Hi | (a).Lo)
#else
+#ifdef ACPI_NO_INTEGER64_SUPPORT
/*
- * Full 64-bit address on 32-bit and 64-bit platforms
+ * ACPI_INTEGER is 32-bits, no 64-bit support on this platform
+ */
+#ifndef LODWORD
+#define LODWORD(l) ((UINT32)(l))
+#endif
+
+#ifndef HIDWORD
+#define HIDWORD(l) (0)
+#endif
+
+#define ACPI_GET_ADDRESS(a) (a)
+#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
+#define ACPI_VALID_ADDRESS(a) (a)
+
+#else
+
+/*
+ * Full 64-bit address/integer on both 32-bit and 64-bit platforms
*/
#ifndef LODWORD
#define LODWORD(l) ((UINT32)(UINT64)(l))
#endif
#ifndef HIDWORD
-#define HIDWORD(l) ((UINT32)((((UINT64)(l)) >> 32) & 0xFFFFFFFF))
+#define HIDWORD(l) ((UINT32)(((*(UINT64_STRUCT *)(&l))).Hi))
#endif
#define ACPI_GET_ADDRESS(a) (a)
#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
#define ACPI_VALID_ADDRESS(a) (a)
#endif
+#endif
/*
* Extract a byte of data using a pointer. Any more than a byte and we
@@ -442,31 +461,31 @@
#ifdef ACPI_DEBUG
#define REPORT_INFO(fp) {_ReportInfo(_THIS_MODULE,__LINE__,_COMPONENT); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
#define REPORT_ERROR(fp) {_ReportError(_THIS_MODULE,__LINE__,_COMPONENT); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
#define REPORT_WARNING(fp) {_ReportWarning(_THIS_MODULE,__LINE__,_COMPONENT); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
#else
#define REPORT_INFO(fp) {_ReportInfo("ACPI",__LINE__,_COMPONENT); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
#define REPORT_ERROR(fp) {_ReportError("ACPI",__LINE__,_COMPONENT); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
#define REPORT_WARNING(fp) {_ReportWarning("ACPI",__LINE__,_COMPONENT); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
#endif
/* Error reporting. These versions pass thru the module and line# */
#define _REPORT_INFO(a,b,c,fp) {_ReportInfo(a,b,c); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
#define _REPORT_ERROR(a,b,c,fp) {_ReportError(a,b,c); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
#define _REPORT_WARNING(a,b,c,fp) {_ReportWarning(a,b,c); \
- DebugPrintRaw PARAM_LIST(fp);}
+ AcpiOsPrintf PARAM_LIST(fp);}
/* Buffer dump macros */
@@ -548,24 +567,11 @@
* Print iff:
* 1) Debug print for the current component is enabled
* 2) Debug error level or trace level for the print statement is enabled
- *
*/
-#define TEST_DEBUG_SWITCH(lvl) if (((lvl) & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))
-
-#define DEBUG_PRINT(lvl,fp) TEST_DEBUG_SWITCH(lvl) {\
- DebugPrintPrefix (_THIS_MODULE,__LINE__);\
- DebugPrintRaw PARAM_LIST(fp);\
- BREAK_ON_ERROR(lvl);}
+#define ACPI_DEBUG_PRINT(pl) AcpiUtDebugPrint PARAM_LIST(pl)
+#define ACPI_DEBUG_PRINT_RAW(pl) AcpiUtDebugPrintRaw PARAM_LIST(pl)
-#define DEBUG_PRINTP(lvl,fp) TEST_DEBUG_SWITCH(lvl) {\
- DebugPrintPrefix (_THIS_MODULE,__LINE__);\
- DebugPrintRaw ("%s: ",_ProcName);\
- DebugPrintRaw PARAM_LIST(fp);\
- BREAK_ON_ERROR(lvl);}
-
-#define DEBUG_PRINT_RAW(lvl,fp) TEST_DEBUG_SWITCH(lvl) {\
- DebugPrintRaw PARAM_LIST(fp);}
#else
/*
@@ -595,9 +601,8 @@
#define DUMP_TABLES(a,b)
#define DUMP_PATHNAME(a,b,c,d)
#define DUMP_RESOURCE_LIST(a)
-#define DEBUG_PRINT(l,f)
-#define DEBUG_PRINTP(l,f)
-#define DEBUG_PRINT_RAW(l,f)
+#define ACPI_DEBUG_PRINT(pl)
+#define ACPI_DEBUG_PRINT_RAW(pl)
#define BREAK_MSG(a)
#define return_VOID return
@@ -658,14 +663,9 @@
#define ACPI_MEM_ALLOCATE(a) AcpiOsAllocate(a)
#define ACPI_MEM_CALLOCATE(a) AcpiOsCallocate(a)
#define ACPI_MEM_FREE(a) AcpiOsFree(a)
+#define ACPI_MEM_TRACKING(a)
-#define DECREMENT_OBJECT_METRICS(a)
-#define INCREMENT_OBJECT_METRICS(a)
-#define INITIALIZE_ALLOCATION_METRICS()
-#define DECREMENT_NAME_TABLE_METRICS(a)
-#define INCREMENT_NAME_TABLE_METRICS(a)
-
#else
/* Memory allocation */
@@ -673,54 +673,8 @@
#define ACPI_MEM_ALLOCATE(a) AcpiUtAllocate(a,_COMPONENT,_THIS_MODULE,__LINE__)
#define ACPI_MEM_CALLOCATE(a) AcpiUtCallocate(a, _COMPONENT,_THIS_MODULE,__LINE__)
#define ACPI_MEM_FREE(a) AcpiUtFree(a,_COMPONENT,_THIS_MODULE,__LINE__)
+#define ACPI_MEM_TRACKING(a) a
-#define INITIALIZE_ALLOCATION_METRICS() \
- AcpiGbl_CurrentObjectCount = 0; \
- AcpiGbl_CurrentObjectSize = 0; \
- AcpiGbl_RunningObjectCount = 0; \
- AcpiGbl_RunningObjectSize = 0; \
- AcpiGbl_MaxConcurrentObjectCount = 0; \
- AcpiGbl_MaxConcurrentObjectSize = 0; \
- AcpiGbl_CurrentAllocSize = 0; \
- AcpiGbl_CurrentAllocCount = 0; \
- AcpiGbl_RunningAllocSize = 0; \
- AcpiGbl_RunningAllocCount = 0; \
- AcpiGbl_MaxConcurrentAllocSize = 0; \
- AcpiGbl_MaxConcurrentAllocCount = 0; \
- AcpiGbl_CurrentNodeCount = 0; \
- AcpiGbl_CurrentNodeSize = 0; \
- AcpiGbl_MaxConcurrentNodeCount = 0
-
-
-#define DECREMENT_OBJECT_METRICS(a) \
- AcpiGbl_CurrentObjectCount--; \
- AcpiGbl_CurrentObjectSize -= a
-
-#define INCREMENT_OBJECT_METRICS(a) \
- AcpiGbl_CurrentObjectCount++; \
- AcpiGbl_RunningObjectCount++; \
- if (AcpiGbl_MaxConcurrentObjectCount < AcpiGbl_CurrentObjectCount) \
- { \
- AcpiGbl_MaxConcurrentObjectCount = AcpiGbl_CurrentObjectCount; \
- } \
- AcpiGbl_RunningObjectSize += a; \
- AcpiGbl_CurrentObjectSize += a; \
- if (AcpiGbl_MaxConcurrentObjectSize < AcpiGbl_CurrentObjectSize) \
- { \
- AcpiGbl_MaxConcurrentObjectSize = AcpiGbl_CurrentObjectSize; \
- }
-
-#define DECREMENT_NAME_TABLE_METRICS(a) \
- AcpiGbl_CurrentNodeCount--; \
- AcpiGbl_CurrentNodeSize -= (a)
-
-#define INCREMENT_NAME_TABLE_METRICS(a) \
- AcpiGbl_CurrentNodeCount++; \
- AcpiGbl_CurrentNodeSize+= (a); \
- if (AcpiGbl_MaxConcurrentNodeCount < AcpiGbl_CurrentNodeCount) \
- { \
- AcpiGbl_MaxConcurrentNodeCount = AcpiGbl_CurrentNodeCount; \
- }
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
diff --git a/sys/contrib/dev/acpica/acobject.h b/sys/contrib/dev/acpica/acobject.h
index 104644d7209d..14dc7a606d78 100644
--- a/sys/contrib/dev/acpica/acobject.h
+++ b/sys/contrib/dev/acpica/acobject.h
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only)
- * $Revision: 89 $
+ * $Revision: 90 $
*
*****************************************************************************/
@@ -158,8 +158,10 @@
/* Defines for flag byte above */
#define AOPOBJ_STATIC_ALLOCATION 0x1
-#define AOPOBJ_DATA_VALID 0x2
-#define AOPOBJ_INITIALIZED 0x4
+#define AOPOBJ_STATIC_POINTER 0x2
+#define AOPOBJ_DATA_VALID 0x4
+#define AOPOBJ_ZERO_CONST 0x4
+#define AOPOBJ_INITIALIZED 0x8
/*
diff --git a/sys/contrib/dev/acpica/acoutput.h b/sys/contrib/dev/acpica/acoutput.h
index de793d7650a8..48cf7bd54d70 100644
--- a/sys/contrib/dev/acpica/acoutput.h
+++ b/sys/contrib/dev/acpica/acoutput.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acoutput.h -- debug output
- * $Revision: 80 $
+ * $Revision: 81 $
*
*****************************************************************************/
@@ -123,7 +123,7 @@
* component basis and a per-exception-type basis.
*/
-/* Component IDs -- used in the global "DebugLayer" */
+/* Component IDs are used in the global "DebugLayer" */
#define ACPI_UTILITIES 0x00000001
#define ACPI_HARDWARE 0x00000002
@@ -157,59 +157,104 @@
#define ACPI_TOOLS 0x20000000
+/*
+ * Raw debug output levels, do not use these in the DEBUG_PRINT macros
+ */
+
+#define ACPI_LV_OK 0x00000001
+#define ACPI_LV_INFO 0x00000002
+#define ACPI_LV_WARN 0x00000004
+#define ACPI_LV_ERROR 0x00000008
+#define ACPI_LV_FATAL 0x00000010
+#define ACPI_LV_DEBUG_OBJECT 0x00000020
+#define ACPI_LV_ALL_EXCEPTIONS 0x0000003F
+
+
+/* Trace level -- also used in the global "DebugLevel" */
+
+#define ACPI_LV_THREADS 0x00000080
+#define ACPI_LV_PARSE 0x00000100
+#define ACPI_LV_DISPATCH 0x00000200
+#define ACPI_LV_LOAD 0x00000400
+#define ACPI_LV_EXEC 0x00000800
+#define ACPI_LV_NAMES 0x00001000
+#define ACPI_LV_OPREGION 0x00002000
+#define ACPI_LV_BFIELD 0x00004000
+#define ACPI_LV_TRASH 0x00008000
+#define ACPI_LV_TABLES 0x00010000
+#define ACPI_LV_FUNCTIONS 0x00020000
+#define ACPI_LV_VALUES 0x00040000
+#define ACPI_LV_OBJECTS 0x00080000
+#define ACPI_LV_ALLOCATIONS 0x00100000
+#define ACPI_LV_RESOURCES 0x00200000
+#define ACPI_LV_IO 0x00400000
+#define ACPI_LV_INTERRUPTS 0x00800000
+#define ACPI_LV_USER_REQUESTS 0x01000000
+#define ACPI_LV_PACKAGE 0x02000000
+#define ACPI_LV_MUTEX 0x04000000
+#define ACPI_LV_INIT 0x08000000
+#define ACPI_LV_ALL 0x0FFFFF80
+
+
+/*
+ * Debug level macros that are used in the DEBUG_PRINT macros
+ */
+
+#define ACPI_DEBUG_LEVEL(val) val,_COMPONENT,_ProcName,_THIS_MODULE,__LINE__
+
/* Exception level -- used in the global "DebugLevel" */
-#define ACPI_OK 0x00000001
-#define ACPI_INFO 0x00000002
-#define ACPI_WARN 0x00000004
-#define ACPI_ERROR 0x00000008
-#define ACPI_FATAL 0x00000010
-#define ACPI_DEBUG_OBJECT 0x00000020
-#define ACPI_ALL 0x0000003F
+#define ACPI_DB_OK ACPI_DEBUG_LEVEL (ACPI_LV_OK)
+#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
+#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
+#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
+#define ACPI_DB_FATAL ACPI_DEBUG_LEVEL (ACPI_LV_FATAL)
+#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
+#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
/* Trace level -- also used in the global "DebugLevel" */
-#define TRACE_THREADS 0x00000080
-#define TRACE_PARSE 0x00000100
-#define TRACE_DISPATCH 0x00000200
-#define TRACE_LOAD 0x00000400
-#define TRACE_EXEC 0x00000800
-#define TRACE_NAMES 0x00001000
-#define TRACE_OPREGION 0x00002000
-#define TRACE_BFIELD 0x00004000
-#define TRACE_TRASH 0x00008000
-#define TRACE_TABLES 0x00010000
-#define TRACE_FUNCTIONS 0x00020000
-#define TRACE_VALUES 0x00040000
-#define TRACE_OBJECTS 0x00080000
-#define TRACE_ALLOCATIONS 0x00100000
-#define TRACE_RESOURCES 0x00200000
-#define TRACE_IO 0x00400000
-#define TRACE_INTERRUPTS 0x00800000
-#define TRACE_USER_REQUESTS 0x01000000
-#define TRACE_PACKAGE 0x02000000
-#define TRACE_MUTEX 0x04000000
-#define TRACE_INIT 0x08000000
-
-#define TRACE_ALL 0x0FFFFF80
+#define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS)
+#define ACPI_DB_PARSE ACPI_DEBUG_LEVEL (ACPI_LV_PARSE)
+#define ACPI_DB_DISPATCH ACPI_DEBUG_LEVEL (ACPI_LV_DISPATCH)
+#define ACPI_DB_LOAD ACPI_DEBUG_LEVEL (ACPI_LV_LOAD)
+#define ACPI_DB_EXEC ACPI_DEBUG_LEVEL (ACPI_LV_EXEC)
+#define ACPI_DB_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_NAMES)
+#define ACPI_DB_OPREGION ACPI_DEBUG_LEVEL (ACPI_LV_OPREGION)
+#define ACPI_DB_BFIELD ACPI_DEBUG_LEVEL (ACPI_LV_BFIELD)
+#define ACPI_DB_TRASH ACPI_DEBUG_LEVEL (ACPI_LV_TRASH)
+#define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES)
+#define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS)
+#define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES)
+#define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS)
+#define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
+#define ACPI_DB_RESOURCES ACPI_DEBUG_LEVEL (ACPI_LV_RESOURCES)
+#define ACPI_DB_IO ACPI_DEBUG_LEVEL (ACPI_LV_IO)
+#define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS)
+#define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS)
+#define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE)
+#define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX)
+#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
+
+#define ACPI_DB_ALL ACPI_DEBUG_LEVEL (0x0FFFFF80)
/* Exceptionally verbose output -- also used in the global "DebugLevel" */
-#define VERBOSE_AML_DISASSEMBLE 0x10000000
-#define VERBOSE_INFO 0x20000000
-#define VERBOSE_TABLES 0x40000000
-#define VERBOSE_EVENTS 0x80000000
+#define ACPI_DB_AML_DISASSEMBLE 0x10000000
+#define ACPI_DB_VERBOSE_INFO 0x20000000
+#define ACPI_DB_FULL_TABLES 0x40000000
+#define ACPI_DB_EVENTS 0x80000000
-#define VERBOSE_ALL 0xF0000000
+#define ACPI_DB_VERBOSE 0xF0000000
/* Defaults for DebugLevel, debug and normal */
-#define DEBUG_DEFAULT (ACPI_OK | ACPI_WARN | ACPI_ERROR | ACPI_DEBUG_OBJECT)
-#define NORMAL_DEFAULT (ACPI_OK | ACPI_WARN | ACPI_ERROR | ACPI_DEBUG_OBJECT)
-#define DEBUG_ALL (VERBOSE_AML_DISASSEMBLE | TRACE_ALL | ACPI_ALL)
+#define DEBUG_DEFAULT (ACPI_LV_OK | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
+#define NORMAL_DEFAULT (ACPI_LV_OK | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
+#define DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
/* Misc defines */
diff --git a/sys/contrib/dev/acpica/acpixf.h b/sys/contrib/dev/acpica/acpixf.h
index 367065f9ae2d..e83af5d2a406 100644
--- a/sys/contrib/dev/acpica/acpixf.h
+++ b/sys/contrib/dev/acpica/acpixf.h
@@ -409,34 +409,7 @@ AcpiEnterSleepState (
UINT8 SleepState);
ACPI_STATUS
-AcpiGetProcessorThrottlingInfo (
- ACPI_HANDLE ProcessorHandle,
- ACPI_BUFFER *UserBuffer);
-
-ACPI_STATUS
-AcpiSetProcessorThrottlingState (
- ACPI_HANDLE ProcessorHandle,
- UINT32 ThrottleState);
-
-ACPI_STATUS
-AcpiGetProcessorThrottlingState (
- ACPI_HANDLE ProcessorHandle,
- UINT32 *ThrottleState);
-
-ACPI_STATUS
-AcpiGetProcessorCxInfo (
- ACPI_HANDLE ProcessorHandle,
- ACPI_BUFFER *UserBuffer);
-
-ACPI_STATUS
-AcpiSetProcessorSleepState (
- ACPI_HANDLE ProcessorHandle,
- UINT32 CxState);
-
-ACPI_STATUS
-AcpiProcessorSleep (
- ACPI_HANDLE ProcessorHandle,
- UINT32 *PmTimerTicks);
-
+AcpiLeaveSleepState (
+ UINT8 SleepState);
#endif /* __ACXFACE_H__ */
diff --git a/sys/contrib/dev/acpica/actypes.h b/sys/contrib/dev/acpica/actypes.h
index 828a6befcf95..aeb27423bf84 100644
--- a/sys/contrib/dev/acpica/actypes.h
+++ b/sys/contrib/dev/acpica/actypes.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actypes.h - Common data types for the entire ACPI subsystem
- * $Revision: 184 $
+ * $Revision: 186 $
*
*****************************************************************************/
@@ -285,6 +285,13 @@ typedef UINT32 ACPI_NAME; /* 4-byte ACPI name */
typedef char* ACPI_STRING; /* Null terminated ASCII string */
typedef void* ACPI_HANDLE; /* Actually a ptr to an Node */
+typedef struct
+{
+ UINT32 Lo;
+ UINT32 Hi;
+
+} UINT64_STRUCT;
+
/*
* Acpi integer width. In ACPI version 1, integers are
@@ -302,6 +309,7 @@ typedef UINT32 ACPI_INTEGER;
#define ACPI_INTEGER_BIT_SIZE 32
#define ACPI_MAX_BCD_VALUE 99999999
#define ACPI_MAX_BCD_DIGITS 8
+#define ACPI_MAX_DECIMAL_DIGITS 10
#else
@@ -312,6 +320,7 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_INTEGER_BIT_SIZE 64
#define ACPI_MAX_BCD_VALUE 9999999999999999
#define ACPI_MAX_BCD_DIGITS 16
+#define ACPI_MAX_DECIMAL_DIGITS 19
#endif
diff --git a/sys/contrib/dev/acpica/acutils.h b/sys/contrib/dev/acpica/acutils.h
index b08320547819..23498fd3bff5 100644
--- a/sys/contrib/dev/acpica/acutils.h
+++ b/sys/contrib/dev/acpica/acutils.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
- * $Revision: 104 $
+ * $Revision: 108 $
*
*****************************************************************************/
@@ -202,6 +202,11 @@ AcpiUtGetRegionName (
#endif
+UINT8
+AcpiUtHexToAsciiChar (
+ ACPI_INTEGER Integer,
+ UINT32 Position);
+
BOOLEAN
AcpiUtValidObjectType (
UINT32 Type);
@@ -423,23 +428,6 @@ FunctionPtrExit (
UINT8 *Ptr);
void
-DebugPrintPrefix (
- NATIVE_CHAR *ModuleName,
- UINT32 LineNumber);
-
-void
-DebugPrint (
- NATIVE_CHAR *ModuleName,
- UINT32 LineNumber,
- UINT32 ComponentId,
- UINT32 PrintLevel,
- NATIVE_CHAR *Format, ...);
-
-void
-DebugPrintRaw (
- NATIVE_CHAR *Format, ...);
-
-void
_ReportInfo (
NATIVE_CHAR *ModuleName,
UINT32 LineNumber,
@@ -464,6 +452,25 @@ AcpiUtDumpBuffer (
UINT32 Display,
UINT32 componentId);
+void
+AcpiUtDebugPrint (
+ UINT32 RequestedDebugLevel,
+ UINT32 ComponentId,
+ NATIVE_CHAR *ModuleName,
+ NATIVE_CHAR *ProcName,
+ UINT32 LineNumber,
+ char *Format,
+ ...);
+
+void
+AcpiUtDebugPrintRaw (
+ UINT32 RequestedDebugLevel,
+ UINT32 ComponentId,
+ NATIVE_CHAR *ModuleName,
+ NATIVE_CHAR *ProcName,
+ UINT32 LineNumber,
+ char *Format,
+ ...);
/*
* UtDelete - Object deletion
@@ -695,11 +702,26 @@ AcpiUtDisplayInitPathname (
/*
- * Memory allocation functions and related macros.
- * Macros that expand to include filename and line number
+ * Utalloc - memory allocation and object caching
*/
void *
+AcpiUtAcquireFromCache (
+ UINT32 ListId);
+
+void
+AcpiUtReleaseToCache (
+ UINT32 ListId,
+ void *Object);
+
+void
+AcpiUtDeleteGenericCache (
+ UINT32 ListId);
+
+
+/* Debug Memory allocation functions */
+
+void *
AcpiUtAllocate (
UINT32 Size,
UINT32 Component,
diff --git a/sys/contrib/dev/acpica/dbdisasm.c b/sys/contrib/dev/acpica/dbdisasm.c
index edeec3a9dffe..ccf68bf8a303 100644
--- a/sys/contrib/dev/acpica/dbdisasm.c
+++ b/sys/contrib/dev/acpica/dbdisasm.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbdisasm - parser op tree display routines
- * $Revision: 40 $
+ * $Revision: 43 $
*
******************************************************************************/
@@ -330,7 +330,7 @@ AcpiDbDisplayOp (
VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth));
for (i = 0; i < LastDepth; i++)
{
- AcpiOsPrintf (INDENT_STRING);
+ AcpiOsPrintf ("%s", INDENT_STRING);
}
if (AcpiDbBlockType (Op) == BLOCK_PAREN)
@@ -352,7 +352,7 @@ AcpiDbDisplayOp (
VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - j));
for (i = 0; i < (LastDepth - j - 1); i++)
{
- AcpiOsPrintf (INDENT_STRING);
+ AcpiOsPrintf ("%s", INDENT_STRING);
}
if (AcpiDbBlockType (Op) == BLOCK_PAREN)
@@ -375,7 +375,7 @@ AcpiDbDisplayOp (
for (i = 0; i < DepthCount; i++)
{
- AcpiOsPrintf (INDENT_STRING);
+ AcpiOsPrintf ("%s", INDENT_STRING);
}
@@ -414,7 +414,7 @@ AcpiDbDisplayOp (
VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - i));
for (j = 0; j < DepthCount; j++)
{
- AcpiOsPrintf (INDENT_STRING);
+ AcpiOsPrintf ("%s", INDENT_STRING);
}
AcpiOsPrintf ("}\n");
DepthCount--;
@@ -658,12 +658,12 @@ AcpiDbDisplayOpcode (
if (opt_verbose)
{
- AcpiOsPrintf ("(UINT8) 0x%2.2X", Op->Value.Integer & ACPI_UINT8_MAX);
+ AcpiOsPrintf ("(UINT8) 0x%2.2X", Op->Value.Integer8);
}
else
{
- AcpiOsPrintf ("0x%2.2X", Op->Value.Integer & ACPI_UINT8_MAX);
+ AcpiOsPrintf ("0x%2.2X", Op->Value.Integer8);
}
break;
@@ -673,12 +673,12 @@ AcpiDbDisplayOpcode (
if (opt_verbose)
{
- AcpiOsPrintf ("(UINT16) 0x%4.4X", Op->Value.Integer & ACPI_UINT16_MAX);
+ AcpiOsPrintf ("(UINT16) 0x%4.4X", Op->Value.Integer16);
}
else
{
- AcpiOsPrintf ("0x%4.4X", Op->Value.Integer & ACPI_UINT16_MAX);
+ AcpiOsPrintf ("0x%4.4X", Op->Value.Integer16);
}
break;
@@ -688,12 +688,29 @@ AcpiDbDisplayOpcode (
if (opt_verbose)
{
- AcpiOsPrintf ("(UINT32) 0x%8.8X", Op->Value.Integer);
+ AcpiOsPrintf ("(UINT32) 0x%8.8X", Op->Value.Integer32);
}
else
{
- AcpiOsPrintf ("0x%8.8X", Op->Value.Integer);
+ AcpiOsPrintf ("0x%8.8X", Op->Value.Integer32);
+ }
+
+ break;
+
+
+ case AML_QWORD_OP:
+
+ if (opt_verbose)
+ {
+ AcpiOsPrintf ("(UINT64) 0x%8.8X%8.8X", Op->Value.Integer64.Hi,
+ Op->Value.Integer64.Lo);
+ }
+
+ else
+ {
+ AcpiOsPrintf ("0x%8.8X%8.8X", Op->Value.Integer64.Hi,
+ Op->Value.Integer64.Lo);
}
break;
@@ -737,19 +754,19 @@ AcpiDbDisplayOpcode (
case AML_INT_NAMEDFIELD_OP:
- AcpiOsPrintf ("NamedField (Length 0x%8.8X) ", Op->Value.Integer);
+ AcpiOsPrintf ("NamedField (Length 0x%8.8X) ", Op->Value.Integer32);
break;
case AML_INT_RESERVEDFIELD_OP:
- AcpiOsPrintf ("ReservedField (Length 0x%8.8X) ", Op->Value.Integer);
+ AcpiOsPrintf ("ReservedField (Length 0x%8.8X) ", Op->Value.Integer32);
break;
case AML_INT_ACCESSFIELD_OP:
- AcpiOsPrintf ("AccessField (Length 0x%8.8X) ", Op->Value.Integer);
+ AcpiOsPrintf ("AccessField (Length 0x%8.8X) ", Op->Value.Integer32);
break;
@@ -757,14 +774,14 @@ AcpiDbDisplayOpcode (
if (opt_verbose)
{
- AcpiOsPrintf ("ByteList (Length 0x%8.8X) ", Op->Value.Integer);
+ AcpiOsPrintf ("ByteList (Length 0x%8.8X) ", Op->Value.Integer32);
}
else
{
- AcpiOsPrintf ("0x%2.2X", Op->Value.Integer);
+ AcpiOsPrintf ("0x%2.2X", Op->Value.Integer32);
- ByteCount = Op->Value.Integer;
+ ByteCount = Op->Value.Integer32;
ByteData = ((ACPI_PARSE2_OBJECT *) Op)->Data;
for (i = 0; i < ByteCount; i++)
diff --git a/sys/contrib/dev/acpica/dbdisply.c b/sys/contrib/dev/acpica/dbdisply.c
index 8ef647d5c4df..982a5c12d23f 100644
--- a/sys/contrib/dev/acpica/dbdisply.c
+++ b/sys/contrib/dev/acpica/dbdisply.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbdisply - debug display commands
- * $Revision: 46 $
+ * $Revision: 47 $
*
******************************************************************************/
@@ -412,10 +412,14 @@ AcpiDbDecodeInternalObject (
switch (ObjDesc->Common.Type)
{
case ACPI_TYPE_INTEGER:
- AcpiOsPrintf (" %.8X", ObjDesc->Integer.Value);
+
+ AcpiOsPrintf (" %.8X%.8X", HIDWORD (ObjDesc->Integer.Value),
+ LODWORD (ObjDesc->Integer.Value));
break;
+
case ACPI_TYPE_STRING:
+
AcpiOsPrintf ("(%d) \"%.24s",
ObjDesc->String.Length, ObjDesc->String.Pointer);
@@ -429,7 +433,9 @@ AcpiDbDecodeInternalObject (
}
break;
+
case ACPI_TYPE_BUFFER:
+
AcpiOsPrintf ("(%d)", ObjDesc->Buffer.Length);
for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++)
{
@@ -510,15 +516,15 @@ AcpiDbDisplayInternalObject (
switch (ObjDesc->Reference.Opcode)
{
case AML_ZERO_OP:
- AcpiOsPrintf ("[Const] Number %.8X", 0);
+ AcpiOsPrintf ("[Const] Zero (0) [Null Target]", 0);
break;
case AML_ONES_OP:
- AcpiOsPrintf ("[Const] Number %.8X", ACPI_UINT32_MAX);
+ AcpiOsPrintf ("[Const] Ones (0xFFFFFFFFFFFFFFFF) [No Limit]");
break;
case AML_ONE_OP:
- AcpiOsPrintf ("[Const] Number %.8X", 1);
+ AcpiOsPrintf ("[Const] One (1)");
break;
case AML_LOCAL_OP:
diff --git a/sys/contrib/dev/acpica/dbexec.c b/sys/contrib/dev/acpica/dbexec.c
index b0f9dc5f6f1e..9a14b8636b22 100644
--- a/sys/contrib/dev/acpica/dbexec.c
+++ b/sys/contrib/dev/acpica/dbexec.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbexec - debugger control method execution
- * $Revision: 27 $
+ * $Revision: 29 $
*
******************************************************************************/
@@ -259,6 +259,40 @@ AcpiDbExecuteSetup (
/*******************************************************************************
*
+ * FUNCTION: AcpiDbGetOutstandingAllocations
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Current global allocation count minus cache entries
+ *
+ * DESCRIPTION: Determine the current number of "outstanding" allocations --
+ * those allocations that have not been freed and also are not
+ * in one of the various object caches.
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiDbGetOutstandingAllocations (void)
+{
+ UINT32 i;
+ UINT32 Outstanding = 0;
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+
+ for (i = ACPI_MEM_LIST_FIRST_CACHE_LIST; i < ACPI_NUM_MEM_LISTS; i++)
+ {
+ Outstanding += (AcpiGbl_MemoryLists[i].TotalAllocated -
+ AcpiGbl_MemoryLists[i].TotalFreed -
+ AcpiGbl_MemoryLists[i].CacheDepth);
+ }
+#endif
+
+ return (Outstanding);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDbExecute
*
* PARAMETERS: Name - Name of method to execute
@@ -284,15 +318,12 @@ AcpiDbExecute (
#ifdef ACPI_DEBUG
UINT32 PreviousAllocations;
- UINT32 PreviousSize;
UINT32 Allocations;
- UINT32 Size;
/* Memory allocation tracking */
- PreviousAllocations = AcpiGbl_CurrentAllocCount;
- PreviousSize = AcpiGbl_CurrentAllocSize;
+ PreviousAllocations = AcpiDbGetOutstandingAllocations ();
#endif
Info.Name = Name;
@@ -302,20 +333,25 @@ AcpiDbExecute (
AcpiDbExecuteSetup (&Info);
Status = AcpiDbExecuteMethod (&Info, &ReturnObj);
+ /*
+ * Allow any handlers in separate threads to complete.
+ * (Such as Notify handlers invoked from AML executed above).
+ */
+ AcpiOsSleep (0, 10);
+
#ifdef ACPI_DEBUG
/* Memory allocation tracking */
- Allocations = AcpiGbl_CurrentAllocCount - PreviousAllocations;
- Size = AcpiGbl_CurrentAllocSize - PreviousSize;
+ Allocations = AcpiDbGetOutstandingAllocations () - PreviousAllocations;
AcpiDbSetOutputDestination (DB_DUPLICATE_OUTPUT);
if (Allocations > 0)
{
- AcpiOsPrintf ("Outstanding: %ld allocations of total size %ld after execution\n",
- Allocations, Size);
+ AcpiOsPrintf ("Outstanding: %ld allocations after execution\n",
+ Allocations);
}
#endif
diff --git a/sys/contrib/dev/acpica/dbfileio.c b/sys/contrib/dev/acpica/dbfileio.c
index 57e430da105e..d492f659b3c7 100644
--- a/sys/contrib/dev/acpica/dbfileio.c
+++ b/sys/contrib/dev/acpica/dbfileio.c
@@ -2,7 +2,7 @@
*
* Module Name: dbfileio - Debugger file I/O commands. These can't usually
* be used when running the debugger in Ring 0 (Kernel mode)
- * $Revision: 43 $
+ * $Revision: 44 $
*
******************************************************************************/
@@ -314,7 +314,8 @@ AcpiDbLoadTable(
*TablePtr = ACPI_MEM_ALLOCATE ((size_t) *TableLength);
if (!*TablePtr)
{
- AcpiOsPrintf ("Could not allocate memory for the table (size=%X)\n", TableHeader.Length);
+ AcpiOsPrintf ("Could not allocate memory for ACPI table %4.4s (size=%X)\n",
+ TableHeader.Signature, TableHeader.Length);
return (AE_NO_MEMORY);
}
diff --git a/sys/contrib/dev/acpica/dbinput.c b/sys/contrib/dev/acpica/dbinput.c
index 1eb93d50be8e..576fb68b4a5a 100644
--- a/sys/contrib/dev/acpica/dbinput.c
+++ b/sys/contrib/dev/acpica/dbinput.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbinput - user front-end to the AML debugger
- * $Revision: 62 $
+ * $Revision: 64 $
*
******************************************************************************/
@@ -144,7 +144,7 @@ BOOLEAN OutputToFile = FALSE;
UINT32 AcpiGbl_DbDebugLevel = 0x0FFFFFFF;
-UINT32 AcpiGbl_DbConsoleDebugLevel = NORMAL_DEFAULT | TRACE_TABLES;
+UINT32 AcpiGbl_DbConsoleDebugLevel = NORMAL_DEFAULT | ACPI_LV_TABLES;
UINT8 AcpiGbl_DbOutputFlags = DB_CONSOLE_OUTPUT;
@@ -264,7 +264,7 @@ COMMAND_INFO Commands[] =
{"TERMINATE", 0},
{"THREADS", 3},
{"TREE", 0},
- {"UNLOAD", 0},
+ {"UNLOAD", 1},
{NULL, 0}
};
@@ -325,7 +325,7 @@ AcpiDbDisplayHelp (
AcpiOsPrintf ("Stats [Allocations|Memory|Misc\n");
AcpiOsPrintf (" |Objects|Tables] Display namespace and memory statistics\n");
AcpiOsPrintf ("Tables Display info about loaded ACPI tables\n");
- AcpiOsPrintf ("Unload Unload an ACPI table\n");
+ AcpiOsPrintf ("Unload <TableSig> [Instance] Unload an ACPI table\n");
AcpiOsPrintf ("! <CommandNumber> Execute command from history buffer\n");
AcpiOsPrintf ("!! Execute last command again\n");
return;
diff --git a/sys/contrib/dev/acpica/dbstats.c b/sys/contrib/dev/acpica/dbstats.c
index 89019ebeefec..043f42a6d1b9 100644
--- a/sys/contrib/dev/acpica/dbstats.c
+++ b/sys/contrib/dev/acpica/dbstats.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbstats - Generation and display of ACPI table statistics
- * $Revision: 41 $
+ * $Revision: 43 $
*
******************************************************************************/
@@ -378,6 +378,8 @@ AcpiDbDisplayStatistics (
{
UINT32 i;
UINT32 Type;
+ UINT32 Outstanding;
+ UINT32 Size;
if (!AcpiGbl_DSDT)
@@ -454,39 +456,48 @@ AcpiDbDisplayStatistics (
case CMD_MEMORY:
- AcpiOsPrintf ("\nDynamic Memory Estimates:\n\n");
- AcpiOsPrintf ("Parse Tree without Methods:.% 7ld\n", SizeOfParseTree);
- AcpiOsPrintf ("Control Method Parse Trees:.% 7ld (If parsed simultaneously)\n", SizeOfMethodTrees);
- AcpiOsPrintf ("Namespace Nodes:............% 7ld (%d nodes)\n", sizeof (ACPI_NAMESPACE_NODE) * NumNodes, NumNodes);
- AcpiOsPrintf ("Named Internal Objects......% 7ld\n", SizeOfAcpiObjects);
- AcpiOsPrintf ("State Cache size............% 7ld\n", AcpiGbl_GenericStateCacheDepth * sizeof (ACPI_GENERIC_STATE));
- AcpiOsPrintf ("Parse Cache size............% 7ld\n", AcpiGbl_ParseCacheDepth * sizeof (ACPI_PARSE_OBJECT));
- AcpiOsPrintf ("Object Cache size...........% 7ld\n", AcpiGbl_ObjectCacheDepth * sizeof (ACPI_OPERAND_OBJECT));
- AcpiOsPrintf ("WalkState Cache size........% 7ld\n", AcpiGbl_WalkStateCacheDepth * sizeof (ACPI_WALK_STATE));
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+ AcpiOsPrintf ("\n----Object and Cache Statistics---------------------------------------------\n");
- AcpiOsPrintf ("\n");
+ for (i = 0; i < ACPI_NUM_MEM_LISTS; i++)
+ {
+ AcpiOsPrintf ("\n%s\n", AcpiGbl_MemoryLists[i].ListName);
+
+ if (AcpiGbl_MemoryLists[i].MaxCacheDepth > 0)
+ {
+ AcpiOsPrintf (" Cache: [Depth Max Avail Size] % 7d % 7d % 7d % 7d B\n",
+ AcpiGbl_MemoryLists[i].CacheDepth,
+ AcpiGbl_MemoryLists[i].MaxCacheDepth,
+ AcpiGbl_MemoryLists[i].MaxCacheDepth - AcpiGbl_MemoryLists[i].CacheDepth,
+ (AcpiGbl_MemoryLists[i].CacheDepth * AcpiGbl_MemoryLists[i].ObjectSize));
+
+ AcpiOsPrintf (" Cache: [Requests Hits Misses ObjSize] % 7d % 7d % 7d % 7d B\n",
+ AcpiGbl_MemoryLists[i].CacheRequests,
+ AcpiGbl_MemoryLists[i].CacheHits,
+ AcpiGbl_MemoryLists[i].CacheRequests - AcpiGbl_MemoryLists[i].CacheHits,
+ AcpiGbl_MemoryLists[i].ObjectSize);
+ }
+
+ Outstanding = AcpiGbl_MemoryLists[i].TotalAllocated -
+ AcpiGbl_MemoryLists[i].TotalFreed -
+ AcpiGbl_MemoryLists[i].CacheDepth;
+
+ if (AcpiGbl_MemoryLists[i].ObjectSize)
+ {
+ Size = ROUND_UP_TO_1K (Outstanding * AcpiGbl_MemoryLists[i].ObjectSize);
+ }
+ else
+ {
+ Size = ROUND_UP_TO_1K (AcpiGbl_MemoryLists[i].CurrentTotalSize);
+ }
+
+ AcpiOsPrintf (" Mem: [Alloc Free Outstanding Size] % 7d % 7d % 7d % 7d Kb\n",
+ AcpiGbl_MemoryLists[i].TotalAllocated,
+ AcpiGbl_MemoryLists[i].TotalFreed,
+ Outstanding, Size);
+ }
+#endif
- AcpiOsPrintf ("Cache Statistics:\n\n");
- AcpiOsPrintf ("State Cache requests........% 7ld\n", AcpiGbl_StateCacheRequests);
- AcpiOsPrintf ("State Cache hits............% 7ld\n", AcpiGbl_StateCacheHits);
- AcpiOsPrintf ("State Cache depth...........% 7ld (%d remaining entries)\n", AcpiGbl_GenericStateCacheDepth,
- MAX_STATE_CACHE_DEPTH - AcpiGbl_GenericStateCacheDepth);
- AcpiOsPrintf ("Parse Cache requests........% 7ld\n", AcpiGbl_ParseCacheRequests);
- AcpiOsPrintf ("Parse Cache hits............% 7ld\n", AcpiGbl_ParseCacheHits);
- AcpiOsPrintf ("Parse Cache depth...........% 7ld (%d remaining entries)\n", AcpiGbl_ParseCacheDepth,
- MAX_PARSE_CACHE_DEPTH - AcpiGbl_ParseCacheDepth);
- AcpiOsPrintf ("Ext Parse Cache requests....% 7ld\n", AcpiGbl_ExtParseCacheRequests);
- AcpiOsPrintf ("Ext Parse Cache hits........% 7ld\n", AcpiGbl_ExtParseCacheHits);
- AcpiOsPrintf ("Ext Parse Cache depth.......% 7ld (%d remaining entries)\n", AcpiGbl_ExtParseCacheDepth,
- MAX_EXTPARSE_CACHE_DEPTH - AcpiGbl_ExtParseCacheDepth);
- AcpiOsPrintf ("Object Cache requests.......% 7ld\n", AcpiGbl_ObjectCacheRequests);
- AcpiOsPrintf ("Object Cache hits...........% 7ld\n", AcpiGbl_ObjectCacheHits);
- AcpiOsPrintf ("Object Cache depth..........% 7ld (%d remaining entries)\n", AcpiGbl_ObjectCacheDepth,
- MAX_OBJECT_CACHE_DEPTH - AcpiGbl_ObjectCacheDepth);
- AcpiOsPrintf ("WalkState Cache requests....% 7ld\n", AcpiGbl_WalkStateCacheRequests);
- AcpiOsPrintf ("WalkState Cache hits........% 7ld\n", AcpiGbl_WalkStateCacheHits);
- AcpiOsPrintf ("WalkState Cache depth.......% 7ld (%d remaining entries)\n", AcpiGbl_WalkStateCacheDepth,
- MAX_WALK_CACHE_DEPTH - AcpiGbl_WalkStateCacheDepth);
break;
case CMD_MISC:
diff --git a/sys/contrib/dev/acpica/dbutils.c b/sys/contrib/dev/acpica/dbutils.c
index 06cf8f8754ba..2ca67c4adb00 100644
--- a/sys/contrib/dev/acpica/dbutils.c
+++ b/sys/contrib/dev/acpica/dbutils.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbutils - AML debugger utilities
- * $Revision: 39 $
+ * $Revision: 41 $
*
******************************************************************************/
@@ -185,7 +185,7 @@ AcpiDbDumpBuffer (
AcpiOsPrintf ("\nLocation %X:\n", Address);
- AcpiDbgLevel |= TRACE_TABLES;
+ AcpiDbgLevel |= ACPI_LV_TABLES;
AcpiUtDumpBuffer ((UINT8 *) Address, 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
}
@@ -226,12 +226,14 @@ AcpiDbDumpObject (
{
case ACPI_TYPE_ANY:
- AcpiOsPrintf ("[Object Reference] Value: %p\n", ObjDesc->Reference.Handle);
+ AcpiOsPrintf ("[Object Reference] = %p\n", ObjDesc->Reference.Handle);
break;
case ACPI_TYPE_INTEGER:
- AcpiOsPrintf ("[Number] Value: %ld (%lX)\n", ObjDesc->Integer.Value, ObjDesc->Integer.Value);
+
+ AcpiOsPrintf ("[Integer] = %X%8.8X\n", HIDWORD (ObjDesc->Integer.Value),
+ LODWORD (ObjDesc->Integer.Value));
break;
@@ -248,7 +250,7 @@ AcpiDbDumpObject (
case ACPI_TYPE_BUFFER:
- AcpiOsPrintf ("[Buffer] Value: ");
+ AcpiOsPrintf ("[Buffer] = ");
AcpiUtDumpBuffer ((UINT8 *) ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
break;
@@ -265,17 +267,23 @@ AcpiDbDumpObject (
case INTERNAL_TYPE_REFERENCE:
- AcpiOsPrintf ("[Object Reference] Value: %p\n", ObjDesc->Reference.Handle);
+
+ AcpiOsPrintf ("[Object Reference] = %p\n", ObjDesc->Reference.Handle);
break;
+
case ACPI_TYPE_PROCESSOR:
+
AcpiOsPrintf ("[Processor]\n");
break;
+
case ACPI_TYPE_POWER:
+
AcpiOsPrintf ("[Power Resource]\n");
break;
+
default:
AcpiOsPrintf ("[Unknown Type] %X \n", ObjDesc->Type);
diff --git a/sys/contrib/dev/acpica/dbxface.c b/sys/contrib/dev/acpica/dbxface.c
index 28c49a65d497..1d176fe48e73 100644
--- a/sys/contrib/dev/acpica/dbxface.c
+++ b/sys/contrib/dev/acpica/dbxface.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbxface - AML Debugger external interfaces
- * $Revision: 37 $
+ * $Revision: 38 $
*
******************************************************************************/
@@ -212,10 +212,10 @@ AcpiDbSingleStep (
if ((OutputToFile) ||
(AcpiGbl_CmSingleStep) ||
- (AcpiDbgLevel & TRACE_PARSE))
+ (AcpiDbgLevel & ACPI_LV_PARSE))
{
if ((OutputToFile) ||
- (AcpiDbgLevel & TRACE_PARSE))
+ (AcpiDbgLevel & ACPI_LV_PARSE))
{
AcpiOsPrintf ("\n[AmlDebug] Next AML Opcode to execute:\n");
}
@@ -227,7 +227,7 @@ AcpiDbSingleStep (
*/
OriginalDebugLevel = AcpiDbgLevel;
- AcpiDbgLevel &= ~(TRACE_PARSE | TRACE_FUNCTIONS);
+ AcpiDbgLevel &= ~(ACPI_LV_PARSE | ACPI_LV_FUNCTIONS);
Next = Op->Next;
Op->Next = NULL;
diff --git a/sys/contrib/dev/acpica/dsfield.c b/sys/contrib/dev/acpica/dsfield.c
index 2239077a39a2..d9e8c5074ec9 100644
--- a/sys/contrib/dev/acpica/dsfield.c
+++ b/sys/contrib/dev/acpica/dsfield.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsfield - Dispatcher field routines
- * $Revision: 41 $
+ * $Revision: 43 $
*
*****************************************************************************/
@@ -310,13 +310,13 @@ AcpiDsCreateBankField (
/* Third arg is the BankValue */
Arg = Arg->Next;
- BankValue = Arg->Value.Integer;
+ BankValue = Arg->Value.Integer32;
/* Next arg is the field flags */
Arg = Arg->Next;
- FieldFlags = (UINT8) Arg->Value.Integer;
+ FieldFlags = Arg->Value.Integer8;
/* Each remaining arg is a Named Field */
@@ -503,7 +503,7 @@ AcpiDsCreateIndexField (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Invalid opcode in field list: %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n",
Arg->Opcode));
Status = AE_AML_ERROR;
break;
diff --git a/sys/contrib/dev/acpica/dsmethod.c b/sys/contrib/dev/acpica/dsmethod.c
index 585b85642f29..b9ffc8077763 100644
--- a/sys/contrib/dev/acpica/dsmethod.c
+++ b/sys/contrib/dev/acpica/dsmethod.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing
- * $Revision: 63 $
+ * $Revision: 64 $
*
*****************************************************************************/
@@ -169,7 +169,7 @@ AcpiDsParseMethod (
return_ACPI_STATUS (AE_NULL_ENTRY);
}
- DEBUG_PRINTP (ACPI_INFO, ("**** Parsing [%4.4s] **** NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Parsing [%4.4s] **** NamedObj=%p\n",
&((ACPI_NAMESPACE_NODE *)ObjHandle)->Name, ObjHandle));
@@ -238,7 +238,7 @@ AcpiDsParseMethod (
OwnerId = AcpiUtAllocateOwnerId (OWNER_TYPE_METHOD);
ObjDesc->Method.OwningId = OwnerId;
- DEBUG_PRINTP (ACPI_INFO, ("**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n",
&((ACPI_NAMESPACE_NODE *)ObjHandle)->Name, ObjHandle, Op));
/* Install the parsed tree in the method object */
@@ -356,7 +356,7 @@ AcpiDsCallControlMethod (
FUNCTION_TRACE_PTR ("DsCallControlMethod", ThisWalkState);
- DEBUG_PRINTP (TRACE_DISPATCH, ("Execute method %p, currentstate=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Execute method %p, currentstate=%p\n",
ThisWalkState->PrevOp, ThisWalkState));
/*
@@ -476,7 +476,7 @@ AcpiDsCallControlMethod (
ThisWalkState->NumOperands = 0;
- DEBUG_PRINTP (TRACE_DISPATCH, ("Starting nested execution, newstate=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Starting nested execution, newstate=%p\n",
NextWalkState));
return_ACPI_STATUS (AE_OK);
@@ -543,8 +543,8 @@ AcpiDsRestartControlMethod (
}
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("Method=%p Return=%p ReturnUsed?=%X ResStack=%p State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Method=%p Return=%p ReturnUsed?=%X ResStack=%p State=%p\n",
WalkState->MethodCallOp, ReturnDesc, WalkState->ReturnUsed,
WalkState->Results, WalkState));
diff --git a/sys/contrib/dev/acpica/dsmthdat.c b/sys/contrib/dev/acpica/dsmthdat.c
index 6c0bdc77d37e..7645b31e5e04 100644
--- a/sys/contrib/dev/acpica/dsmthdat.c
+++ b/sys/contrib/dev/acpica/dsmthdat.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dsmthdat - control method arguments and local variables
- * $Revision: 47 $
+ * $Revision: 48 $
*
******************************************************************************/
@@ -215,14 +215,14 @@ AcpiDsMethodDataDeleteAll (
/* Delete the locals */
- DEBUG_PRINTP (ACPI_INFO, ("Deleting local variables in %p\n", WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting local variables in %p\n", WalkState));
for (Index = 0; Index < MTH_NUM_LOCALS; Index++)
{
Object = WalkState->LocalVariables[Index].Object;
if (Object)
{
- DEBUG_PRINTP (TRACE_EXEC, ("Deleting Local%d=%p\n", Index, Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n", Index, Object));
/* Remove first */
@@ -237,14 +237,14 @@ AcpiDsMethodDataDeleteAll (
/* Delete the arguments */
- DEBUG_PRINTP (ACPI_INFO, ("Deleting arguments in %p\n", WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting arguments in %p\n", WalkState));
for (Index = 0; Index < MTH_NUM_ARGS; Index++)
{
Object = WalkState->Arguments[Index].Object;
if (Object)
{
- DEBUG_PRINTP (TRACE_EXEC, ("Deleting Arg%d=%p\n", Index, Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n", Index, Object));
/* Remove first */
@@ -290,7 +290,7 @@ AcpiDsMethodDataInitArgs (
if (!Params)
{
- DEBUG_PRINTP (TRACE_EXEC, ("No param list passed to method\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "No param list passed to method\n"));
return_ACPI_STATUS (AE_OK);
}
@@ -323,7 +323,7 @@ AcpiDsMethodDataInitArgs (
}
}
- DEBUG_PRINTP (TRACE_EXEC, ("%d args passed to method\n", Pindex));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", Pindex));
return_ACPI_STATUS (AE_OK);
}
@@ -367,7 +367,7 @@ AcpiDsMethodDataGetEntry (
if (Index > MTH_MAX_LOCAL)
{
- DEBUG_PRINTP (ACPI_ERROR, ("LocalVar index %d is invalid (max %d)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "LocalVar index %d is invalid (max %d)\n",
Index, MTH_MAX_LOCAL));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -381,7 +381,7 @@ AcpiDsMethodDataGetEntry (
if (Index > MTH_MAX_ARG)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Arg index %d is invalid (max %d)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n",
Index, MTH_MAX_ARG));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -392,7 +392,7 @@ AcpiDsMethodDataGetEntry (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Opcode %d is invalid\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Opcode %d is invalid\n", Opcode));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -533,7 +533,7 @@ AcpiDsMethodDataGetNode (
if (Index > MTH_MAX_LOCAL)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Local index %d is invalid (max %d)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local index %d is invalid (max %d)\n",
Index, MTH_MAX_LOCAL));
return_PTR (Node);
}
@@ -546,7 +546,7 @@ AcpiDsMethodDataGetNode (
if (Index > MTH_MAX_ARG)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Arg index %d is invalid (max %d)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n",
Index, MTH_MAX_ARG));
return_PTR (Node);
}
@@ -556,7 +556,7 @@ AcpiDsMethodDataGetNode (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Opcode %d is invalid\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Opcode %d is invalid\n", Opcode));
break;
}
@@ -602,7 +602,7 @@ AcpiDsMethodDataGetValue (
if (!DestDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null object descriptor pointer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null object descriptor pointer\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -636,7 +636,7 @@ AcpiDsMethodDataGetValue (
{
case AML_ARG_OP:
- DEBUG_PRINTP (ACPI_ERROR, ("Uninitialized Arg[%d] at entry %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at entry %p\n",
Index, Entry));
return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG);
@@ -644,7 +644,7 @@ AcpiDsMethodDataGetValue (
case AML_LOCAL_OP:
- DEBUG_PRINTP (ACPI_ERROR, ("Uninitialized Local[%d] at entry %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Local[%d] at entry %p\n",
Index, Entry));
return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL);
@@ -759,7 +759,7 @@ AcpiDsStoreObjectToLocal (
FUNCTION_TRACE ("DsMethodDataSetValue");
- DEBUG_PRINTP (TRACE_EXEC, ("Opcode=%d Idx=%d Obj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n",
Opcode, Index, SrcDesc));
@@ -781,7 +781,7 @@ AcpiDsStoreObjectToLocal (
if (*Entry == SrcDesc)
{
- DEBUG_PRINTP (TRACE_EXEC, ("Obj=%p already installed!\n", SrcDesc));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", SrcDesc));
goto Cleanup;
}
@@ -815,8 +815,8 @@ AcpiDsStoreObjectToLocal (
if ((Opcode == AML_ARG_OP) &&
(VALID_DESCRIPTOR_TYPE (*Entry, ACPI_DESC_TYPE_NAMED)))
{
- DEBUG_PRINTP (TRACE_EXEC,
- ("Arg (%p) is an ObjRef(Node), storing in %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Arg (%p) is an ObjRef(Node), storing in %p\n",
SrcDesc, *Entry));
/* Detach an existing object from the Node */
diff --git a/sys/contrib/dev/acpica/dsobject.c b/sys/contrib/dev/acpica/dsobject.c
index daf7205503f5..12a0f81b70ff 100644
--- a/sys/contrib/dev/acpica/dsobject.c
+++ b/sys/contrib/dev/acpica/dsobject.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsobject - Dispatcher object management routines
- * $Revision: 67 $
+ * $Revision: 71 $
*
*****************************************************************************/
@@ -197,9 +197,9 @@ AcpiDsInitOneObject (
Info->MethodCount++;
- if (!(AcpiDbgLevel & TRACE_INIT))
+ if (!(AcpiDbgLevel & ACPI_LV_INIT))
{
- DEBUG_PRINT_RAW (ACPI_OK, ("."));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
/*
@@ -223,7 +223,7 @@ AcpiDsInitOneObject (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Method %p [%4.4s] parse failed! %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] parse failed! %s\n",
ObjHandle, &((ACPI_NAMESPACE_NODE *)ObjHandle)->Name,
AcpiFormatException (Status)));
break;
@@ -273,9 +273,9 @@ AcpiDsInitializeObjects (
FUNCTION_TRACE ("DsInitializeObjects");
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("**** Starting initialization of namespace objects ****\n"));
- DEBUG_PRINT_RAW (ACPI_OK, ("Parsing Methods:"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "**** Starting initialization of namespace objects ****\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Parsing Methods:"));
Info.MethodCount = 0;
@@ -290,16 +290,16 @@ AcpiDsInitializeObjects (
AcpiDsInitOneObject, &Info, NULL);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("WalkNamespace failed! %x\n", Status));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed! %x\n", Status));
}
- DEBUG_PRINT_RAW (ACPI_OK,
- ("\n%d Control Methods found and parsed (%d nodes total)\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ "\n%d Control Methods found and parsed (%d nodes total)\n",
Info.MethodCount, Info.ObjectCount));
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("%d Control Methods found\n", Info.MethodCount));
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("%d Op Regions found\n", Info.OpRegionCount));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "%d Control Methods found\n", Info.MethodCount));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "%d Op Regions found\n", Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
@@ -326,18 +326,20 @@ AcpiDsInitObjectFromOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
UINT16 Opcode,
- ACPI_OPERAND_OBJECT **ObjDesc)
+ ACPI_OPERAND_OBJECT **RetObjDesc)
{
ACPI_STATUS Status;
ACPI_PARSE_OBJECT *Arg;
ACPI_PARSE2_OBJECT *ByteList;
ACPI_OPERAND_OBJECT *ArgDesc;
ACPI_OPCODE_INFO *OpInfo;
+ ACPI_OPERAND_OBJECT *ObjDesc;
PROC_NAME ("DsInitObjectFromOp");
+ ObjDesc = *RetObjDesc;
OpInfo = AcpiPsGetOpcodeInfo (Opcode);
if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE)
{
@@ -349,7 +351,7 @@ AcpiDsInitObjectFromOp (
/* Get and prepare the first argument */
- switch ((*ObjDesc)->Common.Type)
+ switch (ObjDesc->Common.Type)
{
case ACPI_TYPE_BUFFER:
@@ -372,8 +374,8 @@ AcpiDsInitObjectFromOp (
if (ArgDesc->Common.Type != ACPI_TYPE_INTEGER)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Expecting number, got obj: %p type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Expecting number, got obj: %p type %X\n",
ArgDesc, ArgDesc->Common.Type));
AcpiUtRemoveReference (ArgDesc);
return (AE_TYPE);
@@ -381,49 +383,48 @@ AcpiDsInitObjectFromOp (
/* Get the value, delete the internal object */
- (*ObjDesc)->Buffer.Length = (UINT32) ArgDesc->Integer.Value;
+ ObjDesc->Buffer.Length = (UINT32) ArgDesc->Integer.Value;
AcpiUtRemoveReference (ArgDesc);
/* Allocate the buffer */
- if ((*ObjDesc)->Buffer.Length == 0)
+ if (ObjDesc->Buffer.Length == 0)
{
- (*ObjDesc)->Buffer.Pointer = NULL;
+ ObjDesc->Buffer.Pointer = NULL;
REPORT_WARNING (("Buffer created with zero length in AML\n"));
break;
}
else
{
- (*ObjDesc)->Buffer.Pointer = ACPI_MEM_CALLOCATE (
- (*ObjDesc)->Buffer.Length);
+ ObjDesc->Buffer.Pointer = ACPI_MEM_CALLOCATE (
+ ObjDesc->Buffer.Length);
- if (!(*ObjDesc)->Buffer.Pointer)
+ if (!ObjDesc->Buffer.Pointer)
{
return (AE_NO_MEMORY);
}
}
/*
- * Second arg is the buffer data (optional)
- * ByteList can be either individual bytes or a
- * string initializer!
+ * Second arg is the buffer data (optional) ByteList can be either
+ * individual bytes or a string initializer.
*/
- /* skip first arg */
- Arg = Op->Value.Arg;
+ Arg = Op->Value.Arg; /* skip first arg */
+
ByteList = (ACPI_PARSE2_OBJECT *) Arg->Next;
if (ByteList)
{
if (ByteList->Opcode != AML_INT_BYTELIST_OP)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Expecting bytelist, got: %x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %x\n",
ByteList));
return (AE_TYPE);
}
- MEMCPY ((*ObjDesc)->Buffer.Pointer, ByteList->Data,
- (*ObjDesc)->Buffer.Length);
+ MEMCPY (ObjDesc->Buffer.Pointer, ByteList->Data,
+ ObjDesc->Buffer.Length);
}
break;
@@ -432,26 +433,24 @@ AcpiDsInitObjectFromOp (
case ACPI_TYPE_PACKAGE:
/*
- * When called, an internal package object has already
- * been built and is pointed to by *ObjDesc.
- * AcpiDsBuildInternalObject build another internal
- * package object, so remove reference to the original
- * so that it is deleted. Error checking is done
- * within the remove reference function.
+ * When called, an internal package object has already been built and
+ * is pointed to by ObjDesc. AcpiDsBuildInternalObject builds another
+ * internal package object, so remove reference to the original so
+ * that it is deleted. Error checking is done within the remove
+ * reference function.
*/
- AcpiUtRemoveReference(*ObjDesc);
-
- Status = AcpiDsBuildInternalObject (WalkState, Op, ObjDesc);
+ AcpiUtRemoveReference (ObjDesc);
+ Status = AcpiDsBuildInternalObject (WalkState, Op, RetObjDesc);
break;
case ACPI_TYPE_INTEGER:
- (*ObjDesc)->Integer.Value = Op->Value.Integer;
+ ObjDesc->Integer.Value = Op->Value.Integer;
break;
case ACPI_TYPE_STRING:
- (*ObjDesc)->String.Pointer = Op->Value.String;
- (*ObjDesc)->String.Length = STRLEN (Op->Value.String);
+ ObjDesc->String.Pointer = Op->Value.String;
+ ObjDesc->String.Length = STRLEN (Op->Value.String);
break;
@@ -467,28 +466,84 @@ AcpiDsInitObjectFromOp (
/* Split the opcode into a base opcode + offset */
- (*ObjDesc)->Reference.Opcode = AML_LOCAL_OP;
- (*ObjDesc)->Reference.Offset = Opcode - AML_LOCAL_OP;
+ ObjDesc->Reference.Opcode = AML_LOCAL_OP;
+ ObjDesc->Reference.Offset = Opcode - AML_LOCAL_OP;
break;
+
case OPTYPE_METHOD_ARGUMENT:
/* Split the opcode into a base opcode + offset */
- (*ObjDesc)->Reference.Opcode = AML_ARG_OP;
- (*ObjDesc)->Reference.Offset = Opcode - AML_ARG_OP;
+ ObjDesc->Reference.Opcode = AML_ARG_OP;
+ ObjDesc->Reference.Offset = Opcode - AML_ARG_OP;
break;
+
+#ifdef INTEGER_CONST__
+ case OPTYPE_CONSTANT:
+
+ /* TBD: Why is the DEBUG object a CONSTANT? */
+
+ if (Op->Opcode == AML_DEBUG_OP)
+ {
+ break;
+ }
+
+ /* Reference object no longer needed */
+
+ AcpiUtRemoveReference (ObjDesc);
+
+ /* Create/Init a new Integer object */
+
+ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ if (!ObjDesc)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ /*
+ * Decode constants here. Turn them into real integer objects
+ * that are initialized to the value of the constant.
+ */
+ switch (Op->Opcode)
+ {
+ case AML_ONE_OP:
+ ObjDesc->Integer.Value = 1;
+ break;
+
+ case AML_ONES_OP:
+ ObjDesc->Integer.Value = ACPI_INTEGER_MAX;
+ break;
+
+ case AML_REVISION_OP:
+ ObjDesc->Integer.Value = ACPI_CA_VERSION;
+ break;
+
+ case AML_ZERO_OP:
+ ObjDesc->Integer.Flags |= AOPOBJ_ZERO_CONST;
+ ObjDesc->Integer.Value = 0;
+ break;
+
+ default:
+ ObjDesc->Integer.Value = 0;
+ break;
+ }
+
+ *RetObjDesc = ObjDesc;
+ break;
+#endif
+
default: /* Constants, Literals, etc.. */
if (Op->Opcode == AML_INT_NAMEPATH_OP)
{
/* Node was saved in Op */
- (*ObjDesc)->Reference.Node = Op->Node;
+ ObjDesc->Reference.Node = Op->Node;
}
- (*ObjDesc)->Reference.Opcode = Opcode;
+ ObjDesc->Reference.Opcode = Opcode;
break;
}
@@ -497,8 +552,8 @@ AcpiDsInitObjectFromOp (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unimplemented data type: %x\n",
- (*ObjDesc)->Common.Type));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unimplemented data type: %x\n",
+ ObjDesc->Common.Type));
break;
}
@@ -544,7 +599,6 @@ AcpiDsBuildInternalSimpleObj (
* previously looked up in the NS, it is stored in this op.
* Otherwise, go ahead and look it up now
*/
-
if (!Op->Node)
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
@@ -648,22 +702,30 @@ AcpiDsBuildInternalPackageObj (
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
+ *ObjDescPtr = ObjDesc;
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
+
+ if (Op->Opcode == AML_VAR_PACKAGE_OP)
+ {
+ /*
+ * Variable length package parameters are evaluated JIT
+ */
+ return_ACPI_STATUS (AE_OK);
+ }
/* The first argument must be the package length */
Arg = Op->Value.Arg;
- ObjDesc->Package.Count = Arg->Value.Integer;
+ ObjDesc->Package.Count = Arg->Value.Integer32;
/*
* Allocate the array of pointers (ptrs to the
* individual objects) Add an extra pointer slot so
* that the list is always null terminated.
*/
-
ObjDesc->Package.Elements = ACPI_MEM_CALLOCATE (
(ObjDesc->Package.Count + 1) * sizeof (void *));
@@ -678,7 +740,6 @@ AcpiDsBuildInternalPackageObj (
/*
* Now init the elements of the package
*/
-
Arg = Arg->Next;
while (Arg)
{
@@ -698,7 +759,7 @@ AcpiDsBuildInternalPackageObj (
Arg = Arg->Next;
}
- *ObjDescPtr = ObjDesc;
+ ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
return_ACPI_STATUS (Status);
}
@@ -726,14 +787,19 @@ AcpiDsBuildInternalObject (
ACPI_STATUS Status;
- if (Op->Opcode == AML_PACKAGE_OP)
+ switch (Op->Opcode)
{
+ case AML_PACKAGE_OP:
+ case AML_VAR_PACKAGE_OP:
+
Status = AcpiDsBuildInternalPackageObj (WalkState, Op, ObjDescPtr);
- }
+ break;
+
+
+ default:
- else
- {
Status = AcpiDsBuildInternalSimpleObj (WalkState, Op, ObjDescPtr);
+ break;
}
return (Status);
diff --git a/sys/contrib/dev/acpica/dsopcode.c b/sys/contrib/dev/acpica/dsopcode.c
index a8e916cddd02..83b9036377e9 100644
--- a/sys/contrib/dev/acpica/dsopcode.c
+++ b/sys/contrib/dev/acpica/dsopcode.c
@@ -2,7 +2,7 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
- * $Revision: 47 $
+ * $Revision: 49 $
*
*****************************************************************************/
@@ -170,7 +170,7 @@ AcpiDsGetBufferFieldArguments (
Node = ObjDesc->BufferField.Node;
DEBUG_EXEC(AcpiUtDisplayInitPathname (Node, " [Field]"));
- DEBUG_PRINTP (TRACE_EXEC, ("[%4.4s] BufferField JIT Init\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField JIT Init\n",
&Node->Name));
@@ -291,7 +291,7 @@ AcpiDsGetRegionArguments (
DEBUG_EXEC(AcpiUtDisplayInitPathname (Node, " [Operation Region]"));
- DEBUG_PRINTP (TRACE_EXEC, ("[%4.4s] OpRegion Init at AML %p[%x]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Init at AML %p[%x]\n",
&Node->Name, ExtraDesc->Extra.Pcode,
*(UINT32*) ExtraDesc->Extra.Pcode));
@@ -299,7 +299,6 @@ AcpiDsGetRegionArguments (
* Allocate a new parser op to be the root of the parsed
* OpRegion tree
*/
-
Op = AcpiPsAllocOp (AML_SCOPE_OP);
if (!Op)
{
@@ -341,7 +340,7 @@ AcpiDsGetRegionArguments (
RegionOp->Node = Node;
AcpiPsDeleteParseTree (Op);
- /* AcpiEvaluate the address and length arguments for the OpRegion */
+ /* Evaluate the address and length arguments for the OpRegion */
Op = AcpiPsAllocOp (AML_SCOPE_OP);
if (!Op)
@@ -497,7 +496,7 @@ AcpiDsEvalBufferFieldOperands (
{
/* Invalid parameters on object stack */
- DEBUG_PRINTP (ACPI_ERROR, ("(%s) bad operand(s) (%X)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) (%X)\n",
AcpiPsGetOpcodeName (Op->Opcode), Status));
goto Cleanup;
@@ -514,7 +513,7 @@ AcpiDsEvalBufferFieldOperands (
if (!VALID_DESCRIPTOR_TYPE (ResDesc, ACPI_DESC_TYPE_NAMED))
{
- DEBUG_PRINTP (ACPI_ERROR, ("(%s) destination must be a Node\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a Node\n",
AcpiPsGetOpcodeName (Op->Opcode)));
Status = AE_AML_OPERAND_TYPE;
@@ -603,8 +602,8 @@ AcpiDsEvalBufferFieldOperands (
default:
- DEBUG_PRINTP (ACPI_ERROR,
- ("Internal error - unknown field creation opcode %02x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Internal error - unknown field creation opcode %02x\n",
Op->Opcode));
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
@@ -625,8 +624,8 @@ AcpiDsEvalBufferFieldOperands (
if ((BitOffset + BitCount) >
(8 * (UINT32) SrcDesc->Buffer.Length))
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Field size %d exceeds Buffer size %d (bits)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Field size %d exceeds Buffer size %d (bits)\n",
BitOffset + BitCount, 8 * (UINT32) SrcDesc->Buffer.Length));
Status = AE_AML_BUFFER_LIMIT;
goto Cleanup;
@@ -660,15 +659,15 @@ AcpiDsEvalBufferFieldOperands (
if ((SrcDesc->Common.Type > (UINT8) INTERNAL_TYPE_REFERENCE) || !AcpiUtValidObjectType (SrcDesc->Common.Type)) /* TBD: This line MUST be a single line until AcpiSrc can handle it (block deletion) */
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Tried to create field in invalid object type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Tried to create field in invalid object type %X\n",
SrcDesc->Common.Type));
}
else
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Tried to create field in improper object type - %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Tried to create field in improper object type - %s\n",
AcpiUtGetTypeName (SrcDesc->Common.Type)));
}
@@ -802,7 +801,7 @@ AcpiDsEvalRegionOperands (
AcpiUtRemoveReference (OperandDesc);
- DEBUG_PRINTP (TRACE_EXEC, ("RgnObj %p Addr %8.8lX%8.8lX Len %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8lX%8.8lX Len %X\n",
ObjDesc, HIDWORD(ObjDesc->Region.Address), LODWORD(ObjDesc->Region.Address),
ObjDesc->Region.Length));
@@ -840,7 +839,7 @@ AcpiDsExecBeginControlOp (
PROC_NAME ("DsExecBeginControlOp");
- DEBUG_PRINTP (TRACE_DISPATCH, ("Op=%p Opcode=%2.2X State=%p\n", Op,
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n", Op,
Op->Opcode, WalkState));
switch (Op->Opcode)
@@ -931,7 +930,7 @@ AcpiDsExecEndControlOp (
{
case AML_IF_OP:
- DEBUG_PRINTP (TRACE_DISPATCH, ("[IF_OP] Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[IF_OP] Op=%p\n", Op));
/*
* Save the result of the predicate in case there is an
@@ -956,7 +955,7 @@ AcpiDsExecEndControlOp (
case AML_WHILE_OP:
- DEBUG_PRINTP (TRACE_DISPATCH, ("[WHILE_OP] Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op));
if (WalkState->ControlState->Common.Value)
{
@@ -965,7 +964,7 @@ AcpiDsExecEndControlOp (
Status = AE_CTRL_PENDING;
}
- DEBUG_PRINTP (TRACE_DISPATCH, ("[WHILE_OP] termination! Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] termination! Op=%p\n", Op));
/* Pop this control state and free it */
@@ -978,8 +977,8 @@ AcpiDsExecEndControlOp (
case AML_RETURN_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("[RETURN_OP] Op=%p Arg=%p\n",Op, Op->Value.Arg));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "[RETURN_OP] Op=%p Arg=%p\n",Op, Op->Value.Arg));
/*
@@ -1058,8 +1057,8 @@ AcpiDsExecEndControlOp (
}
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("Completed RETURN_OP State=%p, RetVal=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Completed RETURN_OP State=%p, RetVal=%p\n",
WalkState, WalkState->ReturnDesc));
/* End the control method execution right now */
@@ -1087,8 +1086,8 @@ AcpiDsExecEndControlOp (
case AML_BREAK_OP:
- DEBUG_PRINTP (ACPI_INFO,
- ("Break to end of current package, Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Break to end of current package, Op=%p\n", Op));
/* TBD: update behavior for ACPI 2.0 */
@@ -1115,7 +1114,7 @@ AcpiDsExecEndControlOp (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown control opcode=%X Op=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown control opcode=%X Op=%p\n",
Op->Opcode, Op));
Status = AE_AML_BAD_OPCODE;
diff --git a/sys/contrib/dev/acpica/dsutils.c b/sys/contrib/dev/acpica/dsutils.c
index 96a1656266fe..1e1bc831c4fb 100644
--- a/sys/contrib/dev/acpica/dsutils.c
+++ b/sys/contrib/dev/acpica/dsutils.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dsutils - Dispatcher utilities
- * $Revision: 62 $
+ * $Revision: 68 $
*
******************************************************************************/
@@ -157,7 +157,7 @@ AcpiDsIsResultUsed (
if (!Op)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null Op\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Op\n"));
return_VALUE (TRUE);
}
@@ -181,7 +181,7 @@ AcpiDsIsResultUsed (
ParentInfo = AcpiPsGetOpcodeInfo (Op->Parent->Opcode);
if (ACPI_GET_OP_TYPE (ParentInfo) != ACPI_OP_TYPE_OPCODE)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown parent opcode. Op=%X\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%X\n", Op));
return_VALUE (FALSE);
}
@@ -206,8 +206,8 @@ AcpiDsIsResultUsed (
/* Never delete the return value associated with a return opcode */
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("Result used, [RETURN] opcode=%X Op=%X\n", Op->Opcode, Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Result used, [RETURN] opcode=%X Op=%X\n", Op->Opcode, Op));
return_VALUE (TRUE);
break;
@@ -222,8 +222,8 @@ AcpiDsIsResultUsed (
if ((WalkState->ControlState->Common.State == CONTROL_PREDICATE_EXECUTING) &&
(WalkState->ControlState->Control.PredicateOp == Op))
{
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n",
Op->Opcode, Op));
return_VALUE (TRUE);
}
@@ -249,14 +249,14 @@ AcpiDsIsResultUsed (
(Op->Parent->Opcode == AML_CREATE_DWORD_FIELD_OP) ||
(Op->Parent->Opcode == AML_CREATE_QWORD_FIELD_OP))
{
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("Result used, [Region or CreateField] opcode=%X Op=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Result used, [Region or CreateField] opcode=%X Op=%X\n",
Op->Opcode, Op));
return_VALUE (TRUE);
}
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("Result not used, Parent opcode=%X Op=%X\n", Op->Opcode, Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Result not used, Parent opcode=%X Op=%X\n", Op->Opcode, Op));
return_VALUE (FALSE);
break;
@@ -305,7 +305,7 @@ AcpiDsDeleteResultIfNotUsed (
if (!Op)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null Op\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Op\n"));
return_VOID;
}
@@ -318,10 +318,8 @@ AcpiDsDeleteResultIfNotUsed (
if (!AcpiDsIsResultUsed (Op, WalkState))
{
/*
- * Must pop the result stack (ObjDesc should be equal
- * to ResultObj)
+ * Must pop the result stack (ObjDesc should be equal to ResultObj)
*/
-
Status = AcpiDsResultPop (&ObjDesc, WalkState);
if (ACPI_SUCCESS (Status))
{
@@ -374,7 +372,7 @@ AcpiDsCreateOperand (
if ((Arg->Opcode == AML_INT_NAMEPATH_OP) &&
(Arg->Value.String))
{
- DEBUG_PRINTP (TRACE_DISPATCH, ("Getting a name: Arg=%p\n", Arg));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Getting a name: Arg=%p\n", Arg));
/* Get the entire name string from the AML stream */
@@ -397,7 +395,6 @@ AcpiDsCreateOperand (
* IMODE_EXECUTE) in order to support the creation of
* namespace objects during the execution of control methods.
*/
-
ParentOp = Arg->Parent;
if ((AcpiPsIsNodeOp (ParentOp->Opcode)) &&
(ParentOp->Opcode != AML_INT_METHODCALL_OP) &&
@@ -487,7 +484,7 @@ AcpiDsCreateOperand (
*/
Opcode = AML_ZERO_OP; /* Has no arguments! */
- DEBUG_PRINTP (TRACE_DISPATCH, ("Null namepath: Arg=%p\n", Arg));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Null namepath: Arg=%p\n", Arg));
/*
* TBD: [Investigate] anything else needed for the
@@ -511,8 +508,8 @@ AcpiDsCreateOperand (
if (Flags & OP_HAS_RETURN_VALUE)
{
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("Argument previously created, already stacked \n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Argument previously created, already stacked \n"));
DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (WalkState->Operands [WalkState->NumOperands - 1], WalkState));
@@ -527,7 +524,7 @@ AcpiDsCreateOperand (
* Only error is underflow, and this indicates
* a missing or null operand!
*/
- DEBUG_PRINTP (ACPI_ERROR, ("Missing or null operand, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Missing or null operand, %s\n",
AcpiFormatException (Status)));
return_ACPI_STATUS (Status);
}
@@ -607,7 +604,7 @@ AcpiDsCreateOperands (
goto Cleanup;
}
- DEBUG_PRINTP (TRACE_DISPATCH, ("Arg #%d (%p) done, Arg1=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%d (%p) done, Arg1=%p\n",
ArgCount, Arg, FirstArg));
/* Move on to next argument, if any */
@@ -628,7 +625,7 @@ Cleanup:
AcpiDsObjStackPopAndDelete (ArgCount, WalkState);
- DEBUG_PRINTP (ACPI_ERROR, ("While creating Arg %d - %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "While creating Arg %d - %s\n",
(ArgCount + 1), AcpiFormatException (Status)));
return_ACPI_STATUS (Status);
}
@@ -715,7 +712,7 @@ AcpiDsMapOpcodeToDataType (
{
/* Unknown opcode */
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown AML opcode: %x\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown AML opcode: %x\n", Opcode));
return (DataType);
}
@@ -729,6 +726,7 @@ AcpiDsMapOpcodeToDataType (
case AML_BYTE_OP:
case AML_WORD_OP:
case AML_DWORD_OP:
+ case AML_QWORD_OP:
DataType = ACPI_TYPE_INTEGER;
break;
@@ -744,8 +742,8 @@ AcpiDsMapOpcodeToDataType (
break;
default:
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unknown (type LITERAL) AML opcode: %x\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unknown (type LITERAL) AML opcode: %x\n", Opcode));
break;
}
break;
@@ -767,8 +765,8 @@ AcpiDsMapOpcodeToDataType (
break;
default:
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unknown (type DATA_TERM) AML opcode: %x\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unknown (type DATA_TERM) AML opcode: %x\n", Opcode));
break;
}
break;
@@ -820,8 +818,8 @@ AcpiDsMapOpcodeToDataType (
default:
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unimplemented data type opcode: %x\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unimplemented data type opcode: %x\n", Opcode));
break;
}
diff --git a/sys/contrib/dev/acpica/dswexec.c b/sys/contrib/dev/acpica/dswexec.c
index 7f6f1609afee..ba8df46130b3 100644
--- a/sys/contrib/dev/acpica/dswexec.c
+++ b/sys/contrib/dev/acpica/dswexec.c
@@ -2,7 +2,7 @@
*
* Module Name: dswexec - Dispatcher method execution callbacks;
* dispatch to interpreter.
- * $Revision: 63 $
+ * $Revision: 64 $
*
*****************************************************************************/
@@ -162,8 +162,8 @@ AcpiDsGetPredicateValue (
Status = AcpiDsResultPop (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Could not get result from predicate evaluation, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Could not get result from predicate evaluation, %s\n",
AcpiFormatException (Status)));
return_ACPI_STATUS (Status);
@@ -189,7 +189,7 @@ AcpiDsGetPredicateValue (
if (!ObjDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No predicate ObjDesc=%X State=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate ObjDesc=%X State=%X\n",
ObjDesc, WalkState));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
@@ -203,8 +203,8 @@ AcpiDsGetPredicateValue (
if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Bad predicate (not a number) ObjDesc=%X State=%X Type=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Bad predicate (not a number) ObjDesc=%X State=%X Type=%X\n",
ObjDesc, WalkState, ObjDesc->Common.Type));
Status = AE_AML_OPERAND_TYPE;
@@ -240,7 +240,7 @@ AcpiDsGetPredicateValue (
Cleanup:
- DEBUG_PRINTP (TRACE_EXEC, ("Completed a predicate eval=%X Op=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%X\n",
WalkState->ControlState->Common.Value, Op));
/* Break to debugger to display result */
@@ -321,7 +321,7 @@ AcpiDsExecBeginOp (
(WalkState->ControlState->Common.State ==
CONTROL_CONDITIONAL_EXECUTING))
{
- DEBUG_PRINTP (TRACE_EXEC, ("Exec predicate Op=%X State=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%X State=%X\n",
Op, WalkState));
WalkState->ControlState->Common.State = CONTROL_PREDICATE_EXECUTING;
@@ -454,7 +454,7 @@ AcpiDsExecEndOp (
OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown opcode %X\n", Op->Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", Op->Opcode));
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
}
@@ -481,13 +481,13 @@ AcpiDsExecEndOp (
{
case OPTYPE_UNDEFINED:
- DEBUG_PRINTP (ACPI_ERROR, ("Undefined opcode type Op=%X\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%X\n", Op));
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
break;
case OPTYPE_BOGUS:
- DEBUG_PRINTP (TRACE_DISPATCH, ("Internal opcode=%X type Op=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Internal opcode=%X type Op=%X\n",
Opcode, Op));
break;
@@ -639,7 +639,7 @@ AcpiDsExecEndOp (
case OPTYPE_METHOD_CALL:
- DEBUG_PRINTP (TRACE_DISPATCH, ("Method invocation, Op=%X\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%X\n", Op));
/*
* (AML_METHODCALL) Op->Value->Arg->Node contains
@@ -691,8 +691,8 @@ AcpiDsExecEndOp (
case OPTYPE_CREATE_FIELD:
- DEBUG_PRINTP (TRACE_EXEC,
- ("Executing CreateField Buffer/Index Op=%X\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Executing CreateField Buffer/Index Op=%X\n", Op));
Status = AcpiDsLoad2EndOp (WalkState, Op);
if (ACPI_FAILURE (Status))
@@ -716,8 +716,8 @@ AcpiDsExecEndOp (
{
case AML_REGION_OP:
- DEBUG_PRINTP (TRACE_EXEC,
- ("Executing OpRegion Address/Length Op=%X\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Executing OpRegion Address/Length Op=%X\n", Op));
Status = AcpiDsEvalRegionOperands (WalkState, Op);
if (ACPI_FAILURE (Status))
@@ -751,8 +751,8 @@ AcpiDsExecEndOp (
default:
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unimplemented opcode, type=%X Opcode=%X Op=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unimplemented opcode, type=%X Opcode=%X Op=%X\n",
Optype, Op->Opcode, Op));
Status = AE_NOT_IMPLEMENTED;
diff --git a/sys/contrib/dev/acpica/dswload.c b/sys/contrib/dev/acpica/dswload.c
index e098485e9e91..ab9ed5dd492d 100644
--- a/sys/contrib/dev/acpica/dswload.c
+++ b/sys/contrib/dev/acpica/dswload.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
- * $Revision: 37 $
+ * $Revision: 40 $
*
*****************************************************************************/
@@ -157,7 +157,7 @@ AcpiDsLoad1BeginOp (
PROC_NAME ("DsLoad1BeginOp");
- DEBUG_PRINTP (TRACE_DISPATCH, ("Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
/* We are only interested in opcodes that have an associated name */
@@ -184,14 +184,14 @@ AcpiDsLoad1BeginOp (
DataType = AcpiDsMapNamedOpcodeToDataType (Opcode);
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("State=%p Op=%p Type=%x\n", WalkState, Op, DataType));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "State=%p Op=%p Type=%x\n", WalkState, Op, DataType));
if (Opcode == AML_SCOPE_OP)
{
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("State=%p Op=%p Type=%x\n", WalkState, Op, DataType));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "State=%p Op=%p Type=%x\n", WalkState, Op, DataType));
}
/*
@@ -261,7 +261,7 @@ AcpiDsLoad1EndOp (
PROC_NAME ("DsLoad1EndOp");
- DEBUG_PRINT (TRACE_DISPATCH, ("Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
/* We are only interested in opcodes that have an associated name */
@@ -293,7 +293,7 @@ AcpiDsLoad1EndOp (
if (AcpiNsOpensScope (DataType))
{
- DEBUG_PRINTP (TRACE_DISPATCH, ("(%s): Popping scope for Op %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",
AcpiUtGetTypeName (DataType), Op));
AcpiDsScopeStackPop (WalkState);
@@ -333,7 +333,7 @@ AcpiDsLoad2BeginOp (
PROC_NAME ("DsLoad2BeginOp");
- DEBUG_PRINTP (TRACE_DISPATCH, ("Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
/* We only care about Namespace opcodes here */
@@ -388,8 +388,8 @@ AcpiDsLoad2BeginOp (
DataType = AcpiDsMapNamedOpcodeToDataType (Opcode);
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("State=%p Op=%p Type=%x\n", WalkState, Op, DataType));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "State=%p Op=%p Type=%x\n", WalkState, Op, DataType));
if (Opcode == AML_FIELD_OP ||
@@ -406,10 +406,8 @@ AcpiDsLoad2BeginOp (
* The NamePath is an object reference to an existing object. Don't enter the
* name into the namespace, but look it up for use later
*/
- Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr,
- DataType, IMODE_EXECUTE,
- NS_SEARCH_PARENT, WalkState,
- &(Node));
+ Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, DataType,
+ IMODE_EXECUTE, NS_SEARCH_PARENT, WalkState, &(Node));
}
else
@@ -421,9 +419,7 @@ AcpiDsLoad2BeginOp (
if (AcpiNsOpensScope (DataType))
{
- Status = AcpiDsScopeStackPush (Node,
- DataType,
- WalkState);
+ Status = AcpiDsScopeStackPush (Node, DataType, WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -469,12 +465,12 @@ AcpiDsLoad2BeginOp (
if (Original)
{
- DEBUG_PRINTP (ACPI_INFO, ("old %p new %p\n", Original, Node));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "old %p new %p\n", Original, Node));
if (Original != Node)
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Lookup match error: old %p new %p\n", Original, Node));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Lookup match error: old %p new %p\n", Original, Node));
}
}
}
@@ -511,7 +507,7 @@ AcpiDsLoad2EndOp (
PROC_NAME ("DsLoad2EndOp");
- DEBUG_PRINTP (TRACE_DISPATCH, ("Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
if (!AcpiPsIsNamespaceObjectOp (Op->Opcode))
{
@@ -520,12 +516,12 @@ AcpiDsLoad2EndOp (
if (Op->Opcode == AML_SCOPE_OP)
{
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("Ending scope Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Ending scope Op=%p State=%p\n", Op, WalkState));
if (((ACPI_PARSE2_OBJECT *)Op)->Name == -1)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Unnamed scope! Op=%p State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unnamed scope! Op=%p State=%p\n",
Op, WalkState));
return (AE_OK);
}
@@ -553,7 +549,7 @@ AcpiDsLoad2EndOp (
if (AcpiNsOpensScope (DataType))
{
- DEBUG_PRINTP (TRACE_DISPATCH, ("(%s) Popping scope for Op %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
AcpiUtGetTypeName (DataType), Op));
AcpiDsScopeStackPop (WalkState);
}
@@ -606,8 +602,8 @@ AcpiDsLoad2EndOp (
* be evaluated later during the execution phase
*/
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("CreateXxxField: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "CreateXxxField: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
/* Get the NameString argument */
@@ -667,8 +663,8 @@ AcpiDsLoad2EndOp (
case AML_INT_METHODCALL_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
/*
@@ -703,8 +699,8 @@ AcpiDsLoad2EndOp (
/* Nothing to do other than enter object into namespace */
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-Processor: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Processor: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
Status = AcpiExCreateProcessor (Op, Node);
@@ -713,8 +709,8 @@ AcpiDsLoad2EndOp (
goto Cleanup;
}
- DEBUG_PRINT (TRACE_DISPATCH,
- ("Completed Processor Init, Op=%p State=%p entry=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Completed Processor Init, Op=%p State=%p entry=%p\n",
Op, WalkState, Node));
break;
@@ -723,8 +719,8 @@ AcpiDsLoad2EndOp (
/* Nothing to do other than enter object into namespace */
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-PowerResource: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-PowerResource: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
Status = AcpiExCreatePowerResource (Op, Node);
@@ -733,8 +729,8 @@ AcpiDsLoad2EndOp (
goto Cleanup;
}
- DEBUG_PRINT (TRACE_DISPATCH,
- ("Completed PowerResource Init, Op=%p State=%p entry=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Completed PowerResource Init, Op=%p State=%p entry=%p\n",
Op, WalkState, Node));
break;
@@ -743,16 +739,16 @@ AcpiDsLoad2EndOp (
/* Nothing to do other than enter object into namespace */
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-ThermalZone: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-ThermalZone: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
break;
case AML_FIELD_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-Field: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Field: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
Arg = Op->Value.Arg;
@@ -763,8 +759,8 @@ AcpiDsLoad2EndOp (
case AML_INDEX_FIELD_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-IndexField: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-IndexField: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
Arg = Op->Value.Arg;
@@ -776,8 +772,8 @@ AcpiDsLoad2EndOp (
case AML_BANK_FIELD_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-BankField: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-BankField: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
Arg = Op->Value.Arg;
@@ -790,23 +786,23 @@ AcpiDsLoad2EndOp (
*/
case AML_METHOD_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-Method: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Method: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
if (!Node->Object)
{
Status = AcpiExCreateMethod (((ACPI_PARSE2_OBJECT *) Op)->Data,
((ACPI_PARSE2_OBJECT *) Op)->Length,
- Arg->Value.Integer, Node);
+ Arg->Value.Integer32, Node);
}
break;
case AML_MUTEX_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-Mutex: Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Mutex: Op=%p State=%p\n", Op, WalkState));
Status = AcpiDsCreateOperands (WalkState, Arg);
if (ACPI_FAILURE (Status))
@@ -820,8 +816,8 @@ AcpiDsLoad2EndOp (
case AML_EVENT_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-Event: Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Event: Op=%p State=%p\n", Op, WalkState));
Status = AcpiDsCreateOperands (WalkState, Arg);
if (ACPI_FAILURE (Status))
@@ -840,8 +836,8 @@ AcpiDsLoad2EndOp (
break;
}
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-Opregion: Op=%p State=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Opregion: Op=%p State=%p NamedObj=%p\n",
Op, WalkState, Node));
/*
@@ -852,8 +848,8 @@ AcpiDsLoad2EndOp (
((ACPI_PARSE2_OBJECT *) Op)->Length,
(ACPI_ADR_SPACE_TYPE) Arg->Value.Integer, WalkState);
- DEBUG_PRINT (TRACE_DISPATCH,
- ("Completed OpRegion Init, Op=%p State=%p entry=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Completed OpRegion Init, Op=%p State=%p entry=%p\n",
Op, WalkState, Node));
break;
@@ -862,8 +858,8 @@ AcpiDsLoad2EndOp (
case AML_ALIAS_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-Alias: Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Alias: Op=%p State=%p\n", Op, WalkState));
Status = AcpiDsCreateOperands (WalkState, Arg);
if (ACPI_FAILURE (Status))
@@ -877,15 +873,14 @@ AcpiDsLoad2EndOp (
case AML_NAME_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-Name: Op=%p State=%p\n", Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Name: Op=%p State=%p\n", Op, WalkState));
/*
* Because of the execution pass through the non-control-method
* parts of the table, we can arrive here twice. Only init
* the named object node the first time through
*/
-
if (!Node->Object)
{
Status = AcpiDsCreateNode (WalkState, Node, Op);
@@ -896,8 +891,8 @@ AcpiDsLoad2EndOp (
case AML_INT_NAMEPATH_OP:
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("LOADING-NamePath object: State=%p Op=%p NamedObj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-NamePath object: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
break;
diff --git a/sys/contrib/dev/acpica/dswscope.c b/sys/contrib/dev/acpica/dswscope.c
index 8e28cb3d0349..b0c578a3da4e 100644
--- a/sys/contrib/dev/acpica/dswscope.c
+++ b/sys/contrib/dev/acpica/dswscope.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswscope - Scope stack manipulation
- * $Revision: 45 $
+ * $Revision: 46 $
*
*****************************************************************************/
@@ -145,6 +145,8 @@ AcpiDsScopeStackClear (
{
ACPI_GENERIC_STATE *ScopeInfo;
+ PROC_NAME ("AcpiDsScopeStackClear");
+
while (WalkState->ScopeInfo)
{
@@ -153,8 +155,8 @@ AcpiDsScopeStackClear (
ScopeInfo = WalkState->ScopeInfo;
WalkState->ScopeInfo = ScopeInfo->Scope.Next;
- DEBUG_PRINT (TRACE_EXEC,
- ("Popped object type %X\n", ScopeInfo->Common.Value));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Popped object type %X\n", ScopeInfo->Common.Value));
AcpiUtDeleteGenericState (ScopeInfo);
}
}
@@ -257,8 +259,8 @@ AcpiDsScopeStackPop (
return_ACPI_STATUS (AE_STACK_UNDERFLOW);
}
- DEBUG_PRINT (TRACE_EXEC,
- ("Popped object type %X\n", ScopeInfo->Common.Value));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Popped object type %X\n", ScopeInfo->Common.Value));
AcpiUtDeleteGenericState (ScopeInfo);
diff --git a/sys/contrib/dev/acpica/dswstate.c b/sys/contrib/dev/acpica/dswstate.c
index 95b27b8edac0..8ba87c47c771 100644
--- a/sys/contrib/dev/acpica/dswstate.c
+++ b/sys/contrib/dev/acpica/dswstate.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswstate - Dispatcher parse tree walk management routines
- * $Revision: 46 $
+ * $Revision: 48 $
*
*****************************************************************************/
@@ -156,23 +156,23 @@ AcpiDsResultInsert (
State = WalkState->Results;
if (!State)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No result object pushed! State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result object pushed! State=%p\n",
WalkState));
return (AE_NOT_EXIST);
}
if (Index >= OBJ_NUM_OPERANDS)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Index out of range: %X Obj=%p State=%p Num=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Index out of range: %X Obj=%p State=%p Num=%X\n",
Index, Object, WalkState, State->Results.NumResults));
return (AE_BAD_PARAMETER);
}
if (!Object)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Null Object! Index=%X Obj=%p State=%p Num=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Null Object! Index=%X Obj=%p State=%p Num=%X\n",
Index, Object, WalkState, State->Results.NumResults));
return (AE_BAD_PARAMETER);
}
@@ -180,8 +180,8 @@ AcpiDsResultInsert (
State->Results.ObjDesc [Index] = Object;
State->Results.NumResults++;
- DEBUG_PRINTP (TRACE_EXEC,
- ("Obj=%p [%s] State=%p Num=%X Cur=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
Object, Object ? AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *) Object)->Common.Type) : "NULL",
WalkState, State->Results.NumResults, WalkState->CurrentResult));
@@ -218,15 +218,15 @@ AcpiDsResultRemove (
State = WalkState->Results;
if (!State)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No result object pushed! State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result object pushed! State=%p\n",
WalkState));
return (AE_NOT_EXIST);
}
if (Index >= OBJ_NUM_OPERANDS)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Index out of range: %X State=%p Num=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Index out of range: %X State=%p Num=%X\n",
Index, WalkState, State->Results.NumResults));
}
@@ -235,8 +235,8 @@ AcpiDsResultRemove (
if (!State->Results.ObjDesc [Index])
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Null operand! State=%p #Ops=%X, Index=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Null operand! State=%p #Ops=%X, Index=%X\n",
WalkState, State->Results.NumResults, Index));
return (AE_AML_NO_RETURN_VALUE);
}
@@ -248,8 +248,8 @@ AcpiDsResultRemove (
*Object = State->Results.ObjDesc [Index];
State->Results.ObjDesc [Index] = NULL;
- DEBUG_PRINTP (TRACE_EXEC,
- ("Obj=%p [%s] Index=%X State=%p Num=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Obj=%p [%s] Index=%X State=%p Num=%X\n",
*Object, (*Object) ? AcpiUtGetTypeName ((*Object)->Common.Type) : "NULL",
Index, WalkState, State->Results.NumResults));
@@ -292,7 +292,7 @@ AcpiDsResultPop (
if (!State->Results.NumResults)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Result stack is empty! State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Result stack is empty! State=%p\n",
WalkState));
return (AE_AML_NO_RETURN_VALUE);
}
@@ -310,7 +310,7 @@ AcpiDsResultPop (
*Object = State->Results.ObjDesc [Index -1];
State->Results.ObjDesc [Index -1] = NULL;
- DEBUG_PRINTP (TRACE_EXEC, ("Obj=%p [%s] Index=%X State=%p Num=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] Index=%X State=%p Num=%X\n",
*Object, (*Object) ? AcpiUtGetTypeName ((*Object)->Common.Type) : "NULL",
Index -1, WalkState, State->Results.NumResults));
@@ -319,7 +319,7 @@ AcpiDsResultPop (
}
- DEBUG_PRINTP (ACPI_ERROR, ("No result objects! State=%p\n", WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result objects! State=%p\n", WalkState));
return (AE_AML_NO_RETURN_VALUE);
}
@@ -352,15 +352,15 @@ AcpiDsResultPopFromBottom (
State = WalkState->Results;
if (!State)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Warning: No result object pushed! State=%p\n", WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Warning: No result object pushed! State=%p\n", WalkState));
return (AE_NOT_EXIST);
}
if (!State->Results.NumResults)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No result objects! State=%p\n", WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result objects! State=%p\n", WalkState));
return (AE_AML_NO_RETURN_VALUE);
}
@@ -382,12 +382,12 @@ AcpiDsResultPopFromBottom (
if (!*Object)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null operand! State=%p #Ops=%X, Index=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null operand! State=%p #Ops=%X, Index=%X\n",
WalkState, State->Results.NumResults, Index));
return (AE_AML_NO_RETURN_VALUE);
}
- DEBUG_PRINTP (TRACE_EXEC, ("Obj=%p [%s], Results=%p State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s], Results=%p State=%p\n",
*Object, (*Object) ? AcpiUtGetTypeName ((*Object)->Common.Type) : "NULL",
State, WalkState));
@@ -423,21 +423,21 @@ AcpiDsResultPush (
State = WalkState->Results;
if (!State)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No result stack frame\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result stack frame\n"));
return (AE_AML_INTERNAL);
}
if (State->Results.NumResults == OBJ_NUM_OPERANDS)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Result stack overflow: Obj=%p State=%p Num=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Result stack overflow: Obj=%p State=%p Num=%X\n",
Object, WalkState, State->Results.NumResults));
return (AE_STACK_OVERFLOW);
}
if (!Object)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null Object! Obj=%p State=%p Num=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Object! Obj=%p State=%p Num=%X\n",
Object, WalkState, State->Results.NumResults));
return (AE_BAD_PARAMETER);
}
@@ -446,7 +446,7 @@ AcpiDsResultPush (
State->Results.ObjDesc [State->Results.NumResults] = Object;
State->Results.NumResults++;
- DEBUG_PRINTP (TRACE_EXEC, ("Obj=%p [%s] State=%p Num=%X Cur=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
Object, Object ? AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *) Object)->Common.Type) : "NULL",
WalkState, State->Results.NumResults, WalkState->CurrentResult));
@@ -473,6 +473,8 @@ AcpiDsResultStackPush (
{
ACPI_GENERIC_STATE *State;
+ PROC_NAME ("DsResultStackPush");
+
State = AcpiUtCreateGenericState ();
if (!State)
@@ -482,7 +484,7 @@ AcpiDsResultStackPush (
AcpiUtPushGenericState (&WalkState->Results, State);
- DEBUG_PRINT (TRACE_EXEC, ("DsResultStackPush: Results=%p State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Results=%p State=%p\n",
State, WalkState));
return (AE_OK);
@@ -507,12 +509,14 @@ AcpiDsResultStackPop (
{
ACPI_GENERIC_STATE *State;
+ PROC_NAME ("DsResultStackPop");
+
/* Check for stack underflow */
if (WalkState->Results == NULL)
{
- DEBUG_PRINT (TRACE_EXEC, ("DsResultStackPop: Underflow - State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Underflow - State=%p\n",
WalkState));
return (AE_AML_NO_OPERAND);
}
@@ -520,8 +524,8 @@ AcpiDsResultStackPop (
State = AcpiUtPopGenericState (&WalkState->Results);
- DEBUG_PRINT (TRACE_EXEC,
- ("DsResultStackPop: Result=%p RemainingResults=%X State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Result=%p RemainingResults=%X State=%p\n",
State, State->Results.NumResults, WalkState));
AcpiUtDeleteGenericState (State);
@@ -586,14 +590,15 @@ AcpiDsObjStackPush (
void *Object,
ACPI_WALK_STATE *WalkState)
{
+ PROC_NAME ("DsObjStackPush");
/* Check for stack overflow */
if (WalkState->NumOperands >= OBJ_NUM_OPERANDS)
{
- DEBUG_PRINT (ACPI_ERROR,
- ("DsObjStackPush: overflow! Obj=%p State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "overflow! Obj=%p State=%p #Ops=%X\n",
Object, WalkState, WalkState->NumOperands));
return (AE_STACK_OVERFLOW);
}
@@ -603,7 +608,7 @@ AcpiDsObjStackPush (
WalkState->Operands [WalkState->NumOperands] = Object;
WalkState->NumOperands++;
- DEBUG_PRINT (TRACE_EXEC, ("DsObjStackPush: Obj=%p [%s] State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
Object, AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *) Object)->Common.Type),
WalkState, WalkState->NumOperands));
@@ -630,14 +635,15 @@ AcpiDsObjStackPopObject (
ACPI_OPERAND_OBJECT **Object,
ACPI_WALK_STATE *WalkState)
{
+ PROC_NAME ("DsObjStackPopObject");
/* Check for stack underflow */
if (WalkState->NumOperands == 0)
{
- DEBUG_PRINT (ACPI_ERROR,
- ("DsObjStackPop: Missing operand/stack empty! State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Missing operand/stack empty! State=%p #Ops=%X\n",
WalkState, WalkState->NumOperands));
*Object = NULL;
return (AE_AML_NO_OPERAND);
@@ -651,8 +657,8 @@ AcpiDsObjStackPopObject (
if (!WalkState->Operands [WalkState->NumOperands])
{
- DEBUG_PRINT (ACPI_ERROR,
- ("DsObjStackPop: Null operand! State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Null operand! State=%p #Ops=%X\n",
WalkState, WalkState->NumOperands));
*Object = NULL;
return (AE_AML_NO_OPERAND);
@@ -663,7 +669,7 @@ AcpiDsObjStackPopObject (
*Object = WalkState->Operands [WalkState->NumOperands];
WalkState->Operands [WalkState->NumOperands] = NULL;
- DEBUG_PRINT (TRACE_EXEC, ("DsObjStackPopObject: Obj=%p [%s] State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
*Object, AcpiUtGetTypeName ((*Object)->Common.Type),
WalkState, WalkState->NumOperands));
@@ -692,6 +698,8 @@ AcpiDsObjStackPop (
{
UINT32 i;
+ PROC_NAME ("DsObjStackPop");
+
for (i = 0; i < PopCount; i++)
{
@@ -699,8 +707,8 @@ AcpiDsObjStackPop (
if (WalkState->NumOperands == 0)
{
- DEBUG_PRINT (ACPI_ERROR,
- ("DsObjStackPop: Underflow! Count=%X State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Underflow! Count=%X State=%p #Ops=%X\n",
PopCount, WalkState, WalkState->NumOperands));
return (AE_STACK_UNDERFLOW);
}
@@ -711,7 +719,7 @@ AcpiDsObjStackPop (
WalkState->Operands [WalkState->NumOperands] = NULL;
}
- DEBUG_PRINT (TRACE_EXEC, ("DsObjStackPop: Count=%X State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
PopCount, WalkState, WalkState->NumOperands));
return (AE_OK);
@@ -740,6 +748,8 @@ AcpiDsObjStackPopAndDelete (
UINT32 i;
ACPI_OPERAND_OBJECT *ObjDesc;
+ PROC_NAME ("DsObjStackPopAndDelete");
+
for (i = 0; i < PopCount; i++)
{
@@ -747,8 +757,8 @@ AcpiDsObjStackPopAndDelete (
if (WalkState->NumOperands == 0)
{
- DEBUG_PRINT (ACPI_ERROR,
- ("DsObjStackPop: Underflow! Count=%X State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Underflow! Count=%X State=%p #Ops=%X\n",
PopCount, WalkState, WalkState->NumOperands));
return (AE_STACK_UNDERFLOW);
}
@@ -764,7 +774,7 @@ AcpiDsObjStackPopAndDelete (
}
}
- DEBUG_PRINT (TRACE_EXEC, ("DsObjStackPop: Count=%X State=%p #Ops=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
PopCount, WalkState, WalkState->NumOperands));
return (AE_OK);
@@ -833,8 +843,10 @@ AcpiDsGetCurrentWalkState (
ACPI_WALK_LIST *WalkList)
{
+ PROC_NAME ("DsGetCurrentWalkState");
+
- DEBUG_PRINT (TRACE_PARSE, ("DsGetCurrentWalkState, =%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "DsGetCurrentWalkState, =%p\n",
WalkList->WalkState));
if (!WalkList)
@@ -947,39 +959,10 @@ AcpiDsCreateWalkState (
FUNCTION_TRACE ("DsCreateWalkState");
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
- AcpiGbl_WalkStateCacheRequests++;
-
- /* Check the cache first */
-
- if (AcpiGbl_WalkStateCache)
- {
- /* There is an object available, use it */
-
- WalkState = AcpiGbl_WalkStateCache;
- AcpiGbl_WalkStateCache = WalkState->Next;
-
- AcpiGbl_WalkStateCacheHits++;
- AcpiGbl_WalkStateCacheDepth--;
-
- DEBUG_PRINTP (TRACE_EXEC, ("State %p from cache\n", WalkState));
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
- }
-
- else
+ WalkState = AcpiUtAcquireFromCache (ACPI_MEM_LIST_WALK);
+ if (!WalkState)
{
- /* The cache is empty, create a new object */
-
- /* Avoid deadlock with ACPI_MEM_CALLOCATE */
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
-
- WalkState = ACPI_MEM_CALLOCATE (sizeof (ACPI_WALK_STATE));
- if (!WalkState)
- {
- return_PTR (NULL);
- }
+ return_PTR (NULL);
}
WalkState->DataType = ACPI_DESC_TYPE_WALK;
@@ -1040,7 +1023,7 @@ AcpiDsDeleteWalkState (
if (WalkState->DataType != ACPI_DESC_TYPE_WALK)
{
- DEBUG_PRINTP (ACPI_ERROR, ("%p is not a valid walk state\n", WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p is not a valid walk state\n", WalkState));
return;
}
@@ -1076,34 +1059,7 @@ AcpiDsDeleteWalkState (
}
- /* If walk cache is full, just free this wallkstate object */
-
- if (AcpiGbl_WalkStateCacheDepth >= MAX_WALK_CACHE_DEPTH)
- {
- ACPI_MEM_FREE (WalkState);
- }
-
- /* Otherwise put this object back into the cache */
-
- else
- {
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
-
- /* Clear the state */
-
- MEMSET (WalkState, 0, sizeof (ACPI_WALK_STATE));
- WalkState->DataType = ACPI_DESC_TYPE_WALK;
-
- /* Put the object at the head of the global cache list */
-
- WalkState->Next = AcpiGbl_WalkStateCache;
- AcpiGbl_WalkStateCache = WalkState;
- AcpiGbl_WalkStateCacheDepth++;
-
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
- }
-
+ AcpiUtReleaseToCache (ACPI_MEM_LIST_WALK, WalkState);
return_VOID;
}
@@ -1125,25 +1081,10 @@ void
AcpiDsDeleteWalkStateCache (
void)
{
- ACPI_WALK_STATE *Next;
-
-
FUNCTION_TRACE ("DsDeleteWalkStateCache");
- /* Traverse the global cache list */
-
- while (AcpiGbl_WalkStateCache)
- {
- /* Delete one cached state object */
-
- Next = AcpiGbl_WalkStateCache->Next;
- ACPI_MEM_FREE (AcpiGbl_WalkStateCache);
-
- AcpiGbl_WalkStateCache = Next;
- AcpiGbl_WalkStateCacheDepth--;
- }
-
+ AcpiUtDeleteGenericCache (ACPI_MEM_LIST_WALK);
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/evevent.c b/sys/contrib/dev/acpica/evevent.c
index 042a2aa02adf..f3c0e524c3a7 100644
--- a/sys/contrib/dev/acpica/evevent.c
+++ b/sys/contrib/dev/acpica/evevent.c
@@ -2,7 +2,7 @@
*
* Module Name: evevent - Fixed and General Purpose AcpiEvent
* handling and dispatch
- * $Revision: 46 $
+ * $Revision: 47 $
*
*****************************************************************************/
@@ -152,7 +152,7 @@ AcpiEvInitialize (
if (!AcpiGbl_DSDT)
{
- DEBUG_PRINTP (ACPI_WARN, ("No ACPI tables present!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No ACPI tables present!\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -161,7 +161,7 @@ AcpiEvInitialize (
if (SYS_MODE_LEGACY == AcpiHwGetModeCapabilities())
{
- DEBUG_PRINTP (ACPI_WARN, ("ACPI Mode is not supported!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "ACPI Mode is not supported!\n"));
return_ACPI_STATUS (AE_ERROR);
}
@@ -177,14 +177,14 @@ AcpiEvInitialize (
Status = AcpiEvFixedEventInitialize ();
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_FATAL, ("Unable to initialize fixed events.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize fixed events.\n"));
return_ACPI_STATUS (Status);
}
Status = AcpiEvGpeInitialize ();
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_FATAL, ("Unable to initialize general purpose events.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize general purpose events.\n"));
return_ACPI_STATUS (Status);
}
@@ -193,7 +193,7 @@ AcpiEvInitialize (
Status = AcpiEvInstallSciHandler ();
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_FATAL, ("Unable to install System Control Interrupt Handler\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to install System Control Interrupt Handler\n"));
return_ACPI_STATUS (Status);
}
@@ -203,7 +203,7 @@ AcpiEvInitialize (
Status = AcpiEvInitGpeControlMethods ();
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_FATAL, ("Unable to initialize Gpe control methods\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize Gpe control methods\n"));
return_ACPI_STATUS (Status);
}
@@ -212,7 +212,7 @@ AcpiEvInitialize (
Status = AcpiEvInitGlobalLockHandler ();
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_FATAL, ("Unable to initialize Global Lock handler\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize Global Lock handler\n"));
return_ACPI_STATUS (Status);
}
@@ -269,12 +269,15 @@ AcpiEvFixedEventInitialize(void)
******************************************************************************/
UINT32
-AcpiEvFixedEventDetect(void)
+AcpiEvFixedEventDetect (void)
{
UINT32 IntStatus = INTERRUPT_NOT_HANDLED;
UINT32 StatusRegister;
UINT32 EnableRegister;
+ PROC_NAME ("AcpiEvFixedEventDetect");
+
+
/*
* Read the fixed feature status and enable registers, as all the cases
* depend on their values.
@@ -283,8 +286,8 @@ AcpiEvFixedEventDetect(void)
StatusRegister = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_STS);
EnableRegister = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_EN);
- DEBUG_PRINT (TRACE_INTERRUPTS,
- ("Fixed AcpiEvent Block: Enable %08X Status %08X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
+ "Fixed AcpiEvent Block: Enable %08X Status %08X\n",
EnableRegister, StatusRegister));
@@ -459,8 +462,8 @@ AcpiEvGpeInitialize (void)
sizeof (ACPI_GPE_REGISTERS));
if (!AcpiGbl_GpeRegisters)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Could not allocate the GpeRegisters block\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Could not allocate the GpeRegisters block\n"));
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -475,7 +478,7 @@ AcpiEvGpeInitialize (void)
if (!AcpiGbl_GpeInfo)
{
ACPI_MEM_FREE (AcpiGbl_GpeRegisters);
- DEBUG_PRINTP (ACPI_ERROR, ("Could not allocate the GpeInfo block\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the GpeInfo block\n"));
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -551,7 +554,7 @@ AcpiEvGpeInitialize (void)
RegisterIndex++;
}
- DEBUG_PRINTP (ACPI_INFO, ("GPE registers: %X@%p (Blk0) %X@%p (Blk1)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%p (Blk0) %X@%p (Blk1)\n",
Gpe0RegisterCount, AcpiGbl_FADT->XGpe0Blk.Address, Gpe1RegisterCount,
AcpiGbl_FADT->XGpe1Blk.Address));
@@ -616,8 +619,8 @@ AcpiEvSaveMethodInfo (
{
/* Unknown method type, just ignore it! */
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unknown GPE method type: %s (name not of form _Lnn or _Enn)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unknown GPE method type: %s (name not of form _Lnn or _Enn)\n",
Name));
return (AE_OK);
}
@@ -629,8 +632,8 @@ AcpiEvSaveMethodInfo (
{
/* Conversion failed; invalid method, just ignore it */
- DEBUG_PRINTP (ACPI_ERROR,
- ("Could not extract GPE number from name: %s (name not of form _Lnn or _Enn)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Could not extract GPE number from name: %s (name not of form _Lnn or _Enn)\n",
Name));
return (AE_OK);
}
@@ -659,7 +662,7 @@ AcpiEvSaveMethodInfo (
AcpiHwEnableGpe (GpeNumber);
- DEBUG_PRINTP (ACPI_INFO, ("Registered GPE method %s as GPE number %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registered GPE method %s as GPE number %X\n",
Name, GpeNumber));
return (AE_OK);
}
@@ -728,6 +731,9 @@ AcpiEvGpeDetect (void)
UINT8 BitMask;
+ PROC_NAME ("EvGpeDetect");
+
+
/*
* Read all of the 8-bit GPE status and enable registers
* in both of the register blocks, saving all of it.
@@ -741,8 +747,8 @@ AcpiEvGpeDetect (void)
AcpiOsReadPort (AcpiGbl_GpeRegisters[i].EnableAddr,
&AcpiGbl_GpeRegisters[i].Enable, 8);
- DEBUG_PRINT (TRACE_INTERRUPTS,
- ("GPE block at %X - Enable %08X Status %08X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
+ "GPE block at %X - Enable %08X Status %08X\n",
AcpiGbl_GpeRegisters[i].EnableAddr,
AcpiGbl_GpeRegisters[i].Status,
AcpiGbl_GpeRegisters[i].Enable));
@@ -876,7 +882,7 @@ AcpiEvGpeDispatch (
*/
if (AcpiGbl_GpeValid[GpeNumber] == ACPI_GPE_INVALID)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Invalid GPE bit [%X].\n", GpeNumber));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid GPE bit [%X].\n", GpeNumber));
return_VALUE (INTERRUPT_NOT_HANDLED);
}
diff --git a/sys/contrib/dev/acpica/evmisc.c b/sys/contrib/dev/acpica/evmisc.c
index afa7b2dcf980..94217042a4c9 100644
--- a/sys/contrib/dev/acpica/evmisc.c
+++ b/sys/contrib/dev/acpica/evmisc.c
@@ -2,7 +2,7 @@
*
* Module Name: evmisc - ACPI device notification handler dispatch
* and ACPI Global Lock support
- * $Revision: 31 $
+ * $Revision: 32 $
*
*****************************************************************************/
@@ -159,29 +159,29 @@ AcpiEvQueueNotifyRequest (
* initiate soft-off or sleep operation?
*/
- DEBUG_PRINTP (ACPI_INFO,
- ("Dispatching Notify(%X) on node %p\n", NotifyValue, Node));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Dispatching Notify(%X) on node %p\n", NotifyValue, Node));
switch (NotifyValue)
{
case 0:
- DEBUG_PRINTP (ACPI_INFO, ("Notify value: Re-enumerate Devices\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: Re-enumerate Devices\n"));
break;
case 1:
- DEBUG_PRINTP (ACPI_INFO, ("Notify value: Ejection Request\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: Ejection Request\n"));
break;
case 2:
- DEBUG_PRINTP (ACPI_INFO, ("Notify value: Device Wake\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: Device Wake\n"));
break;
case 0x80:
- DEBUG_PRINTP (ACPI_INFO, ("Notify value: Status Change\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: Status Change\n"));
break;
default:
- DEBUG_PRINTP (ACPI_INFO, ("Unknown Notify Value: %lx \n", NotifyValue));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unknown Notify Value: %lx \n", NotifyValue));
break;
}
@@ -252,7 +252,7 @@ AcpiEvQueueNotifyRequest (
{
/* There is no per-device notify handler for this device */
- DEBUG_PRINTP (ACPI_INFO, ("No notify handler for node %p \n", Node));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "No notify handler for node %p \n", Node));
}
return (Status);
@@ -501,7 +501,7 @@ AcpiEvAcquireGlobalLock(void)
{
/* We got the lock */
- DEBUG_PRINTP (ACPI_INFO, ("Acquired the Global Lock\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Acquired the Global Lock\n"));
AcpiGbl_GlobalLockAcquired = TRUE;
return_ACPI_STATUS (AE_OK);
@@ -513,7 +513,7 @@ AcpiEvAcquireGlobalLock(void)
* wait until we get the global lock released interrupt.
*/
- DEBUG_PRINTP (ACPI_INFO, ("Waiting for the HW Global Lock\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Waiting for the HW Global Lock\n"));
/*
* Acquire the global lock semaphore first.
diff --git a/sys/contrib/dev/acpica/evregion.c b/sys/contrib/dev/acpica/evregion.c
index 10aef1e39505..1537af029311 100644
--- a/sys/contrib/dev/acpica/evregion.c
+++ b/sys/contrib/dev/acpica/evregion.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evregion - ACPI AddressSpace (OpRegion) handler dispatch
- * $Revision: 106 $
+ * $Revision: 107 $
*
*****************************************************************************/
@@ -310,7 +310,7 @@ AcpiEvAddressSpaceDispatch (
HandlerDesc = RegionObj->Region.AddrHandler;
if (!HandlerDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("no handler for region(%p) [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "no handler for region(%p) [%s]\n",
RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
return_ACPI_STATUS(AE_NOT_EXIST);
@@ -331,7 +331,7 @@ AcpiEvAddressSpaceDispatch (
/*
* Bad news, no init routine and not init'd
*/
- DEBUG_PRINTP (ACPI_ERROR, ("No init routine for region(%p) [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No init routine for region(%p) [%s]\n",
RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
return_ACPI_STATUS (AE_UNKNOWN_STATUS);
}
@@ -354,7 +354,7 @@ AcpiEvAddressSpaceDispatch (
*/
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Region Init: %s [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region Init: %s [%s]\n",
AcpiFormatException (Status),
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
return_ACPI_STATUS(Status);
@@ -374,8 +374,8 @@ AcpiEvAddressSpaceDispatch (
*/
Handler = HandlerDesc->AddrHandler.Handler;
- DEBUG_PRINTP ((TRACE_OPREGION | VERBOSE_INFO),
- ("Addrhandler %p (%p), Address %8.8lX%8.8lX\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Addrhandler %p (%p), Address %8.8lX%8.8lX\n",
&RegionObj->Region.AddrHandler->AddrHandler, Handler, HIDWORD(Address),
LODWORD(Address)));
@@ -398,7 +398,7 @@ AcpiEvAddressSpaceDispatch (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Region handler: %s [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region handler: %s [%s]\n",
AcpiFormatException (Status),
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
}
@@ -473,8 +473,8 @@ AcpiEvDisassociateRegionFromHandler(
*/
if (ObjDesc == RegionObj)
{
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Removing Region %p from address handler %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Removing Region %p from address handler %p\n",
RegionObj, HandlerObj));
/*
* This is it, remove it from the handler's list
@@ -509,7 +509,7 @@ AcpiEvDisassociateRegionFromHandler(
*/
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("%s from region init, [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s from region init, [%s]\n",
AcpiFormatException (Status),
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
}
@@ -542,8 +542,8 @@ AcpiEvDisassociateRegionFromHandler(
/*
* If we get here, the region was not in the handler's region list
*/
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Cannot remove region %p from address handler %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Cannot remove region %p from address handler %p\n",
RegionObj, HandlerObj));
return_VOID;
@@ -577,8 +577,8 @@ AcpiEvAssociateRegionAndHandler (
FUNCTION_TRACE ("EvAssociateRegionAndHandler");
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Adding Region %p to address handler %p [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Adding Region %p to address handler %p [%s]\n",
RegionObj, HandlerObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
@@ -707,8 +707,8 @@ AcpiEvAddrHandlerHelper (
/*
* It's for the same address space
*/
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Found handler for region [%s] in device %p(%p) handler %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Found handler for region [%s] in device %p(%p) handler %p\n",
AcpiUtGetRegionName (HandlerObj->AddrHandler.SpaceId),
ObjDesc, TmpObj, HandlerObj));
diff --git a/sys/contrib/dev/acpica/evrgnini.c b/sys/contrib/dev/acpica/evrgnini.c
index 34440d554341..b08d5b7b75dd 100644
--- a/sys/contrib/dev/acpica/evrgnini.c
+++ b/sys/contrib/dev/acpica/evrgnini.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evrgnini- ACPI AddressSpace (OpRegion) init
- * $Revision: 44 $
+ * $Revision: 45 $
*
*****************************************************************************/
@@ -256,8 +256,8 @@ AcpiEvPciConfigRegionSetup (
* No installed handler. This shouldn't happen because the dispatch
* routine checks before we get here, but we check again just in case.
*/
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Attempting to init a region %X, with no handler\n", RegionObj));
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Attempting to init a region %X, with no handler\n", RegionObj));
return_ACPI_STATUS (AE_NOT_EXIST);
}
@@ -516,8 +516,8 @@ AcpiEvInitializeRegion (
*/
if (HandlerObj->AddrHandler.SpaceId == SpaceId)
{
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Found handler %p for region %p in obj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Found handler %p for region %p in obj %p\n",
HandlerObj, RegionObj, ObjDesc));
/*
@@ -544,8 +544,8 @@ AcpiEvInitializeRegion (
/*
* If we get here, there is no handler for this region
*/
- DEBUG_PRINTP (TRACE_OPREGION,
- ("No handler for RegionType %s(%X) (RegionObj %p)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "No handler for RegionType %s(%X) (RegionObj %p)\n",
AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj));
return_ACPI_STATUS (AE_NOT_EXIST);
diff --git a/sys/contrib/dev/acpica/evxface.c b/sys/contrib/dev/acpica/evxface.c
index 95973d437f29..18193cfebcec 100644
--- a/sys/contrib/dev/acpica/evxface.c
+++ b/sys/contrib/dev/acpica/evxface.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evxface - External interfaces for ACPI events
- * $Revision: 110 $
+ * $Revision: 111 $
*
*****************************************************************************/
@@ -190,7 +190,7 @@ AcpiInstallFixedEventHandler (
Status = AcpiEnableEvent (Event, ACPI_EVENT_FIXED);
if (!ACPI_SUCCESS (Status))
{
- DEBUG_PRINTP (ACPI_WARN, ("Could not enable fixed event.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not enable fixed event.\n"));
/* Remove the handler */
@@ -200,8 +200,8 @@ AcpiInstallFixedEventHandler (
else
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Enabled fixed event %X, Handler=%p\n", Event, Handler));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Enabled fixed event %X, Handler=%p\n", Event, Handler));
}
@@ -264,13 +264,13 @@ AcpiRemoveFixedEventHandler (
if (!ACPI_SUCCESS(Status))
{
- DEBUG_PRINTP (ACPI_WARN,
- ("Could not write to fixed event enable register.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN,
+ "Could not write to fixed event enable register.\n"));
}
else
{
- DEBUG_PRINTP (ACPI_INFO, ("Disabled fixed event %X.\n", Event));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X.\n", Event));
}
AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
@@ -525,7 +525,7 @@ AcpiRemoveNotifyHandler (
*/
if (Device == ACPI_ROOT_OBJECT) {
- DEBUG_PRINTP (ACPI_INFO, ("Removing notify handler for ROOT object.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing notify handler for ROOT object.\n"));
if (((HandlerType == ACPI_SYSTEM_NOTIFY) &&
!AcpiGbl_SysNotify.Handler) ||
diff --git a/sys/contrib/dev/acpica/evxfevnt.c b/sys/contrib/dev/acpica/evxfevnt.c
index 5d121a8077c1..33492ec5601f 100644
--- a/sys/contrib/dev/acpica/evxfevnt.c
+++ b/sys/contrib/dev/acpica/evxfevnt.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
- * $Revision: 33 $
+ * $Revision: 34 $
*
*****************************************************************************/
@@ -153,7 +153,7 @@ AcpiEnable (void)
if (!AcpiGbl_DSDT)
{
- DEBUG_PRINTP (ACPI_WARN, ("No ACPI tables present!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No ACPI tables present!\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -161,7 +161,7 @@ AcpiEnable (void)
if (SYS_MODE_LEGACY == AcpiHwGetModeCapabilities())
{
- DEBUG_PRINTP (ACPI_WARN, ("Only legacy mode supported!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Only legacy mode supported!\n"));
return_ACPI_STATUS (AE_ERROR);
}
@@ -170,11 +170,11 @@ AcpiEnable (void)
Status = AcpiHwSetMode (SYS_MODE_ACPI);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_FATAL, ("Could not transition to ACPI mode.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Could not transition to ACPI mode.\n"));
return_ACPI_STATUS (Status);
}
- DEBUG_PRINTP (ACPI_OK, ("Transition to ACPI mode successful\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Transition to ACPI mode successful\n"));
return_ACPI_STATUS (Status);
}
@@ -215,7 +215,7 @@ AcpiDisable (void)
Status = AcpiHwSetMode (AcpiGbl_OriginalMode);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Unable to transition to original mode"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to transition to original mode"));
return_ACPI_STATUS (Status);
}
@@ -306,8 +306,8 @@ AcpiEnableEvent (
if (1 != AcpiHwRegisterBitAccess(ACPI_READ, ACPI_MTX_LOCK, RegisterId))
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Fixed event bit clear when it should be set\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Fixed event bit clear when it should be set\n"));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
@@ -419,8 +419,8 @@ AcpiDisableEvent (
if (0 != AcpiHwRegisterBitAccess(ACPI_READ, ACPI_MTX_LOCK, RegisterId))
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Fixed event bit set when it should be clear,\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Fixed event bit set when it should be clear,\n"));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
diff --git a/sys/contrib/dev/acpica/evxfregn.c b/sys/contrib/dev/acpica/evxfregn.c
index dceafd67d5fb..7e14873ff259 100644
--- a/sys/contrib/dev/acpica/evxfregn.c
+++ b/sys/contrib/dev/acpica/evxfregn.c
@@ -2,7 +2,7 @@
*
* Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
* Address Spaces.
- * $Revision: 34 $
+ * $Revision: 35 $
*
*****************************************************************************/
@@ -278,8 +278,8 @@ AcpiInstallAddressSpaceHandler (
else
{
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Creating object on Device %p while installing handler\n", Node));
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Creating object on Device %p while installing handler\n", Node));
/* ObjDesc does not exist, create one */
@@ -314,8 +314,8 @@ AcpiInstallAddressSpaceHandler (
}
}
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Installing address handler for region %s(%X) on Device %p(%p)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Installing address handler for region %s(%X) on Device %p(%p)\n",
AcpiUtGetRegionName (SpaceId), SpaceId, Node, ObjDesc));
/*
@@ -462,8 +462,8 @@ AcpiRemoveAddressSpaceHandler (
/*
* Got it, first dereference this in the Regions
*/
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Removing address handler %p(%p) for region %s on Device %p(%p)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Removing address handler %p(%p) for region %s on Device %p(%p)\n",
HandlerObj, Handler, AcpiUtGetRegionName (SpaceId),
Node, ObjDesc));
@@ -516,8 +516,8 @@ AcpiRemoveAddressSpaceHandler (
/*
* The handler does not exist
*/
- DEBUG_PRINTP (TRACE_OPREGION,
- ("Unable to remove address handler %p for %s(%X), DevNode %p, obj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Unable to remove address handler %p for %s(%X), DevNode %p, obj %p\n",
Handler, AcpiUtGetRegionName (SpaceId), SpaceId, Node, ObjDesc));
Status = AE_NOT_EXIST;
diff --git a/sys/contrib/dev/acpica/exconfig.c b/sys/contrib/dev/acpica/exconfig.c
index 88ed3b5fe3a0..c79f8b8c1eeb 100644
--- a/sys/contrib/dev/acpica/exconfig.c
+++ b/sys/contrib/dev/acpica/exconfig.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
- * $Revision: 36 $
+ * $Revision: 37 $
*
*****************************************************************************/
@@ -214,8 +214,8 @@ AcpiExLoadTableOp (
AcpiGbl_AcpiTableData[ACPI_TABLE_SSDT].Signature,
AcpiGbl_AcpiTableData[ACPI_TABLE_SSDT].SigLength)))
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Table has invalid signature [%4.4s], must be SSDT or PSDT\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Table has invalid signature [%4.4s], must be SSDT or PSDT\n",
TableHeader.Signature));
Status = AE_BAD_SIGNATURE;
goto Cleanup;
@@ -393,7 +393,7 @@ AcpiExReconfiguration (
Status |= AcpiDsObjStackPopObject (&RegionDesc, WalkState);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("bad operand(s) (Load) (%s)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad operand(s) (Load) (%s)\n",
AcpiFormatException (Status)));
AcpiUtRemoveReference (RegionDesc);
@@ -408,7 +408,7 @@ AcpiExReconfiguration (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("bad operand(s) (unload) (%s)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad operand(s) (unload) (%s)\n",
AcpiFormatException (Status)));
return_ACPI_STATUS (Status);
@@ -420,7 +420,7 @@ AcpiExReconfiguration (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("bad opcode=%X\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad opcode=%X\n", Opcode));
Status = AE_AML_BAD_OPCODE;
break;
}
diff --git a/sys/contrib/dev/acpica/exconvrt.c b/sys/contrib/dev/acpica/exconvrt.c
index c9df9703ba38..d8af78d56e9c 100644
--- a/sys/contrib/dev/acpica/exconvrt.c
+++ b/sys/contrib/dev/acpica/exconvrt.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exconvrt - Object conversion routines
- * $Revision: 16 $
+ * $Revision: 20 $
*
*****************************************************************************/
@@ -376,6 +376,124 @@ AcpiExConvertToBuffer (
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExConvertAscii
+ *
+ * PARAMETERS: Integer
+ *
+ * RETURN: Actual string length
+ *
+ * DESCRIPTION: Convert an ACPI Integer to a hex string
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiExConvertToAscii (
+ ACPI_INTEGER Integer,
+ UINT32 Base,
+ UINT8 *String)
+{
+ UINT32 i;
+ UINT32 j;
+ UINT32 k = 0;
+ UINT8 HexDigit;
+ ACPI_INTEGER Digit;
+ BOOLEAN LeadingZero = TRUE;
+ UINT32 Length = sizeof (ACPI_INTEGER);
+
+
+ /******** TBD: DEBUG only
+ char *buf;
+ char sbuf[32];
+#include <stdio.h>
+#include <stdlib.h>
+ buf = _ui64toa (Integer, sbuf, 10);
+ printf ("1): %s\n", sbuf);
+
+ AcpiExConvertToDecimalAscii (Integer, 0, sbuf);
+ printf ("2): %s\n", sbuf);
+
+
+ buf = _ui64toa (Integer, sbuf, 16);
+ printf ("3): %s\n", sbuf);
+
+ printf ("4): %s\n", String);
+***************************************************/
+
+
+ switch (Base)
+ {
+ case 10:
+
+ for (i = ACPI_MAX_DECIMAL_DIGITS; i > 0 ; i--)
+ {
+ /* Divide by nth factor of 10 */
+
+ Digit = Integer;
+ for (j = 1; j < i; j++)
+ {
+ Digit = ACPI_DIVIDE (Digit, 10);
+ }
+
+ /* Create the decimal digit */
+
+ if (Digit != 0)
+ {
+ LeadingZero = FALSE;
+ }
+
+ if (!LeadingZero)
+ {
+ String[k] = (UINT8) (ASCII_ZERO + ACPI_MODULO (Digit, 10));
+ k++;
+ }
+ }
+ break;
+
+ case 16:
+
+ /* Copy the integer to the buffer */
+
+ for (i = 0, j = ((Length * 2) -1); i < (Length * 2); i++, j--)
+ {
+
+ HexDigit = AcpiUtHexToAsciiChar (Integer, (j * 4));
+ if (HexDigit != ASCII_ZERO)
+ {
+ LeadingZero = FALSE;
+ }
+
+ if (!LeadingZero)
+ {
+ String[k] = HexDigit;
+ k++;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ /*
+ * Since leading zeros are supressed, we must check for the case where
+ * the integer equals 0.
+ *
+ * Finally, null terminate the string and return the length
+ */
+ if (!k)
+ {
+ String [0] = ASCII_ZERO;
+ k = 1;
+ }
+ String [k] = 0;
+
+ return (k);
+}
+
+
/*******************************************************************************
*
* FUNCTION: AcpiExConvertToString
@@ -394,12 +512,12 @@ ACPI_STATUS
AcpiExConvertToString (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ResultDesc,
+ UINT32 Base,
UINT32 MaxLength,
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT *RetDesc;
UINT32 i;
- UINT32 j;
UINT32 Index;
UINT32 StringLength;
UINT32 IntegerSize = sizeof (ACPI_INTEGER);
@@ -412,15 +530,6 @@ AcpiExConvertToString (
{
case ACPI_TYPE_INTEGER:
- /*
- * Create a new String
- */
- RetDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING);
- if (!RetDesc)
- {
- return (AE_NO_MEMORY);
- }
-
/* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */
if (WalkState->MethodNode->Flags & ANOBJ_DATA_WIDTH_32)
@@ -433,10 +542,24 @@ AcpiExConvertToString (
IntegerSize = sizeof (UINT32);
}
+ StringLength = IntegerSize * 2;
+ if (Base == 10)
+ {
+ StringLength = ACPI_MAX_DECIMAL_DIGITS;
+ }
+
+ /*
+ * Create a new String
+ */
+ RetDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING);
+ if (!RetDesc)
+ {
+ return (AE_NO_MEMORY);
+ }
+
/* Need enough space for one ASCII integer plus null terminator */
- RetDesc->String.Length = (IntegerSize * 2) + 1;
- NewBuf = ACPI_MEM_CALLOCATE (RetDesc->String.Length);
+ NewBuf = ACPI_MEM_CALLOCATE (StringLength + 1);
if (!NewBuf)
{
REPORT_ERROR
@@ -445,22 +568,22 @@ AcpiExConvertToString (
return (AE_NO_MEMORY);
}
- /* Copy the integer to the buffer */
- for (i = 0, j = ((IntegerSize * 2) -1); i < (IntegerSize * 2); i++, j--)
- {
- NewBuf[i] = AcpiGbl_HexToAscii [(ObjDesc->Integer.Value >> (j * 4)) & 0xF];
- }
+ /* Convert */
+
+ i = AcpiExConvertToAscii (ObjDesc->Integer.Value, Base, NewBuf);
/* Null terminate at the correct place */
if (MaxLength < i)
{
NewBuf[MaxLength] = 0;
+ RetDesc->String.Length = MaxLength;
}
else
{
NewBuf [i] = 0;
+ RetDesc->String.Length = i;
}
RetDesc->Buffer.Pointer = NewBuf;
@@ -482,6 +605,10 @@ AcpiExConvertToString (
case ACPI_TYPE_BUFFER:
StringLength = ObjDesc->Buffer.Length * 3;
+ if (Base == 10)
+ {
+ StringLength = ObjDesc->Buffer.Length * 4;
+ }
if (MaxLength > ACPI_MAX_STRING_CONVERSION)
{
@@ -521,12 +648,12 @@ AcpiExConvertToString (
*/
Pointer = ObjDesc->Buffer.Pointer;
Index = 0;
- for (i = 0; i < (StringLength/3); i++)
+ for (i = 0, Index = 0; i < ObjDesc->Buffer.Length; i++)
{
- NewBuf[Index + 0] = AcpiGbl_HexToAscii [Pointer[i] & 0x0F];
- NewBuf[Index + 1] = AcpiGbl_HexToAscii [(Pointer[i] >> 4) & 0x0F];
- NewBuf[Index + 2] = ' ';
- Index += 3;
+ Index = AcpiExConvertToAscii (Pointer[i], Base, &NewBuf[Index]);
+
+ NewBuf[Index] = ' ';
+ Index++;
}
/* Null terminate */
@@ -624,8 +751,8 @@ AcpiExConvertToTargetType (
if (DestinationType != (*ObjDesc)->Common.Type)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Target does not allow conversion of type %s to %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Target does not allow conversion of type %s to %s\n",
AcpiUtGetTypeName ((*ObjDesc)->Common.Type),
AcpiUtGetTypeName (DestinationType)));
Status = AE_TYPE;
@@ -656,7 +783,7 @@ AcpiExConvertToTargetType (
* The operand must be a String. We can convert an
* Integer or Buffer if necessary
*/
- Status = AcpiExConvertToString (*ObjDesc, ObjDesc, ACPI_UINT32_MAX, WalkState);
+ Status = AcpiExConvertToString (*ObjDesc, ObjDesc, 16, ACPI_UINT32_MAX, WalkState);
break;
@@ -680,8 +807,8 @@ AcpiExConvertToTargetType (
default:
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unknown Target type ID 0x%X Op %s DestType %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unknown Target type ID 0x%X Op %s DestType %s\n",
GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs),
WalkState->OpInfo->Name, AcpiUtGetTypeName (DestinationType)));
diff --git a/sys/contrib/dev/acpica/excreate.c b/sys/contrib/dev/acpica/excreate.c
index 57c0c8832729..1718b122e336 100644
--- a/sys/contrib/dev/acpica/excreate.c
+++ b/sys/contrib/dev/acpica/excreate.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: excreate - Named object creation
- * $Revision: 63 $
+ * $Revision: 64 $
*
*****************************************************************************/
@@ -238,9 +238,9 @@ AcpiExCreateBufferField (
DUMP_PATHNAME (Node,
"ExCreateBufferField: Removing Current Reference",
- TRACE_BFIELD, _COMPONENT);
+ ACPI_LV_BFIELD, _COMPONENT);
- DUMP_ENTRY (Node, TRACE_BFIELD);
+ DUMP_ENTRY (Node, ACPI_LV_BFIELD);
DUMP_STACK_ENTRY (TmpDesc);
AcpiUtRemoveReference (TmpDesc);
@@ -536,7 +536,7 @@ AcpiExCreateRegion (
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
}
- DEBUG_PRINTP (TRACE_LOAD, ("Region Type - %s (%X)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (%X)\n",
AcpiUtGetRegionName (RegionSpace), RegionSpace));
diff --git a/sys/contrib/dev/acpica/exdump.c b/sys/contrib/dev/acpica/exdump.c
index 55a5c0dc1a21..6c4855762aef 100644
--- a/sys/contrib/dev/acpica/exdump.c
+++ b/sys/contrib/dev/acpica/exdump.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exdump - Interpreter debug output routines
- * $Revision: 114 $
+ * $Revision: 116 $
*
*****************************************************************************/
@@ -121,6 +121,7 @@
#include "amlcode.h"
#include "acnamesp.h"
#include "actables.h"
+#include "acparser.h"
#define _COMPONENT ACPI_EXECUTER
MODULE_NAME ("exdump")
@@ -191,34 +192,34 @@ AcpiExShowHexValue (
Length += 3 + AcpiExDigitsNeeded (Value, 10);
}
- DEBUG_PRINT (TRACE_LOAD, (""));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, ""));
for (Length = LeadSpace; Length; --Length )
{
- DEBUG_PRINT_RAW (TRACE_LOAD, (" "));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
}
while (ByteCount--)
{
- DEBUG_PRINT_RAW (TRACE_LOAD, ("%02x", *AmlPtr++));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "%02x", *AmlPtr++));
if (ByteCount)
{
- DEBUG_PRINT_RAW (TRACE_LOAD, (" "));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
}
}
if (ShowDecimalValue)
{
- DEBUG_PRINT_RAW (TRACE_LOAD, (" [%ld]", Value));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%ld]", Value));
}
if (0 == LeadSpace)
{
- DEBUG_PRINT_RAW (TRACE_LOAD, (" "));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
}
- DEBUG_PRINT_RAW (TRACE_LOAD, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "\n"));
return_VOID;
}
@@ -254,34 +255,34 @@ AcpiExDumpOperand (
* since most (if not all)
* code that dumps the stack expects something to be there!
*/
- DEBUG_PRINTP (ACPI_INFO, ("Null stack entry ptr\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null stack entry ptr\n"));
return (AE_OK);
}
if (VALID_DESCRIPTOR_TYPE (EntryDesc, ACPI_DESC_TYPE_NAMED))
{
- DEBUG_PRINTP (ACPI_INFO, ("Node: \n"));
- DUMP_ENTRY (EntryDesc, ACPI_INFO);
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Node: \n"));
+ DUMP_ENTRY (EntryDesc, ACPI_LV_INFO);
return (AE_OK);
}
if (AcpiTbSystemTablePointer (EntryDesc))
{
- DEBUG_PRINTP (ACPI_INFO, ("%p is an AML pointer\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p is an AML pointer\n",
EntryDesc));
return (AE_OK);
}
if (!VALID_DESCRIPTOR_TYPE (EntryDesc, ACPI_DESC_TYPE_INTERNAL))
{
- DEBUG_PRINTP (ACPI_INFO, ("%p Not a local object \n", EntryDesc));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p Not a local object \n", EntryDesc));
DUMP_BUFFER (EntryDesc, sizeof (ACPI_OPERAND_OBJECT));
return (AE_OK);
}
/* EntryDesc is a valid object */
- DEBUG_PRINTP (ACPI_INFO, ("%p ", EntryDesc));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p ", EntryDesc));
switch (EntryDesc->Common.Type)
{
@@ -291,63 +292,63 @@ AcpiExDumpOperand (
{
case AML_ZERO_OP:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Zero\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Zero\n"));
break;
case AML_ONE_OP:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: One\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: One\n"));
break;
case AML_ONES_OP:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Ones\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Ones\n"));
break;
case AML_DEBUG_OP:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Debug\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Debug\n"));
break;
case AML_NAME_OP:
DUMP_PATHNAME (EntryDesc->Reference.Object, "Reference: Name: ",
- ACPI_INFO, _COMPONENT);
- DUMP_ENTRY (EntryDesc->Reference.Object, ACPI_INFO);
+ ACPI_LV_INFO, _COMPONENT);
+ DUMP_ENTRY (EntryDesc->Reference.Object, ACPI_LV_INFO);
break;
case AML_INDEX_OP:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Index %p\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Index %p\n",
EntryDesc->Reference.Object));
break;
case AML_ARG_OP:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Arg%d",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Arg%d",
EntryDesc->Reference.Offset));
if (ACPI_TYPE_INTEGER == EntryDesc->Common.Type)
{
/* Value is a Number */
- DEBUG_PRINT_RAW (ACPI_INFO, (" value is [%ld]",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%ld]",
EntryDesc->Integer.Value));
}
- DEBUG_PRINT_RAW (ACPI_INFO, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
break;
case AML_LOCAL_OP:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Local%d",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Local%d",
EntryDesc->Reference.Offset));
if (ACPI_TYPE_INTEGER == EntryDesc->Common.Type)
@@ -355,16 +356,16 @@ AcpiExDumpOperand (
/* Value is a Number */
- DEBUG_PRINT_RAW (ACPI_INFO, (" value is [%ld]",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%ld]",
EntryDesc->Integer.Value));
}
- DEBUG_PRINT_RAW (ACPI_INFO, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
break;
case AML_INT_NAMEPATH_OP:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Reference.Node->Name %x\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %x\n",
EntryDesc->Reference.Node->Name));
break;
@@ -372,7 +373,7 @@ AcpiExDumpOperand (
/* unknown opcode */
- DEBUG_PRINT_RAW (ACPI_INFO, ("Unknown opcode=%X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Unknown opcode=%X\n",
EntryDesc->Reference.Opcode));
break;
@@ -383,7 +384,7 @@ AcpiExDumpOperand (
case ACPI_TYPE_BUFFER:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Buffer len %X @ %p \n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer len %X @ %p \n",
EntryDesc->Buffer.Length,
EntryDesc->Buffer.Pointer));
@@ -398,14 +399,14 @@ AcpiExDumpOperand (
if (EntryDesc->Buffer.Pointer)
{
- DEBUG_PRINT_RAW (ACPI_INFO, ("Buffer Contents: "));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer Contents: "));
for (Buf = EntryDesc->Buffer.Pointer; Length--; ++Buf)
{
- DEBUG_PRINT_RAW (ACPI_INFO,
- (Length ? " %02x" : " %02x", *Buf));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
+ Length ? " %02x" : " %02x", *Buf));
}
- DEBUG_PRINT_RAW (ACPI_INFO,("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,"\n"));
}
break;
@@ -413,28 +414,28 @@ AcpiExDumpOperand (
case ACPI_TYPE_INTEGER:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Number %lX\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Number %lX\n",
EntryDesc->Integer.Value));
break;
case INTERNAL_TYPE_IF:
- DEBUG_PRINT_RAW (ACPI_INFO, ("If [Number] %lX\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "If [Number] %lX\n",
EntryDesc->Integer.Value));
break;
case INTERNAL_TYPE_WHILE:
- DEBUG_PRINT_RAW (ACPI_INFO, ("While [Number] %lX\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "While [Number] %lX\n",
EntryDesc->Integer.Value));
break;
case ACPI_TYPE_PACKAGE:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Package count %X @ %p\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Package count %X @ %p\n",
EntryDesc->Package.Count, EntryDesc->Package.Elements));
@@ -457,14 +458,14 @@ AcpiExDumpOperand (
}
}
- DEBUG_PRINT_RAW (ACPI_INFO, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
break;
case ACPI_TYPE_REGION:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Region %s (%X)",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Region %s (%X)",
AcpiUtGetRegionName (EntryDesc->Region.SpaceId),
EntryDesc->Region.SpaceId));
@@ -474,11 +475,11 @@ AcpiExDumpOperand (
*/
if (!(EntryDesc->Region.Flags & AOPOBJ_DATA_VALID))
{
- DEBUG_PRINT_RAW (ACPI_INFO, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
}
else
{
- DEBUG_PRINT_RAW (ACPI_INFO, (" base %p Length %X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %p Length %X\n",
EntryDesc->Region.Address, EntryDesc->Region.Length));
}
break;
@@ -486,29 +487,29 @@ AcpiExDumpOperand (
case ACPI_TYPE_STRING:
- DEBUG_PRINT_RAW (ACPI_INFO, ("String length %X @ %p\n\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "String length %X @ %p\n\n",
EntryDesc->String.Length, EntryDesc->String.Pointer));
for (i=0; i < EntryDesc->String.Length; i++)
{
- DEBUG_PRINT_RAW (ACPI_INFO, ("%c",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "%c",
EntryDesc->String.Pointer[i]));
}
- DEBUG_PRINT_RAW (ACPI_INFO, ("\n\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n\n"));
break;
case INTERNAL_TYPE_BANK_FIELD:
- DEBUG_PRINT_RAW (ACPI_INFO, ("BankField\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "BankField\n"));
break;
case INTERNAL_TYPE_REGION_FIELD:
- DEBUG_PRINT_RAW (ACPI_INFO,
- ("RegionField: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%lX bit=%X of below:\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
+ "RegionField: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%lX bit=%X of below:\n",
EntryDesc->Field.BitLength, EntryDesc->Field.AccessBitWidth,
EntryDesc->Field.LockRule, EntryDesc->Field.UpdateRule,
EntryDesc->Field.BaseByteOffset, EntryDesc->Field.StartFieldBitOffset));
@@ -518,26 +519,26 @@ AcpiExDumpOperand (
case INTERNAL_TYPE_INDEX_FIELD:
- DEBUG_PRINT_RAW (ACPI_INFO, ("IndexField\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "IndexField\n"));
break;
case ACPI_TYPE_BUFFER_FIELD:
- DEBUG_PRINT_RAW (ACPI_INFO,
- ("BufferField: %X bits at byte %lX bit %X of \n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
+ "BufferField: %X bits at byte %lX bit %X of \n",
EntryDesc->BufferField.BitLength, EntryDesc->BufferField.BaseByteOffset,
EntryDesc->BufferField.StartFieldBitOffset));
if (!EntryDesc->BufferField.BufferObj)
{
- DEBUG_PRINT (ACPI_INFO, ("*NULL* \n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*NULL* \n"));
}
else if (ACPI_TYPE_BUFFER !=
EntryDesc->BufferField.BufferObj->Common.Type)
{
- DEBUG_PRINT_RAW (ACPI_INFO, ("*not a Buffer* \n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "*not a Buffer* \n"));
}
else
@@ -550,14 +551,14 @@ AcpiExDumpOperand (
case ACPI_TYPE_EVENT:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Event\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Event\n"));
break;
case ACPI_TYPE_METHOD:
- DEBUG_PRINT_RAW (ACPI_INFO,
- ("Method(%X) @ %p:%lX\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
+ "Method(%X) @ %p:%lX\n",
EntryDesc->Method.ParamCount,
EntryDesc->Method.Pcode, EntryDesc->Method.PcodeLength));
break;
@@ -565,38 +566,38 @@ AcpiExDumpOperand (
case ACPI_TYPE_MUTEX:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Mutex\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Mutex\n"));
break;
case ACPI_TYPE_DEVICE:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Device\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Device\n"));
break;
case ACPI_TYPE_POWER:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Power\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Power\n"));
break;
case ACPI_TYPE_PROCESSOR:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Processor\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Processor\n"));
break;
case ACPI_TYPE_THERMAL:
- DEBUG_PRINT_RAW (ACPI_INFO, ("Thermal\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Thermal\n"));
break;
default:
/* unknown EntryDesc->Common.Type value */
- DEBUG_PRINT_RAW (ACPI_INFO, ("Unknown Type %X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Unknown Type %X\n",
EntryDesc->Common.Type));
/* Back up to previous entry */
@@ -645,6 +646,8 @@ AcpiExDumpOperands (
ACPI_OPERAND_OBJECT **EntryDesc;
+ PROC_NAME ("AcpiExDumpOperands");
+
if (!Ident)
{
Ident = "?";
@@ -656,11 +659,11 @@ AcpiExDumpOperands (
}
- DEBUG_PRINT (ACPI_INFO,
- ("************* AcpiExDumpOperands Mode=%X ******************\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "************* AcpiExDumpOperands Mode=%X ******************\n",
InterpreterMode));
- DEBUG_PRINT (ACPI_INFO,
- ("From %12s(%d) %s: %s\n", ModuleName, LineNumber, Ident, Note));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "From %12s(%d) %s: %s\n", ModuleName, LineNumber, Ident, Note));
if (NumLevels == 0)
{
@@ -702,7 +705,7 @@ AcpiExDumpNode (
if (!Flags)
{
- if (!((TRACE_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
+ if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
{
return;
}
@@ -737,12 +740,15 @@ AcpiExDumpObjectDescriptor (
ACPI_OPERAND_OBJECT *ObjDesc,
UINT32 Flags)
{
+ ACPI_OPCODE_INFO *OpInfo;
+
+
FUNCTION_TRACE ("ExDumpObjectDescriptor");
if (!Flags)
{
- if (!((TRACE_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
+ if (!((ACPI_DB_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
{
return;
}
@@ -765,8 +771,9 @@ AcpiExDumpObjectDescriptor (
{
case ACPI_TYPE_INTEGER:
- AcpiOsPrintf ("%20s : %s\n", "Type", "Number");
- AcpiOsPrintf ("%20s : %X\n", "Value", ObjDesc->Integer.Value);
+ AcpiOsPrintf ("%20s : %s\n", "Type", "Integer");
+ AcpiOsPrintf ("%20s : %X%8.8X\n", "Value", HIDWORD (ObjDesc->Integer.Value),
+ LODWORD (ObjDesc->Integer.Value));
break;
@@ -789,6 +796,7 @@ AcpiExDumpObjectDescriptor (
case ACPI_TYPE_PACKAGE:
AcpiOsPrintf ("%20s : %s\n", "Type", "Package");
+ AcpiOsPrintf ("%20s : %X\n", "Flags", ObjDesc->Package.Flags);
AcpiOsPrintf ("%20s : %X\n", "Count", ObjDesc->Package.Count);
AcpiOsPrintf ("%20s : %p\n", "Elements", ObjDesc->Package.Elements);
AcpiOsPrintf ("%20s : %p\n", "NextElement", ObjDesc->Package.NextElement);
@@ -925,9 +933,11 @@ AcpiExDumpObjectDescriptor (
case INTERNAL_TYPE_REFERENCE:
+ OpInfo = AcpiPsGetOpcodeInfo (ObjDesc->Reference.Opcode);
+
AcpiOsPrintf ("%20s : %s\n", "Type", "Reference");
AcpiOsPrintf ("%20s : %X\n", "TargetType", ObjDesc->Reference.TargetType);
- AcpiOsPrintf ("%20s : %X\n", "Opcode", ObjDesc->Reference.Opcode);
+ AcpiOsPrintf ("%20s : %s\n", "Opcode", OpInfo->Name);
AcpiOsPrintf ("%20s : %X\n", "Offset", ObjDesc->Reference.Offset);
AcpiOsPrintf ("%20s : %p\n", "ObjDesc", ObjDesc->Reference.Object);
AcpiOsPrintf ("%20s : %p\n", "Node", ObjDesc->Reference.Node);
diff --git a/sys/contrib/dev/acpica/exdyadic.c b/sys/contrib/dev/acpica/exdyadic.c
index 451ad6b345a4..e542f64edad4 100644
--- a/sys/contrib/dev/acpica/exdyadic.c
+++ b/sys/contrib/dev/acpica/exdyadic.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exdyadic - ACPI AML execution for dyadic (2-operand) operators
- * $Revision: 82 $
+ * $Revision: 85 $
*
*****************************************************************************/
@@ -351,7 +351,7 @@ AcpiExDyadic1 (
{
/* Invalid parameters on object stack */
- DEBUG_PRINTP (ACPI_ERROR, ("(%s) bad operand(s) %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (Status)));
goto Cleanup;
@@ -394,7 +394,7 @@ AcpiExDyadic1 (
break;
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unexpected notify object type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type %X\n",
ObjDesc->Common.Type));
Status = AE_AML_OPERAND_TYPE;
@@ -464,6 +464,14 @@ AcpiExDyadic2R (
DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, AcpiPsGetOpcodeName (Opcode),
NumOperands, "after AcpiExResolveOperands");
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) Could not resolve operand(s) (%s)\n",
+ AcpiPsGetOpcodeName (Opcode), AcpiFormatException (Status)));
+
+ goto Cleanup;
+ }
+
/* Get all operands */
if (AML_DIVIDE_OP == Opcode)
@@ -477,7 +485,7 @@ AcpiExDyadic2R (
Status |= AcpiDsObjStackPopObject (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("(%s) bad operand(s) (%s)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) (%s)\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (Status)));
goto Cleanup;
@@ -679,7 +687,7 @@ AcpiExDyadic2R (
break;
case ACPI_TYPE_STRING:
- Status = AcpiExConvertToString (ObjDesc2, &ObjDesc2, ACPI_UINT32_MAX, WalkState);
+ Status = AcpiExConvertToString (ObjDesc2, &ObjDesc2, 16, ACPI_UINT32_MAX, WalkState);
break;
case ACPI_TYPE_BUFFER:
@@ -713,7 +721,7 @@ AcpiExDyadic2R (
case AML_TO_STRING_OP: /* ACPI 2.0 */
- Status = AcpiExConvertToString (ObjDesc, &RetDesc,
+ Status = AcpiExConvertToString (ObjDesc, &RetDesc, 16,
(UINT32) ObjDesc2->Integer.Value, WalkState);
break;
@@ -839,7 +847,7 @@ AcpiExDyadic2S (
{
/* Invalid parameters on object stack */
- DEBUG_PRINTP (ACPI_ERROR, ("(%s) bad operand(s) %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (Status)));
goto Cleanup;
@@ -973,7 +981,7 @@ AcpiExDyadic2 (
{
/* Invalid parameters on object stack */
- DEBUG_PRINTP (ACPI_ERROR, ("(%s) bad operand(s) %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (Status)));
goto Cleanup;
diff --git a/sys/contrib/dev/acpica/exfield.c b/sys/contrib/dev/acpica/exfield.c
index 361f0a936123..9c9e9e7a006e 100644
--- a/sys/contrib/dev/acpica/exfield.c
+++ b/sys/contrib/dev/acpica/exfield.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exfield - ACPI AML (p-code) execution - field manipulation
- * $Revision: 91 $
+ * $Revision: 92 $
*
*****************************************************************************/
@@ -601,9 +601,9 @@ AcpiExCommonAccessField (
FUNCTION_TRACE_PTR ("ExCommonAccessField", ObjDesc);
- DEBUG_PRINTP (ACPI_INFO, ("Obj=%p Type=%X Buf=%p Len=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj=%p Type=%X Buf=%p Len=%X\n",
ObjDesc, ObjDesc->Common.Type, Buffer, BufferLength));
- DEBUG_PRINTP (ACPI_INFO, ("Mode=%d BitLen=%X BitOff=%X ByteOff=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode=%d BitLen=%X BitOff=%X ByteOff=%X\n",
Mode, ObjDesc->CommonField.BitLength,
ObjDesc->CommonField.StartFieldBitOffset,
ObjDesc->CommonField.BaseByteOffset));
@@ -628,7 +628,7 @@ AcpiExCommonAccessField (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown I/O Mode: %X\n", Mode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown I/O Mode: %X\n", Mode));
Status = AE_BAD_PARAMETER;
break;
}
diff --git a/sys/contrib/dev/acpica/exfldio.c b/sys/contrib/dev/acpica/exfldio.c
index fd49c6b108ba..5e21ea1194c9 100644
--- a/sys/contrib/dev/acpica/exfldio.c
+++ b/sys/contrib/dev/acpica/exfldio.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exfldio - Aml Field I/O
- * $Revision: 59 $
+ * $Revision: 62 $
*
*****************************************************************************/
@@ -155,19 +155,11 @@ AcpiExSetupField (
FUNCTION_TRACE_U32 ("ExSetupField", FieldDatumByteOffset);
-
- /* Parameter validation */
-
RgnDesc = ObjDesc->CommonField.RegionObj;
- if (!ObjDesc || !RgnDesc)
- {
- DEBUG_PRINTP (ACPI_ERROR, ("Internal error - null handle\n"));
- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
if (ACPI_TYPE_REGION != RgnDesc->Common.Type)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Needed Region, found type %x %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %x %s\n",
RgnDesc->Common.Type, AcpiUtGetTypeName (RgnDesc->Common.Type)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -204,8 +196,8 @@ AcpiExSetupField (
* than the region itself. For example, a region of length one
* byte, and a field with Dword access specified.
*/
- DEBUG_PRINTP (ACPI_ERROR,
- ("Field access width (%d bytes) too large for region size (%X)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Field access width (%d bytes) too large for region size (%X)\n",
ObjDesc->CommonField.AccessByteWidth, RgnDesc->Region.Length));
}
@@ -213,8 +205,8 @@ AcpiExSetupField (
* Offset rounded up to next multiple of field width
* exceeds region length, indicate an error
*/
- DEBUG_PRINTP (ACPI_ERROR,
- ("Field base+offset+width %X+%X+%X exceeds region size (%X bytes) field=%p region=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Field base+offset+width %X+%X+%X exceeds region size (%X bytes) field=%p region=%p\n",
ObjDesc->CommonField.BaseByteOffset, FieldDatumByteOffset,
ObjDesc->CommonField.AccessByteWidth,
RgnDesc->Region.Length, ObjDesc, RgnDesc));
@@ -309,7 +301,7 @@ AcpiExReadFieldDatum (
Address = RgnDesc->Region.Address + ObjDesc->CommonField.BaseByteOffset +
FieldDatumByteOffset;
- DEBUG_PRINTP (TRACE_BFIELD, ("Region %s(%X) width %X base:off %X:%X at %8.8lX%8.8lX\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Region %s(%X) width %X base:off %X:%X at %8.8lX%8.8lX\n",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId, ObjDesc->CommonField.AccessBitWidth,
ObjDesc->CommonField.BaseByteOffset, FieldDatumByteOffset,
@@ -322,14 +314,14 @@ AcpiExReadFieldDatum (
Address, ObjDesc->CommonField.AccessBitWidth, Value);
if (Status == AE_NOT_IMPLEMENTED)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Region %s(%X) not implemented\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %s(%X) not implemented\n",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId));
}
else if (Status == AE_NOT_EXIST)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Region %s(%X) has no handler\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %s(%X) has no handler\n",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId));
}
@@ -338,14 +330,14 @@ AcpiExReadFieldDatum (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("%p, wrong source type - %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, wrong source type - %s\n",
ObjDesc, AcpiUtGetTypeName (ObjDesc->Common.Type)));
Status = AE_AML_INTERNAL;
break;
}
- DEBUG_PRINTP (TRACE_BFIELD, ("Returned value=%08lX \n", *Value));
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Returned value=%08lX \n", *Value));
return_ACPI_STATUS (Status);
}
@@ -473,7 +465,7 @@ AcpiExExtractFromField (
ByteFieldLength = ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength);
if (ByteFieldLength > BufferLength)
{
- DEBUG_PRINTP (ACPI_INFO, ("Field size %X (bytes) too large for buffer (%X)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Field size %X (bytes) too large for buffer (%X)\n",
ByteFieldLength, BufferLength));
return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
@@ -483,8 +475,8 @@ AcpiExExtractFromField (
DatumCount = ROUND_UP_TO (ByteFieldLength, ObjDesc->CommonField.AccessByteWidth);
- DEBUG_PRINT (ACPI_INFO,
- ("ByteLen=%x, DatumLen=%x, BitGran=%x, ByteGran=%x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "ByteLen=%x, DatumLen=%x, BitGran=%x, ByteGran=%x\n",
ByteFieldLength, DatumCount, ObjDesc->CommonField.AccessBitWidth,
ObjDesc->CommonField.AccessByteWidth));
@@ -695,8 +687,8 @@ AcpiExWriteFieldDatum (
ObjDesc->CommonField.BaseByteOffset +
FieldDatumByteOffset;
- DEBUG_PRINTP (TRACE_BFIELD,
- ("Store %X in Region %s(%X) at %8.8lX%8.8lX width %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+ "Store %X in Region %s(%X) at %8.8lX%8.8lX width %X\n",
Value, AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId, HIDWORD(Address), LODWORD(Address),
ObjDesc->CommonField.AccessBitWidth));
@@ -708,16 +700,16 @@ AcpiExWriteFieldDatum (
if (Status == AE_NOT_IMPLEMENTED)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("**** Region type %s(%X) not implemented\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "**** Region type %s(%X) not implemented\n",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId));
}
else if (Status == AE_NOT_EXIST)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("**** Region type %s(%X) does not have a handler\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "**** Region type %s(%X) does not have a handler\n",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId));
}
@@ -727,14 +719,14 @@ AcpiExWriteFieldDatum (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("%p, wrong source type - %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, wrong source type - %s\n",
ObjDesc, AcpiUtGetTypeName (ObjDesc->Common.Type)));
Status = AE_AML_INTERNAL;
break;
}
- DEBUG_PRINTP (TRACE_BFIELD, ("Value written=%08lX \n", Value));
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value written=%08lX \n", Value));
return_ACPI_STATUS (Status);
}
@@ -818,8 +810,8 @@ AcpiExWriteFieldDatumWithUpdateRule (
default:
- DEBUG_PRINT (ACPI_ERROR,
- ("WriteWithUpdateRule: Unknown UpdateRule setting: %x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "WriteWithUpdateRule: Unknown UpdateRule setting: %x\n",
ObjDesc->CommonField.UpdateRule));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
break;
@@ -832,7 +824,7 @@ AcpiExWriteFieldDatumWithUpdateRule (
Status = AcpiExWriteFieldDatum (ObjDesc, FieldDatumByteOffset,
MergedValue);
- DEBUG_PRINTP (TRACE_BFIELD, ("Mask %X DatumOffset %X Value %X, MergedValue %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Mask %X DatumOffset %X Value %X, MergedValue %X\n",
Mask, FieldDatumByteOffset, FieldValue, MergedValue));
return_ACPI_STATUS (Status);
@@ -881,7 +873,7 @@ AcpiExInsertIntoField (
ByteFieldLength = ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength);
if (BufferLength < ByteFieldLength)
{
- DEBUG_PRINTP (ACPI_INFO, ("Buffer length %X too small for field %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer length %X too small for field %X\n",
BufferLength, ByteFieldLength));
/* TBD: Need a better error code */
@@ -893,8 +885,8 @@ AcpiExInsertIntoField (
DatumCount = ROUND_UP_TO (ByteFieldLength, ObjDesc->CommonField.AccessByteWidth);
- DEBUG_PRINT (ACPI_INFO,
- ("ByteLen=%x, DatumLen=%x, BitGran=%x, ByteGran=%x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "ByteLen=%x, DatumLen=%x, BitGran=%x, ByteGran=%x\n",
ByteFieldLength, DatumCount, ObjDesc->CommonField.AccessBitWidth,
ObjDesc->CommonField.AccessByteWidth));
diff --git a/sys/contrib/dev/acpica/exmisc.c b/sys/contrib/dev/acpica/exmisc.c
index f4a510caf5fa..ea9f8887e213 100644
--- a/sys/contrib/dev/acpica/exmisc.c
+++ b/sys/contrib/dev/acpica/exmisc.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
- * $Revision: 79 $
+ * $Revision: 80 $
*
*****************************************************************************/
@@ -177,7 +177,7 @@ AcpiExFatal (
{
/* Invalid parameters on object stack */
- DEBUG_PRINTP (ACPI_ERROR, ("bad operand(s) (Status=%X)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad operand(s) (Status=%X)\n",
Status));
goto Cleanup;
}
@@ -185,8 +185,8 @@ AcpiExFatal (
/* DefFatal := FatalOp FatalType FatalCode FatalArg */
- DEBUG_PRINTP (ACPI_INFO,
- ("Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
TypeDesc->Integer.Value, CodeDesc->Integer.Value, ArgDesc->Integer.Value));
@@ -264,7 +264,7 @@ AcpiExTriadic (
{
/* Invalid parameters on object stack */
- DEBUG_PRINTP (ACPI_ERROR, ("bad operand(s) (Status=%X)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad operand(s) (Status=%X)\n",
Status));
goto Cleanup;
}
@@ -278,8 +278,8 @@ AcpiExTriadic (
/* DefFatal := FatalOp FatalType FatalCode FatalArg */
- DEBUG_PRINTP (ACPI_INFO,
- ("FatalOp: Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "FatalOp: Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
(UINT32) ObjDesc1->Integer.Value, (UINT32) ObjDesc2->Integer.Value,
(UINT32) ResDesc->Integer.Value));
@@ -334,7 +334,7 @@ AcpiExTriadic (
if (ObjDesc2->Integer.Value >= ObjDesc1->Package.Count)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Index value beyond package end\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond package end\n"));
Status = AE_AML_PACKAGE_LIMIT;
goto Cleanup;
}
@@ -380,7 +380,7 @@ AcpiExTriadic (
if (ObjDesc2->Integer.Value >= ObjDesc1->Buffer.Length)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Index value beyond end of buffer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond end of buffer\n"));
Status = AE_AML_BUFFER_LIMIT;
goto Cleanup;
}
@@ -479,7 +479,7 @@ AcpiExHexadic (
{
/* Invalid parameters on object stack */
- DEBUG_PRINTP (ACPI_ERROR, ("bad operand(s) (Status=%X)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad operand(s) (Status=%X)\n",
Status));
goto Cleanup;
}
@@ -495,7 +495,7 @@ AcpiExHexadic (
if ((Op1Desc->Integer.Value > MAX_MATCH_OPERATOR) ||
(Op2Desc->Integer.Value > MAX_MATCH_OPERATOR))
{
- DEBUG_PRINTP (ACPI_ERROR, ("operation encoding out of range\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "operation encoding out of range\n"));
Status = AE_AML_OPERAND_VALUE;
goto Cleanup;
}
@@ -503,7 +503,7 @@ AcpiExHexadic (
Index = (UINT32) StartDesc->Integer.Value;
if (Index >= (UINT32) PkgDesc->Package.Count)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Start position value out of range\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Start position value out of range\n"));
Status = AE_AML_PACKAGE_LIMIT;
goto Cleanup;
}
diff --git a/sys/contrib/dev/acpica/exmonad.c b/sys/contrib/dev/acpica/exmonad.c
index 90dd7e8709e5..9a4ea4ce18b5 100644
--- a/sys/contrib/dev/acpica/exmonad.c
+++ b/sys/contrib/dev/acpica/exmonad.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exmonad - ACPI AML execution for monadic (1 operand) operators
- * $Revision: 104 $
+ * $Revision: 108 $
*
*****************************************************************************/
@@ -179,7 +179,7 @@ AcpiExGetObjectReference (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("(Internal) Unknown Ref subtype %02x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(Internal) Unknown Ref subtype %02x\n",
ObjDesc->Reference.Opcode));
*RetDesc = NULL;
Status = AE_AML_INTERNAL;
@@ -204,7 +204,7 @@ AcpiExGetObjectReference (
Cleanup:
- DEBUG_PRINTP (TRACE_EXEC, ("Obj=%p Ref=%p\n", ObjDesc, *RetDesc));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p Ref=%p\n", ObjDesc, *RetDesc));
return_ACPI_STATUS (Status);
}
@@ -250,7 +250,7 @@ AcpiExMonadic1 (
if (ACPI_FAILURE (ResolveStatus))
{
- DEBUG_PRINTP (ACPI_ERROR, ("[%s]: Could not resolve operands, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: Could not resolve operands, %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (ResolveStatus)));
goto Cleanup;
@@ -258,7 +258,7 @@ AcpiExMonadic1 (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("[%s]: bad operand(s) %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: bad operand(s) %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (Status)));
goto Cleanup;
@@ -381,7 +381,7 @@ AcpiExMonadic2R (
if (ACPI_FAILURE (ResolveStatus))
{
- DEBUG_PRINTP (ACPI_ERROR, ("[%s]: Could not resolve operands, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: Could not resolve operands, %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (ResolveStatus)));
goto Cleanup;
@@ -389,7 +389,7 @@ AcpiExMonadic2R (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("[%s]: bad operand(s) %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: bad operand(s) %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException(Status)));
goto Cleanup;
@@ -486,7 +486,7 @@ AcpiExMonadic2R (
if (Digit > 9)
{
- DEBUG_PRINTP (ACPI_ERROR, ("BCD digit too large: \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD digit too large: \n",
Digit));
Status = AE_AML_NUMERIC_OVERFLOW;
goto Cleanup;
@@ -514,7 +514,7 @@ AcpiExMonadic2R (
if (ObjDesc->Integer.Value > ACPI_MAX_BCD_VALUE)
{
- DEBUG_PRINTP (ACPI_ERROR, ("BCD overflow: %d\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD overflow: %d\n",
ObjDesc->Integer.Value));
Status = AE_AML_NUMERIC_OVERFLOW;
goto Cleanup;
@@ -528,7 +528,7 @@ AcpiExMonadic2R (
Digit = ObjDesc->Integer.Value;
for (j = 0; j < i; j++)
{
- Digit /= 10;
+ Digit = ACPI_DIVIDE (Digit, 10);
}
/* Create the BCD digit */
@@ -597,29 +597,23 @@ AcpiExMonadic2R (
* Do the store, and be careful about deleting the source object,
* since the object itself may have been stored.
*/
-
Status = AcpiExStore (ObjDesc, ResDesc, WalkState);
if (ACPI_FAILURE (Status))
{
/* On failure, just delete the ObjDesc */
AcpiUtRemoveReference (ObjDesc);
+ return_ACPI_STATUS (Status);
}
- else
- {
- /*
- * Normally, we would remove a reference on the ObjDesc parameter;
- * But since it is being used as the internal return object
- * (meaning we would normally increment it), the two cancel out,
- * and we simply don't do anything.
- */
- *ReturnDesc = ObjDesc;
- }
-
- ObjDesc = NULL;
+ /*
+ * Normally, we would remove a reference on the ObjDesc parameter;
+ * But since it is being used as the internal return object
+ * (meaning we would normally increment it), the two cancel out,
+ * and we simply don't do anything.
+ */
+ *ReturnDesc = ObjDesc;
return_ACPI_STATUS (Status);
-
break;
@@ -627,7 +621,7 @@ AcpiExMonadic2R (
/* Reference, returning an Reference */
- DEBUG_PRINTP (ACPI_ERROR, ("DebugOp should never get here!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "DebugOp should never get here!\n"));
return_ACPI_STATUS (AE_OK);
break;
@@ -636,16 +630,12 @@ AcpiExMonadic2R (
* ACPI 2.0 Opcodes
*/
case AML_TO_DECSTRING_OP:
-
- DEBUG_PRINTP (ACPI_ERROR, ("%s is not implemented\n",
- AcpiPsGetOpcodeName (Opcode)));
- Status = AE_NOT_IMPLEMENTED;
- goto Cleanup;
+ Status = AcpiExConvertToString (ObjDesc, &RetDesc, 10, ACPI_UINT32_MAX, WalkState);
break;
case AML_TO_HEXSTRING_OP:
- Status = AcpiExConvertToString (ObjDesc, &RetDesc, ACPI_UINT32_MAX, WalkState);
+ Status = AcpiExConvertToString (ObjDesc, &RetDesc, 16, ACPI_UINT32_MAX, WalkState);
break;
case AML_TO_BUFFER_OP:
@@ -667,7 +657,7 @@ AcpiExMonadic2R (
case AML_SHIFT_LEFT_BIT_OP:
case AML_SHIFT_RIGHT_BIT_OP:
- DEBUG_PRINTP (ACPI_ERROR, ("%s is unimplemented\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s is unimplemented\n",
AcpiPsGetOpcodeName (Opcode)));
Status = AE_SUPPORT;
goto Cleanup;
@@ -757,7 +747,7 @@ AcpiExMonadic2 (
if (ACPI_FAILURE (ResolveStatus))
{
- DEBUG_PRINTP (ACPI_ERROR, ("[%s]: Could not resolve operands, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: Could not resolve operands, %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (ResolveStatus)));
goto Cleanup;
@@ -765,7 +755,7 @@ AcpiExMonadic2 (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("[%s]: Bad operand(s), %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: Bad operand(s), %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException (Status)));
goto Cleanup;
@@ -840,7 +830,7 @@ AcpiExMonadic2 (
Status = AcpiExResolveOperands (AML_LNOT_OP, &RetDesc, WalkState);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("%s: bad operand(s) %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s: bad operand(s) %s\n",
AcpiPsGetOpcodeName (Opcode), AcpiFormatException(Status)));
goto Cleanup;
@@ -1009,7 +999,7 @@ AcpiExMonadic2 (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Not Buf/Str/Pkg - found type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Not Buf/Str/Pkg - found type %X\n",
ObjDesc->Common.Type));
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
@@ -1105,7 +1095,7 @@ AcpiExMonadic2 (
if ((ObjDesc->Reference.Opcode != AML_INDEX_OP) &&
(ObjDesc->Reference.Opcode != AML_REF_OF_OP))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown opcode in ref(%p) - %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode in ref(%p) - %X\n",
ObjDesc, ObjDesc->Reference.Opcode));
Status = AE_TYPE;
@@ -1167,7 +1157,7 @@ AcpiExMonadic2 (
* severe error.
*/
- DEBUG_PRINTP (ACPI_ERROR, ("NULL package element obj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "NULL package element obj %p\n",
ObjDesc));
Status = AE_AML_UNINITIALIZED_ELEMENT;
goto Cleanup;
@@ -1178,7 +1168,7 @@ AcpiExMonadic2 (
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown TargetType %X in obj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown TargetType %X in obj %p\n",
ObjDesc->Reference.TargetType, ObjDesc));
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
diff --git a/sys/contrib/dev/acpica/exnames.c b/sys/contrib/dev/acpica/exnames.c
index c05113c0dbd6..85edbba9330c 100644
--- a/sys/contrib/dev/acpica/exnames.c
+++ b/sys/contrib/dev/acpica/exnames.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exnames - interpreter/scanner name load/execute
- * $Revision: 80 $
+ * $Revision: 81 $
*
*****************************************************************************/
@@ -270,18 +270,18 @@ AcpiExNameSegment (
if ('0' <= CharBuf[0] && CharBuf[0] <= '9')
{
- DEBUG_PRINTP (ACPI_ERROR, ("leading digit: %c\n", CharBuf[0]));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "leading digit: %c\n", CharBuf[0]));
return_ACPI_STATUS (AE_CTRL_PENDING);
}
- DEBUG_PRINTP (TRACE_LOAD, ("Bytes from stream:\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Bytes from stream:\n"));
for (Index = 4;
(Index > 0) && (AcpiUtValidAcpiCharacter (*AmlAddress));
--Index)
{
CharBuf[4 - Index] = *AmlAddress++;
- DEBUG_PRINT (TRACE_LOAD, ("%c\n", CharBuf[4 - Index]));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "%c\n", CharBuf[4 - Index]));
}
@@ -296,14 +296,14 @@ AcpiExNameSegment (
if (NameString)
{
STRCAT (NameString, CharBuf);
- DEBUG_PRINTP (TRACE_NAMES,
- ("Appended to - %s \n", NameString));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Appended to - %s \n", NameString));
}
else
{
- DEBUG_PRINTP (TRACE_NAMES,
- ("No Name string - %s \n", CharBuf));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "No Name string - %s \n", CharBuf));
}
}
@@ -313,8 +313,8 @@ AcpiExNameSegment (
* First character was not a valid name character,
* so we are looking at something other than a name.
*/
- DEBUG_PRINTP (ACPI_INFO,
- ("Leading character is not alpha: %02Xh (not a name)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Leading character is not alpha: %02Xh (not a name)\n",
CharBuf[0]));
Status = AE_CTRL_PENDING;
}
@@ -324,7 +324,7 @@ AcpiExNameSegment (
/* Segment started with one or more valid characters, but fewer than 4 */
Status = AE_AML_BAD_NAME;
- DEBUG_PRINTP (ACPI_ERROR, ("Bad character %02x in name, at %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad character %02x in name, at %p\n",
*AmlAddress, AmlAddress));
}
@@ -395,7 +395,7 @@ AcpiExGetNameString (
case AML_ROOT_PREFIX:
Prefix = *AmlAddress++;
- DEBUG_PRINT (TRACE_LOAD, ("RootPrefix: %x\n", Prefix));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "RootPrefix: %x\n", Prefix));
/*
* Remember that we have a RootPrefix --
@@ -413,7 +413,7 @@ AcpiExGetNameString (
do
{
Prefix = *AmlAddress++;
- DEBUG_PRINT (TRACE_LOAD, ("ParentPrefix: %x\n", Prefix));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "ParentPrefix: %x\n", Prefix));
++PrefixCount;
@@ -436,7 +436,7 @@ AcpiExGetNameString (
case AML_DUAL_NAME_PREFIX:
Prefix = *AmlAddress++;
- DEBUG_PRINT (TRACE_LOAD, ("DualNamePrefix: %x\n", Prefix));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "DualNamePrefix: %x\n", Prefix));
NameString = AcpiExAllocateNameString (PrefixCount, 2);
if (!NameString)
@@ -459,7 +459,7 @@ AcpiExGetNameString (
case AML_MULTI_NAME_PREFIX_OP:
Prefix = *AmlAddress++;
- DEBUG_PRINT (TRACE_LOAD, ("MultiNamePrefix: %x\n", Prefix));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "MultiNamePrefix: %x\n", Prefix));
/* Fetch count of segments remaining in name path */
@@ -490,7 +490,7 @@ AcpiExGetNameString (
if (-1 == PrefixCount)
{
- DEBUG_PRINTP (TRACE_EXEC, ("NameSeg is \"\\\" followed by NULL\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "NameSeg is \"\\\" followed by NULL\n"));
}
/* Consume the NULL byte */
diff --git a/sys/contrib/dev/acpica/exprep.c b/sys/contrib/dev/acpica/exprep.c
index 184b17fe0571..a8f8474962b5 100644
--- a/sys/contrib/dev/acpica/exprep.c
+++ b/sys/contrib/dev/acpica/exprep.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
- * $Revision: 91 $
+ * $Revision: 93 $
*
*****************************************************************************/
@@ -135,7 +135,7 @@
* PARAMETERS: Access - Encoded field access bits
* Length - Field length.
*
- * RETURN: Field granularity (8, 16, or 32)
+ * RETURN: Field granularity (8, 16, 32 or 64)
*
* DESCRIPTION: Decode the AccessType bits of a field definition.
*
@@ -147,6 +147,8 @@ AcpiExDecodeFieldAccessType (
UINT16 Length,
UINT32 *Alignment)
{
+ PROC_NAME ("AcpiExDecodeFieldAccessType");
+
switch (Access)
{
@@ -201,8 +203,8 @@ AcpiExDecodeFieldAccessType (
default:
/* Invalid field access type */
- DEBUG_PRINT (ACPI_ERROR,
- ("ExDecodeFieldAccessType: Unknown field access type %x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unknown field access type %x\n",
Access));
return (0);
}
@@ -376,14 +378,14 @@ AcpiExPrepRegionFieldValue (
if (!RegionNode)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null RegionNode\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null RegionNode\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
Type = AcpiNsGetType (RegionNode);
if (Type != ACPI_TYPE_REGION)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Needed Region, found type %X %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n",
Type, AcpiUtGetTypeName (Type)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -424,11 +426,11 @@ AcpiExPrepRegionFieldValue (
/* Debug info */
- DEBUG_PRINTP (ACPI_INFO, ("Bitoff=%X Off=%X Gran=%X Region %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bitoff=%X Off=%X Gran=%X Region %p\n",
ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset,
ObjDesc->Field.AccessBitWidth, ObjDesc->Field.RegionObj));
- DEBUG_PRINTP (ACPI_INFO, ("set NamedObj %p (%4.4s) val = %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set NamedObj %p (%4.4s) val = %p\n",
Node, &(Node->Name), ObjDesc));
@@ -482,14 +484,14 @@ AcpiExPrepBankFieldValue (
if (!RegionNode)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null RegionNode\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null RegionNode\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
Type = AcpiNsGetType (RegionNode);
if (Type != ACPI_TYPE_REGION)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Needed Region, found type %X %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n",
Type, AcpiUtGetTypeName (Type)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -531,12 +533,12 @@ AcpiExPrepBankFieldValue (
/* Debug info */
- DEBUG_PRINTP (ACPI_INFO, ("BitOff=%X Off=%X Gran=%X Region %p BankReg %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "BitOff=%X Off=%X Gran=%X Region %p BankReg %p\n",
ObjDesc->BankField.StartFieldBitOffset, ObjDesc->BankField.BaseByteOffset,
ObjDesc->Field.AccessBitWidth, ObjDesc->BankField.RegionObj,
ObjDesc->BankField.BankRegisterObj));
- DEBUG_PRINTP (ACPI_INFO, ("Set NamedObj %p (%4.4s) val=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Set NamedObj %p (%4.4s) val=%p\n",
Node, &(Node->Name), ObjDesc));
@@ -587,7 +589,7 @@ AcpiExPrepIndexFieldValue (
if (!IndexReg || !DataReg)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null handle\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null handle\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
@@ -622,12 +624,12 @@ AcpiExPrepIndexFieldValue (
/* Debug info */
- DEBUG_PRINTP (ACPI_INFO, ("bitoff=%X off=%X gran=%X Index %p Data %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "bitoff=%X off=%X gran=%X Index %p Data %p\n",
ObjDesc->IndexField.StartFieldBitOffset, ObjDesc->IndexField.BaseByteOffset,
ObjDesc->Field.AccessBitWidth, ObjDesc->IndexField.IndexObj,
ObjDesc->IndexField.DataObj));
- DEBUG_PRINTP (ACPI_INFO, ("set NamedObj %p (%4.4s) val = %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set NamedObj %p (%4.4s) val = %p\n",
Node, &(Node->Name), ObjDesc));
diff --git a/sys/contrib/dev/acpica/exregion.c b/sys/contrib/dev/acpica/exregion.c
index b94c9da20163..d42ae31b0b79 100644
--- a/sys/contrib/dev/acpica/exregion.c
+++ b/sys/contrib/dev/acpica/exregion.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exregion - ACPI default OpRegion (address space) handlers
- * $Revision: 54 $
+ * $Revision: 55 $
*
*****************************************************************************/
@@ -183,7 +183,7 @@ AcpiExSystemMemorySpaceHandler (
break;
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Invalid SystemMemory width %d\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid SystemMemory width %d\n",
BitWidth));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
break;
@@ -241,9 +241,9 @@ AcpiExSystemMemorySpaceHandler (
LogicalAddrPtr = MemInfo->MappedLogicalAddress +
((ACPI_INTEGER) Address - (ACPI_INTEGER) MemInfo->MappedPhysicalAddress);
- DEBUG_PRINT ((TRACE_OPREGION | VERBOSE_INFO),
- ("IO %d (%d width) Address=%8.8lX%8.8lX\n", Function, BitWidth,
- HIDWORD(Address), LODWORD(Address)));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "IO %d (%d width) Address=%8.8lX%8.8lX\n", Function, BitWidth,
+ HIDWORD (Address), LODWORD (Address)));
/* Perform the memory read or write */
@@ -332,9 +332,9 @@ AcpiExSystemIoSpaceHandler (
FUNCTION_TRACE ("ExSystemIoSpaceHandler");
- DEBUG_PRINT ((TRACE_OPREGION | VERBOSE_INFO),
- ("IO %d (%d width) Address=%8.8lX%8.8lX\n", Function, BitWidth,
- HIDWORD(Address), LODWORD(Address)));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "IO %d (%d width) Address=%8.8lX%8.8lX\n", Function, BitWidth,
+ HIDWORD (Address), LODWORD (Address)));
/* Decode the function parameter */
@@ -413,8 +413,8 @@ AcpiExPciConfigSpaceHandler (
PciId = (ACPI_PCI_ID *) RegionContext;
PciRegister = (UINT16) Address;
- DEBUG_PRINT ((TRACE_OPREGION | VERBOSE_INFO),
- ("IO %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "IO %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
Function, BitWidth, PciId->Segment, PciId->Bus, PciId->Device,
PciId->Function, PciRegister));
diff --git a/sys/contrib/dev/acpica/exresnte.c b/sys/contrib/dev/acpica/exresnte.c
index c819a13509d0..981a7e65fdf2 100644
--- a/sys/contrib/dev/acpica/exresnte.c
+++ b/sys/contrib/dev/acpica/exresnte.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresnte - AML Interpreter object resolution
- * $Revision: 37 $
+ * $Revision: 39 $
*
*****************************************************************************/
@@ -166,11 +166,8 @@ AcpiExResolveNodeToValue (
ACPI_OPERAND_OBJECT *ValDesc;
ACPI_OPERAND_OBJECT *ObjDesc = NULL;
ACPI_NAMESPACE_NODE *Node;
- UINT8 *AmlPointer = NULL;
ACPI_OBJECT_TYPE8 EntryType;
ACPI_INTEGER TempVal;
- BOOLEAN AttachedAmlPointer = FALSE;
- UINT8 AmlOpcode = 0;
FUNCTION_TRACE ("ExResolveNodeToValue");
@@ -180,39 +177,18 @@ AcpiExResolveNodeToValue (
* The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the
* object that is attached to the Node.
*/
-
Node = *StackPtr;
ValDesc = AcpiNsGetAttachedObject (Node);
EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
- DEBUG_PRINTP (TRACE_EXEC, ("Entry=%p ValDesc=%p Type=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p ValDesc=%p Type=%X\n",
Node, ValDesc, EntryType));
- /*
- * The ValDesc attached to the Node can be either:
- * 1) An internal ACPI object
- * 2) A pointer into the AML stream (into one of the ACPI system tables)
- */
-
- if (AcpiTbSystemTablePointer (ValDesc))
- {
- /* CAN THIS EVERY HAPPEN NOW? TBD!!! */
-
- AttachedAmlPointer = TRUE;
- AmlOpcode = *((UINT8 *) ValDesc);
- AmlPointer = ((UINT8 *) ValDesc) + 1;
-
- DEBUG_PRINTP (TRACE_EXEC, ("Unparsed AML: %p Len=%X\n",
- AmlOpcode, AmlPointer));
- }
-
/*
- * Several EntryTypes do not require further processing, so
- * we will return immediately
- */
- /* Devices rarely have an attached object, return the Node
- * and Method locals and arguments have a pseudo-Node
+ * Several object types require no further processing:
+ * 1) Devices rarely have an attached object, return the Node
+ * 2) Method locals and arguments have a pseudo-Node
*/
if (EntryType == ACPI_TYPE_DEVICE ||
(Node->Flags & (ANOBJ_METHOD_ARG | ANOBJ_METHOD_LOCAL)))
@@ -222,7 +198,7 @@ AcpiExResolveNodeToValue (
if (!ValDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No object attached to node %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object attached to node %p\n",
Node));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
@@ -236,21 +212,9 @@ AcpiExResolveNodeToValue (
case ACPI_TYPE_PACKAGE:
- if (AttachedAmlPointer)
- {
- /*
- * This means that the package initialization is not parsed
- * -- should not happen
- */
- DEBUG_PRINTP (ACPI_ERROR, ("Unparsed Packages not supported!\n"));
- return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
- }
-
- /* ValDesc is an internal object in all cases by the time we get here */
-
if (ACPI_TYPE_PACKAGE != ValDesc->Common.Type)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Object not a package, type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a package, type %X\n",
ValDesc->Common.Type));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -264,21 +228,9 @@ AcpiExResolveNodeToValue (
case ACPI_TYPE_BUFFER:
- if (AttachedAmlPointer)
- {
- /*
- * This means that the buffer initialization is not parsed
- * -- should not happen
- */
- DEBUG_PRINTP (ACPI_ERROR, ("Unparsed Buffers not supported!\n"));
- return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
- }
-
- /* ValDesc is an internal object in all cases by the time we get here */
-
if (ACPI_TYPE_BUFFER != ValDesc->Common.Type)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Object not a buffer, type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a buffer, type %X\n",
ValDesc->Common.Type));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -292,52 +244,25 @@ AcpiExResolveNodeToValue (
case ACPI_TYPE_STRING:
- if (AttachedAmlPointer)
+ if (ACPI_TYPE_STRING != ValDesc->Common.Type)
{
- /* Allocate a new string object */
-
- ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING);
- if (!ObjDesc)
- {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-
- /* Init the internal object */
-
- ObjDesc->String.Pointer = (NATIVE_CHAR *) AmlPointer;
- ObjDesc->String.Length = STRLEN (ObjDesc->String.Pointer);
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a string, type %X\n",
+ ValDesc->Common.Type));
+ return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
- else
- {
- if (ACPI_TYPE_STRING != ValDesc->Common.Type)
- {
- DEBUG_PRINTP (ACPI_ERROR, ("Object not a string, type %X\n",
- ValDesc->Common.Type));
- return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
- }
-
- /* Return an additional reference to the object */
-
- ObjDesc = ValDesc;
- AcpiUtAddReference (ObjDesc);
- }
+ /* Return an additional reference to the object */
+ ObjDesc = ValDesc;
+ AcpiUtAddReference (ObjDesc);
break;
case ACPI_TYPE_INTEGER:
- DEBUG_PRINTP (TRACE_EXEC, ("case Integer \n"));
-
- /*
- * The Node has an attached internal object, make sure that it's a
- * number
- */
-
if (ACPI_TYPE_INTEGER != ValDesc->Common.Type)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Object not a Number, type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Number, type %X\n",
ValDesc->Common.Type));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -354,7 +279,7 @@ AcpiExResolveNodeToValue (
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
- DEBUG_PRINTP (TRACE_EXEC, ("FieldRead Node=%p ValDesc=%p Type=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead Node=%p ValDesc=%p Type=%X\n",
Node, ValDesc, EntryType));
Status = AcpiExReadDataFromField (ValDesc, &ObjDesc);
@@ -364,7 +289,6 @@ AcpiExResolveNodeToValue (
/*
* For these objects, just return the object attached to the Node
*/
-
case ACPI_TYPE_MUTEX:
case ACPI_TYPE_METHOD:
case ACPI_TYPE_POWER:
@@ -373,7 +297,6 @@ AcpiExResolveNodeToValue (
case ACPI_TYPE_EVENT:
case ACPI_TYPE_REGION:
-
/* Return an additional reference to the object */
ObjDesc = ValDesc;
@@ -385,7 +308,7 @@ AcpiExResolveNodeToValue (
case ACPI_TYPE_ANY:
- DEBUG_PRINTP (ACPI_ERROR, ("Untyped entry %p, no attached object!\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Untyped entry %p, no attached object!\n",
Node));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
@@ -418,7 +341,7 @@ AcpiExResolveNodeToValue (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unsupported reference opcode %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported reference opcode %X\n",
ValDesc->Reference.Opcode));
return_ACPI_STATUS (AE_AML_BAD_OPCODE);
@@ -444,7 +367,7 @@ AcpiExResolveNodeToValue (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Node %p - Unknown object type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Node %p - Unknown object type %X\n",
Node, EntryType));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
diff --git a/sys/contrib/dev/acpica/exresolv.c b/sys/contrib/dev/acpica/exresolv.c
index 9dfa5691d0ef..ac97dc6ef484 100644
--- a/sys/contrib/dev/acpica/exresolv.c
+++ b/sys/contrib/dev/acpica/exresolv.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresolv - AML Interpreter object resolution
- * $Revision: 95 $
+ * $Revision: 96 $
*
*****************************************************************************/
@@ -163,7 +163,7 @@ AcpiExGetBufferFieldValue (
*/
if (!ObjDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - null field pointer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null field pointer\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
@@ -178,19 +178,19 @@ AcpiExGetBufferFieldValue (
if (!ObjDesc->BufferField.BufferObj)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - null container pointer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null container pointer\n"));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
if (ACPI_TYPE_BUFFER != ObjDesc->BufferField.BufferObj->Common.Type)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - container is not a Buffer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - container is not a Buffer\n"));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
if (!ResultDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - null result pointer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null result pointer\n"));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -230,8 +230,8 @@ AcpiExGetBufferFieldValue (
ResultDesc->Integer.Value =
(ResultDesc->Integer.Value >> ObjDesc->BufferField.StartFieldBitOffset) & Mask;
- DEBUG_PRINT (ACPI_INFO,
- ("** Read from buffer %p byte %ld bit %d width %d addr %p mask %08lx val %08lx\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "** Read from buffer %p byte %ld bit %d width %d addr %p mask %08lx val %08lx\n",
ObjDesc->BufferField.BufferObj->Buffer.Pointer,
ObjDesc->BufferField.BaseByteOffset,
ObjDesc->BufferField.StartFieldBitOffset,
@@ -270,7 +270,7 @@ AcpiExResolveToValue (
if (!StackPtr || !*StackPtr)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - null pointer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null pointer\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
@@ -304,7 +304,7 @@ AcpiExResolveToValue (
}
- DEBUG_PRINTP (ACPI_INFO, ("Resolved object %p\n", *StackPtr));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Resolved object %p\n", *StackPtr));
return_ACPI_STATUS (AE_OK);
}
@@ -392,7 +392,7 @@ AcpiExResolveObjectToValue (
AcpiUtRemoveReference (StackDesc);
*StackPtr = ObjDesc;
- DEBUG_PRINTP (ACPI_INFO, ("[Arg/Local %d] ValueObj is %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "[Arg/Local %d] ValueObj is %p\n",
StackDesc->Reference.Offset, ObjDesc));
break;
@@ -456,8 +456,8 @@ AcpiExResolveObjectToValue (
* A NULL object descriptor means an unitialized element of
* the package, can't dereference it
*/
- DEBUG_PRINTP (ACPI_ERROR,
- ("Attempt to deref an Index to NULL pkg element Idx=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Attempt to deref an Index to NULL pkg element Idx=%p\n",
StackDesc));
Status = AE_AML_UNINITIALIZED_ELEMENT;
}
@@ -466,8 +466,8 @@ AcpiExResolveObjectToValue (
default:
/* Invalid reference object */
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unknown TargetType %X in Index/Reference obj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unknown TargetType %X in Index/Reference obj %p\n",
StackDesc->Reference.TargetType, StackDesc));
Status = AE_AML_INTERNAL;
break;
@@ -484,7 +484,7 @@ AcpiExResolveObjectToValue (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown Reference object subtype %02X in %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference object subtype %02X in %p\n",
Opcode, StackDesc));
Status = AE_AML_INTERNAL;
break;
diff --git a/sys/contrib/dev/acpica/exresop.c b/sys/contrib/dev/acpica/exresop.c
index 6746664434f5..8c12470069a9 100644
--- a/sys/contrib/dev/acpica/exresop.c
+++ b/sys/contrib/dev/acpica/exresop.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresop - AML Interpreter operand/object resolution
- * $Revision: 31 $
+ * $Revision: 33 $
*
*****************************************************************************/
@@ -151,7 +151,7 @@ AcpiExCheckObjectType (
ACPI_OBJECT_TYPE ThisType,
void *Object)
{
-
+ PROC_NAME ("AcpiExCheckObjectType");
if (TypeNeeded == ACPI_TYPE_ANY)
{
@@ -162,8 +162,8 @@ AcpiExCheckObjectType (
if (TypeNeeded != ThisType)
{
- DEBUG_PRINT (ACPI_INFO,
- ("ExCheckObjectType: Needed [%s], found [%s] %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed [%s], found [%s] %p\n",
AcpiUtGetTypeName (TypeNeeded),
AcpiUtGetTypeName (ThisType), Object));
@@ -222,13 +222,13 @@ AcpiExResolveOperands (
ArgTypes = OpInfo->RuntimeArgs;
if (ArgTypes == ARGI_INVALID_OPCODE)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - %X is not a valid AML opcode\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - %X is not a valid AML opcode\n",
Opcode));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
- DEBUG_PRINTP (TRACE_EXEC, ("Opcode %X OperandTypes=%X \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X OperandTypes=%X \n",
Opcode, ArgTypes));
@@ -244,7 +244,7 @@ AcpiExResolveOperands (
{
if (!StackPtr || !*StackPtr)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - null stack entry at %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null stack entry at %X\n",
StackPtr));
return_ACPI_STATUS (AE_AML_INTERNAL);
@@ -273,7 +273,7 @@ AcpiExResolveOperands (
if (!AcpiExValidateObjectType (ObjectType))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Bad operand object type [%X]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad operand object type [%X]\n",
ObjectType));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -303,13 +303,13 @@ AcpiExResolveOperands (
case AML_ARG_OP:
case AML_LOCAL_OP:
- DEBUG_ONLY_MEMBERS (DEBUG_PRINT (ACPI_INFO,
- ("Reference Opcode: %s\n", OpInfo->Name)));
+ DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Reference Opcode: %s\n", OpInfo->Name)));
break;
default:
- DEBUG_PRINT (ACPI_INFO,
- ("Reference Opcode: Unknown [%02x]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Reference Opcode: Unknown [%02x]\n",
ObjDesc->Reference.Opcode));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -322,8 +322,8 @@ AcpiExResolveOperands (
{
/* Invalid descriptor */
- DEBUG_PRINT (ACPI_ERROR,
- ("Bad descriptor type %X in Obj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Bad descriptor type %X in Obj %p\n",
ObjDesc->Common.DataType, ObjDesc));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -482,8 +482,8 @@ AcpiExResolveOperands (
{
if (Status == AE_TYPE)
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Needed [Integer/String/Buffer], found [%s] %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p\n",
AcpiUtGetTypeName ((*StackPtr)->Common.Type), *StackPtr));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -507,8 +507,8 @@ AcpiExResolveOperands (
{
if (Status == AE_TYPE)
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Needed [Integer/String/Buffer], found [%s] %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p\n",
AcpiUtGetTypeName ((*StackPtr)->Common.Type), *StackPtr));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -527,13 +527,13 @@ AcpiExResolveOperands (
* Need an operand of type ACPI_TYPE_STRING,
* But we can implicitly convert from a BUFFER or INTEGER
*/
- Status = AcpiExConvertToString (*StackPtr, StackPtr, ACPI_UINT32_MAX, WalkState);
+ Status = AcpiExConvertToString (*StackPtr, StackPtr, 16, ACPI_UINT32_MAX, WalkState);
if (ACPI_FAILURE (Status))
{
if (Status == AE_TYPE)
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Needed [Integer/String/Buffer], found [%s] %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p\n",
AcpiUtGetTypeName ((*StackPtr)->Common.Type), *StackPtr));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -554,8 +554,8 @@ AcpiExResolveOperands (
(ACPI_TYPE_STRING != (*StackPtr)->Common.Type) &&
(ACPI_TYPE_BUFFER != (*StackPtr)->Common.Type))
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Needed [Integer/String/Buffer], found [%s] %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p\n",
AcpiUtGetTypeName ((*StackPtr)->Common.Type), *StackPtr));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -581,8 +581,8 @@ AcpiExResolveOperands (
((*StackPtr)->Common.Type != ACPI_TYPE_PACKAGE) &&
((*StackPtr)->Common.Type != INTERNAL_TYPE_REFERENCE))
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Needed [Buf/Str/Pkg/Ref], found [%s] %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed [Buf/Str/Pkg/Ref], found [%s] %p\n",
AcpiUtGetTypeName ((*StackPtr)->Common.Type), *StackPtr));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -595,8 +595,8 @@ AcpiExResolveOperands (
{
if (!(*StackPtr)->Reference.Node)
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Needed [Node Reference], found [%p]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed [Node Reference], found [%p]\n",
*StackPtr));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -614,8 +614,8 @@ AcpiExResolveOperands (
((*StackPtr)->Common.Type != ACPI_TYPE_STRING) &&
((*StackPtr)->Common.Type != ACPI_TYPE_PACKAGE))
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Needed [Buf/Pkg], found [%s] %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed [Buf/Pkg], found [%s] %p\n",
AcpiUtGetTypeName ((*StackPtr)->Common.Type), *StackPtr));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -628,8 +628,8 @@ AcpiExResolveOperands (
/* Unknown type */
- DEBUG_PRINTP (ACPI_ERROR,
- ("Internal - Unknown ARGI type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Internal - Unknown ARGI type %X\n",
ThisArgType));
return_ACPI_STATUS (AE_BAD_PARAMETER);
diff --git a/sys/contrib/dev/acpica/exstore.c b/sys/contrib/dev/acpica/exstore.c
index 85284575f766..bc1b536b2615 100644
--- a/sys/contrib/dev/acpica/exstore.c
+++ b/sys/contrib/dev/acpica/exstore.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
- * $Revision: 140 $
+ * $Revision: 142 $
*
*****************************************************************************/
@@ -166,7 +166,7 @@ AcpiExStore (
if (!ValDesc || !DestDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - null pointer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null pointer\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
@@ -193,8 +193,8 @@ AcpiExStore (
{
/* Destination is not an Reference */
- DEBUG_PRINTP (ACPI_ERROR,
- ("Destination is not a ReferenceObj [%p]\n", DestDesc));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Destination is not a ReferenceObj [%p]\n", DestDesc));
DUMP_STACK_ENTRY (ValDesc);
DUMP_STACK_ENTRY (DestDesc);
@@ -251,43 +251,43 @@ AcpiExStore (
* Storing to the Debug object causes the value stored to be
* displayed and otherwise has no effect -- see ACPI Specification
*/
- DEBUG_PRINT (ACPI_INFO, ("**** Write to Debug Object: ****: \n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Write to Debug Object: ****: \n"));
- DEBUG_PRINT_RAW (ACPI_DEBUG_OBJECT, ("[ACPI Debug] %s: ",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OBJECTS, "[ACPI Debug] %s: ",
AcpiUtGetTypeName (ValDesc->Common.Type)));
switch (ValDesc->Common.Type)
{
case ACPI_TYPE_INTEGER:
- DEBUG_PRINT_RAW (ACPI_DEBUG_OBJECT, ("0x%X (%d)\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OBJECTS, "0x%X (%d)\n",
(UINT32) ValDesc->Integer.Value, (UINT32) ValDesc->Integer.Value));
break;
case ACPI_TYPE_BUFFER:
- DEBUG_PRINT_RAW (ACPI_DEBUG_OBJECT, ("Length 0x%X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OBJECTS, "Length 0x%X\n",
(UINT32) ValDesc->Buffer.Length));
break;
case ACPI_TYPE_STRING:
- DEBUG_PRINT_RAW (ACPI_DEBUG_OBJECT, ("%s\n", ValDesc->String.Pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OBJECTS, "%s\n", ValDesc->String.Pointer));
break;
case ACPI_TYPE_PACKAGE:
- DEBUG_PRINT_RAW (ACPI_DEBUG_OBJECT, ("Elements - 0x%X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OBJECTS, "Elements - 0x%X\n",
(UINT32) ValDesc->Package.Elements));
break;
default:
- DEBUG_PRINT_RAW (ACPI_DEBUG_OBJECT, ("@0x%p\n", ValDesc));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OBJECTS, "@0x%p\n", ValDesc));
break;
}
@@ -297,6 +297,7 @@ AcpiExStore (
case AML_ZERO_OP:
case AML_ONE_OP:
case AML_ONES_OP:
+ case AML_REVISION_OP:
/*
* Storing to a constant is a no-op -- see ACPI Specification
@@ -307,7 +308,7 @@ AcpiExStore (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Internal - Unknown Reference subtype %02x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - Unknown Reference subtype %02x\n",
RefDesc->Reference.Opcode));
/* TBD: [Restructure] use object dump routine !! */
@@ -456,8 +457,8 @@ AcpiExStoreObjectToIndex (
* An error occurrered when copying the internal object
* so delete the reference.
*/
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unable to copy the internal object\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unable to copy the internal object\n"));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
}
@@ -516,7 +517,7 @@ AcpiExStoreObjectToIndex (
Length = ValDesc->Buffer.Length;
for (i = 0; i < Length; i++)
{
- Value = *(ValDesc->Buffer.Pointer + i);
+ Value = ValDesc->Buffer.Pointer[i];
ObjDesc->Buffer.Pointer[DestDesc->Reference.Offset] = Value;
}
break;
@@ -530,7 +531,7 @@ AcpiExStoreObjectToIndex (
Length = ValDesc->String.Length;
for (i = 0; i < Length; i++)
{
- Value = *(ValDesc->String.Pointer + i);
+ Value = ValDesc->String.Pointer[i];
ObjDesc->Buffer.Pointer[DestDesc->Reference.Offset] = Value;
}
break;
@@ -540,8 +541,8 @@ AcpiExStoreObjectToIndex (
/* Other types are invalid */
- DEBUG_PRINTP (ACPI_ERROR,
- ("Source must be Number/Buffer/String type, not %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Source must be Number/Buffer/String type, not %X\n",
ValDesc->Common.Type));
Status = AE_AML_OPERAND_TYPE;
break;
@@ -550,7 +551,7 @@ AcpiExStoreObjectToIndex (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Target is not a Package or BufferField\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Target is not a Package or BufferField\n"));
Status = AE_AML_OPERAND_TYPE;
break;
}
@@ -611,7 +612,7 @@ AcpiExStoreObjectToNode (
TargetType = AcpiNsGetType (Node);
TargetDesc = AcpiNsGetAttachedObject (Node);
- DEBUG_PRINTP (ACPI_INFO, ("Storing %p(%s) into node %p(%s)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Storing %p(%s) into node %p(%s)\n",
Node, AcpiUtGetTypeName (SourceDesc->Common.Type),
SourceDesc, AcpiUtGetTypeName (TargetType)));
@@ -666,8 +667,8 @@ AcpiExStoreObjectToNode (
* SourceDesc reference count is incremented by AttachObject.
*/
Status = AcpiNsAttachObject (Node, TargetDesc, TargetType);
- DEBUG_PRINTP (ACPI_INFO,
- ("Store %s into %s via Convert/Attach\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Store %s into %s via Convert/Attach\n",
AcpiUtGetTypeName (TargetDesc->Common.Type),
AcpiUtGetTypeName (TargetType)));
break;
@@ -679,8 +680,8 @@ AcpiExStoreObjectToNode (
Status = AcpiNsAttachObject (Node, SourceDesc, SourceDesc->Common.Type);
- DEBUG_PRINTP (ACPI_INFO,
- ("Store %s into %s via Attach only\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Store %s into %s via Attach only\n",
AcpiUtGetTypeName (SourceDesc->Common.Type),
AcpiUtGetTypeName (SourceDesc->Common.Type)));
break;
@@ -734,7 +735,7 @@ AcpiExStoreObjectToObject (
* Assuming the parameters are valid!
*/
- DEBUG_PRINTP (ACPI_INFO, ("Storing %p(%s) to %p(%s)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Storing %p(%s) to %p(%s)\n",
SourceDesc, AcpiUtGetTypeName (SourceDesc->Common.Type),
DestDesc, AcpiUtGetTypeName (DestDesc->Common.Type)));
@@ -750,7 +751,7 @@ AcpiExStoreObjectToObject (
break;
default:
- DEBUG_PRINTP (ACPI_WARN, ("Store into %s not implemented\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Store into %s not implemented\n",
AcpiUtGetTypeName (DestDesc->Common.Type)));
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
diff --git a/sys/contrib/dev/acpica/exstoren.c b/sys/contrib/dev/acpica/exstoren.c
index d7b72d199f30..574755f2a2b6 100644
--- a/sys/contrib/dev/acpica/exstoren.c
+++ b/sys/contrib/dev/acpica/exstoren.c
@@ -3,7 +3,7 @@
*
* Module Name: exstoren - AML Interpreter object store support,
* Store to Node (namespace object)
- * $Revision: 38 $
+ * $Revision: 39 $
*
*****************************************************************************/
@@ -206,8 +206,8 @@ AcpiExResolveObject (
/*
* Conversion successful but still not a valid type
*/
- DEBUG_PRINTP (ACPI_ERROR,
- ("Cannot assign type %s to %s (must be type Int/Str/Buf)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Cannot assign type %s to %s (must be type Int/Str/Buf)\n",
AcpiUtGetTypeName ((*SourceDescPtr)->Common.Type),
AcpiUtGetTypeName (TargetType)));
Status = AE_AML_OPERAND_TYPE;
@@ -221,7 +221,7 @@ AcpiExResolveObject (
/*
* Aliases are resolved by AcpiExPrepOperands
*/
- DEBUG_PRINTP (ACPI_WARN, ("Store into Alias - should never happen\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Store into Alias - should never happen\n"));
Status = AE_AML_INTERNAL;
break;
@@ -338,7 +338,7 @@ AcpiExStoreObject (
/*
* All other types come here.
*/
- DEBUG_PRINTP (ACPI_WARN, ("Store into type %s not implemented\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Store into type %s not implemented\n",
AcpiUtGetTypeName (TargetType)));
Status = AE_NOT_IMPLEMENTED;
diff --git a/sys/contrib/dev/acpica/exstorob.c b/sys/contrib/dev/acpica/exstorob.c
index 68e58e691f45..86c567d72584 100644
--- a/sys/contrib/dev/acpica/exstorob.c
+++ b/sys/contrib/dev/acpica/exstorob.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstorob - AML Interpreter object store support, store to object
- * $Revision: 33 $
+ * $Revision: 35 $
*
*****************************************************************************/
@@ -151,6 +151,8 @@ AcpiExCopyBufferToBuffer (
UINT32 Length;
UINT8 *Buffer;
+ PROC_NAME ("AcpiExCopyBufferToBuffer");
+
/*
* We know that SourceDesc is a buffer by now
@@ -192,8 +194,8 @@ AcpiExCopyBufferToBuffer (
*/
MEMCPY (TargetDesc->Buffer.Pointer, Buffer, TargetDesc->Buffer.Length);
- DEBUG_PRINT (ACPI_INFO,
- ("ExCopyBufferToBuffer: Truncating src buffer from %X to %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Truncating src buffer from %X to %X\n",
Length, TargetDesc->Buffer.Length));
}
@@ -247,7 +249,7 @@ AcpiExCopyStringToString (
* large enough to hold the value
*/
if (TargetDesc->String.Pointer &&
- !AcpiTbSystemTablePointer (TargetDesc->String.Pointer))
+ (!(TargetDesc->Common.Flags & AOPOBJ_STATIC_POINTER)))
{
/*
* Only free if not a pointer into the DSDT
diff --git a/sys/contrib/dev/acpica/exsystem.c b/sys/contrib/dev/acpica/exsystem.c
index bbe57ee19162..b97c06a51aaa 100644
--- a/sys/contrib/dev/acpica/exsystem.c
+++ b/sys/contrib/dev/acpica/exsystem.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exsystem - Interface to OS services
- * $Revision: 64 $
+ * $Revision: 65 $
*
*****************************************************************************/
@@ -166,7 +166,7 @@ AcpiExSystemWaitSemaphore (
Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);
- DEBUG_PRINT (TRACE_EXEC, ("*** Thread awake after blocking, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*** Thread awake after blocking, %s\n",
AcpiFormatException (Status)));
/* Reacquire the interpreter */
diff --git a/sys/contrib/dev/acpica/exutils.c b/sys/contrib/dev/acpica/exutils.c
index dadd35a379a2..6a857c50bcb3 100644
--- a/sys/contrib/dev/acpica/exutils.c
+++ b/sys/contrib/dev/acpica/exutils.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exutils - interpreter/scanner utilities
- * $Revision: 80 $
+ * $Revision: 82 $
*
*****************************************************************************/
@@ -294,7 +294,7 @@ AcpiExAcquireGlobalLock (
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("Could not acquire Global Lock, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not acquire Global Lock, %s\n",
AcpiFormatException (Status)));
}
}
@@ -441,10 +441,10 @@ AcpiExEisaIdToString (
OutString[0] = (char) ('@' + ((id >> 26) & 0x1f));
OutString[1] = (char) ('@' + ((id >> 21) & 0x1f));
OutString[2] = (char) ('@' + ((id >> 16) & 0x1f));
- OutString[3] = AcpiGbl_HexToAscii[(id >> 12) & 0xf];
- OutString[4] = AcpiGbl_HexToAscii[(id >> 8) & 0xf];
- OutString[5] = AcpiGbl_HexToAscii[(id >> 4) & 0xf];
- OutString[6] = AcpiGbl_HexToAscii[id & 0xf];
+ OutString[3] = AcpiUtHexToAsciiChar (id, 12);
+ OutString[4] = AcpiUtHexToAsciiChar (id, 8);
+ OutString[5] = AcpiUtHexToAsciiChar (id, 4);
+ OutString[6] = AcpiUtHexToAsciiChar (id, 0);
OutString[7] = 0;
return (AE_OK);
diff --git a/sys/contrib/dev/acpica/hwacpi.c b/sys/contrib/dev/acpica/hwacpi.c
index dcd0f8b9d5e9..3cf3d853e5f8 100644
--- a/sys/contrib/dev/acpica/hwacpi.c
+++ b/sys/contrib/dev/acpica/hwacpi.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
- * $Revision: 42 $
+ * $Revision: 43 $
*
*****************************************************************************/
@@ -154,7 +154,7 @@ AcpiHwInitialize (
{
AcpiGbl_RestoreAcpiChipset = FALSE;
- DEBUG_PRINTP (ACPI_ERROR, ("No FADT!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No FADT!\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -165,8 +165,8 @@ AcpiHwInitialize (
{
RestoreAcpiChipset = FALSE;
- DEBUG_PRINTP (ACPI_ERROR,
- ("Supported modes uninitialized!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Supported modes uninitialized!\n"));
return_ACPI_STATUS (AE_ERROR);
}
@@ -180,15 +180,15 @@ AcpiHwInitialize (
case (SYS_MODE_ACPI):
AcpiGbl_OriginalMode = SYS_MODE_ACPI;
- DEBUG_PRINTP (ACPI_INFO, ("System supports ACPI mode only.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "System supports ACPI mode only.\n"));
break;
case (SYS_MODE_LEGACY):
AcpiGbl_OriginalMode = SYS_MODE_LEGACY;
- DEBUG_PRINTP (ACPI_INFO,
- ("Tables loaded from buffer, hardware assumed to support LEGACY mode only.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Tables loaded from buffer, hardware assumed to support LEGACY mode only.\n"));
break;
@@ -203,11 +203,11 @@ AcpiHwInitialize (
AcpiGbl_OriginalMode = SYS_MODE_LEGACY;
}
- DEBUG_PRINTP (ACPI_INFO,
- ("System supports both ACPI and LEGACY modes.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "System supports both ACPI and LEGACY modes.\n"));
- DEBUG_PRINTP (ACPI_INFO,
- ("System is currently in %s mode.\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "System is currently in %s mode.\n",
(AcpiGbl_OriginalMode == SYS_MODE_ACPI) ? "ACPI" : "LEGACY"));
break;
}
@@ -326,7 +326,7 @@ AcpiHwSetMode (
/* BIOS should have disabled ALL fixed and GP events */
AcpiOsWritePort (AcpiGbl_FADT->SmiCmd, AcpiGbl_FADT->AcpiEnable, 8);
- DEBUG_PRINTP (ACPI_INFO, ("Attempting to enable ACPI mode\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable ACPI mode\n"));
}
else if (Mode == SYS_MODE_LEGACY)
@@ -337,13 +337,13 @@ AcpiHwSetMode (
*/
AcpiOsWritePort (AcpiGbl_FADT->SmiCmd, AcpiGbl_FADT->AcpiDisable, 8);
- DEBUG_PRINTP (ACPI_INFO,
- ("Attempting to enable Legacy (non-ACPI) mode\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Attempting to enable Legacy (non-ACPI) mode\n"));
}
if (AcpiHwGetMode () == Mode)
{
- DEBUG_PRINTP (ACPI_INFO, ("Mode %X successfully enabled\n", Mode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", Mode));
Status = AE_OK;
}
diff --git a/sys/contrib/dev/acpica/hwregs.c b/sys/contrib/dev/acpica/hwregs.c
index 7df3da235456..d231b4763bc8 100644
--- a/sys/contrib/dev/acpica/hwregs.c
+++ b/sys/contrib/dev/acpica/hwregs.c
@@ -3,7 +3,7 @@
*
* Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers.
- * $Revision: 102 $
+ * $Revision: 104 $
*
******************************************************************************/
@@ -184,7 +184,7 @@ AcpiHwClearAcpiStatus (void)
FUNCTION_TRACE ("HwClearAcpiStatus");
- DEBUG_PRINTP (TRACE_IO, ("About to write %04X to %04X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %04X\n",
ALL_FIXED_STS_BITS,
(UINT16) ACPI_GET_ADDRESS (AcpiGbl_FADT->XPm1aEvtBlk.Address)));
@@ -329,7 +329,7 @@ AcpiHwObtainSleepTypeRegisterData (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Bad Sleep object %p type %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad Sleep object %p type %X\n",
ObjDesc, ObjDesc->Common.Type));
}
@@ -539,7 +539,7 @@ AcpiHwRegisterBitAccess (
*/
RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_CONTROL);
- DEBUG_PRINT (TRACE_IO, ("PM1 control: Read %X\n", RegisterValue));
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM1 control: Read %X\n", RegisterValue));
if (ReadWrite == ACPI_WRITE)
{
@@ -579,7 +579,7 @@ AcpiHwRegisterBitAccess (
RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM2_CONTROL);
- DEBUG_PRINT (TRACE_IO, ("PM2 control: Read %X from %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %p\n",
RegisterValue, ACPI_GET_ADDRESS (AcpiGbl_FADT->XPm2CntBlk.Address)));
if (ReadWrite == ACPI_WRITE)
@@ -589,7 +589,7 @@ AcpiHwRegisterBitAccess (
Value &= Mask;
RegisterValue |= Value;
- DEBUG_PRINT (TRACE_IO, ("About to write %04X to %p\n", RegisterValue,
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %p\n", RegisterValue,
AcpiGbl_FADT->XPm2CntBlk.Address));
AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
@@ -603,7 +603,7 @@ AcpiHwRegisterBitAccess (
Mask = TMR_VAL_MASK;
RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK,
PM_TIMER);
- DEBUG_PRINT (TRACE_IO, ("PM_TIMER: Read %X from %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM_TIMER: Read %X from %p\n",
RegisterValue, ACPI_GET_ADDRESS (AcpiGbl_FADT->XPmTmrBlk.Address)));
break;
@@ -645,7 +645,7 @@ AcpiHwRegisterBitAccess (
/* Now get the current Enable Bits in the selected Reg */
RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, RegisterId);
- DEBUG_PRINT (TRACE_IO, ("GPE Enable bits: Read %X from %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "GPE Enable bits: Read %X from %X\n",
RegisterValue, RegisterId));
if (ReadWrite == ACPI_WRITE)
@@ -658,7 +658,7 @@ AcpiHwRegisterBitAccess (
/* This write will put the Action state into the General Purpose */
/* Enable Register indexed by the value in Mask */
- DEBUG_PRINT (TRACE_IO, ("About to write %04X to %04X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %04X\n",
RegisterValue, RegisterId));
AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, RegisterId,
(UINT8) RegisterValue);
@@ -686,7 +686,7 @@ AcpiHwRegisterBitAccess (
RegisterValue &= Mask;
RegisterValue >>= AcpiHwGetBitShift (Mask);
- DEBUG_PRINT (TRACE_IO, ("Register I/O: returning %X\n", RegisterValue));
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Register I/O: returning %X\n", RegisterValue));
return_VALUE (RegisterValue);
}
@@ -759,38 +759,40 @@ AcpiHwRegisterRead (
break;
+ /*
+ * For the GPE? Blocks, the lower word of RegisterId contains the
+ * byte offset for which to read, as each part of each block may be
+ * several bytes long.
+ */
case GPE0_STS_BLOCK: /* 8-bit access */
- Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe0Blk, 0);
+ BankOffset = REGISTER_BIT_ID(RegisterId);
+ Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe0Blk, BankOffset);
break;
-
case GPE0_EN_BLOCK: /* 8-bit access */
- BankOffset = DIV_2 (AcpiGbl_FADT->Gpe0BlkLen);
- Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe0Blk, BankOffset);
+ BankOffset = DIV_2 (AcpiGbl_FADT->Gpe0BlkLen) + REGISTER_BIT_ID(RegisterId);
+ Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe0Blk, BankOffset);
break;
-
case GPE1_STS_BLOCK: /* 8-bit access */
- Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe1Blk, 0);
+ BankOffset = REGISTER_BIT_ID(RegisterId);
+ Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe1Blk, BankOffset);
break;
-
case GPE1_EN_BLOCK: /* 8-bit access */
- BankOffset = DIV_2 (AcpiGbl_FADT->Gpe1BlkLen);
- Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe1Blk, BankOffset);
+ BankOffset = DIV_2 (AcpiGbl_FADT->Gpe1BlkLen) + REGISTER_BIT_ID(RegisterId);
+ Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe1Blk, BankOffset);
break;
-
case SMI_CMD_BLOCK: /* 8bit */
AcpiOsReadPort (AcpiGbl_FADT->SmiCmd, &Value, 8);
break;
-
default:
/* Value will be returned as 0 */
break;
@@ -887,26 +889,28 @@ AcpiHwRegisterWrite (
case GPE0_STS_BLOCK: /* 8-bit access */
- AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe0Blk, 0);
+ BankOffset = REGISTER_BIT_ID(RegisterId);
+ AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe0Blk, BankOffset);
break;
case GPE0_EN_BLOCK: /* 8-bit access */
- BankOffset = DIV_2 (AcpiGbl_FADT->Gpe0BlkLen);
+ BankOffset = DIV_2 (AcpiGbl_FADT->Gpe0BlkLen) + REGISTER_BIT_ID(RegisterId);
AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe0Blk, BankOffset);
break;
case GPE1_STS_BLOCK: /* 8-bit access */
- AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe1Blk, 0);
+ BankOffset = REGISTER_BIT_ID(RegisterId);
+ AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe1Blk, BankOffset);
break;
case GPE1_EN_BLOCK: /* 8-bit access */
- BankOffset = DIV_2 (AcpiGbl_FADT->Gpe1BlkLen);
+ BankOffset = DIV_2 (AcpiGbl_FADT->Gpe1BlkLen) + REGISTER_BIT_ID(RegisterId);
AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe1Blk, BankOffset);
break;
diff --git a/sys/contrib/dev/acpica/hwsleep.c b/sys/contrib/dev/acpica/hwsleep.c
index 494d37dd3dda..fb7a4ee2258a 100644
--- a/sys/contrib/dev/acpica/hwsleep.c
+++ b/sys/contrib/dev/acpica/hwsleep.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
- * $Revision: 14 $
+ * $Revision: 18 $
*
*****************************************************************************/
@@ -262,48 +262,106 @@ AcpiEnterSleepState (
Arg.Type = ACPI_TYPE_INTEGER;
Arg.Integer.Value = SleepState;
- AcpiEvaluateObject(NULL, "\\_PTS", &ArgList, NULL);
- AcpiEvaluateObject(NULL, "\\_GTS", &ArgList, NULL);
+ AcpiEvaluateObject (NULL, "\\_PTS", &ArgList, NULL);
+ AcpiEvaluateObject (NULL, "\\_GTS", &ArgList, NULL);
/* clear wake status */
- AcpiHwRegisterBitAccess(ACPI_WRITE, ACPI_MTX_LOCK, WAK_STS, 1);
+ AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, WAK_STS, 1);
- disable();
+ disable ();
- PM1AControl = (UINT16) AcpiHwRegisterRead(ACPI_MTX_LOCK, PM1_CONTROL);
+ /* TODO: disable all non-wake GPEs here */
- DEBUG_PRINT(ACPI_OK, ("Entering S%d\n", SleepState));
+ PM1AControl = (UINT16) AcpiHwRegisterRead (ACPI_MTX_LOCK, PM1_CONTROL);
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Entering S%d\n", SleepState));
/* mask off SLP_EN and SLP_TYP fields */
- PM1AControl &= 0xC3FF;
+
+ PM1AControl &= ~(SLP_TYPE_X_MASK | SLP_EN_MASK);
PM1BControl = PM1AControl;
/* mask in SLP_TYP */
+
PM1AControl |= (TypeA << AcpiHwGetBitShift (SLP_TYPE_X_MASK));
PM1BControl |= (TypeB << AcpiHwGetBitShift (SLP_TYPE_X_MASK));
/* write #1: fill in SLP_TYP data */
- AcpiHwRegisterWrite(ACPI_MTX_LOCK, PM1A_CONTROL, PM1AControl);
- AcpiHwRegisterWrite(ACPI_MTX_LOCK, PM1B_CONTROL, PM1BControl);
+
+ AcpiHwRegisterWrite (ACPI_MTX_LOCK, PM1A_CONTROL, PM1AControl);
+ AcpiHwRegisterWrite (ACPI_MTX_LOCK, PM1B_CONTROL, PM1BControl);
/* mask in SLP_EN */
+
PM1AControl |= (1 << AcpiHwGetBitShift (SLP_EN_MASK));
PM1BControl |= (1 << AcpiHwGetBitShift (SLP_EN_MASK));
+ /* flush caches */
+
+ wbinvd();
+
/* write #2: SLP_TYP + SLP_EN */
- AcpiHwRegisterWrite(ACPI_MTX_LOCK, PM1A_CONTROL, PM1AControl);
- AcpiHwRegisterWrite(ACPI_MTX_LOCK, PM1B_CONTROL, PM1BControl);
- /* wait a second, then try again */
- AcpiOsStall(1000000);
+ AcpiHwRegisterWrite (ACPI_MTX_LOCK, PM1A_CONTROL, PM1AControl);
+ AcpiHwRegisterWrite (ACPI_MTX_LOCK, PM1B_CONTROL, PM1BControl);
+
+ /*
+ * Wait a second, then try again. This is to get S4/5 to work on all machines.
+ */
+ if (SleepState > ACPI_STATE_S3)
+ {
+ AcpiOsStall(1000000);
- if (SleepState > ACPI_STATE_S1) {
- AcpiHwRegisterWrite(ACPI_MTX_LOCK, PM1_CONTROL,
- (1 << AcpiHwGetBitShift (SLP_EN_MASK)));
+ AcpiHwRegisterWrite (ACPI_MTX_LOCK, PM1_CONTROL,
+ (1 << AcpiHwGetBitShift (SLP_EN_MASK)));
}
- enable();
+ /* wait until we enter sleep state */
+
+ while (!AcpiHwRegisterBitAccess (ACPI_READ,ACPI_MTX_LOCK,WAK_STS))
+ { }
+
+ enable ();
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiLeaveSleepState
+ *
+ * PARAMETERS: SleepState - Which sleep state we just exited
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiLeaveSleepState (
+ UINT8 SleepState)
+{
+ ACPI_OBJECT_LIST ArgList;
+ ACPI_OBJECT Arg;
+
+ FUNCTION_TRACE ("AcpiLeaveSleepState");
+
+
+ MEMSET (&ArgList, 0, sizeof(ArgList));
+ ArgList.Count = 1;
+ ArgList.Pointer = &Arg;
+
+ MEMSET (&Arg, 0, sizeof(Arg));
+ Arg.Type = ACPI_TYPE_INTEGER;
+ Arg.Integer.Value = SleepState;
+
+ AcpiEvaluateObject (NULL, "\\_BFS", &ArgList, NULL);
+ AcpiEvaluateObject (NULL, "\\_WAK", &ArgList, NULL);
+ /* _WAK returns stuff - do we want to look at it? */
+
+ /* Re-enable GPEs */
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/nsaccess.c b/sys/contrib/dev/acpica/nsaccess.c
index bbc5b5a7af94..98a658ac6da3 100644
--- a/sys/contrib/dev/acpica/nsaccess.c
+++ b/sys/contrib/dev/acpica/nsaccess.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nsaccess - Top-level functions for accessing ACPI namespace
- * $Revision: 128 $
+ * $Revision: 130 $
*
******************************************************************************/
@@ -177,7 +177,7 @@ AcpiNsRootInitialize (void)
/* Enter the pre-defined names in the name table */
- DEBUG_PRINTP (ACPI_INFO, ("Entering predefined entries into namespace\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Entering predefined entries into namespace\n"));
for (InitVal = AcpiGbl_PreDefinedNames; InitVal->Name; InitVal++)
{
@@ -187,8 +187,8 @@ AcpiNsRootInitialize (void)
if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Could not create predefined name %s, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Could not create predefined name %s, %s\n",
InitVal->Name, AcpiFormatException (Status)));
}
@@ -230,23 +230,12 @@ AcpiNsRootInitialize (void)
case ACPI_TYPE_STRING:
- ObjDesc->String.Length = STRLEN (InitVal->Val);
-
/*
- * Allocate a buffer for the string. All
- * String.Pointers must be allocated buffers!
- * (makes deletion simpler)
+ * Build an object around the static string
*/
- ObjDesc->String.Pointer = ACPI_MEM_ALLOCATE (
- (ObjDesc->String.Length + 1));
- if (!ObjDesc->String.Pointer)
- {
- AcpiUtRemoveReference (ObjDesc);
- Status = AE_NO_MEMORY;
- goto UnlockAndExit;
- }
-
- STRCPY (ObjDesc->String.Pointer, InitVal->Val);
+ ObjDesc->String.Length = STRLEN (InitVal->Val);
+ ObjDesc->String.Pointer = InitVal->Val;
+ ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;
break;
@@ -387,7 +376,7 @@ AcpiNsLookup (
if ((!ScopeInfo) ||
(!ScopeInfo->Scope.Node))
{
- DEBUG_PRINTP (TRACE_NAMES, ("Null scope prefix, using root node (%p)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Null scope prefix, using root node (%p)\n",
AcpiGbl_RootNode));
PrefixNode = AcpiGbl_RootNode;
@@ -438,8 +427,8 @@ AcpiNsLookup (
NumSegments = 0;
ThisNode = AcpiGbl_RootNode;
- DEBUG_PRINTP (TRACE_NAMES,
- ("Null Pathname (Zero segments), Flags=%x\n", Flags));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Null Pathname (Zero segments), Flags=%x\n", Flags));
}
else
@@ -473,7 +462,7 @@ AcpiNsLookup (
Pathname++;
- DEBUG_PRINTP (TRACE_NAMES, ("Searching from root [%p]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching from root [%p]\n",
CurrentNode));
/* Direct reference to root, "\" */
@@ -491,7 +480,7 @@ AcpiNsLookup (
CurrentNode = PrefixNode;
- DEBUG_PRINTP (TRACE_NAMES, ("Searching relative to pfx scope [%p]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching relative to pfx scope [%p]\n",
PrefixNode));
/*
@@ -535,8 +524,8 @@ AcpiNsLookup (
Pathname++;
- DEBUG_PRINTP (TRACE_NAMES,
- ("Dual Pathname (2 segments, Flags=%X)\n", Flags));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Dual Pathname (2 segments, Flags=%X)\n", Flags));
}
else if (*Pathname == AML_MULTI_NAME_PREFIX_OP)
@@ -547,8 +536,8 @@ AcpiNsLookup (
Pathname++;
- DEBUG_PRINTP (TRACE_NAMES,
- ("Multi Pathname (%d Segments, Flags=%X) \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Multi Pathname (%d Segments, Flags=%X) \n",
NumSegments, Flags));
}
@@ -560,8 +549,8 @@ AcpiNsLookup (
*/
NumSegments = 1;
- DEBUG_PRINTP (TRACE_NAMES,
- ("Simple Pathname (1 segment, Flags=%X)\n", Flags));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Simple Pathname (1 segment, Flags=%X)\n", Flags));
}
#ifdef ACPI_DEBUG
@@ -570,13 +559,13 @@ AcpiNsLookup (
/* Debug only: print the entire name that we are about to lookup */
- DEBUG_PRINTP (TRACE_NAMES, ("["));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
for (i = 0; i < NumSegments; i++)
{
- DEBUG_PRINT_RAW (TRACE_NAMES, ("%4.4s/", &Pathname[i * 4]));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "%4.4s/", &Pathname[i * 4]));
}
- DEBUG_PRINT_RAW (TRACE_NAMES, ("]\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "]\n"));
#endif
}
@@ -619,8 +608,8 @@ AcpiNsLookup (
{
/* Name not found in ACPI namespace */
- DEBUG_PRINTP (TRACE_NAMES,
- ("Name [%4.4s] not found in scope %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Name [%4.4s] not found in scope %X\n",
&SimpleName, CurrentNode));
}
@@ -676,7 +665,7 @@ AcpiNsLookup (
* and the next scope has not been allocated.
*/
- DEBUG_PRINTP (ACPI_INFO, ("Load mode=%X ThisNode=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Load mode=%X ThisNode=%X\n",
InterpreterMode, ThisNode));
}
@@ -723,7 +712,7 @@ CheckForNewScopeAndExit:
return_ACPI_STATUS (Status);
}
- DEBUG_PRINTP (ACPI_INFO, ("Set global scope to %p\n", ScopeToPush));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Set global scope to %p\n", ScopeToPush));
}
}
diff --git a/sys/contrib/dev/acpica/nsalloc.c b/sys/contrib/dev/acpica/nsalloc.c
index f5b332f7471a..6a6d2d14588b 100644
--- a/sys/contrib/dev/acpica/nsalloc.c
+++ b/sys/contrib/dev/acpica/nsalloc.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nsalloc - Namespace allocation and deletion utilities
- * $Revision: 51 $
+ * $Revision: 53 $
*
******************************************************************************/
@@ -153,7 +153,7 @@ AcpiNsCreateNode (
return_PTR (NULL);
}
- INCREMENT_NAME_TABLE_METRICS (sizeof (ACPI_NAMESPACE_NODE));
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].TotalAllocated++);
Node->DataType = ACPI_DESC_TYPE_NAMED;
Node->Name = AcpiName;
@@ -211,7 +211,7 @@ AcpiNsDeleteNode (
}
- DECREMENT_NAME_TABLE_METRICS (sizeof (ACPI_NAMESPACE_NODE));
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].TotalFreed++);
/*
* Detach an object if there is one
@@ -312,7 +312,7 @@ AcpiNsInstallNode (
* We will fill in the actual type when the
* real definition is found later.
*/
- DEBUG_PRINTP (ACPI_INFO, ("[%4.4s] is a forward reference\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "[%4.4s] is a forward reference\n",
&Node->Name));
}
@@ -339,7 +339,7 @@ AcpiNsInstallNode (
Node->Type = (UINT8) Type;
}
- DEBUG_PRINTP (TRACE_NAMES, ("%4.4s added to %p at %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s added to %p at %p\n",
&Node->Name, ParentNode, Node));
/*
@@ -407,15 +407,15 @@ AcpiNsDeleteChildren (
if (ChildNode->Child)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Found a grandchild! P=%X C=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found a grandchild! P=%X C=%X\n",
ParentNode, ChildNode));
}
/* Now we can free this child object */
- DECREMENT_NAME_TABLE_METRICS (sizeof (ACPI_NAMESPACE_NODE));
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].TotalFreed++);
- DEBUG_PRINTP (ACPI_INFO, ("Object %p, Remaining %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object %p, Remaining %X\n",
ChildNode, AcpiGbl_CurrentNodeCount));
/*
diff --git a/sys/contrib/dev/acpica/nsdump.c b/sys/contrib/dev/acpica/nsdump.c
index def997da4562..85644af280a3 100644
--- a/sys/contrib/dev/acpica/nsdump.c
+++ b/sys/contrib/dev/acpica/nsdump.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
- * $Revision: 94 $
+ * $Revision: 95 $
*
*****************************************************************************/
@@ -215,6 +215,9 @@ AcpiNsDumpOneObject (
UINT32 WhichBit;
+ PROC_NAME ("AcpiNsDumpOneObject");
+
+
ThisNode = AcpiNsConvertHandleToEntry (ObjHandle);
LevelTmp = Level;
@@ -229,7 +232,7 @@ AcpiNsDumpOneObject (
if (!ObjHandle)
{
- DEBUG_PRINT (ACPI_INFO, ("NsDumpOneObject: Null object handle\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
return (AE_OK);
}
@@ -253,12 +256,12 @@ AcpiNsDumpOneObject (
{
if (DownstreamSiblingMask & WhichBit)
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("|"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "|"));
}
else
{
- DEBUG_PRINT_RAW (TRACE_TABLES, (" "));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
}
WhichBit <<= 1;
@@ -269,28 +272,28 @@ AcpiNsDumpOneObject (
if (AcpiNsExistDownstreamSibling (ThisNode + 1))
{
DownstreamSiblingMask |= (1 << (Level - 1));
- DEBUG_PRINT_RAW (TRACE_TABLES, ("+"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+"));
}
else
{
DownstreamSiblingMask &= ACPI_UINT32_MAX ^ (1 << (Level - 1));
- DEBUG_PRINT_RAW (TRACE_TABLES, ("+"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+"));
}
if (ThisNode->Child == NULL)
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("-"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-"));
}
else if (AcpiNsExistDownstreamSibling (ThisNode->Child))
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("+"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+"));
}
else
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("-"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-"));
}
}
}
@@ -312,15 +315,15 @@ AcpiNsDumpOneObject (
* Now we can print out the pertinent information
*/
- DEBUG_PRINT_RAW (TRACE_TABLES, (" %4.4s %-9s ", &ThisNode->Name, AcpiUtGetTypeName (Type)));
- DEBUG_PRINT_RAW (TRACE_TABLES, ("%p S:%p O:%p", ThisNode, ThisNode->Child, ThisNode->Object));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-9s ", &ThisNode->Name, AcpiUtGetTypeName (Type)));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p S:%p O:%p", ThisNode, ThisNode->Child, ThisNode->Object));
if (!ThisNode->Object)
{
/* No attached object, we are done */
- DEBUG_PRINT_RAW (TRACE_TABLES, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
return (AE_OK);
}
@@ -331,7 +334,7 @@ AcpiNsDumpOneObject (
/* Name is a Method and its AML offset/length are set */
- DEBUG_PRINT_RAW (TRACE_TABLES, (" M:%p-%X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " M:%p-%X\n",
((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Method.Pcode,
((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Method.PcodeLength));
@@ -340,14 +343,14 @@ AcpiNsDumpOneObject (
case ACPI_TYPE_INTEGER:
- DEBUG_PRINT_RAW (TRACE_TABLES, (" N:%X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " N:%X\n",
((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Integer.Value));
break;
case ACPI_TYPE_STRING:
- DEBUG_PRINT_RAW (TRACE_TABLES, (" S:%p-%X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " S:%p-%X\n",
((ACPI_OPERAND_OBJECT *) ThisNode->Object)->String.Pointer,
((ACPI_OPERAND_OBJECT *) ThisNode->Object)->String.Length));
break;
@@ -355,7 +358,7 @@ AcpiNsDumpOneObject (
case ACPI_TYPE_BUFFER:
- DEBUG_PRINT_RAW (TRACE_TABLES, (" B:%p-%X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n",
((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Buffer.Pointer,
((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Buffer.Length));
break;
@@ -363,13 +366,13 @@ AcpiNsDumpOneObject (
default:
- DEBUG_PRINT_RAW (TRACE_TABLES, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
break;
}
/* If debug turned off, done */
- if (!(AcpiDbgLevel & TRACE_VALUES))
+ if (!(AcpiDbgLevel & ACPI_LV_VALUES))
{
return (AE_OK);
}
@@ -387,17 +390,17 @@ AcpiNsDumpOneObject (
/* Decode the type of attached object and dump the contents */
- DEBUG_PRINT_RAW (TRACE_TABLES, (" Attached Object %p: ", Value));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", Value));
if (AcpiTbSystemTablePointer (Value))
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("(Ptr to AML Code)\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to AML Code)\n"));
BytesToDump = 16;
}
else if (VALID_DESCRIPTOR_TYPE (Value, ACPI_DESC_TYPE_NAMED))
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("(Ptr to Node)\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to Node)\n"));
BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
}
@@ -409,13 +412,13 @@ AcpiNsDumpOneObject (
if (ObjType > INTERNAL_TYPE_MAX)
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType));
BytesToDump = 32;
}
else
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("(Ptr to ACPI Object type %X [%s])\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [%s])\n",
ObjType, AcpiUtGetTypeName (ObjType)));
BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
}
@@ -423,7 +426,7 @@ AcpiNsDumpOneObject (
else
{
- DEBUG_PRINT_RAW (TRACE_TABLES, ("(String or Buffer - not descriptor)\n", Value));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n", Value));
BytesToDump = 16;
}
@@ -482,7 +485,7 @@ AcpiNsDumpOneObject (
}
Cleanup:
- DEBUG_PRINT_RAW (TRACE_TABLES, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
return (AE_OK);
}
@@ -513,7 +516,7 @@ AcpiNsDumpObjects (
ACPI_WALK_INFO Info;
- Info.DebugLevel = TRACE_TABLES;
+ Info.DebugLevel = ACPI_LV_TABLES;
Info.OwnerId = OwnerId;
AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, NS_WALK_NO_UNLOCK, AcpiNsDumpOneObject,
@@ -546,6 +549,8 @@ AcpiNsDumpOneDevice (
ACPI_STATUS Status;
UINT32 i;
+ PROC_NAME ("AcpiNsDumpOneDevice");
+
Status = AcpiNsDumpOneObject (ObjHandle, Level, Context, ReturnValue);
@@ -554,10 +559,10 @@ AcpiNsDumpOneDevice (
{
for (i = 0; i < Level; i++)
{
- DEBUG_PRINT_RAW (TRACE_TABLES, (" "));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
}
- DEBUG_PRINT_RAW (TRACE_TABLES, (" HID: %.8X, ADR: %.8X, Status: %x\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %.8X, ADR: %.8X, Status: %x\n",
Info.HardwareId, Info.Address, Info.CurrentStatus));
}
@@ -580,17 +585,19 @@ AcpiNsDumpRootDevices (void)
{
ACPI_HANDLE SysBusHandle;
+ PROC_NAME ("AcpiNsDumpRootDevices");
+
/* Only dump the table if tracing is enabled */
- if (!(TRACE_TABLES & AcpiDbgLevel))
+ if (!(ACPI_DB_TABLES & AcpiDbgLevel))
{
return;
}
AcpiGetHandle (0, NS_SYSTEM_BUS, &SysBusHandle);
- DEBUG_PRINT (TRACE_TABLES, ("Display of all devices in the namespace:\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n"));
AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle, ACPI_UINT32_MAX, NS_WALK_NO_UNLOCK,
AcpiNsDumpOneDevice, NULL, NULL);
}
@@ -627,7 +634,7 @@ AcpiNsDumpTables (
* If the name space has not been initialized,
* there is nothing to dump.
*/
- DEBUG_PRINTP (TRACE_TABLES, ("name space not initialized!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "name space not initialized!\n"));
return_VOID;
}
@@ -636,7 +643,7 @@ AcpiNsDumpTables (
/* entire namespace */
SearchHandle = AcpiGbl_RootNode;
- DEBUG_PRINT (TRACE_TABLES, ("\\\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
}
diff --git a/sys/contrib/dev/acpica/nseval.c b/sys/contrib/dev/acpica/nseval.c
index 49556d4bd019..709e6a480f80 100644
--- a/sys/contrib/dev/acpica/nseval.c
+++ b/sys/contrib/dev/acpica/nseval.c
@@ -2,7 +2,7 @@
*
* Module Name: nseval - Object evaluation interfaces -- includes control
* method lookup and execution.
- * $Revision: 93 $
+ * $Revision: 94 $
*
******************************************************************************/
@@ -207,7 +207,7 @@ AcpiNsEvaluateRelative (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_INFO, ("Object [%s] not found [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object [%s] not found [%s]\n",
Pathname, AcpiFormatException (Status)));
goto Cleanup;
}
@@ -217,12 +217,12 @@ AcpiNsEvaluateRelative (
* to evaluate it.
*/
- DEBUG_PRINTP (ACPI_INFO, ("%s [%p] Value %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n",
Pathname, Node, Node->Object));
Status = AcpiNsEvaluateByHandle (Node, Params, ReturnObject);
- DEBUG_PRINTP (ACPI_INFO, ("*** Completed eval of object %s ***\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*** Completed eval of object %s ***\n",
Pathname));
Cleanup:
@@ -286,7 +286,7 @@ AcpiNsEvaluateByName (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_INFO, ("Object at [%s] was not found, status=%.4X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object at [%s] was not found, status=%.4X\n",
Pathname, Status));
goto Cleanup;
}
@@ -296,12 +296,12 @@ AcpiNsEvaluateByName (
* to evaluate it.
*/
- DEBUG_PRINTP (ACPI_INFO, ("%s [%p] Value %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n",
Pathname, Node, Node->Object));
Status = AcpiNsEvaluateByHandle (Node, Params, ReturnObject);
- DEBUG_PRINTP (ACPI_INFO, ("*** Completed eval of object %s ***\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*** Completed eval of object %s ***\n",
Pathname));
@@ -487,20 +487,20 @@ AcpiNsExecuteControlMethod (
ObjDesc = AcpiNsGetAttachedObject (MethodNode);
if (!ObjDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No attached method object\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n"));
AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (AE_ERROR);
}
- DEBUG_PRINTP (ACPI_INFO, ("Control method at Offset %x Length %lx]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %x Length %lx]\n",
ObjDesc->Method.Pcode + 1, ObjDesc->Method.PcodeLength - 1));
DUMP_PATHNAME (MethodNode, "NsExecuteControlMethod: Executing",
- TRACE_NAMES, _COMPONENT);
+ ACPI_LV_NAMES, _COMPONENT);
- DEBUG_PRINTP (TRACE_NAMES, ("At offset %8XH\n", ObjDesc->Method.Pcode + 1));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %8XH\n", ObjDesc->Method.Pcode + 1));
/*
@@ -646,7 +646,7 @@ AcpiNsGetObjectValue (
Status = AE_CTRL_RETURN_VALUE;
*ReturnObjDesc = ObjDesc;
- DEBUG_PRINTP (ACPI_INFO, ("Returning obj %p\n", *ReturnObjDesc));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Returning obj %p\n", *ReturnObjDesc));
}
/* Namespace is unlocked */
diff --git a/sys/contrib/dev/acpica/nsinit.c b/sys/contrib/dev/acpica/nsinit.c
index 441767e79172..7ae355022ad8 100644
--- a/sys/contrib/dev/acpica/nsinit.c
+++ b/sys/contrib/dev/acpica/nsinit.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsinit - namespace initialization
- * $Revision: 28 $
+ * $Revision: 29 $
*
*****************************************************************************/
@@ -150,9 +150,9 @@ AcpiNsInitializeObjects (
FUNCTION_TRACE ("NsInitializeObjects");
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("**** Starting initialization of namespace objects ****\n"));
- DEBUG_PRINT_RAW (ACPI_OK, ("Completing Region and Field initialization:"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "**** Starting initialization of namespace objects ****\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Completing Region and Field initialization:"));
Info.FieldCount = 0;
@@ -169,17 +169,17 @@ AcpiNsInitializeObjects (
&Info, NULL);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("WalkNamespace failed! %x\n", Status));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed! %x\n", Status));
}
- DEBUG_PRINT_RAW (ACPI_OK,
- ("\n%d/%d Regions, %d/%d Fields initialized (%d nodes total)\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ "\n%d/%d Regions, %d/%d Fields initialized (%d nodes total)\n",
Info.OpRegionInit, Info.OpRegionCount, Info.FieldInit,
Info.FieldCount, Info.ObjectCount));
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("%d Control Methods found\n", Info.MethodCount));
- DEBUG_PRINTP (TRACE_DISPATCH,
- ("%d Op Regions found\n", Info.OpRegionCount));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "%d Control Methods found\n", Info.MethodCount));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "%d Op Regions found\n", Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
@@ -217,19 +217,19 @@ AcpiNsInitializeDevices (
Info.Num_INI = 0;
- DEBUG_PRINT_RAW (ACPI_OK, ("Executing device _INI methods:"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Executing device _INI methods:"));
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, &Info, NULL);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("WalkNamespace failed! %x\n", Status));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed! %x\n", Status));
}
- DEBUG_PRINT_RAW (ACPI_OK,
- ("\n%d Devices found: %d _STA, %d _INI\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ "\n%d Devices found: %d _STA, %d _INI\n",
Info.DeviceCount, Info.Num_STA, Info.Num_INI));
return_ACPI_STATUS (Status);
@@ -270,6 +270,9 @@ AcpiNsInitOneObject (
ACPI_OPERAND_OBJECT *ObjDesc;
+ PROC_NAME ("AcpiNsInitOneObject");
+
+
Info->ObjectCount++;
@@ -313,15 +316,15 @@ AcpiNsInitOneObject (
Status = AcpiDsGetRegionArguments (ObjDesc);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINT_RAW (ACPI_ERROR, ("\n"));
- DEBUG_PRINT (ACPI_ERROR,
- ("%s while getting region arguments [%4.4s]\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "%s while getting region arguments [%4.4s]\n",
AcpiFormatException (Status), &Node->Name));
}
- if (!(AcpiDbgLevel & TRACE_INIT))
+ if (!(AcpiDbgLevel & ACPI_LV_INIT))
{
- DEBUG_PRINT_RAW (ACPI_OK, ("."));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
break;
@@ -339,14 +342,14 @@ AcpiNsInitOneObject (
Status = AcpiDsGetBufferFieldArguments (ObjDesc);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINT_RAW (ACPI_ERROR, ("\n"));
- DEBUG_PRINT (ACPI_ERROR,
- ("%s while getting buffer field arguments [%4.4s]\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "%s while getting buffer field arguments [%4.4s]\n",
AcpiFormatException (Status), &Node->Name));
}
- if (!(AcpiDbgLevel & TRACE_INIT))
+ if (!(AcpiDbgLevel & ACPI_LV_INIT))
{
- DEBUG_PRINT_RAW (ACPI_OK, ("."));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
@@ -396,9 +399,9 @@ AcpiNsInitOneDevice (
FUNCTION_TRACE ("AcpiNsInitOneDevice");
- if (!(AcpiDbgLevel & TRACE_INIT))
+ if (!(AcpiDbgLevel & ACPI_LV_INIT))
{
- DEBUG_PRINT_RAW (ACPI_OK, ("."));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
Info->DeviceCount++;
@@ -456,7 +459,7 @@ AcpiNsInitOneDevice (
#ifdef ACPI_DEBUG
NATIVE_CHAR *ScopeName = AcpiNsGetTablePathname (ObjHandle);
- DEBUG_PRINTP (ACPI_WARN, ("%s._INI failed: %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n",
ScopeName, AcpiFormatException (Status)));
ACPI_MEM_FREE (ScopeName);
diff --git a/sys/contrib/dev/acpica/nsload.c b/sys/contrib/dev/acpica/nsload.c
index 762509be5866..73f8a6c74d62 100644
--- a/sys/contrib/dev/acpica/nsload.c
+++ b/sys/contrib/dev/acpica/nsload.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsload - namespace loading/expanding/contracting procedures
- * $Revision: 41 $
+ * $Revision: 42 $
*
*****************************************************************************/
@@ -156,7 +156,7 @@ AcpiNsLoadNamespace (
if (AcpiGbl_DSDT == NULL)
{
- DEBUG_PRINTP (ACPI_ERROR, ("DSDT is not in memory\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "DSDT is not in memory\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -178,8 +178,8 @@ AcpiNsLoadNamespace (
AcpiNsLoadTableByType (ACPI_TABLE_PSDT);
- DEBUG_PRINT_RAW (ACPI_OK,
- ("ACPI Namespace successfully loaded at root %p\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ "ACPI Namespace successfully loaded at root %p\n",
AcpiGbl_RootNode));
@@ -247,7 +247,7 @@ AcpiNsOneCompleteParse (
/* Pass 1: Parse everything except control method bodies */
- DEBUG_PRINTP (TRACE_PARSE, ("*PARSE* pass %d parse\n", PassNumber));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", PassNumber));
Status = AcpiPsParseAml (ParseRoot, TableDesc->AmlPointer,
TableDesc->AmlLength,
@@ -348,16 +348,16 @@ AcpiNsLoadTable (
if (!TableDesc->AmlPointer)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null AML pointer\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null AML pointer\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- DEBUG_PRINTP (ACPI_INFO, ("AML block at %p\n", TableDesc->AmlPointer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n", TableDesc->AmlPointer));
if (!TableDesc->AmlLength)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Zero-length AML block\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Zero-length AML block\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -372,7 +372,7 @@ AcpiNsLoadTable (
* because we don't know how many arguments to parse next!
*/
- DEBUG_PRINTP (ACPI_INFO, ("**** Loading table into namespace ****\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Loading table into namespace ****\n"));
AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
Status = AcpiNsParseTable (TableDesc, Node->Child);
@@ -390,13 +390,13 @@ AcpiNsLoadTable (
* parse trees.
*/
- DEBUG_PRINTP (ACPI_INFO,
- ("**** Begin Table Method Parsing and Object Initialization ****\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "**** Begin Table Method Parsing and Object Initialization ****\n"));
Status = AcpiDsInitializeObjects (TableDesc, Node);
- DEBUG_PRINTP (ACPI_INFO,
- ("**** Completed Table Method Parsing and Object Initialization ****\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "**** Completed Table Method Parsing and Object Initialization ****\n"));
return_ACPI_STATUS (Status);
}
@@ -441,7 +441,7 @@ AcpiNsLoadTableByType (
case ACPI_TABLE_DSDT:
- DEBUG_PRINTP (ACPI_INFO, ("Loading DSDT\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading DSDT\n"));
TableDesc = &AcpiGbl_AcpiTables[ACPI_TABLE_DSDT];
@@ -467,7 +467,7 @@ AcpiNsLoadTableByType (
case ACPI_TABLE_SSDT:
- DEBUG_PRINTP (ACPI_INFO, ("Loading %d SSDTs\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d SSDTs\n",
AcpiGbl_AcpiTables[ACPI_TABLE_SSDT].Count));
/*
@@ -500,7 +500,7 @@ AcpiNsLoadTableByType (
case ACPI_TABLE_PSDT:
- DEBUG_PRINTP (ACPI_INFO, ("Loading %d PSDTs\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d PSDTs\n",
AcpiGbl_AcpiTables[ACPI_TABLE_PSDT].Count));
/*
diff --git a/sys/contrib/dev/acpica/nsnames.c b/sys/contrib/dev/acpica/nsnames.c
index 5ddeeaab5802..f2ca79348a95 100644
--- a/sys/contrib/dev/acpica/nsnames.c
+++ b/sys/contrib/dev/acpica/nsnames.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nsnames - Name manipulation and search
- * $Revision: 60 $
+ * $Revision: 61 $
*
******************************************************************************/
@@ -209,7 +209,7 @@ AcpiNsGetTablePathname (
if (Size != 0)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Bad pointer returned; size=%X\n", Size));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad pointer returned; size=%X\n", Size));
}
return_PTR (NameBuffer);
@@ -354,7 +354,7 @@ AcpiNsHandleToPathname (
UserBuffer[Size] = '\\';
- DEBUG_PRINTP (TRACE_EXEC, ("Len=%X, %s \n", PathLength, UserBuffer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Len=%X, %s \n", PathLength, UserBuffer));
Exit:
return_ACPI_STATUS (Status);
diff --git a/sys/contrib/dev/acpica/nsobject.c b/sys/contrib/dev/acpica/nsobject.c
index e33b96239ffb..567c8f0ddfd9 100644
--- a/sys/contrib/dev/acpica/nsobject.c
+++ b/sys/contrib/dev/acpica/nsobject.c
@@ -2,7 +2,7 @@
*
* Module Name: nsobject - Utilities for objects attached to namespace
* table entries
- * $Revision: 56 $
+ * $Revision: 60 $
*
******************************************************************************/
@@ -133,10 +133,10 @@
*
* FUNCTION: AcpiNsAttachObject
*
- * PARAMETERS: Node - Parent Node
+ * PARAMETERS: Node - Parent Node
* Object - Object to be attached
* Type - Type of object, or ACPI_TYPE_ANY if not
- * known
+ * known
*
* DESCRIPTION: Record the given object as the value associated with the
* name whose ACPI_HANDLE is passed. If Object is NULL
@@ -154,7 +154,7 @@ AcpiNsAttachObject (
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *PreviousObjDesc;
- ACPI_OBJECT_TYPE8 ObjType = ACPI_TYPE_ANY;
+ ACPI_OBJECT_TYPE8 ObjType = ACPI_TYPE_ANY;
UINT8 Flags;
UINT16 Opcode;
@@ -165,7 +165,6 @@ AcpiNsAttachObject (
/*
* Parameter validation
*/
-
if (!AcpiGbl_RootNode)
{
/* Name space not initialized */
@@ -202,7 +201,7 @@ AcpiNsAttachObject (
if (Node->Object == Object)
{
- DEBUG_PRINTP (TRACE_EXEC, ("Obj %p already installed in NameObj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj %p already installed in NameObj %p\n",
Object, Node));
return_ACPI_STATUS (AE_OK);
@@ -227,7 +226,6 @@ AcpiNsAttachObject (
* If the object is an Node with an attached object,
* we will use that (attached) object
*/
-
else if (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_NAMED) &&
((ACPI_NAMESPACE_NODE *) Object)->Object)
{
@@ -235,14 +233,12 @@ AcpiNsAttachObject (
* Value passed is a name handle and that name has a
* non-null value. Use that name's value and type.
*/
-
ObjDesc = ((ACPI_NAMESPACE_NODE *) Object)->Object;
ObjType = ((ACPI_NAMESPACE_NODE *) Object)->Type;
/*
* Copy appropriate flags
*/
-
if (((ACPI_NAMESPACE_NODE *) Object)->Flags & ANOBJ_AML_ATTACHMENT)
{
Flags |= ANOBJ_AML_ATTACHMENT;
@@ -254,7 +250,6 @@ AcpiNsAttachObject (
* Otherwise, we will use the parameter object, but we must type
* it first
*/
-
else
{
ObjDesc = (ACPI_OPERAND_OBJECT *) Object;
@@ -282,14 +277,12 @@ AcpiNsAttachObject (
* Object points into the AML stream.
* Set a flag bit in the Node to indicate this
*/
-
Flags |= ANOBJ_AML_ATTACHMENT;
/*
* The next byte (perhaps the next two bytes)
* will be the AML opcode
*/
-
MOVE_UNALIGNED16_TO_16 (&Opcode, Object);
/* Check for a recognized Opcode */
@@ -305,15 +298,18 @@ AcpiNsAttachObject (
* OpPrefix is unrecognized unless part
* of RevisionOp
*/
-
break;
}
- /* Else fall through to set type as Number */
-
+ /* Otherwise, fall through and set the type to Integer */
- case AML_ZERO_OP: case AML_ONES_OP: case AML_ONE_OP:
- case AML_BYTE_OP: case AML_WORD_OP: case AML_DWORD_OP:
+ case AML_ZERO_OP:
+ case AML_ONES_OP:
+ case AML_ONE_OP:
+ case AML_BYTE_OP:
+ case AML_WORD_OP:
+ case AML_DWORD_OP:
+ case AML_QWORD_OP:
ObjType = ACPI_TYPE_INTEGER;
break;
@@ -345,8 +341,8 @@ AcpiNsAttachObject (
default:
- DEBUG_PRINTP (ACPI_ERROR,
- ("AML Opcode/Type [%x] not supported in attach\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "AML Opcode/Type [%x] not supported in attach\n",
(UINT8) Opcode));
return_ACPI_STATUS (AE_TYPE);
@@ -360,27 +356,26 @@ AcpiNsAttachObject (
* Cannot figure out the type -- set to DefAny which
* will print as an error in the name table dump
*/
-
if (GetDebugLevel () > 0)
{
DUMP_PATHNAME (Node,
"NsAttachObject confused: setting bogus type for ",
- ACPI_INFO, _COMPONENT);
+ ACPI_LV_INFO, _COMPONENT);
if (AcpiTbSystemTablePointer (Object))
{
- DEBUG_PRINTP (ACPI_INFO,
- ("AML-stream code %02x\n", *(UINT8 *) Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "AML-stream code %02x\n", *(UINT8 *) Object));
}
else if (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_NAMED))
{
- DUMP_PATHNAME (Object, "name ", ACPI_INFO, _COMPONENT);
+ DUMP_PATHNAME (Object, "name ", ACPI_LV_INFO, _COMPONENT);
}
else
{
- DUMP_PATHNAME (Object, "object ", ACPI_INFO, _COMPONENT);
+ DUMP_PATHNAME (Object, "object ", ACPI_LV_INFO, _COMPONENT);
DUMP_STACK_ENTRY (Object);
}
}
@@ -390,7 +385,7 @@ AcpiNsAttachObject (
}
- DEBUG_PRINTP (TRACE_EXEC, ("Installing obj %p into NameObj %p [%4.4s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n",
ObjDesc, Node, &Node->Name));
@@ -398,7 +393,6 @@ AcpiNsAttachObject (
* Must increment the new value's reference count
* (if it is an internal object)
*/
-
AcpiUtAddReference (ObjDesc);
/* Save the existing object (if any) for deletion later */
@@ -415,7 +409,6 @@ AcpiNsAttachObject (
/*
* Delete an existing attached object.
*/
-
if (PreviousObjDesc)
{
/* One for the attach to the Node */
@@ -466,14 +459,13 @@ AcpiNsDetachObject (
/* Found a valid value */
- DEBUG_PRINTP (ACPI_INFO, ("Object=%p Value=%p Name %4.4s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object=%p Value=%p Name %4.4s\n",
Node, ObjDesc, &Node->Name));
/*
* Not every value is an object allocated via ACPI_MEM_CALLOCATE,
* - must check
*/
-
if (!AcpiTbSystemTablePointer (ObjDesc))
{
/* Attempt to delete the object (and all subobjects) */
@@ -507,7 +499,7 @@ AcpiNsGetAttachedObject (
{
/* handle invalid */
- DEBUG_PRINTP (ACPI_WARN, ("Null Node ptr\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Null Node ptr\n"));
return_PTR (NULL);
}
diff --git a/sys/contrib/dev/acpica/nssearch.c b/sys/contrib/dev/acpica/nssearch.c
index ac5747c217b5..4b4f1902eea2 100644
--- a/sys/contrib/dev/acpica/nssearch.c
+++ b/sys/contrib/dev/acpica/nssearch.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nssearch - Namespace search
- * $Revision: 71 $
+ * $Revision: 72 $
*
******************************************************************************/
@@ -166,14 +166,14 @@ AcpiNsSearchNode (
#ifdef ACPI_DEBUG
- if (TRACE_NAMES & AcpiDbgLevel)
+ if (ACPI_LV_NAMES & AcpiDbgLevel)
{
NATIVE_CHAR *ScopeName;
ScopeName = AcpiNsGetTablePathname (Node);
if (ScopeName)
{
- DEBUG_PRINTP (TRACE_NAMES, ("Searching %s [%p] For %4.4s (type %X)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (type %X)\n",
ScopeName, Node, &TargetName, Type));
ACPI_MEM_FREE (ScopeName);
@@ -223,8 +223,8 @@ AcpiNsSearchNode (
NextNode->Type = (UINT8) Type;
}
- DEBUG_PRINTP (TRACE_NAMES,
- ("Name %4.4s (actual type %X) found at %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Name %4.4s (actual type %X) found at %p\n",
&TargetName, NextNode->Type, NextNode));
*ReturnNode = NextNode;
@@ -251,7 +251,7 @@ AcpiNsSearchNode (
/* Searched entire table, not found */
- DEBUG_PRINTP (TRACE_NAMES, ("Name %4.4s (type %X) not found at %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s (type %X) not found at %p\n",
&TargetName, Type, NextNode));
return_ACPI_STATUS (AE_NOT_FOUND);
@@ -308,13 +308,13 @@ AcpiNsSearchParentTree (
{
if (!ParentNode)
{
- DEBUG_PRINTP (TRACE_NAMES, ("[%4.4s] has no parent\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n",
&TargetName));
}
if (AcpiNsLocal (Type))
{
- DEBUG_PRINTP (TRACE_NAMES, ("[%4.4s] type %X is local(no search)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] type %X is local(no search)\n",
&TargetName, Type));
}
@@ -324,7 +324,7 @@ AcpiNsSearchParentTree (
/* Search the parent tree */
- DEBUG_PRINTP (TRACE_NAMES, ("Searching parent for %4.4s\n", &TargetName));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", &TargetName));
/*
* Search parents until found the target or we have backed up to
@@ -404,7 +404,7 @@ AcpiNsSearchAndEnter (
if (!Node || !TargetName || !ReturnNode)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Null param- Table %p Name %p Return %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param- Table %p Name %p Return %p\n",
Node, TargetName, ReturnNode));
REPORT_ERROR (("NsSearchAndEnter: bad (null) parameter\n"));
@@ -416,7 +416,7 @@ AcpiNsSearchAndEnter (
if (!AcpiUtValidAcpiName (TargetName))
{
- DEBUG_PRINTP (ACPI_ERROR, ("*** Bad character in name: %08lx *** \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "*** Bad character in name: %08lx *** \n",
TargetName));
REPORT_ERROR (("NsSearchAndEnter: Bad character in ACPI Name\n"));
@@ -480,7 +480,7 @@ AcpiNsSearchAndEnter (
*/
if (InterpreterMode == IMODE_EXECUTE)
{
- DEBUG_PRINTP (TRACE_NAMES, ("%4.4s Not found in %p [Not adding]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s Not found in %p [Not adding]\n",
&TargetName, Node));
return_ACPI_STATUS (AE_NOT_FOUND);
diff --git a/sys/contrib/dev/acpica/nsutils.c b/sys/contrib/dev/acpica/nsutils.c
index 7388fc308d86..c468b8fb7bfc 100644
--- a/sys/contrib/dev/acpica/nsutils.c
+++ b/sys/contrib/dev/acpica/nsutils.c
@@ -2,7 +2,7 @@
*
* Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
* parents and siblings and Scope manipulation
- * $Revision: 85 $
+ * $Revision: 86 $
*
*****************************************************************************/
@@ -437,12 +437,12 @@ AcpiNsBuildInternalName (
if (Info->FullyQualified)
{
- DEBUG_PRINTP (TRACE_EXEC, ("returning [%p] (abs) \"\\%s\"\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "returning [%p] (abs) \"\\%s\"\n",
InternalName, &InternalName[0]));
}
else
{
- DEBUG_PRINTP (TRACE_EXEC, ("returning [%p] (rel) \"%s\"\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "returning [%p] (rel) \"%s\"\n",
InternalName, &InternalName[2]));
}
@@ -808,14 +808,14 @@ AcpiNsTerminate (void)
}
AcpiNsDeleteChildren (ThisNode);
- DEBUG_PRINTP (ACPI_INFO, ("Namespace freed\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace freed\n"));
/*
* 2) Now we can delete the ACPI tables
*/
AcpiTbDeleteAcpiTables ();
- DEBUG_PRINTP (ACPI_INFO, ("ACPI Tables freed\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n"));
return_VOID;
}
@@ -922,7 +922,7 @@ AcpiNsGetNode (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_INFO, ("%s, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s, %s\n",
InternalPath, AcpiFormatException (Status)));
}
@@ -967,7 +967,7 @@ AcpiNsFindParentName (
ParentNode = AcpiNsGetParentObject (ChildNode);
if (ParentNode)
{
- DEBUG_PRINTP (TRACE_EXEC, ("Parent of %p [%4.4s] is %p [%4.4s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n",
ChildNode, &ChildNode->Name, ParentNode, &ParentNode->Name));
if (ParentNode->Name)
@@ -976,7 +976,7 @@ AcpiNsFindParentName (
}
}
- DEBUG_PRINTP (TRACE_EXEC, ("unable to find parent of %p (%4.4s)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n",
ChildNode, &ChildNode->Name));
}
diff --git a/sys/contrib/dev/acpica/nswalk.c b/sys/contrib/dev/acpica/nswalk.c
index 72a0a20078b8..71569bbdffeb 100644
--- a/sys/contrib/dev/acpica/nswalk.c
+++ b/sys/contrib/dev/acpica/nswalk.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
- * Module Name: nswalk - Functions for walking the APCI namespace
- * $Revision: 22 $
+ * Module Name: nswalk - Functions for walking the ACPI namespace
+ * $Revision: 23 $
*
*****************************************************************************/
diff --git a/sys/contrib/dev/acpica/nsxfobj.c b/sys/contrib/dev/acpica/nsxfobj.c
index 4f100a170ac4..c0bbeae2396a 100644
--- a/sys/contrib/dev/acpica/nsxfobj.c
+++ b/sys/contrib/dev/acpica/nsxfobj.c
@@ -2,7 +2,7 @@
*
* Module Name: nsxfobj - Public interfaces to the ACPI subsystem
* ACPI Object oriented interfaces
- * $Revision: 87 $
+ * $Revision: 88 $
*
******************************************************************************/
@@ -263,12 +263,12 @@ AcpiEvaluateObject (
if (!Pathname)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Both Handle and Pathname are NULL\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Both Handle and Pathname are NULL\n"));
}
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("Handle is NULL and Pathname is relative\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Handle is NULL and Pathname is relative\n"));
}
Status = AE_BAD_PARAMETER;
@@ -354,8 +354,8 @@ AcpiEvaluateObject (
* but return the buffer size needed
*/
- DEBUG_PRINTP (ACPI_INFO,
- ("Needed buffer size %X, received %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Needed buffer size %X, received %X\n",
BufferSpaceNeeded, UserBufferLength));
ReturnBuffer->Length = BufferSpaceNeeded;
diff --git a/sys/contrib/dev/acpica/psargs.c b/sys/contrib/dev/acpica/psargs.c
index bb26cbe7db4a..61482e59c970 100644
--- a/sys/contrib/dev/acpica/psargs.c
+++ b/sys/contrib/dev/acpica/psargs.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psargs - Parse AML opcode arguments
- * $Revision: 47 $
+ * $Revision: 50 $
*
*****************************************************************************/
@@ -398,7 +398,7 @@ AcpiPsGetNextNamepath (
NameOp->Node = (ACPI_NAMESPACE_NODE *) Op;
AcpiPsAppendArg (Arg, NameOp);
- *ArgCount = Count->Value.Integer &
+ *ArgCount = (UINT32) Count->Value.Integer &
METHOD_FLAGS_ARG_COUNT;
}
}
@@ -488,7 +488,7 @@ AcpiPsGetNextNamepath (
if (Node->Type == ACPI_TYPE_METHOD)
{
MethodNode = Node;
- DEBUG_PRINTP (TRACE_PARSE, ("method - %p Path=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "method - %p Path=%p\n",
MethodNode, Path));
NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
@@ -597,6 +597,17 @@ AcpiPsGetNextSimpleArg (
break;
+ case ARGP_QWORDDATA:
+
+ AcpiPsInitOp (Arg, AML_QWORD_OP);
+
+ /* Get 8 bytes from the AML stream */
+
+ MOVE_UNALIGNED64_TO_64 (&Arg->Value.Integer, ParserState->Aml);
+ ParserState->Aml += 8;
+ break;
+
+
case ARGP_CHARLIST:
AcpiPsInitOp (Arg, AML_STRING_OP);
diff --git a/sys/contrib/dev/acpica/psfind.c b/sys/contrib/dev/acpica/psfind.c
index c706b0c8f939..c81e324c9843 100644
--- a/sys/contrib/dev/acpica/psfind.c
+++ b/sys/contrib/dev/acpica/psfind.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: psfind - Parse tree search routine
- * $Revision: 24 $
+ * $Revision: 25 $
*
*****************************************************************************/
@@ -288,7 +288,7 @@ AcpiPsFind (
if (!Scope || !Path)
{
- DEBUG_PRINTP (TRACE_PARSE, ("Null path (%p) or scope (%p)!\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Null path (%p) or scope (%p)!\n",
Path, Scope));
return_PTR (NULL);
}
@@ -356,7 +356,7 @@ AcpiPsFind (
}
- DEBUG_PRINTP (TRACE_PARSE, ("Null path, returning current root scope Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Null path, returning current root scope Op=%p\n", Op));
return_PTR (Op);
break;
@@ -375,7 +375,7 @@ AcpiPsFind (
break;
}
- DEBUG_PRINTP (TRACE_PARSE, ("Search scope %p Segs=%d Opcode=%4.4X Create=%d\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Search scope %p Segs=%d Opcode=%4.4X Create=%d\n",
Scope, SegCount, Opcode, Create));
/* match each name segment */
@@ -398,7 +398,7 @@ AcpiPsFind (
Op = AcpiPsFindName (Scope, Name, NameOp);
if (Op)
{
- DEBUG_PRINTP (TRACE_PARSE, ("[%4.4s] Found! Op=%p Opcode=%4.4X\n", &Name, Op, Op->Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Found! Op=%p Opcode=%4.4X\n", &Name, Op, Op->Opcode));
}
if (!Op)
@@ -421,7 +421,7 @@ AcpiPsFind (
AcpiPsSetName (Op, Name);
AcpiPsAppendArg (Scope, Op);
- DEBUG_PRINTP (TRACE_PARSE, ("[%4.4s] Not found, created Op=%p Opcode=%4.4X\n", &Name, Op, Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Not found, created Op=%p Opcode=%4.4X\n", &Name, Op, Opcode));
}
}
@@ -435,19 +435,19 @@ AcpiPsFind (
Op = AcpiPsFindName (Scope, Name, Opcode);
if (Op)
{
- DEBUG_PRINTP (TRACE_PARSE, ("[%4.4s] Found in parent tree! Op=%p Opcode=%4.4X\n", &Name, Op, Op->Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Found in parent tree! Op=%p Opcode=%4.4X\n", &Name, Op, Op->Opcode));
}
else
{
- DEBUG_PRINTP (TRACE_PARSE, ("[%4.4s] Not found in parent=%p\n", &Name, Scope));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Not found in parent=%p\n", &Name, Scope));
}
}
}
else
{
- DEBUG_PRINTP (TRACE_PARSE, ("Segment [%4.4s] Not Found in scope %p!\n", &Name, Scope));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Segment [%4.4s] Not Found in scope %p!\n", &Name, Scope));
}
}
diff --git a/sys/contrib/dev/acpica/psopcode.c b/sys/contrib/dev/acpica/psopcode.c
index 26af8701cd9a..e17d4ccc3df4 100644
--- a/sys/contrib/dev/acpica/psopcode.c
+++ b/sys/contrib/dev/acpica/psopcode.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psopcode - Parser opcode information table
- * $Revision: 33 $
+ * $Revision: 35 $
*
*****************************************************************************/
@@ -554,7 +554,7 @@ static ACPI_OPCODE_INFO AmlOpInfo[] =
/* 71 */ /* AML_MOD_OP */ OP_INFO_ENTRY (ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS, "Mod", ARGP_MOD_OP, ARGI_MOD_OP),
/* 72 */ /* AML_CREATE_QWORD_FIELD_OP */ OP_INFO_ENTRY (ACPI_OP_TYPE_OPCODE | OPTYPE_CREATE_FIELD| AML_HAS_ARGS, "CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP),
/* 73 */ /* AML_TO_BUFFER_OP */ OP_INFO_ENTRY (ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS, "ToBuffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP),
-/* 74 */ /* AML_TO_DECSTR_OP */ OP_INFO_ENTRY (ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS, "ToDecString", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP),
+/* 74 */ /* AML_TO_DECSTR_OP */ OP_INFO_ENTRY (ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS, "ToDecimalString", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP),
/* 75 */ /* AML_TO_HEXSTR_OP */ OP_INFO_ENTRY (ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS, "ToHexString", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP),
/* 76 */ /* AML_TO_INTEGER_OP */ OP_INFO_ENTRY (ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS, "ToInteger", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP),
/* 77 */ /* AML_TO_STRING_OP */ OP_INFO_ENTRY (ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS, "ToString", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP),
@@ -701,13 +701,13 @@ AcpiPsGetOpcodeInfo (
/* This case is for the bogus opcodes LNOTEQUAL, LLESSEQUAL, LGREATEREQUAL */
/* TBD: [Investigate] remove this case? */
- DEBUG_PRINTP (ACPI_ERROR, ("Bad multi-byte opcode=%X\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad multi-byte opcode=%X\n", Opcode));
break;
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown extended opcode=%X\n", Opcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown extended opcode=%X\n", Opcode));
break;
}
diff --git a/sys/contrib/dev/acpica/psparse.c b/sys/contrib/dev/acpica/psparse.c
index 6e18ccc998c4..9defbbefe193 100644
--- a/sys/contrib/dev/acpica/psparse.c
+++ b/sys/contrib/dev/acpica/psparse.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
- * $Revision: 87 $
+ * $Revision: 89 $
*
*****************************************************************************/
@@ -664,12 +664,12 @@ AcpiPsParseLoop (
{
if (Status == AE_AML_NO_RETURN_VALUE)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Invoked method did not return a value, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Invoked method did not return a value, %s\n",
AcpiFormatException (Status)));
}
- DEBUG_PRINTP (ACPI_ERROR, ("GetPredicate Failed, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "GetPredicate Failed, %s\n",
AcpiFormatException (Status)));
return_ACPI_STATUS (Status);
}
@@ -678,7 +678,7 @@ AcpiPsParseLoop (
}
AcpiPsPopScope (ParserState, &Op, &ArgTypes, &ArgCount);
- DEBUG_PRINTP (TRACE_PARSE, ("Popped scope, Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", Op));
}
else if (WalkState->PrevOp)
@@ -737,8 +737,8 @@ AcpiPsParseLoop (
/* The opcode is unrecognized. Just skip unknown opcodes */
- DEBUG_PRINTP (ACPI_ERROR,
- ("Found unknown opcode %lX at AML offset %X, ignoring\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Found unknown opcode %lX at AML offset %X, ignoring\n",
Opcode, AmlOffset));
DUMP_BUFFER (ParserState->Aml, 128);
@@ -879,8 +879,8 @@ AcpiPsParseLoop (
if (OpInfo)
{
- DEBUG_PRINTP (TRACE_PARSE,
- ("Op=%p Opcode=%4.4lX Aml %p Oft=%5.5lX\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Op=%p Opcode=%4.4lX Aml %p Oft=%5.5lX\n",
Op, Op->Opcode, ParserState->Aml, Op->AmlOffset));
}
}
@@ -900,6 +900,7 @@ AcpiPsParseLoop (
case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
case AML_WORD_OP: /* AML_WORDDATA_ARG */
case AML_DWORD_OP: /* AML_DWORDATA_ARG */
+ case AML_QWORD_OP: /* AML_QWORDATA_ARG */
case AML_STRING_OP: /* AML_ASCIICHARLIST_ARG */
/* fill in constant or string argument directly */
@@ -1120,7 +1121,7 @@ CloseThisOp:
if (AcpiPsHasCompletedScope (ParserState))
{
AcpiPsPopScope (ParserState, &Op, &ArgTypes, &ArgCount);
- DEBUG_PRINTP (TRACE_PARSE, ("Popped scope, Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", Op));
}
else
@@ -1151,7 +1152,7 @@ CloseThisOp:
* sequential closing braces). We want to terminate each one cleanly.
*/
- DEBUG_PRINTP (TRACE_PARSE, ("Package complete at Op %p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Package complete at Op %p\n", Op));
do
{
if (Op)
@@ -1242,7 +1243,7 @@ AcpiPsParseAml (
FUNCTION_TRACE ("PsParseAml");
- DEBUG_PRINTP (TRACE_PARSE, ("Entered with Scope=%p Aml=%p size=%lX\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Entered with Scope=%p Aml=%p size=%lX\n",
StartScope, Aml, AmlSize));
@@ -1334,7 +1335,7 @@ AcpiPsParseAml (
* handles nested control method invocations without recursion.
*/
- DEBUG_PRINTP (TRACE_PARSE, ("State=%p\n", WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "State=%p\n", WalkState));
while (WalkState)
{
@@ -1343,8 +1344,8 @@ AcpiPsParseAml (
Status = AcpiPsParseLoop (WalkState);
}
- DEBUG_PRINTP (TRACE_PARSE,
- ("Completed one call to walk loop, State=%p\n", WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Completed one call to walk loop, State=%p\n", WalkState));
if (Status == AE_CTRL_TRANSFER)
{
@@ -1378,7 +1379,7 @@ AcpiPsParseAml (
ReturnDesc = WalkState->ReturnDesc;
- DEBUG_PRINTP (TRACE_PARSE, ("ReturnValue=%p, State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "ReturnValue=%p, State=%p\n",
WalkState->ReturnDesc, WalkState));
/* Reset the current scope to the beginning of scope stack */
diff --git a/sys/contrib/dev/acpica/psscope.c b/sys/contrib/dev/acpica/psscope.c
index ff1148f027da..b8211ebe3f80 100644
--- a/sys/contrib/dev/acpica/psscope.c
+++ b/sys/contrib/dev/acpica/psscope.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psscope - Parser scope stack management routines
- * $Revision: 27 $
+ * $Revision: 28 $
*
*****************************************************************************/
@@ -328,7 +328,7 @@ AcpiPsPopScope (
}
- DEBUG_PRINTP (TRACE_PARSE, ("Popped Op %p Args %X\n", *Op, *ArgCount));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped Op %p Args %X\n", *Op, *ArgCount));
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/psutils.c b/sys/contrib/dev/acpica/psutils.c
index 01e9dec6252b..39d7633868ac 100644
--- a/sys/contrib/dev/acpica/psutils.c
+++ b/sys/contrib/dev/acpica/psutils.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psutils - Parser miscellaneous utilities (Parser only)
- * $Revision: 38 $
+ * $Revision: 40 $
*
*****************************************************************************/
@@ -185,8 +185,6 @@ AcpiPsAllocOp (
UINT8 Flags;
- PROC_NAME ("PsAllocOp");
-
/* Allocate the minimum required size object */
@@ -215,85 +213,23 @@ AcpiPsAllocOp (
}
+
if (Size == sizeof (ACPI_PARSE_OBJECT))
{
/*
- * The generic op is by far the most common (16 to 1), and therefore
- * the op cache is implemented with this type.
- *
- * Check if there is an Op already available in the cache
+ * The generic op is by far the most common (16 to 1)
*/
-
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
- AcpiGbl_ParseCacheRequests++;
- if (AcpiGbl_ParseCache)
- {
- /* Extract an op from the front of the cache list */
-
- AcpiGbl_ParseCacheDepth--;
- AcpiGbl_ParseCacheHits++;
-
- Op = AcpiGbl_ParseCache;
- AcpiGbl_ParseCache = Op->Next;
-
- if (Op->DataType == 0xFF)
- {
- DEBUG_PRINTP (ACPI_ERROR, ("Op %p deleted while in cache!\n", Op));
- }
-
- /* Clear the previously used Op */
-
- MEMSET (Op, 0, sizeof (ACPI_PARSE_OBJECT));
-
- DEBUG_PRINTP (TRACE_PARSE, ("Op %p from Parse Cache\n", Op));
- }
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
+ Op = AcpiUtAcquireFromCache (ACPI_MEM_LIST_PSNODE);
}
else
{
- /*
- * The generic op is by far the most common (16 to 1), and therefore
- * the op cache is implemented with this type.
- *
- * Check if there is an Op already available in the cache
- */
-
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
- AcpiGbl_ExtParseCacheRequests++;
- if (AcpiGbl_ExtParseCache)
- {
- /* Extract an op from the front of the cache list */
-
- AcpiGbl_ExtParseCacheDepth--;
- AcpiGbl_ExtParseCacheHits++;
-
- Op = (ACPI_PARSE_OBJECT *) AcpiGbl_ExtParseCache;
- AcpiGbl_ExtParseCache = (ACPI_PARSE2_OBJECT *) Op->Next;
-
- if (Op->DataType == 0xFF)
- {
- DEBUG_PRINTP (ACPI_ERROR, ("Op %p deleted while in cache!\n", Op));
- }
-
- /* Clear the previously used Op */
-
- MEMSET (Op, 0, sizeof (ACPI_PARSE2_OBJECT));
-
- DEBUG_PRINTP (TRACE_PARSE, ("Op %p from ExtParse Cache\n", Op));
- }
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
+ Op = AcpiUtAcquireFromCache (ACPI_MEM_LIST_PSNODE_EXT);
}
- /* Allocate a new Op if necessary */
-
- if (!Op)
- {
- Op = ACPI_MEM_CALLOCATE (Size);
- }
-
/* Initialize the Op */
+
if (Op)
{
AcpiPsInitOp (Op, Opcode);
@@ -326,62 +262,18 @@ AcpiPsFreeOp (
if (Op->Opcode == AML_INT_RETURN_VALUE_OP)
{
- DEBUG_PRINTP (ACPI_INFO, ("Free retval op: %p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Free retval op: %p\n", Op));
}
if (Op->Flags == PARSEOP_GENERIC)
{
- /* Is the cache full? */
-
- if (AcpiGbl_ParseCacheDepth < MAX_PARSE_CACHE_DEPTH)
- {
- /* Put a GENERIC_OP back into the cache */
-
- /* Clear the previously used Op */
-
- MEMSET (Op, 0, sizeof (ACPI_PARSE_OBJECT));
- Op->Flags = PARSEOP_IN_CACHE;
-
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
- AcpiGbl_ParseCacheDepth++;
-
- Op->Next = AcpiGbl_ParseCache;
- AcpiGbl_ParseCache = Op;
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
- return;
- }
+ AcpiUtReleaseToCache (ACPI_MEM_LIST_PSNODE, Op);
}
else
{
- /* Is the cache full? */
-
- if (AcpiGbl_ExtParseCacheDepth < MAX_EXTPARSE_CACHE_DEPTH)
- {
- /* Put a GENERIC_OP back into the cache */
-
- /* Clear the previously used Op */
-
- MEMSET (Op, 0, sizeof (ACPI_PARSE2_OBJECT));
- Op->Flags = PARSEOP_IN_CACHE;
-
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
- AcpiGbl_ExtParseCacheDepth++;
-
- Op->Next = (ACPI_PARSE_OBJECT *) AcpiGbl_ExtParseCache;
- AcpiGbl_ExtParseCache = (ACPI_PARSE2_OBJECT *) Op;
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
- return;
- }
+ AcpiUtReleaseToCache (ACPI_MEM_LIST_PSNODE_EXT, Op);
}
-
-
- /*
- * Not a GENERIC OP, or the cache is full, just free the Op
- */
- ACPI_MEM_FREE (Op);
}
@@ -401,38 +293,11 @@ void
AcpiPsDeleteParseCache (
void)
{
- ACPI_PARSE_OBJECT *Next;
-
-
FUNCTION_TRACE ("PsDeleteParseCache");
- /* Traverse the global cache list */
-
- while (AcpiGbl_ParseCache)
- {
- /* Delete one cached state object */
-
- Next = AcpiGbl_ParseCache->Next;
- ACPI_MEM_FREE (AcpiGbl_ParseCache);
-
- AcpiGbl_ParseCache = Next;
- AcpiGbl_ParseCacheDepth--;
- }
-
- /* Traverse the global cache list */
-
- while (AcpiGbl_ExtParseCache)
- {
- /* Delete one cached state object */
-
- Next = AcpiGbl_ExtParseCache->Next;
- ACPI_MEM_FREE (AcpiGbl_ExtParseCache);
-
- AcpiGbl_ExtParseCache = (ACPI_PARSE2_OBJECT *) Next;
- AcpiGbl_ExtParseCacheDepth--;
- }
-
+ AcpiUtDeleteGenericCache (ACPI_MEM_LIST_PSNODE);
+ AcpiUtDeleteGenericCache (ACPI_MEM_LIST_PSNODE_EXT);
return_VOID;
}
@@ -592,6 +457,7 @@ AcpiPsIsDeferredOp (
{
return ((BOOLEAN)
(Opcode == AML_METHOD_OP ||
+ Opcode == AML_VAR_PACKAGE_OP ||
Opcode == AML_CREATE_FIELD_OP ||
Opcode == AML_CREATE_BIT_FIELD_OP ||
Opcode == AML_CREATE_BYTE_FIELD_OP ||
diff --git a/sys/contrib/dev/acpica/psxface.c b/sys/contrib/dev/acpica/psxface.c
index f794deea360c..2ba98ec9eca7 100644
--- a/sys/contrib/dev/acpica/psxface.c
+++ b/sys/contrib/dev/acpica/psxface.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psxface - Parser external interfaces
- * $Revision: 45 $
+ * $Revision: 46 $
*
*****************************************************************************/
@@ -199,8 +199,8 @@ AcpiPsxExecute (
* Perform the first pass parse of the method to enter any
* named objects that it creates into the namespace
*/
- DEBUG_PRINTP (ACPI_INFO,
- ("**** Begin Method Execution **** Entry=%p obj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "**** Begin Method Execution **** Entry=%p obj=%p\n",
MethodNode, ObjDesc));
/* Create and init a Root Node */
@@ -259,7 +259,7 @@ AcpiPsxExecute (
*/
if (*ReturnObjDesc)
{
- DEBUG_PRINTP (ACPI_INFO, ("Method returned ObjDesc=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method returned ObjDesc=%X\n",
*ReturnObjDesc));
DUMP_STACK_ENTRY (*ReturnObjDesc);
diff --git a/sys/contrib/dev/acpica/rscreate.c b/sys/contrib/dev/acpica/rscreate.c
index 3114414d033a..a01a47bd1869 100644
--- a/sys/contrib/dev/acpica/rscreate.c
+++ b/sys/contrib/dev/acpica/rscreate.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rscreate - Create resource lists/tables
- * $Revision: 34 $
+ * $Revision: 35 $
*
******************************************************************************/
@@ -161,7 +161,7 @@ AcpiRsCreateResourceList (
FUNCTION_TRACE ("RsCreateResourceList");
- DEBUG_PRINTP (VERBOSE_INFO, ("ByteStreamBuffer = %p\n", ByteStreamBuffer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ByteStreamBuffer = %p\n", ByteStreamBuffer));
/*
* Params already validated, so we don't re-validate here
@@ -177,7 +177,7 @@ AcpiRsCreateResourceList (
Status = AcpiRsCalculateListLength (ByteStreamStart, ByteStreamBufferLength,
&ListSizeNeeded);
- DEBUG_PRINTP (VERBOSE_INFO, ("Status=%X ListSizeNeeded=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status=%X ListSizeNeeded=%X\n",
Status, ListSizeNeeded));
/*
@@ -211,7 +211,7 @@ AcpiRsCreateResourceList (
return_ACPI_STATUS (Status);
}
- DEBUG_PRINTP (VERBOSE_INFO, ("OutputBuffer = %p\n", OutputBuffer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer = %p\n", OutputBuffer));
}
else
@@ -277,7 +277,7 @@ AcpiRsCreatePciRoutingTable (
return_ACPI_STATUS (Status);
}
- DEBUG_PRINTP (VERBOSE_INFO, ("BufferSizeNeeded = %X\n", BufferSizeNeeded));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "BufferSizeNeeded = %X\n", BufferSizeNeeded));
/*
* If the data will fit into the available buffer
@@ -344,7 +344,7 @@ AcpiRsCreatePciRoutingTable (
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("Need Integer, found %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n",
AcpiUtGetTypeName ((*SubObjectList)->Common.Type)));
return_ACPI_STATUS (AE_BAD_DATA);
}
@@ -361,7 +361,7 @@ AcpiRsCreatePciRoutingTable (
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("Need Integer, found %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n",
AcpiUtGetTypeName ((*SubObjectList)->Common.Type)));
return_ACPI_STATUS (AE_BAD_DATA);
}
@@ -377,7 +377,7 @@ AcpiRsCreatePciRoutingTable (
if ((*SubObjectList)->Reference.Opcode != AML_INT_NAMEPATH_OP)
{
- DEBUG_PRINTP (ACPI_ERROR, ("Need name, found reference op %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need name, found reference op %X\n",
(*SubObjectList)->Reference.Opcode));
return_ACPI_STATUS (AE_BAD_DATA);
}
@@ -421,7 +421,7 @@ AcpiRsCreatePciRoutingTable (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Need Integer, found %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n",
AcpiUtGetTypeName ((*SubObjectList)->Common.Type)));
return_ACPI_STATUS (AE_BAD_DATA);
break;
@@ -443,7 +443,7 @@ AcpiRsCreatePciRoutingTable (
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("Need Integer, found %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n",
AcpiUtGetTypeName ((*SubObjectList)->Common.Type)));
return_ACPI_STATUS (AE_BAD_DATA);
}
@@ -454,7 +454,7 @@ AcpiRsCreatePciRoutingTable (
TopObjectList++;
}
- DEBUG_PRINTP (VERBOSE_INFO, ("OutputBuffer = %p\n", OutputBuffer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer = %p\n", OutputBuffer));
}
else
@@ -504,7 +504,7 @@ AcpiRsCreateByteStream (
FUNCTION_TRACE ("RsCreateByteStream");
- DEBUG_PRINTP (VERBOSE_INFO, ("LinkedListBuffer = %p\n", LinkedListBuffer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "LinkedListBuffer = %p\n", LinkedListBuffer));
/*
* Params already validated, so we don't re-validate here
@@ -515,7 +515,7 @@ AcpiRsCreateByteStream (
Status = AcpiRsCalculateByteStreamLength (LinkedListBuffer,
&ByteStreamSizeNeeded);
- DEBUG_PRINTP (VERBOSE_INFO, ("ByteStreamSizeNeeded=%X, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ByteStreamSizeNeeded=%X, %s\n",
ByteStreamSizeNeeded, AcpiFormatException (Status)));
/*
@@ -549,7 +549,7 @@ AcpiRsCreateByteStream (
return_ACPI_STATUS (Status);
}
- DEBUG_PRINTP (VERBOSE_INFO, ("OutputBuffer = %p\n", OutputBuffer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer = %p\n", OutputBuffer));
}
else
diff --git a/sys/contrib/dev/acpica/rsdump.c b/sys/contrib/dev/acpica/rsdump.c
index d820758134d5..6cf7e35ced43 100644
--- a/sys/contrib/dev/acpica/rsdump.c
+++ b/sys/contrib/dev/acpica/rsdump.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsdump - Functions to display the resource structures.
- * $Revision: 20 $
+ * $Revision: 21 $
*
******************************************************************************/
@@ -1046,7 +1046,7 @@ AcpiRsDumpResourceList (
BOOLEAN Done = FALSE;
- if (AcpiDbgLevel & TRACE_RESOURCES && _COMPONENT & AcpiDbgLayer)
+ if (AcpiDbgLevel & ACPI_LV_RESOURCES && _COMPONENT & AcpiDbgLayer)
{
while (!Done)
{
@@ -1152,7 +1152,7 @@ AcpiRsDumpIrqList (
PCI_ROUTING_TABLE *PrtElement;
- if (AcpiDbgLevel & TRACE_RESOURCES && _COMPONENT & AcpiDbgLayer)
+ if (AcpiDbgLevel & ACPI_LV_RESOURCES && _COMPONENT & AcpiDbgLayer)
{
PrtElement = (PCI_ROUTING_TABLE *) Buffer;
diff --git a/sys/contrib/dev/acpica/rsutils.c b/sys/contrib/dev/acpica/rsutils.c
index dcdd7877b09b..85ccd221c131 100644
--- a/sys/contrib/dev/acpica/rsutils.c
+++ b/sys/contrib/dev/acpica/rsutils.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsutils - Utilities for the resource manager
- * $Revision: 20 $
+ * $Revision: 21 $
*
******************************************************************************/
@@ -174,7 +174,7 @@ AcpiRsGetPrtMethodData (
{
/* Return object is required */
- DEBUG_PRINTP (ACPI_ERROR, ("No object was returned from _PRT\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _PRT\n"));
return_ACPI_STATUS (AE_TYPE);
}
@@ -261,7 +261,7 @@ AcpiRsGetCrsMethodData (
{
/* Return object is required */
- DEBUG_PRINTP (ACPI_ERROR, ("No object was returned from _CRS\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _CRS\n"));
return_ACPI_STATUS (AE_TYPE);
}
@@ -348,7 +348,7 @@ AcpiRsGetPrsMethodData (
{
/* Return object is required */
- DEBUG_PRINTP (ACPI_ERROR, ("No object was returned from _PRS\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _PRS\n"));
return_ACPI_STATUS (AE_TYPE);
}
diff --git a/sys/contrib/dev/acpica/tbconvrt.c b/sys/contrib/dev/acpica/tbconvrt.c
index c6abe04c1d73..5bdddc1262bf 100644
--- a/sys/contrib/dev/acpica/tbconvrt.c
+++ b/sys/contrib/dev/acpica/tbconvrt.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbconvrt - ACPI Table conversion utilities
- * $Revision: 24 $
+ * $Revision: 25 $
*
*****************************************************************************/
@@ -572,8 +572,8 @@ AcpiTbConvertTableFadt (void)
/* Dump the entire FADT */
- DEBUG_PRINT (TRACE_TABLES,
- ("Hex dump of common internal FADT, size %ld (%lX)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
+ "Hex dump of common internal FADT, size %ld (%lX)\n",
AcpiGbl_FADT->header.Length, AcpiGbl_FADT->header.Length));
DUMP_BUFFER ((UINT8 *) (AcpiGbl_FADT), AcpiGbl_FADT->header.Length);
diff --git a/sys/contrib/dev/acpica/tbget.c b/sys/contrib/dev/acpica/tbget.c
index 9c326c6d36bc..7b8aa878f230 100644
--- a/sys/contrib/dev/acpica/tbget.c
+++ b/sys/contrib/dev/acpica/tbget.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbget - ACPI Table get* routines
- * $Revision: 51 $
+ * $Revision: 52 $
*
*****************************************************************************/
@@ -337,7 +337,7 @@ AcpiTbGetAllTables (
FUNCTION_TRACE ("TbGetAllTables");
- DEBUG_PRINT (ACPI_INFO, ("Number of tables: %d\n", NumberOfTables));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Number of tables: %d\n", NumberOfTables));
/*
@@ -462,13 +462,13 @@ AcpiTbGetAllTables (
/* Dump the DSDT Header */
- DEBUG_PRINT (TRACE_TABLES, ("Hex dump of DSDT Header:\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Hex dump of DSDT Header:\n"));
DUMP_BUFFER ((UINT8 *) AcpiGbl_DSDT, sizeof (ACPI_TABLE_HEADER));
/* Dump the entire DSDT */
- DEBUG_PRINT (TRACE_TABLES,
- ("Hex dump of DSDT (After header), size %d (%x)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
+ "Hex dump of DSDT (After header), size %d (%x)\n",
AcpiGbl_DSDT->Length, AcpiGbl_DSDT->Length));
DUMP_BUFFER ((UINT8 *) (AcpiGbl_DSDT + 1), AcpiGbl_DSDT->Length);
@@ -634,6 +634,8 @@ AcpiTbValidateRsdt (
{
UINT32 NoMatch;
+ PROC_NAME ("TbValidateRsdt");
+
/*
* For RSDP revision 0 or 1, we use the RSDT.
@@ -659,8 +661,8 @@ AcpiTbValidateRsdt (
DUMP_BUFFER (AcpiGbl_RSDP, 20);
- DEBUG_PRINT_RAW (ACPI_ERROR,
- ("RSDT/XSDT signature at %X is invalid\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR,
+ "RSDT/XSDT signature at %X is invalid\n",
AcpiGbl_RSDP->RsdtPhysicalAddress));
return (AE_BAD_SIGNATURE);
@@ -742,8 +744,8 @@ AcpiTbGetTableRsdt (
* Get the RSDT from the RSDP
*/
- DEBUG_PRINTP (ACPI_INFO,
- ("RSDP located at %p, RSDT physical=%8.8lX%8.8lX \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "RSDP located at %p, RSDT physical=%8.8lX%8.8lX \n",
AcpiGbl_RSDP, HIDWORD(AcpiGbl_RSDP->RsdtPhysicalAddress),
LODWORD(AcpiGbl_RSDP->RsdtPhysicalAddress)));
@@ -756,7 +758,7 @@ AcpiTbGetTableRsdt (
Status = AcpiTbGetTable (PhysicalAddress, NULL, &TableInfo);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Could not get the RSDT, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not get the RSDT, %s\n",
AcpiFormatException (Status)));
return_ACPI_STATUS (Status);
}
@@ -796,7 +798,7 @@ AcpiTbGetTableRsdt (
AcpiGbl_XSDT = (XSDT_DESCRIPTOR *) TableInfo.Pointer;
- DEBUG_PRINTP (ACPI_INFO, ("XSDT located at %p\n", AcpiGbl_XSDT));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "XSDT located at %p\n", AcpiGbl_XSDT));
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/tbinstal.c b/sys/contrib/dev/acpica/tbinstal.c
index 9981f616a3a7..64c9e99c44ce 100644
--- a/sys/contrib/dev/acpica/tbinstal.c
+++ b/sys/contrib/dev/acpica/tbinstal.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbinstal - ACPI table installation and removal
- * $Revision: 40 $
+ * $Revision: 41 $
*
*****************************************************************************/
@@ -170,7 +170,7 @@ AcpiTbInstallTable (
Status = AcpiTbInitTableDescriptor (TableInfo->Type, TableInfo);
- DEBUG_PRINTP (ACPI_INFO, ("%s located at %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s located at %p\n",
AcpiGbl_AcpiTableData[TableInfo->Type].Name, TableInfo->Pointer));
AcpiUtReleaseMutex (ACPI_MTX_TABLES);
@@ -241,7 +241,7 @@ AcpiTbRecognizeTable (
TableType = i;
Status = AcpiGbl_AcpiTableData[i].Status;
- DEBUG_PRINTP (ACPI_INFO, ("Found %4.4s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Found %4.4s\n",
AcpiGbl_AcpiTableData[i].Signature));
break;
}
@@ -273,8 +273,8 @@ AcpiTbRecognizeTable (
if (Status == AE_SUPPORT)
{
- DEBUG_PRINTP (ACPI_INFO,
- ("Unsupported table %s (Type %X) was found and discarded\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Unsupported table %s (Type %X) was found and discarded\n",
AcpiGbl_AcpiTableData[TableType].Name, TableType));
}
diff --git a/sys/contrib/dev/acpica/tbutils.c b/sys/contrib/dev/acpica/tbutils.c
index dcad455afcb9..a8252da87ad4 100644
--- a/sys/contrib/dev/acpica/tbutils.c
+++ b/sys/contrib/dev/acpica/tbutils.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbutils - Table manipulation utilities
- * $Revision: 38 $
+ * $Revision: 39 $
*
*****************************************************************************/
@@ -146,6 +146,8 @@ AcpiTbHandleToObject (
UINT32 i;
ACPI_TABLE_DESC *ListHead;
+ PROC_NAME ("TbHandleToObject");
+
for (i = 0; i < ACPI_TABLE_MAX; i++)
{
@@ -164,7 +166,7 @@ AcpiTbHandleToObject (
}
- DEBUG_PRINT (ACPI_ERROR, ("TableId=%X does not exist\n", TableId));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "TableId=%X does not exist\n", TableId));
return (AE_BAD_PARAMETER);
}
@@ -284,8 +286,8 @@ AcpiTbValidateTableHeader (
if (!AcpiOsReadable (TableHeader, sizeof (ACPI_TABLE_HEADER)))
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Cannot read table header at %p\n", TableHeader));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Cannot read table header at %p\n", TableHeader));
return (AE_BAD_ADDRESS);
}
@@ -295,8 +297,8 @@ AcpiTbValidateTableHeader (
MOVE_UNALIGNED32_TO_32 (&Signature, &TableHeader->Signature);
if (!AcpiUtValidAcpiName (Signature))
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Table signature at %p [%X] has invalid characters\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Table signature at %p [%X] has invalid characters\n",
TableHeader, &Signature));
REPORT_WARNING (("Invalid table signature %4.4s found\n", &Signature));
@@ -309,8 +311,8 @@ AcpiTbValidateTableHeader (
if (TableHeader->Length < sizeof (ACPI_TABLE_HEADER))
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Invalid length in table header %p name %4.4s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Invalid length in table header %p name %4.4s\n",
TableHeader, &Signature));
REPORT_WARNING (("Invalid table header length found\n"));
@@ -349,6 +351,9 @@ AcpiTbMapAcpiTable (
ACPI_STATUS Status = AE_OK;
+ PROC_NAME ("TbMapAcpiTable");
+
+
/* If size is zero, look at the table header to get the actual size */
if ((*Size) == 0)
@@ -394,8 +399,8 @@ AcpiTbMapAcpiTable (
return (Status);
}
- DEBUG_PRINT (ACPI_INFO,
- ("Mapped memory for ACPI table, length=%d(%X) at %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Mapped memory for ACPI table, length=%d(%X) at %p\n",
TableSize, TableSize, Table));
*Size = TableSize;
diff --git a/sys/contrib/dev/acpica/tbxface.c b/sys/contrib/dev/acpica/tbxface.c
index 83f9269e22fd..76f6ec893f61 100644
--- a/sys/contrib/dev/acpica/tbxface.c
+++ b/sys/contrib/dev/acpica/tbxface.c
@@ -2,7 +2,7 @@
*
* Module Name: tbxface - Public interfaces to the ACPI subsystem
* ACPI table oriented interfaces
- * $Revision: 41 $
+ * $Revision: 42 $
*
*****************************************************************************/
@@ -201,7 +201,7 @@ AcpiLoadTables (void)
goto ErrorExit;
}
- DEBUG_PRINTP (ACPI_OK, ("ACPI Tables successfully loaded\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_OK, "ACPI Tables successfully loaded\n"));
/* Load the namespace from the tables */
diff --git a/sys/contrib/dev/acpica/tbxfroot.c b/sys/contrib/dev/acpica/tbxfroot.c
index 0299e5faa345..f6e5f408f1de 100644
--- a/sys/contrib/dev/acpica/tbxfroot.c
+++ b/sys/contrib/dev/acpica/tbxfroot.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbxfroot - Find the root ACPI table (RSDT)
- * $Revision: 46 $
+ * $Revision: 47 $
*
*****************************************************************************/
@@ -157,7 +157,7 @@ AcpiFindRootPointer (
Status = AcpiTbFindRsdp (&TableInfo, Flags);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("RSDP structure not found\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "RSDP structure not found\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -206,14 +206,14 @@ AcpiTbScanMemoryForRsdp (
{
/* If so, we have found the RSDP */
- DEBUG_PRINTP (ACPI_INFO,
- ("RSDP located at physical address %p\n",MemRover));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "RSDP located at physical address %p\n",MemRover));
return_PTR (MemRover);
}
}
/* Searched entire block, no RSDP was found */
- DEBUG_PRINTP (ACPI_INFO,("Searched entire block, no RSDP was found.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,"Searched entire block, no RSDP was found.\n"));
return_PTR (NULL);
}
@@ -412,14 +412,14 @@ AcpiGetFirmwareTable (
Status = AcpiOsGetRootPointer (Flags, &PhysicalAddress);
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_INFO, ("RSDP not found\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RSDP not found\n"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
AcpiGbl_RSDP = (RSDP_DESCRIPTOR *) (ACPI_TBLPTR) PhysicalAddress;
- DEBUG_PRINTP (ACPI_INFO,
- ("RSDP located at %p, RSDT physical=%8.8lX%8.8lX \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "RSDP located at %p, RSDT physical=%8.8lX%8.8lX \n",
AcpiGbl_RSDP, HIDWORD(AcpiGbl_RSDP->RsdtPhysicalAddress),
LODWORD(AcpiGbl_RSDP->RsdtPhysicalAddress)));
diff --git a/sys/contrib/dev/acpica/utalloc.c b/sys/contrib/dev/acpica/utalloc.c
index 9b7a1703c934..7485797a0c83 100644
--- a/sys/contrib/dev/acpica/utalloc.c
+++ b/sys/contrib/dev/acpica/utalloc.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
- * Module Name: utalloc - local memory allocation routines
- * $Revision: 93 $
+ * Module Name: utalloc - local cache and memory allocation routines
+ * $Revision: 95 $
*
*****************************************************************************/
@@ -126,12 +126,165 @@
MODULE_NAME ("utalloc")
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiUtReleaseToCache
+ *
+ * PARAMETERS: ListId - Memory list/cache ID
+ * Object - The object to be released
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Release an object to the specified cache. If cache is full,
+ * the object is deleted.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtReleaseToCache (
+ UINT32 ListId,
+ void *Object)
+{
+ ACPI_MEMORY_LIST *CacheInfo;
+
+
+ /* If walk cache is full, just free this wallkstate object */
+
+ CacheInfo = &AcpiGbl_MemoryLists[ListId];
+ if (CacheInfo->CacheDepth >= CacheInfo->MaxCacheDepth)
+ {
+ ACPI_MEM_FREE (Object);
+ ACPI_MEM_TRACKING (CacheInfo->TotalFreed++);
+ }
+
+ /* Otherwise put this object back into the cache */
+
+ else
+ {
+ AcpiUtAcquireMutex (ACPI_MTX_CACHES);
+
+ /* Mark the object as cached */
+
+ MEMSET (Object, 0xCA, CacheInfo->ObjectSize);
+
+ /* Put the object at the head of the cache list */
+
+ * (char **) (((char *) Object) + CacheInfo->LinkOffset) = CacheInfo->ListHead;
+ CacheInfo->ListHead = Object;
+ CacheInfo->CacheDepth++;
+
+ AcpiUtReleaseMutex (ACPI_MTX_CACHES);
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiUtAcquireFromCache
+ *
+ * PARAMETERS: ListId - Memory list ID
+ *
+ * RETURN: A requested object. NULL if the object could not be
+ * allocated.
+ *
+ * DESCRIPTION: Get an object from the specified cache. If cache is empty,
+ * the object is allocated.
+ *
+ ******************************************************************************/
+
+void *
+AcpiUtAcquireFromCache (
+ UINT32 ListId)
+{
+ ACPI_MEMORY_LIST *CacheInfo;
+ void *Object;
+
+
+ PROC_NAME ("AcpiUtAcquireFromCache");
+
+ CacheInfo = &AcpiGbl_MemoryLists[ListId];
+ AcpiUtAcquireMutex (ACPI_MTX_CACHES);
+ ACPI_MEM_TRACKING (CacheInfo->CacheRequests++);
+
+ /* Check the cache first */
+
+ if (CacheInfo->ListHead)
+ {
+ /* There is an object available, use it */
+
+ Object = CacheInfo->ListHead;
+ CacheInfo->ListHead = * (char **) (((char *) Object) + CacheInfo->LinkOffset);
+
+ ACPI_MEM_TRACKING (CacheInfo->CacheHits++);
+ CacheInfo->CacheDepth--;
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p from cache %d\n", Object, ListId));
+
+ AcpiUtReleaseMutex (ACPI_MTX_CACHES);
+
+ /* Clear (zero) the previously used Object */
+
+ MEMSET (Object, 0, CacheInfo->ObjectSize);
+ }
+
+ else
+ {
+ /* The cache is empty, create a new object */
+
+ /* Avoid deadlock with ACPI_MEM_CALLOCATE */
+
+ AcpiUtReleaseMutex (ACPI_MTX_CACHES);
+
+ Object = ACPI_MEM_CALLOCATE (CacheInfo->ObjectSize);
+ ACPI_MEM_TRACKING (CacheInfo->TotalAllocated++);
+ }
+
+ return (Object);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiUtDeleteGenericCache
+ *
+ * PARAMETERS: ListId - Memory list ID
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Free all objects within the requested cache.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtDeleteGenericCache (
+ UINT32 ListId)
+{
+ ACPI_MEMORY_LIST *CacheInfo;
+ char *Next;
+
+
+ CacheInfo = &AcpiGbl_MemoryLists[ListId];
+ while (CacheInfo->ListHead)
+ {
+ /* Delete one cached state object */
+
+ Next = * (char **) (((char *) CacheInfo->ListHead) + CacheInfo->LinkOffset);
+ ACPI_MEM_FREE (CacheInfo->ListHead);
+
+ CacheInfo->ListHead = Next;
+ CacheInfo->CacheDepth--;
+ }
+}
+
+
+
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
/*
- * This module is used for tracking memory leaks in the subsystem, and it
- * gets compiled out when the ACPI_DBG_TRACK_ALLOCATIONS is not set.
+ * These procedures are used for tracking memory leaks in the subsystem, and
+ * they get compiled out when the ACPI_DBG_TRACK_ALLOCATIONS is not set.
*
* Each memory allocation is tracked via a doubly linked list. Each
* element contains the caller's component, module name, function name, and
@@ -153,18 +306,26 @@
*
******************************************************************************/
-ACPI_ALLOCATION_INFO *
+ACPI_DEBUG_MEM_BLOCK *
AcpiUtSearchAllocList (
+ UINT32 ListId,
void *Address)
{
- ACPI_ALLOCATION_INFO *Element = AcpiGbl_HeadAllocPtr;
+ ACPI_DEBUG_MEM_BLOCK *Element;
+
+
+ if (ListId > ACPI_MEM_LIST_MAX)
+ {
+ return (NULL);
+ }
+ Element = AcpiGbl_MemoryLists[ListId].ListHead;
/* Search for the address. */
while (Element)
{
- if (Element->Address == Address)
+ if (Element == Address)
{
return (Element);
}
@@ -195,96 +356,66 @@ AcpiUtSearchAllocList (
ACPI_STATUS
AcpiUtAddElementToAllocList (
- void *Address,
+ UINT32 ListId,
+ ACPI_DEBUG_MEM_BLOCK *Address,
UINT32 Size,
UINT8 AllocType,
UINT32 Component,
NATIVE_CHAR *Module,
UINT32 Line)
{
- ACPI_ALLOCATION_INFO *Element;
+ ACPI_MEMORY_LIST *MemList;
+ ACPI_DEBUG_MEM_BLOCK *Element;
ACPI_STATUS Status = AE_OK;
FUNCTION_TRACE_PTR ("UtAddElementToAllocList", Address);
- AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
-
- /* Keep track of the running total of all allocations. */
-
- AcpiGbl_CurrentAllocCount++;
- AcpiGbl_RunningAllocCount++;
-
- if (AcpiGbl_MaxConcurrentAllocCount < AcpiGbl_CurrentAllocCount)
- {
- AcpiGbl_MaxConcurrentAllocCount = AcpiGbl_CurrentAllocCount;
- }
-
- AcpiGbl_CurrentAllocSize += Size;
- AcpiGbl_RunningAllocSize += Size;
-
- if (AcpiGbl_MaxConcurrentAllocSize < AcpiGbl_CurrentAllocSize)
+ if (ListId > ACPI_MEM_LIST_MAX)
{
- AcpiGbl_MaxConcurrentAllocSize = AcpiGbl_CurrentAllocSize;
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* If the head pointer is null, create the first element and fill it in. */
-
- if (NULL == AcpiGbl_HeadAllocPtr)
- {
- AcpiGbl_HeadAllocPtr = AcpiOsCallocate (sizeof (ACPI_ALLOCATION_INFO));
- if (!AcpiGbl_HeadAllocPtr)
- {
- DEBUG_PRINTP (ACPI_ERROR, ("Could not allocate mem info block\n"));
- Status = AE_NO_MEMORY;
- goto UnlockAndExit;
- }
-
- AcpiGbl_TailAllocPtr = AcpiGbl_HeadAllocPtr;
- }
-
- else
- {
- AcpiGbl_TailAllocPtr->Next = AcpiOsCallocate (sizeof (ACPI_ALLOCATION_INFO));
- if (!AcpiGbl_TailAllocPtr->Next)
- {
- DEBUG_PRINTP (ACPI_ERROR, ("Could not allocate mem info block\n"));
- Status = AE_NO_MEMORY;
- goto UnlockAndExit;
- }
-
- /* error check */
-
- AcpiGbl_TailAllocPtr->Next->Previous = AcpiGbl_TailAllocPtr;
- AcpiGbl_TailAllocPtr = AcpiGbl_TailAllocPtr->Next;
- }
+ MemList = &AcpiGbl_MemoryLists[ListId];
+ AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
/*
* Search list for this address to make sure it is not already on the list.
* This will catch several kinds of problems.
*/
- Element = AcpiUtSearchAllocList (Address);
+ Element = AcpiUtSearchAllocList (ListId, Address);
if (Element)
{
REPORT_ERROR (("UtAddElementToAllocList: Address already present in list! (%p)\n",
Address));
- DEBUG_PRINTP (ACPI_ERROR, ("Element %p Address %p\n", Element, Address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n", Element, Address));
- BREAKPOINT3;
+ goto UnlockAndExit;
}
/* Fill in the instance data. */
- AcpiGbl_TailAllocPtr->Address = Address;
- AcpiGbl_TailAllocPtr->Size = Size;
- AcpiGbl_TailAllocPtr->AllocType = AllocType;
- AcpiGbl_TailAllocPtr->Component = Component;
- AcpiGbl_TailAllocPtr->Line = Line;
+ Address->Size = Size;
+ Address->AllocType = AllocType;
+ Address->Component = Component;
+ Address->Line = Line;
- STRNCPY (AcpiGbl_TailAllocPtr->Module, Module, MAX_MODULE_NAME);
+ STRNCPY (Address->Module, Module, MAX_MODULE_NAME);
+
+ /* Insert at list head */
+
+ if (MemList->ListHead)
+ {
+ ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Address;
+ }
+
+ Address->Next = MemList->ListHead;
+ Address->Previous = NULL;
+
+ MemList->ListHead = Address;
UnlockAndExit:
@@ -308,148 +439,64 @@ UnlockAndExit:
*
******************************************************************************/
-void
+ACPI_STATUS
AcpiUtDeleteElementFromAllocList (
- void *Address,
+ UINT32 ListId,
+ ACPI_DEBUG_MEM_BLOCK *Address,
UINT32 Component,
NATIVE_CHAR *Module,
UINT32 Line)
{
- ACPI_ALLOCATION_INFO *Element;
- UINT32 *DwordPtr;
- UINT32 DwordLen;
- UINT32 Size;
- UINT32 i;
+ ACPI_MEMORY_LIST *MemList;
FUNCTION_TRACE ("UtDeleteElementFromAllocList");
- if (NULL == AcpiGbl_HeadAllocPtr)
+
+ if (ListId > ACPI_MEM_LIST_MAX)
+ {
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
+ }
+
+ MemList = &AcpiGbl_MemoryLists[ListId];
+ if (NULL == MemList->ListHead)
{
- /* Boy we got problems. */
+ /* No allocations! */
_REPORT_ERROR (Module, Line, Component,
("UtDeleteElementFromAllocList: Empty allocation list, nothing to free!\n"));
- return_VOID;
+ return_ACPI_STATUS (AE_OK);
}
AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
+
+ /* Unlink */
- /* Keep track of the amount of memory allocated. */
-
- Size = 0;
- AcpiGbl_CurrentAllocCount--;
-
- if (AcpiGbl_HeadAllocPtr == AcpiGbl_TailAllocPtr)
+ if (Address->Previous)
{
- if (Address != AcpiGbl_HeadAllocPtr->Address)
- {
- _REPORT_ERROR (Module, Line, Component,
- ("UtDeleteElementFromAllocList: Deleting non-allocated memory\n"));
-
- goto Cleanup;
- }
-
- Size = AcpiGbl_HeadAllocPtr->Size;
-
- AcpiOsFree (AcpiGbl_HeadAllocPtr);
- AcpiGbl_HeadAllocPtr = NULL;
- AcpiGbl_TailAllocPtr = NULL;
-
- DEBUG_PRINTP (TRACE_ALLOCATIONS,
- ("Allocation list deleted. There are no outstanding allocations\n"));
-
- goto Cleanup;
+ (Address->Previous)->Next = Address->Next;
}
-
-
- /* Search list for this address */
-
- Element = AcpiUtSearchAllocList (Address);
- if (Element)
+ else
{
- /* cases: head, tail, other */
-
- if (Element == AcpiGbl_HeadAllocPtr)
- {
- Element->Next->Previous = NULL;
- AcpiGbl_HeadAllocPtr = Element->Next;
- }
-
- else
- {
- if (Element == AcpiGbl_TailAllocPtr)
- {
- Element->Previous->Next = NULL;
- AcpiGbl_TailAllocPtr = Element->Previous;
- }
-
- else
- {
- Element->Previous->Next = Element->Next;
- Element->Next->Previous = Element->Previous;
- }
- }
-
-
- /* Mark the segment as deleted */
-
- if (Element->Size >= 4)
- {
- DwordLen = DIV_4 (Element->Size);
- DwordPtr = (UINT32 *) Element->Address;
-
- for (i = 0; i < DwordLen; i++)
- {
- DwordPtr[i] = 0x00DEAD00;
- }
-
- /* Set obj type, desc, and ref count fields to all ones */
-
- DwordPtr[0] = ACPI_UINT32_MAX;
- if (Element->Size >= 8)
- {
- DwordPtr[1] = ACPI_UINT32_MAX;
- }
- }
-
- Size = Element->Size;
-
- MEMSET (Element, 0xEA, sizeof (ACPI_ALLOCATION_INFO));
-
-
- if (Size == sizeof (ACPI_OPERAND_OBJECT))
- {
- DEBUG_PRINTP (TRACE_ALLOCATIONS,
- ("Freeing size %X (ACPI_OPERAND_OBJECT)\n", Size));
- }
- else
- {
- DEBUG_PRINTP (TRACE_ALLOCATIONS, ("Freeing size %X\n", Size));
- }
-
- AcpiOsFree (Element);
+ MemList->ListHead = Address->Next;
}
- else
+ if (Address->Next)
{
- _REPORT_ERROR (Module, Line, Component,
- ("AcpiUtFree: Entry not found in list\n"));
- DEBUG_PRINTP (ACPI_ERROR, ("Entry %p was not found in allocation list\n",
- Address));
- AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
- return_VOID;
+ (Address->Next)->Previous = Address->Previous;
}
-Cleanup:
+ /* Mark the segment as deleted */
- AcpiGbl_CurrentAllocSize -= Size;
- AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
+ MEMSET (&Address->UserSpace, 0xEA, Address->Size);
- return_VOID;
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size %X\n", Address->Size));
+
+ AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
+ return_ACPI_STATUS (AE_OK);
}
@@ -469,49 +516,45 @@ void
AcpiUtDumpAllocationInfo (
void)
{
- FUNCTION_TRACE ("UtDumpAllocationInfo");
+/*
+ ACPI_MEMORY_LIST *MemList;
+*/
+ FUNCTION_TRACE ("UtDumpAllocationInfo");
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
+/*
+ ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Current allocations",
- AcpiGbl_CurrentAllocCount,
- ROUND_UP_TO_1K (AcpiGbl_CurrentAllocSize)));
+ MemList->CurrentCount,
+ ROUND_UP_TO_1K (MemList->CurrentSize)));
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
+ ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
- AcpiGbl_MaxConcurrentAllocCount,
- ROUND_UP_TO_1K (AcpiGbl_MaxConcurrentAllocSize)));
+ MemList->MaxConcurrentCount,
+ ROUND_UP_TO_1K (MemList->MaxConcurrentSize)));
+
+
+ ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
+ ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
+ RunningObjectCount,
+ ROUND_UP_TO_1K (RunningObjectSize)));
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Current Internal objects",
- AcpiGbl_CurrentObjectCount,
- ROUND_UP_TO_1K (AcpiGbl_CurrentObjectSize)));
+ ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
+ ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
+ RunningAllocCount,
+ ROUND_UP_TO_1K (RunningAllocSize)));
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Max internal objects",
- AcpiGbl_MaxConcurrentObjectCount,
- ROUND_UP_TO_1K (AcpiGbl_MaxConcurrentObjectSize)));
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
+ ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Current Nodes",
AcpiGbl_CurrentNodeCount,
ROUND_UP_TO_1K (AcpiGbl_CurrentNodeSize)));
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
+ ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Max Nodes",
AcpiGbl_MaxConcurrentNodeCount,
ROUND_UP_TO_1K ((AcpiGbl_MaxConcurrentNodeCount * sizeof (ACPI_NAMESPACE_NODE)))));
-
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
- AcpiGbl_RunningObjectCount,
- ROUND_UP_TO_1K (AcpiGbl_RunningObjectSize)));
-
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
- AcpiGbl_RunningAllocCount,
- ROUND_UP_TO_1K (AcpiGbl_RunningAllocSize)));
-
+*/
return_VOID;
}
@@ -534,17 +577,18 @@ AcpiUtDumpCurrentAllocations (
UINT32 Component,
NATIVE_CHAR *Module)
{
- ACPI_ALLOCATION_INFO *Element = AcpiGbl_HeadAllocPtr;
+ ACPI_DEBUG_MEM_BLOCK *Element;
UINT32 i;
FUNCTION_TRACE ("UtDumpCurrentAllocations");
+ Element = AcpiGbl_MemoryLists[0].ListHead;
if (Element == NULL)
{
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("No outstanding allocations.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "No outstanding allocations.\n"));
return_VOID;
}
@@ -552,52 +596,51 @@ AcpiUtDumpCurrentAllocations (
/*
* Walk the allocation list.
*/
-
AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("Outstanding allocations:\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Outstanding allocations:\n"));
for (i = 1; ; i++) /* Just a counter */
{
if ((Element->Component & Component) &&
((Module == NULL) || (0 == STRCMP (Module, Element->Module))))
{
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%p Len %04lX %9.9s-%ld",
- Element->Address, Element->Size, Element->Module,
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "%p Len %04lX %9.9s-%ld",
+ &Element->UserSpace, Element->Size, Element->Module,
Element->Line));
/* Most of the elements will be internal objects. */
switch (((ACPI_OPERAND_OBJECT *)
- (Element->Address))->Common.DataType)
+ (&Element->UserSpace))->Common.DataType)
{
case ACPI_DESC_TYPE_INTERNAL:
- DEBUG_PRINT_RAW (TRACE_ALLOCATIONS | TRACE_TABLES,
- (" ObjType %s",
- AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)(Element->Address))->Common.Type)));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
+ " ObjType %s",
+ AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.Type)));
break;
case ACPI_DESC_TYPE_PARSER:
- DEBUG_PRINT_RAW (TRACE_ALLOCATIONS | TRACE_TABLES,
- (" ParseObj Opcode %04X",
- ((ACPI_PARSE_OBJECT *)(Element->Address))->Opcode));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
+ " ParseObj Opcode %04X",
+ ((ACPI_PARSE_OBJECT *)(&Element->UserSpace))->Opcode));
break;
case ACPI_DESC_TYPE_NAMED:
- DEBUG_PRINT_RAW (TRACE_ALLOCATIONS | TRACE_TABLES,
- (" Node %4.4s",
- &((ACPI_NAMESPACE_NODE *)(Element->Address))->Name));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
+ " Node %4.4s",
+ &((ACPI_NAMESPACE_NODE *)(&Element->UserSpace))->Name));
break;
case ACPI_DESC_TYPE_STATE:
- DEBUG_PRINT_RAW (TRACE_ALLOCATIONS | TRACE_TABLES,
- (" StateObj"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
+ " StateObj"));
break;
}
- DEBUG_PRINT_RAW (TRACE_ALLOCATIONS | TRACE_TABLES, ("\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS, "\n"));
}
if (Element->Next == NULL)
@@ -610,8 +653,8 @@ AcpiUtDumpCurrentAllocations (
AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
- DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("Total number of unfreed allocations = %d(%X)\n", i,i));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Total number of unfreed allocations = %d(%X)\n", i,i));
return_VOID;
@@ -641,7 +684,8 @@ AcpiUtAllocate (
NATIVE_CHAR *Module,
UINT32 Line)
{
- void *Address = NULL;
+ ACPI_DEBUG_MEM_BLOCK *Address;
+ ACPI_STATUS Status;
FUNCTION_TRACE_U32 ("AcpiUtAllocate", Size);
@@ -656,7 +700,7 @@ AcpiUtAllocate (
Size = 1;
}
- Address = AcpiOsAllocate (Size);
+ Address = AcpiOsAllocate (Size + sizeof (ACPI_DEBUG_MEM_BLOCK));
if (!Address)
{
/* Report allocation error */
@@ -667,17 +711,20 @@ AcpiUtAllocate (
return_PTR (NULL);
}
-
- if (ACPI_FAILURE (AcpiUtAddElementToAllocList (Address, Size, MEM_MALLOC,
- Component, Module, Line)))
+ Status = AcpiUtAddElementToAllocList (ACPI_MEM_LIST_GLOBAL, Address, Size,
+ MEM_MALLOC, Component, Module, Line);
+ if (ACPI_FAILURE (Status))
{
AcpiOsFree (Address);
return_PTR (NULL);
}
- DEBUG_PRINTP (TRACE_ALLOCATIONS, ("%p Size %X\n", Address, Size));
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].TotalAllocated++;
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].CurrentTotalSize += Size;
- return_PTR (Address);
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n", Address, Size));
+
+ return_PTR ((void *) &Address->UserSpace);
}
@@ -703,7 +750,8 @@ AcpiUtCallocate (
NATIVE_CHAR *Module,
UINT32 Line)
{
- void *Address = NULL;
+ ACPI_DEBUG_MEM_BLOCK *Address;
+ ACPI_STATUS Status;
FUNCTION_TRACE_U32 ("AcpiUtCallocate", Size);
@@ -719,7 +767,7 @@ AcpiUtCallocate (
}
- Address = AcpiOsCallocate (Size);
+ Address = AcpiOsCallocate (Size + sizeof (ACPI_DEBUG_MEM_BLOCK));
if (!Address)
{
/* Report allocation error */
@@ -729,17 +777,19 @@ AcpiUtCallocate (
return_PTR (NULL);
}
-
- if (ACPI_FAILURE (AcpiUtAddElementToAllocList (Address, Size, MEM_CALLOC,
- Component,Module, Line)))
+ Status = AcpiUtAddElementToAllocList (ACPI_MEM_LIST_GLOBAL, Address, Size,
+ MEM_CALLOC, Component, Module, Line);
+ if (ACPI_FAILURE (Status))
{
AcpiOsFree (Address);
return_PTR (NULL);
}
- DEBUG_PRINTP (TRACE_ALLOCATIONS, ("%p Size %X\n", Address, Size));
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].TotalAllocated++;
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].CurrentTotalSize += Size;
- return_PTR (Address);
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n", Address, Size));
+ return_PTR ((void *) &Address->UserSpace);
}
@@ -765,6 +815,9 @@ AcpiUtFree (
NATIVE_CHAR *Module,
UINT32 Line)
{
+ ACPI_DEBUG_MEM_BLOCK *DebugBlock;
+
+
FUNCTION_TRACE_PTR ("AcpiUtFree", Address);
@@ -776,10 +829,17 @@ AcpiUtFree (
return_VOID;
}
- AcpiUtDeleteElementFromAllocList (Address, Component, Module, Line);
- AcpiOsFree (Address);
+ DebugBlock = (ACPI_DEBUG_MEM_BLOCK *)
+ (((char *) Address) - sizeof (ACPI_DEBUG_MEM_HEADER));
+
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].TotalFreed++;
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].CurrentTotalSize -= DebugBlock->Size;
+
+ AcpiUtDeleteElementFromAllocList (ACPI_MEM_LIST_GLOBAL, DebugBlock,
+ Component, Module, Line);
+ AcpiOsFree (DebugBlock);
- DEBUG_PRINTP (TRACE_ALLOCATIONS, ("%p freed\n", Address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", Address));
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/utcopy.c b/sys/contrib/dev/acpica/utcopy.c
index 35e1d00ff409..a3ee2763ce53 100644
--- a/sys/contrib/dev/acpica/utcopy.c
+++ b/sys/contrib/dev/acpica/utcopy.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utcopy - Internal to external object translation utilities
- * $Revision: 76 $
+ * $Revision: 77 $
*
*****************************************************************************/
@@ -318,10 +318,9 @@ AcpiUtCopyIelementToEelement (
ACPI_OBJECT *TargetObject;
- ThisIndex = State->Pkg.Index;
- TargetObject = (ACPI_OBJECT *)
- &((ACPI_OBJECT *)(State->Pkg.DestObject))->Package.Elements[ThisIndex];
-
+ ThisIndex = State->Pkg.Index;
+ TargetObject = (ACPI_OBJECT *)
+ &((ACPI_OBJECT *)(State->Pkg.DestObject))->Package.Elements[ThisIndex];
switch (ObjectType)
{
@@ -330,7 +329,6 @@ AcpiUtCopyIelementToEelement (
/*
* This is a simple or null object -- get the size
*/
-
Status = AcpiUtCopyIsimpleToEsimple (SourceObject,
TargetObject, Info->FreeSpace, &ObjectSpace);
if (ACPI_FAILURE (Status))
@@ -676,7 +674,8 @@ AcpiUtCopyEobjectToIobject (
RetBuffer->Pointer,
&RetBuffer->Length);
*/
- DEBUG_PRINTP (ACPI_ERROR, ("Packages as parameters not implemented!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Packages as parameters not implemented!\n"));
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
}
diff --git a/sys/contrib/dev/acpica/utdebug.c b/sys/contrib/dev/acpica/utdebug.c
index 6f3e301aa6b3..7a0393ddc469 100644
--- a/sys/contrib/dev/acpica/utdebug.c
+++ b/sys/contrib/dev/acpica/utdebug.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utdebug - Debug print routines
- * $Revision: 73 $
+ * $Revision: 76 $
*
*****************************************************************************/
@@ -153,6 +153,122 @@ SetDebugLevel (
/*****************************************************************************
*
+ * FUNCTION: AcpiUtDebugPrint
+ *
+ * PARAMETERS: DebugLevel - Requested debug print level
+ * ProcName - Caller's procedure name
+ * ModuleName - Caller's module name (for error output)
+ * LineNumber - Caller's line number (for error output)
+ * ComponentId - Caller's component ID (for error output)
+ *
+ * Format - Printf format field
+ * ... - Optional printf arguments
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print error message with prefix consisting of the module name,
+ * line number, and component ID.
+ *
+ ****************************************************************************/
+
+void
+AcpiUtDebugPrint (
+ UINT32 RequestedDebugLevel,
+ UINT32 ComponentId,
+ NATIVE_CHAR *ProcName,
+ NATIVE_CHAR *ModuleName,
+ UINT32 LineNumber,
+ char *Format,
+ ...)
+{
+ UINT32 ThreadId;
+ va_list args;
+
+
+ if (!(RequestedDebugLevel & AcpiDbgLevel) ||
+ !(ComponentId & AcpiDbgLayer))
+ {
+ return;
+ }
+
+
+ ThreadId = AcpiOsGetThreadId ();
+
+ if (ThreadId != PrevThreadId)
+ {
+ if (ACPI_LV_THREADS & AcpiDbgLevel)
+ {
+ AcpiOsPrintf ("\n**** Context Switch from TID %X to TID %X ****\n\n",
+ PrevThreadId, ThreadId);
+ }
+
+ PrevThreadId = ThreadId;
+ }
+
+ if (ACPI_LV_THREADS & AcpiDbgLevel)
+ {
+ AcpiOsPrintf ("%8s-%04d[%04X][%02d] %s: ", ModuleName, LineNumber, ThreadId, AcpiGbl_NestingLevel, ProcName);
+ }
+ else
+ {
+ AcpiOsPrintf ("%8s-%04d[%02d] %s: ", ModuleName, LineNumber, AcpiGbl_NestingLevel, ProcName);
+ }
+
+
+
+ va_start (args, Format);
+ AcpiOsVprintf (Format, args);
+}
+
+
+/*****************************************************************************
+ *
+ * FUNCTION: AcpiUtDebugPrintRaw
+ *
+ * PARAMETERS: DebugLevel - Requested debug print level
+ * ProcName - Caller's procedure name
+ * ModuleName - Caller's module name (for error output)
+ * LineNumber - Caller's line number (for error output)
+ * ComponentId - Caller's component ID (for error output)
+ *
+ * Format - Printf format field
+ * ... - Optional printf arguments
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print message with no headers. Has same interface as
+ * DebugPrint so that the same macros can be used.
+ *
+ ****************************************************************************/
+
+void
+AcpiUtDebugPrintRaw (
+ UINT32 RequestedDebugLevel,
+ UINT32 ComponentId,
+ NATIVE_CHAR *ProcName,
+ NATIVE_CHAR *ModuleName,
+ UINT32 LineNumber,
+ char *Format,
+ ...)
+{
+ va_list args;
+
+
+
+ if (!(RequestedDebugLevel & AcpiDbgLevel) ||
+ !(ComponentId & AcpiDbgLayer))
+ {
+ return;
+ }
+
+ va_start (args, Format);
+
+ AcpiOsVprintf (Format, args);
+}
+
+
+/*****************************************************************************
+ *
* FUNCTION: FunctionTrace
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
@@ -177,10 +293,8 @@ FunctionTrace (
AcpiGbl_NestingLevel++;
- DebugPrint (ModuleName, LineNumber, ComponentId,
- TRACE_FUNCTIONS,
- " %2.2ld Entered Function: %s\n",
- AcpiGbl_NestingLevel, FunctionName);
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, ComponentId, FunctionName,
+ ModuleName, LineNumber, "----Entered Function----\n");
}
@@ -209,14 +323,13 @@ FunctionTracePtr (
NATIVE_CHAR *FunctionName,
void *Pointer)
{
-
AcpiGbl_NestingLevel++;
- DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
- " %2.2ld Entered Function: %s, %p\n",
- AcpiGbl_NestingLevel, FunctionName, Pointer);
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, ComponentId, FunctionName,
+ ModuleName, LineNumber, "----Entered Function---- %p\n", Pointer);
}
+
/*****************************************************************************
*
* FUNCTION: FunctionTraceStr
@@ -244,9 +357,8 @@ FunctionTraceStr (
{
AcpiGbl_NestingLevel++;
- DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
- " %2.2ld Entered Function: %s, %s\n",
- AcpiGbl_NestingLevel, FunctionName, String);
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, ComponentId, FunctionName,
+ ModuleName, LineNumber, "----Entered Function---- %s\n", String);
}
@@ -277,9 +389,8 @@ FunctionTraceU32 (
{
AcpiGbl_NestingLevel++;
- DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
- " %2.2ld Entered Function: %s, %lX\n",
- AcpiGbl_NestingLevel, FunctionName, Integer);
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, ComponentId, FunctionName,
+ ModuleName, LineNumber, "----Entered Function---- %08X\n", Integer);
}
@@ -307,9 +418,8 @@ FunctionExit (
NATIVE_CHAR *FunctionName)
{
- DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
- " %2.2ld Exiting Function: %s\n",
- AcpiGbl_NestingLevel, FunctionName);
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, ComponentId, FunctionName,
+ ModuleName, LineNumber, "----Exiting Function----\n");
AcpiGbl_NestingLevel--;
}
@@ -341,9 +451,9 @@ FunctionStatusExit (
ACPI_STATUS Status)
{
- DebugPrint (ModuleName, LineNumber, ComponentId,
- TRACE_FUNCTIONS, " %2.2ld Exiting Function: %s, %s\n",
- AcpiGbl_NestingLevel, FunctionName, AcpiFormatException (Status));
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, ComponentId, FunctionName,
+ ModuleName, LineNumber, "----Exiting Function---- %s\n",
+ AcpiFormatException (Status));
AcpiGbl_NestingLevel--;
}
@@ -375,9 +485,9 @@ FunctionValueExit (
ACPI_INTEGER Value)
{
- DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
- " %2.2ld Exiting Function: %s, %X\n",
- AcpiGbl_NestingLevel, FunctionName, Value);
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, ComponentId, FunctionName,
+ ModuleName, LineNumber, "----Exiting Function---- %08X\n",
+ Value);
AcpiGbl_NestingLevel--;
}
@@ -409,9 +519,9 @@ FunctionPtrExit (
UINT8 *Ptr)
{
- DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
- " %2.2ld Exiting Function: %s, %p\n",
- AcpiGbl_NestingLevel, FunctionName, Ptr);
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, ComponentId, FunctionName,
+ ModuleName, LineNumber, "----Exiting Function----, %p\n",
+ Ptr);
AcpiGbl_NestingLevel--;
}
@@ -419,149 +529,6 @@ FunctionPtrExit (
/*****************************************************************************
*
- * FUNCTION: DebugPrint
- *
- * PARAMETERS: ModuleName - Caller's module name (for error output)
- * LineNumber - Caller's line number (for error output)
- * ComponentId - Caller's component ID (for error output)
- * PrintLevel - Requested debug print level
- * Format - Printf format field
- * ... - Optional printf arguments
- *
- * RETURN: None
- *
- * DESCRIPTION: Print error message with prefix consisting of the module name,
- * line number, and component ID.
- *
- ****************************************************************************/
-
-void
-DebugPrint (
- NATIVE_CHAR *ModuleName,
- UINT32 LineNumber,
- UINT32 ComponentId,
- UINT32 PrintLevel,
- NATIVE_CHAR *Format,
- ...)
-{
- va_list args;
- UINT32 ThreadId;
-
-
- ThreadId = AcpiOsGetThreadId ();
-
-
- /* Both the level and the component must be enabled */
-
- if ((PrintLevel & AcpiDbgLevel) &&
- (ComponentId & AcpiDbgLayer))
- {
- va_start (args, Format);
-
- if (ThreadId != PrevThreadId)
- {
- if (TRACE_THREADS & AcpiDbgLevel)
- {
- AcpiOsPrintf ("\n**** Context Switch from TID %X to TID %X ****\n\n",
- PrevThreadId, ThreadId);
- }
-
- PrevThreadId = ThreadId;
- }
-
- if (TRACE_THREADS & AcpiDbgLevel)
- {
- AcpiOsPrintf ("%8s-%04d[%04X]: ", ModuleName, LineNumber, ThreadId);
- }
- else
- {
- AcpiOsPrintf ("%8s-%04d: ", ModuleName, LineNumber);
- }
-
- AcpiOsVprintf (Format, args);
- }
-}
-
-
-/*****************************************************************************
- *
- * FUNCTION: DebugPrintPrefix
- *
- * PARAMETERS: ModuleName - Caller's module name (for error output)
- * LineNumber - Caller's line number (for error output)
- * ComponentId - Caller's component ID (for error output)
- *
- * RETURN: None
- *
- * DESCRIPTION: Print the prefix part of an error message, consisting of the
- * module name, and line number
- *
- ****************************************************************************/
-
-void
-DebugPrintPrefix (
- NATIVE_CHAR *ModuleName,
- UINT32 LineNumber)
-{
- UINT32 ThreadId;
-
-
- ThreadId = AcpiOsGetThreadId ();
-
- if (ThreadId != PrevThreadId)
- {
- if (TRACE_THREADS & AcpiDbgLevel)
- {
- AcpiOsPrintf ("\n**** Context Switch from TID %X to TID %X ****\n\n",
- PrevThreadId, ThreadId);
- }
-
- PrevThreadId = ThreadId;
- }
-
- if (TRACE_THREADS & AcpiDbgLevel)
- {
- AcpiOsPrintf ("%8s-%04d[%04X]: ", ModuleName, LineNumber, ThreadId);
- }
- else
- {
- AcpiOsPrintf ("%8s-%04d: ", ModuleName, LineNumber);
- }
-
-}
-
-
-/*****************************************************************************
- *
- * FUNCTION: DebugPrintRaw
- *
- * PARAMETERS: Format - Printf format field
- * ... - Optional printf arguments
- *
- * RETURN: None
- *
- * DESCRIPTION: Print error message -- without module/line indentifiers
- *
- ****************************************************************************/
-
-void
-DebugPrintRaw (
- NATIVE_CHAR *Format,
- ...)
-{
- va_list args;
-
-
- va_start (args, Format);
-
- AcpiOsVprintf (Format, args);
-
- va_end (args);
-}
-
-
-/*****************************************************************************
- *
* FUNCTION: AcpiUtDumpBuffer
*
* PARAMETERS: Buffer - Buffer to dump
@@ -589,7 +556,7 @@ AcpiUtDumpBuffer (
/* Only dump the buffer if tracing is enabled */
- if (!((TRACE_TABLES & AcpiDbgLevel) &&
+ if (!((ACPI_LV_TABLES & AcpiDbgLevel) &&
(ComponentId & AcpiDbgLayer)))
{
return;
diff --git a/sys/contrib/dev/acpica/utdelete.c b/sys/contrib/dev/acpica/utdelete.c
index 46a42d9eea3f..e556bd14c329 100644
--- a/sys/contrib/dev/acpica/utdelete.c
+++ b/sys/contrib/dev/acpica/utdelete.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: utdelete - object deletion and reference count utilities
- * $Revision: 72 $
+ * $Revision: 74 $
*
******************************************************************************/
@@ -165,18 +165,21 @@ AcpiUtDeleteInternalObj (
case ACPI_TYPE_STRING:
- DEBUG_PRINTP (ACPI_INFO, ("**** String %p, ptr %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** String %p, ptr %p\n",
Object, Object->String.Pointer));
/* Free the actual string buffer */
- ObjPointer = Object->String.Pointer;
+ if (!(Object->Common.Flags & AOPOBJ_STATIC_POINTER))
+ {
+ ObjPointer = Object->String.Pointer;
+ }
break;
case ACPI_TYPE_BUFFER:
- DEBUG_PRINTP (ACPI_INFO, ("**** Buffer %p, ptr %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Buffer %p, ptr %p\n",
Object, Object->Buffer.Pointer));
/* Free the actual buffer */
@@ -187,7 +190,7 @@ AcpiUtDeleteInternalObj (
case ACPI_TYPE_PACKAGE:
- DEBUG_PRINTP (ACPI_INFO, (" **** Package of count %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, " **** Package of count %X\n",
Object->Package.Count));
/*
@@ -203,7 +206,7 @@ AcpiUtDeleteInternalObj (
case ACPI_TYPE_MUTEX:
- DEBUG_PRINTP (ACPI_INFO, ("***** Mutex %p, Semaphore %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Mutex %p, Semaphore %p\n",
Object, Object->Mutex.Semaphore));
AcpiExUnlinkMutex (Object);
@@ -213,7 +216,7 @@ AcpiUtDeleteInternalObj (
case ACPI_TYPE_EVENT:
- DEBUG_PRINTP (ACPI_INFO, ("***** Event %p, Semaphore %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Event %p, Semaphore %p\n",
Object, Object->Event.Semaphore));
AcpiOsDeleteSemaphore (Object->Event.Semaphore);
@@ -223,7 +226,7 @@ AcpiUtDeleteInternalObj (
case ACPI_TYPE_METHOD:
- DEBUG_PRINTP (ACPI_INFO, ("***** Method %p\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Method %p\n", Object));
/* Delete the method semaphore if it exists */
@@ -238,7 +241,7 @@ AcpiUtDeleteInternalObj (
case ACPI_TYPE_REGION:
- DEBUG_PRINTP (ACPI_INFO, ("***** Region %p\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Region %p\n", Object));
if (Object->Region.Extra)
{
@@ -263,7 +266,7 @@ AcpiUtDeleteInternalObj (
case ACPI_TYPE_BUFFER_FIELD:
- DEBUG_PRINTP (ACPI_INFO, ("***** Buffer Field %p\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Buffer Field %p\n", Object));
if (Object->BufferField.Extra)
{
@@ -283,7 +286,7 @@ AcpiUtDeleteInternalObj (
{
if (!AcpiTbSystemTablePointer (ObjPointer))
{
- DEBUG_PRINTP (ACPI_INFO, ("Deleting Obj Ptr %p \n", ObjPointer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting Obj Ptr %p \n", ObjPointer));
ACPI_MEM_FREE (ObjPointer);
}
@@ -294,13 +297,13 @@ AcpiUtDeleteInternalObj (
if (Object->Common.Flags & AOPOBJ_STATIC_ALLOCATION)
{
- DEBUG_PRINTP (ACPI_INFO, ("Object %p [%s] static allocation, no delete\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object %p [%s] static allocation, no delete\n",
Object, AcpiUtGetTypeName (Object->Common.Type)));
}
if (!(Object->Common.Flags & AOPOBJ_STATIC_ALLOCATION))
{
- DEBUG_PRINTP (ACPI_INFO, ("Deleting object %p [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting object %p [%s]\n",
Object, AcpiUtGetTypeName (Object->Common.Type)));
AcpiUtDeleteObjectDesc (Object);
@@ -409,7 +412,7 @@ AcpiUtUpdateRefCount (
NewCount++;
Object->Common.ReferenceCount = NewCount;
- DEBUG_PRINTP (ACPI_INFO, ("Obj %p Refs=%X, [Incremented]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X, [Incremented]\n",
Object, NewCount));
break;
@@ -418,7 +421,7 @@ AcpiUtUpdateRefCount (
if (Count < 1)
{
- DEBUG_PRINTP (ACPI_INFO, ("Obj %p Refs=%X, can't decrement! (Set to 0)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X, can't decrement! (Set to 0)\n",
Object, NewCount));
NewCount = 0;
@@ -428,13 +431,13 @@ AcpiUtUpdateRefCount (
{
NewCount--;
- DEBUG_PRINTP (ACPI_INFO, ("Obj %p Refs=%X, [Decremented]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X, [Decremented]\n",
Object, NewCount));
}
if (Object->Common.Type == ACPI_TYPE_METHOD)
{
- DEBUG_PRINTP (ACPI_INFO, ("Method Obj %p Refs=%X, [Decremented]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method Obj %p Refs=%X, [Decremented]\n",
Object, NewCount));
}
@@ -449,7 +452,7 @@ AcpiUtUpdateRefCount (
case REF_FORCE_DELETE:
- DEBUG_PRINTP (ACPI_INFO, ("Obj %p Refs=%X, Force delete! (Set to 0)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X, Force delete! (Set to 0)\n",
Object, Count));
NewCount = 0;
@@ -460,7 +463,7 @@ AcpiUtUpdateRefCount (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unknown action (%X)\n", Action));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown action (%X)\n", Action));
break;
}
@@ -473,8 +476,8 @@ AcpiUtUpdateRefCount (
if (Count > MAX_REFERENCE_COUNT)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("**** AE_ERROR **** Invalid Reference Count (%X) in object %p\n\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "**** AE_ERROR **** Invalid Reference Count (%X) in object %p\n\n",
Count, Object));
}
@@ -534,13 +537,13 @@ AcpiUtUpdateObjectReference (
if (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_NAMED))
{
- DEBUG_PRINTP (ACPI_INFO, ("Object %p is NS handle\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object %p is NS handle\n", Object));
return_ACPI_STATUS (AE_OK);
}
if (AcpiTbSystemTablePointer (Object))
{
- DEBUG_PRINTP (ACPI_INFO, ("**** Object %p is Pcode Ptr\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Object %p is Pcode Ptr\n", Object));
return_ACPI_STATUS (AE_OK);
}
@@ -783,7 +786,7 @@ AcpiUtRemoveReference (
return_VOID;
}
- DEBUG_PRINTP (ACPI_INFO, ("Obj %p Refs=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X\n",
Object, Object->Common.ReferenceCount));
/*
diff --git a/sys/contrib/dev/acpica/uteval.c b/sys/contrib/dev/acpica/uteval.c
index d805e73c1dca..57fbe7576b51 100644
--- a/sys/contrib/dev/acpica/uteval.c
+++ b/sys/contrib/dev/acpica/uteval.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: uteval - Object evaluation
- * $Revision: 28 $
+ * $Revision: 29 $
*
*****************************************************************************/
@@ -162,12 +162,12 @@ AcpiUtEvaluateNumericObject (
{
if (Status == AE_NOT_FOUND)
{
- DEBUG_PRINTP (ACPI_INFO, ("%s on %4.4s was not found\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s on %4.4s was not found\n",
ObjectName, &DeviceNode->Name));
}
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("%s on %4.4s failed with status %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s on %4.4s failed with status %s\n",
ObjectName, &DeviceNode->Name,
AcpiFormatException (Status)));
}
@@ -180,7 +180,7 @@ AcpiUtEvaluateNumericObject (
if (!ObjDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No object was returned from %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from %s\n",
ObjectName));
return_ACPI_STATUS (AE_TYPE);
}
@@ -190,8 +190,8 @@ AcpiUtEvaluateNumericObject (
if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
Status = AE_TYPE;
- DEBUG_PRINTP (ACPI_ERROR,
- ("Type returned from %s was not a number: %X \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Type returned from %s was not a number: %X \n",
ObjectName, ObjDesc->Common.Type));
}
else
@@ -247,13 +247,13 @@ AcpiUtExecute_HID (
{
if (Status == AE_NOT_FOUND)
{
- DEBUG_PRINTP (ACPI_INFO, ("_HID on %4.4s was not found\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_HID on %4.4s was not found\n",
&DeviceNode->Name));
}
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("_HID on %4.4s failed %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_HID on %4.4s failed %s\n",
&DeviceNode->Name, AcpiFormatException (Status)));
}
@@ -264,7 +264,7 @@ AcpiUtExecute_HID (
if (!ObjDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No object was returned from _HID\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _HID\n"));
return_ACPI_STATUS (AE_TYPE);
}
@@ -276,8 +276,8 @@ AcpiUtExecute_HID (
(ObjDesc->Common.Type != ACPI_TYPE_STRING))
{
Status = AE_TYPE;
- DEBUG_PRINTP (ACPI_ERROR,
- ("Type returned from _HID not a number or string: %s(%X) \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Type returned from _HID not a number or string: %s(%X) \n",
AcpiUtGetTypeName (ObjDesc->Common.Type), ObjDesc->Common.Type));
}
@@ -343,14 +343,14 @@ AcpiUtExecute_UID (
{
if (Status == AE_NOT_FOUND)
{
- DEBUG_PRINTP (ACPI_INFO, ("_UID on %4.4s was not found\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_UID on %4.4s was not found\n",
&DeviceNode->Name));
}
else
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("_UID on %4.4s failed %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "_UID on %4.4s failed %s\n",
&DeviceNode->Name, AcpiFormatException (Status)));
}
@@ -361,7 +361,7 @@ AcpiUtExecute_UID (
if (!ObjDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No object was returned from _UID\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _UID\n"));
return (AE_TYPE);
}
@@ -373,8 +373,8 @@ AcpiUtExecute_UID (
(ObjDesc->Common.Type != ACPI_TYPE_STRING))
{
Status = AE_TYPE;
- DEBUG_PRINTP (ACPI_ERROR,
- ("Type returned from _UID was not a number or string: %X \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Type returned from _UID was not a number or string: %X \n",
ObjDesc->Common.Type));
}
@@ -438,8 +438,8 @@ AcpiUtExecute_STA (
METHOD_NAME__STA, NULL, &ObjDesc);
if (AE_NOT_FOUND == Status)
{
- DEBUG_PRINTP (ACPI_INFO,
- ("_STA on %4.4s was not found, assuming present.\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "_STA on %4.4s was not found, assuming present.\n",
&DeviceNode->Name));
*Flags = 0x0F;
@@ -448,7 +448,7 @@ AcpiUtExecute_STA (
else if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("_STA on %4.4s failed %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_STA on %4.4s failed %s\n",
&DeviceNode->Name,
AcpiFormatException (Status)));
}
@@ -459,7 +459,7 @@ AcpiUtExecute_STA (
if (!ObjDesc)
{
- DEBUG_PRINTP (ACPI_ERROR, ("No object was returned from _STA\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _STA\n"));
return_ACPI_STATUS (AE_TYPE);
}
@@ -468,8 +468,8 @@ AcpiUtExecute_STA (
if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
Status = AE_TYPE;
- DEBUG_PRINTP (ACPI_ERROR,
- ("Type returned from _STA was not a number: %X \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Type returned from _STA was not a number: %X \n",
ObjDesc->Common.Type));
}
diff --git a/sys/contrib/dev/acpica/utglobal.c b/sys/contrib/dev/acpica/utglobal.c
index 505f64faa0fc..7a8ba8758836 100644
--- a/sys/contrib/dev/acpica/utglobal.c
+++ b/sys/contrib/dev/acpica/utglobal.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
- * $Revision: 125 $
+ * $Revision: 127 $
*
*****************************************************************************/
@@ -331,6 +331,14 @@ NATIVE_CHAR AcpiGbl_HexToAscii[] =
{'0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F'};
+UINT8
+AcpiUtHexToAsciiChar (
+ ACPI_INTEGER Integer,
+ UINT32 Position)
+{
+
+ return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
+}
/******************************************************************************
*
@@ -674,6 +682,40 @@ AcpiUtInitGlobals (
FUNCTION_TRACE ("UtInitGlobals");
+
+ /* Memory allocation and cache lists */
+
+ MEMSET (AcpiGbl_MemoryLists, 0,
+ sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS);
+
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].LinkOffset = (UINT16) (NATIVE_UINT) &(((ACPI_GENERIC_STATE *) NULL)->Common.Next);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].LinkOffset = (UINT16) (NATIVE_UINT) &(((ACPI_PARSE_OBJECT *) NULL)->Next);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].LinkOffset = (UINT16) (NATIVE_UINT) &(((ACPI_PARSE2_OBJECT *) NULL)->Next);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].LinkOffset = (UINT16) (NATIVE_UINT) &(((ACPI_OPERAND_OBJECT *) NULL)->Cache.Next);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].LinkOffset = (UINT16) (NATIVE_UINT) &(((ACPI_WALK_STATE *) NULL)->Next);
+
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ObjectSize = sizeof (ACPI_NAMESPACE_NODE);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ObjectSize = sizeof (ACPI_GENERIC_STATE);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ObjectSize = sizeof (ACPI_PARSE_OBJECT);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ObjectSize = sizeof (ACPI_PARSE2_OBJECT);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ObjectSize = sizeof (ACPI_OPERAND_OBJECT);
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ObjectSize = sizeof (ACPI_WALK_STATE);
+
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].MaxCacheDepth = MAX_STATE_CACHE_DEPTH;
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].MaxCacheDepth = MAX_PARSE_CACHE_DEPTH;
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].MaxCacheDepth = MAX_EXTPARSE_CACHE_DEPTH;
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].MaxCacheDepth = MAX_OBJECT_CACHE_DEPTH;
+ AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].MaxCacheDepth = MAX_WALK_CACHE_DEPTH;
+
+
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].ListName = "Global Memory Allocation");
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ListName = "Namespace Nodes");
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ListName = "State Object Cache");
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ListName = "Parse Node Cache");
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ListName = "Extended Parse Node Cache");
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ListName = "Operand Object Cache");
+ ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ListName = "Tree Walk Node Cache");
+
/* ACPI table structure */
for (i = 0; i < NUM_ACPI_TABLES; i++)
@@ -738,32 +780,6 @@ AcpiUtInitGlobals (
AcpiGbl_NextMethodOwnerId = FIRST_METHOD_ID;
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
- /* Cache of small "state" objects */
-
- AcpiGbl_GenericStateCache = NULL;
- AcpiGbl_GenericStateCacheDepth = 0;
- AcpiGbl_StateCacheRequests = 0;
- AcpiGbl_StateCacheHits = 0;
-
- AcpiGbl_ParseCache = NULL;
- AcpiGbl_ParseCacheDepth = 0;
- AcpiGbl_ParseCacheRequests = 0;
- AcpiGbl_ParseCacheHits = 0;
-
- AcpiGbl_ExtParseCache = NULL;
- AcpiGbl_ExtParseCacheDepth = 0;
- AcpiGbl_ExtParseCacheRequests = 0;
- AcpiGbl_ExtParseCacheHits = 0;
-
- AcpiGbl_ObjectCache = NULL;
- AcpiGbl_ObjectCacheDepth = 0;
- AcpiGbl_ObjectCacheRequests = 0;
- AcpiGbl_ObjectCacheHits = 0;
-
- AcpiGbl_WalkStateCache = NULL;
- AcpiGbl_WalkStateCacheDepth = 0;
- AcpiGbl_WalkStateCacheRequests = 0;
- AcpiGbl_WalkStateCacheHits = 0;
/* Hardware oriented */
@@ -785,9 +801,6 @@ AcpiUtInitGlobals (
AcpiGbl_RootNodeStruct.Object = NULL;
AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST;
- /* Memory allocation metrics - compiled out in non-debug mode. */
-
- INITIALIZE_ALLOCATION_METRICS();
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/utinit.c b/sys/contrib/dev/acpica/utinit.c
index 54dbd4704807..64e995f7b7c8 100644
--- a/sys/contrib/dev/acpica/utinit.c
+++ b/sys/contrib/dev/acpica/utinit.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utinit - Common ACPI subsystem initialization
- * $Revision: 98 $
+ * $Revision: 99 $
*
*****************************************************************************/
@@ -314,14 +314,14 @@ AcpiUtSubsystemShutdown (void)
if (AcpiGbl_Shutdown)
{
- DEBUG_PRINTP (ACPI_ERROR, ("ACPI Subsystem is already terminated\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "ACPI Subsystem is already terminated\n"));
return_ACPI_STATUS (AE_OK);
}
/* Subsystem appears active, go ahead and shut it down */
AcpiGbl_Shutdown = TRUE;
- DEBUG_PRINTP (ACPI_INFO, ("Shutting down ACPI Subsystem...\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem...\n"));
/* Close the Namespace */
diff --git a/sys/contrib/dev/acpica/utmisc.c b/sys/contrib/dev/acpica/utmisc.c
index d1f43c88f8e0..dddbe27d3cf3 100644
--- a/sys/contrib/dev/acpica/utmisc.c
+++ b/sys/contrib/dev/acpica/utmisc.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: utmisc - common utility procedures
- * $Revision: 44 $
+ * $Revision: 46 $
*
******************************************************************************/
@@ -415,15 +415,15 @@ AcpiUtAcquireMutex (
{
if (i == MutexId)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Mutex [%s] already acquired by this thread [%X]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Mutex [%s] already acquired by this thread [%X]\n",
AcpiUtGetMutexName (MutexId), ThisThreadId));
return (AE_ALREADY_ACQUIRED);
}
- DEBUG_PRINTP (ACPI_ERROR,
- ("Invalid acquire order: Thread %X owns [%s], wants [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Invalid acquire order: Thread %X owns [%s], wants [%s]\n",
ThisThreadId, AcpiUtGetMutexName (i),
AcpiUtGetMutexName (MutexId)));
@@ -432,8 +432,8 @@ AcpiUtAcquireMutex (
}
- DEBUG_PRINTP (TRACE_MUTEX,
- ("Thread %X attempting to acquire Mutex [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
+ "Thread %X attempting to acquire Mutex [%s]\n",
ThisThreadId, AcpiUtGetMutexName (MutexId)));
Status = AcpiOsWaitSemaphore (AcpiGbl_AcpiMutexInfo[MutexId].Mutex,
@@ -441,7 +441,7 @@ AcpiUtAcquireMutex (
if (ACPI_SUCCESS (Status))
{
- DEBUG_PRINTP (TRACE_MUTEX, ("Thread %X acquired Mutex [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n",
ThisThreadId, AcpiUtGetMutexName (MutexId)));
AcpiGbl_AcpiMutexInfo[MutexId].UseCount++;
@@ -450,7 +450,7 @@ AcpiUtAcquireMutex (
else
{
- DEBUG_PRINTP (ACPI_ERROR, ("Thread %X could not acquire Mutex [%s] %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not acquire Mutex [%s] %s\n",
ThisThreadId, AcpiUtGetMutexName (MutexId),
AcpiFormatException (Status)));
}
@@ -484,8 +484,8 @@ AcpiUtReleaseMutex (
ThisThreadId = AcpiOsGetThreadId ();
- DEBUG_PRINTP (TRACE_MUTEX,
- ("Thread %X releasing Mutex [%s]\n", ThisThreadId,
+ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
+ "Thread %X releasing Mutex [%s]\n", ThisThreadId,
AcpiUtGetMutexName (MutexId)));
if (MutexId > MAX_MTX)
@@ -499,8 +499,8 @@ AcpiUtReleaseMutex (
*/
if (AcpiGbl_AcpiMutexInfo[MutexId].OwnerId == ACPI_MUTEX_NOT_ACQUIRED)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Mutex [%s] is not acquired, cannot release\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Mutex [%s] is not acquired, cannot release\n",
AcpiUtGetMutexName (MutexId)));
return (AE_NOT_ACQUIRED);
@@ -522,8 +522,8 @@ AcpiUtReleaseMutex (
continue;
}
- DEBUG_PRINTP (ACPI_ERROR,
- ("Invalid release order: owns [%s], releasing [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Invalid release order: owns [%s], releasing [%s]\n",
AcpiUtGetMutexName (i), AcpiUtGetMutexName (MutexId)));
return (AE_RELEASE_DEADLOCK);
@@ -539,13 +539,13 @@ AcpiUtReleaseMutex (
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINTP (ACPI_ERROR, ("Thread %X could not release Mutex [%s] %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not release Mutex [%s] %s\n",
ThisThreadId, AcpiUtGetMutexName (MutexId),
AcpiFormatException (Status)));
}
else
{
- DEBUG_PRINTP (TRACE_MUTEX, ("Thread %X released Mutex [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X released Mutex [%s]\n",
ThisThreadId, AcpiUtGetMutexName (MutexId)));
}
@@ -715,45 +715,12 @@ AcpiUtCreateGenericState (void)
ACPI_GENERIC_STATE *State;
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
-
- AcpiGbl_StateCacheRequests++;
-
- /* Check the cache first */
-
- if (AcpiGbl_GenericStateCache)
- {
- /* There is an object available, use it */
-
- State = AcpiGbl_GenericStateCache;
- AcpiGbl_GenericStateCache = State->Common.Next;
- State->Common.Next = NULL;
-
- AcpiGbl_StateCacheHits++;
- AcpiGbl_GenericStateCacheDepth--;
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
-
- DEBUG_PRINT (TRACE_EXEC, ("CreateGenState: State %p from cache\n", State));
- }
-
- else
- {
- /* The cache is empty, create a new object */
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
-
- State = ACPI_MEM_CALLOCATE (sizeof (ACPI_GENERIC_STATE));
- }
+ State = AcpiUtAcquireFromCache (ACPI_MEM_LIST_STATE);
/* Initialize */
if (State)
{
- /* Always zero out the object before init */
-
- MEMSET (State, 0, sizeof (ACPI_GENERIC_STATE));
-
State->Common.DataType = ACPI_DESC_TYPE_STATE;
}
@@ -911,33 +878,7 @@ AcpiUtDeleteGenericState (
FUNCTION_TRACE ("UtDeleteGenericState");
- /* If cache is full, just free this state object */
-
- if (AcpiGbl_GenericStateCacheDepth >= MAX_STATE_CACHE_DEPTH)
- {
- ACPI_MEM_FREE (State);
- }
-
- /* Otherwise put this object back into the cache */
-
- else
- {
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
-
- /* Clear the state */
-
- MEMSET (State, 0, sizeof (ACPI_GENERIC_STATE));
- State->Common.DataType = ACPI_DESC_TYPE_STATE;
-
- /* Put the object at the head of the global cache list */
-
- State->Common.Next = AcpiGbl_GenericStateCache;
- AcpiGbl_GenericStateCache = State;
- AcpiGbl_GenericStateCacheDepth++;
-
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
- }
+ AcpiUtReleaseToCache (ACPI_MEM_LIST_STATE, State);
return_VOID;
}
@@ -959,25 +900,10 @@ void
AcpiUtDeleteGenericStateCache (
void)
{
- ACPI_GENERIC_STATE *Next;
-
-
FUNCTION_TRACE ("UtDeleteGenericStateCache");
- /* Traverse the global cache list */
-
- while (AcpiGbl_GenericStateCache)
- {
- /* Delete one cached state object */
-
- Next = AcpiGbl_GenericStateCache->Common.Next;
- ACPI_MEM_FREE (AcpiGbl_GenericStateCache);
-
- AcpiGbl_GenericStateCache = Next;
- AcpiGbl_GenericStateCacheDepth--;
- }
-
+ AcpiUtDeleteGenericCache (ACPI_MEM_LIST_STATE);
return_VOID;
}
@@ -1070,16 +996,19 @@ AcpiUtDisplayInitPathname (
char Buffer[128];
+ PROC_NAME ("AcpiUtDisplayInitPathname");
+
+
Status = AcpiNsHandleToPathname (ObjHandle, &Length, Buffer);
if (ACPI_SUCCESS (Status))
{
if (Path)
{
- DEBUG_PRINT (TRACE_INIT, ("%s.%s\n", Buffer, Path))
+ ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s.%s\n", Buffer, Path));
}
else
{
- DEBUG_PRINT (TRACE_INIT, ("%s\n", Buffer))
+ ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s\n", Buffer));
}
}
}
diff --git a/sys/contrib/dev/acpica/utobject.c b/sys/contrib/dev/acpica/utobject.c
index 41cb76118d14..9442bbdd3746 100644
--- a/sys/contrib/dev/acpica/utobject.c
+++ b/sys/contrib/dev/acpica/utobject.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utobject - ACPI object create/delete/size/cache routines
- * $Revision: 49 $
+ * $Revision: 51 $
*
*****************************************************************************/
@@ -208,8 +208,8 @@ AcpiUtValidInternalObject (
if (!Object)
{
- DEBUG_PRINT (ACPI_INFO,
- ("**** Null Object Ptr\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "**** Null Object Ptr\n"));
return (FALSE);
}
@@ -217,7 +217,7 @@ AcpiUtValidInternalObject (
if (AcpiTbSystemTablePointer (Object))
{
- DEBUG_PRINTP (ACPI_INFO, ("**** Object %p is a Pcode Ptr\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Object %p is a Pcode Ptr\n", Object));
return (FALSE);
}
@@ -229,20 +229,20 @@ AcpiUtValidInternalObject (
if (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_NAMED))
{
- DEBUG_PRINTP (ACPI_INFO,
- ("**** Obj %p is a named obj, not ACPI obj\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "**** Obj %p is a named obj, not ACPI obj\n", Object));
}
else if (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_PARSER))
{
- DEBUG_PRINTP (ACPI_INFO,
- ("**** Obj %p is a parser obj, not ACPI obj\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "**** Obj %p is a parser obj, not ACPI obj\n", Object));
}
else
{
- DEBUG_PRINTP (ACPI_INFO,
- ("**** Obj %p is of unknown type\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "**** Obj %p is of unknown type\n", Object));
}
return (FALSE);
@@ -283,55 +283,21 @@ _UtAllocateObjectDesc (
FUNCTION_TRACE ("_AllocateObjectDesc");
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
-
- AcpiGbl_ObjectCacheRequests++;
-
- /* Check the cache first */
-
- if (AcpiGbl_ObjectCache)
+ Object = AcpiUtAcquireFromCache (ACPI_MEM_LIST_OPERAND);
+ if (!Object)
{
- /* There is an object available, use it */
+ _REPORT_ERROR (ModuleName, LineNumber, ComponentId,
+ ("Could not allocate an object descriptor\n"));
- Object = AcpiGbl_ObjectCache;
- AcpiGbl_ObjectCache = Object->Cache.Next;
- Object->Cache.Next = NULL;
-
- AcpiGbl_ObjectCacheHits++;
- AcpiGbl_ObjectCacheDepth--;
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
+ return_PTR (NULL);
}
- else
- {
- /* The cache is empty, create a new object */
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
-
- /* Attempt to allocate new descriptor */
-
- Object = ACPI_MEM_CALLOCATE (sizeof (ACPI_OPERAND_OBJECT));
- if (!Object)
- {
- /* Allocation failed */
-
- _REPORT_ERROR (ModuleName, LineNumber, ComponentId,
- ("Could not allocate an object descriptor\n"));
-
- return_PTR (NULL);
- }
-
- /* Memory allocation metrics - compiled out in non debug mode. */
-
- INCREMENT_OBJECT_METRICS (sizeof (ACPI_OPERAND_OBJECT));
- }
/* Mark the descriptor type */
Object->Common.DataType = ACPI_DESC_TYPE_INTERNAL;
- DEBUG_PRINTP (TRACE_ALLOCATIONS, ("%p Size %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
Object, sizeof (ACPI_OPERAND_OBJECT)));
return_PTR (Object);
@@ -354,58 +320,20 @@ void
AcpiUtDeleteObjectDesc (
ACPI_OPERAND_OBJECT *Object)
{
-
FUNCTION_TRACE_PTR ("AcpiUtDeleteObjectDesc", Object);
- /* Make sure that the object isn't already in the cache */
-
- if (Object->Common.DataType == (ACPI_DESC_TYPE_INTERNAL | ACPI_CACHED_OBJECT))
- {
- DEBUG_PRINTP (ACPI_ERROR,
- ("Obj %p is already in the object cache\n", Object));
- return_VOID;
- }
-
/* Object must be an ACPI_OPERAND_OBJECT */
if (Object->Common.DataType != ACPI_DESC_TYPE_INTERNAL)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Obj %p is not an ACPI object\n", Object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Obj %p is not an ACPI object\n", Object));
return_VOID;
}
+ AcpiUtReleaseToCache (ACPI_MEM_LIST_OPERAND, Object);
- /* If cache is full, just free this object */
-
- if (AcpiGbl_ObjectCacheDepth >= MAX_OBJECT_CACHE_DEPTH)
- {
- /*
- * Memory allocation metrics. Call the macro here since we only
- * care about dynamically allocated objects.
- */
- DECREMENT_OBJECT_METRICS (sizeof (ACPI_OPERAND_OBJECT));
-
- ACPI_MEM_FREE (Object);
- return_VOID;
- }
-
- AcpiUtAcquireMutex (ACPI_MTX_CACHES);
-
- /* Clear the entire object. This is important! */
-
- MEMSET (Object, 0, sizeof (ACPI_OPERAND_OBJECT));
- Object->Common.DataType = ACPI_DESC_TYPE_INTERNAL | ACPI_CACHED_OBJECT;
-
- /* Put the object at the head of the global cache list */
-
- Object->Cache.Next = AcpiGbl_ObjectCache;
- AcpiGbl_ObjectCache = Object;
- AcpiGbl_ObjectCacheDepth++;
-
-
- AcpiUtReleaseMutex (ACPI_MTX_CACHES);
return_VOID;
}
@@ -427,32 +355,10 @@ void
AcpiUtDeleteObjectCache (
void)
{
- ACPI_OPERAND_OBJECT *Next;
-
-
FUNCTION_TRACE ("UtDeleteObjectCache");
- /* Traverse the global cache list */
-
- while (AcpiGbl_ObjectCache)
- {
- /* Delete one cached state object */
-
- Next = AcpiGbl_ObjectCache->Cache.Next;
- AcpiGbl_ObjectCache->Cache.Next = NULL;
-
- /*
- * Memory allocation metrics. Call the macro here since we only
- * care about dynamically allocated objects.
- */
- DECREMENT_OBJECT_METRICS (sizeof (ACPI_OPERAND_OBJECT));
-
- ACPI_MEM_FREE (AcpiGbl_ObjectCache);
- AcpiGbl_ObjectCache = Next;
- AcpiGbl_ObjectCacheDepth--;
- }
-
+ AcpiUtDeleteGenericCache (ACPI_MEM_LIST_OPERAND);
return_VOID;
}
@@ -599,8 +505,8 @@ AcpiUtGetSimpleObjectSize (
*/
if (InternalObject->Reference.Opcode != AML_INT_NAMEPATH_OP)
{
- DEBUG_PRINTP (ACPI_ERROR,
- ("Unsupported Reference opcode=%X in object %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unsupported Reference opcode=%X in object %p\n",
InternalObject->Reference.Opcode, InternalObject));
Status = AE_TYPE;
}
@@ -618,7 +524,7 @@ AcpiUtGetSimpleObjectSize (
default:
- DEBUG_PRINTP (ACPI_ERROR, ("Unsupported type=%X in object %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported type=%X in object %p\n",
InternalObject->Common.Type, InternalObject));
Status = AE_TYPE;
break;
diff --git a/sys/contrib/dev/acpica/utxface.c b/sys/contrib/dev/acpica/utxface.c
index 3f6fce00c207..48d569bd9c0c 100644
--- a/sys/contrib/dev/acpica/utxface.c
+++ b/sys/contrib/dev/acpica/utxface.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utxface - External interfaces for "global" ACPI functions
- * $Revision: 76 $
+ * $Revision: 77 $
*
*****************************************************************************/
@@ -238,7 +238,7 @@ AcpiEnableSubsystem (
if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
{
- DEBUG_PRINT (TRACE_EXEC, ("[Init] Installing default address space handlers\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing default address space handlers\n"));
Status = AcpiEvInstallDefaultAddressSpaceHandlers ();
if (ACPI_FAILURE (Status))
@@ -253,7 +253,7 @@ AcpiEnableSubsystem (
if (!(Flags & ACPI_NO_HARDWARE_INIT))
{
- DEBUG_PRINT (TRACE_EXEC, ("[Init] Initializing ACPI hardware\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI hardware\n"));
Status = AcpiHwInitialize ();
if (ACPI_FAILURE (Status))
@@ -268,12 +268,12 @@ AcpiEnableSubsystem (
if (!(Flags & ACPI_NO_ACPI_ENABLE))
{
- DEBUG_PRINT (TRACE_EXEC, ("[Init] Going into ACPI mode\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n"));
Status = AcpiEnable ();
if (ACPI_FAILURE (Status))
{
- DEBUG_PRINT(ACPI_WARN, ("AcpiEnable failed.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "AcpiEnable failed.\n"));
return_ACPI_STATUS (Status);
}
}
@@ -287,7 +287,7 @@ AcpiEnableSubsystem (
if (!(Flags & ACPI_NO_EVENT_INIT))
{
- DEBUG_PRINT (TRACE_EXEC, ("[Init] Initializing ACPI events\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI events\n"));
Status = AcpiEvInitialize ();
if (ACPI_FAILURE (Status))
@@ -304,7 +304,7 @@ AcpiEnableSubsystem (
if (!(Flags & ACPI_NO_DEVICE_INIT))
{
- DEBUG_PRINT (TRACE_EXEC, ("[Init] Initializing ACPI Devices\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI Devices\n"));
Status = AcpiNsInitializeDevices ();
if (ACPI_FAILURE (Status))
@@ -322,7 +322,7 @@ AcpiEnableSubsystem (
if (!(Flags & ACPI_NO_OBJECT_INIT))
{
- DEBUG_PRINT (TRACE_EXEC, ("[Init] Initializing ACPI Objects\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI Objects\n"));
Status = AcpiNsInitializeObjects ();
if (ACPI_FAILURE (Status))