/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -157,7 +157,7 @@
#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
/*
- * Should the subystem abort the loading of an ACPI table if the
+ * Should the subsystem abort the loading of an ACPI table if the
* table checksum is incorrect?
*/
#define ACPI_CHECKSUM_ABORT FALSE
Index: sys/dev/acpi/acpica/Subsystem/acenv.h
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/acenv.h,v
retrieving revision 1.13
diff -u -r1.13 acenv.h
--- sys/dev/acpi/acpica/Subsystem/acenv.h 29 Jan 2006 03:05:46 -0000 1.13
+++ sys/dev/acpi/acpica/Subsystem/acenv.h 7 Feb 2006 07:18:04 -0000
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acenv.h - Generation environment specific items
- * xRevision: 1.120 $
+ * xRevision: 1.122 $
*
*****************************************************************************/
/* All other environments */
@@ -232,13 +235,6 @@
#define COMPILER_DEPENDENT_INT64 long long
#define COMPILER_DEPENDENT_UINT64 unsigned long long
-/*
- * This macro is used to tag functions as "printf-like" because
- * some compilers can catch printf format string problems. MSVC
- * doesn't, so this is proprocessed away.
- */
-#define ACPI_PRINTF_LIKE_FUNC
-
#endif
-/* This macro is used to tag functions as "printf-like" because
+/*
+ * This macro is used to tag functions as "printf-like" because
* some compilers (like GCC) can catch printf format string problems.
*/
-#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7)))
+#define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))
-/* Some compilers complain about unused variables. Sometimes we don't want to
+/*
+ * Some compilers complain about unused variables. Sometimes we don't want to
* use all the variables (for example, _AcpiModuleName). This allows us
* to to tell the compiler warning in a per-variable manner that a variable
* is unused.
*/
#define ACPI_UNUSED_VAR __attribute__ ((unused))
-#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
- UINT8 DataType; /* To differentiate various internal objs */\
+#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
+ UINT8 DataType; /* To differentiate various internal objs */\
UINT8 Flags; \
UINT16 Value; \
UINT16 State; \
UINT16 Reserved; \
- void *Next; \
+ void *Next;
typedef struct acpi_common_state
{
@@ -764,7 +764,7 @@
char AmlOpName[16]) /* Op name (debug only) */\
/* NON-DEBUG members below: */\
ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\
- ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
+ ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */
/*
* An ACPI_NAMESPACE_NODE * can appear in some contexts,
@@ -524,13 +529,12 @@
#define INCREMENT_ARG_LIST(List) (List >>= ((UINT32) ARG_TYPE_WIDTH))
+#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
/*
* Module name is include in both debug and non-debug versions primarily for
* error messages. The __FILE__ macro is not very useful for this, because it
* often includes the entire pathname to the module
*/
-#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
-
#define ACPI_MODULE_NAME(Name) static const char ACPI_UNUSED_VAR *_AcpiModuleName = Name;
#else
#define ACPI_MODULE_NAME(Name)
@@ -540,45 +544,42 @@
* Ascii error messages can be configured out
*/
#ifndef ACPI_NO_ERROR_MESSAGES
-
-#define ACPI_PARAM_LIST(pl) pl
-#define ACPI_LOCATION_INFO _AcpiModuleName, __LINE__
+#define AE_INFO _AcpiModuleName, __LINE__
/*
- * Error reporting. Callers module and line number are inserted automatically
- * These macros are used for both the debug and non-debug versions of the code
- */
-#define ACPI_REPORT_INFO(fp) {AcpiUtReportInfo (ACPI_LOCATION_INFO); \
- AcpiOsPrintf ACPI_PARAM_LIST (fp);}
-#define ACPI_REPORT_ERROR(fp) {AcpiUtReportError (ACPI_LOCATION_INFO); \
- AcpiOsPrintf ACPI_PARAM_LIST (fp);}
-#define ACPI_REPORT_WARNING(fp) {AcpiUtReportWarning (ACPI_LOCATION_INFO); \
- AcpiOsPrintf ACPI_PARAM_LIST (fp);}
-#define ACPI_REPORT_NSERROR(s,e) AcpiNsReportError (ACPI_LOCATION_INFO, \
- s, e);
-#define ACPI_REPORT_MTERROR(s,n,p,e) AcpiNsReportMethodError (ACPI_LOCATION_INFO, \
- s, n, p, e);
-
-/* Error reporting. These versions pass thru the module and lineno */
-
-#define _ACPI_REPORT_INFO(a,b,fp) {AcpiUtReportInfo (a,b); \
- AcpiOsPrintf ACPI_PARAM_LIST (fp);}
-#define _ACPI_REPORT_ERROR(a,b,fp) {AcpiUtReportError (a,b); \
- AcpiOsPrintf ACPI_PARAM_LIST (fp);}
-#define _ACPI_REPORT_WARNING(a,b,fp) {AcpiUtReportWarning (a,b); \
- AcpiOsPrintf ACPI_PARAM_LIST (fp);}
+ * Error reporting. Callers module and line number are inserted by AE_INFO,
+ * the plist contains a set of parens to allow variable-length lists.
+ * These macros are used for both the debug and non-debug versions of the code.
+ */
+#define ACPI_INFO(plist) AcpiUtInfo plist
+#define ACPI_WARNING(plist) AcpiUtWarning plist
+#define ACPI_EXCEPTION(plist) AcpiUtException plist
+#define ACPI_ERROR(plist) AcpiUtError plist
+#define ACPI_ERROR_NAMESPACE(s,e) AcpiNsReportError (AE_INFO, s, e);
+#define ACPI_ERROR_METHOD(s,n,p,e) AcpiNsReportMethodError (AE_INFO, s, n, p, e);
+
+/* Legacy interfaces. Remove when migration is complete */
+
+#define ACPI_REPORT_INFO(fp) {AcpiUtReportInfo (AE_INFO); \
+ AcpiOsPrintf fp;}
+#define ACPI_REPORT_ERROR(fp) {AcpiUtReportError (AE_INFO); \
+ AcpiOsPrintf fp;}
+#define ACPI_REPORT_WARNING(fp) {AcpiUtReportWarning (AE_INFO); \
+ AcpiOsPrintf fp;}
#else
typedef struct acpi_walk_state
{
- UINT8 DataType; /* To differentiate various internal objs MUST BE FIRST!*/\
+ UINT8 DataType; /* To differentiate various internal objs MUST BE FIRST!*/
UINT8 WalkType;
ACPI_OWNER_ID OwnerId; /* Owner of objects created during the walk */
BOOLEAN LastPredicate; /* Result of last predicate */
Index: sys/dev/acpi/acpica/Subsystem/actypes.h
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/actypes.h,v
retrieving revision 1.15
diff -u -r1.15 actypes.h
--- sys/dev/acpi/acpica/Subsystem/actypes.h 29 Jan 2006 03:05:47 -0000 1.15
+++ sys/dev/acpi/acpica/Subsystem/actypes.h 7 Feb 2006 07:18:06 -0000
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actypes.h - Common data types for the entire ACPI subsystem
- * xRevision: 1.298 $
+ * xRevision: 1.300 $
*
*****************************************************************************/
@@ -320,17 +320,23 @@
#endif
+/* Variable-width type, used instead of clib size_t */
+
+typedef ACPI_NATIVE_UINT ACPI_SIZE;
+
+
/*******************************************************************************
*
* OS- or compiler-dependent types
*
+ * If the defaults below are not appropriate for the host system, they can
+ * be defined in the compiler-specific or OS-specific header, and this will
+ * take precedence.
+ *
******************************************************************************/
-/*
- * If ACPI_UINTPTR_T was not defined in the OS- or compiler-dependent header,
- * define it now (use C99 uintptr_t for pointer casting if available,
- * "void *" otherwise)
- */
+/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
+
#ifndef ACPI_UINTPTR_T
#define ACPI_UINTPTR_T void *
#endif
@@ -344,9 +350,31 @@
#define ACPI_CACHE_T ACPI_MEMORY_LIST
#endif
-/* Variable-width type, used instead of clib size_t */
+/*
+ * Allow the CPU flags word to be defined per-OS to simplify the use of the
+ * lock and unlock OSL interfaces.
+ */
+#ifndef ACPI_CPU_FLAGS
+#define ACPI_CPU_FLAGS ACPI_NATIVE_UINT
+#endif
-typedef ACPI_NATIVE_UINT ACPI_SIZE;
+/*
+ * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because
+ * some compilers can catch printf format string problems
+ */
+#ifndef ACPI_PRINTF_LIKE
+#define ACPI_PRINTF_LIKE(c)
+#endif
+
+/*
+ * Some compilers complain about unused variables. Sometimes we don't want to
+ * use all the variables (for example, _AcpiModuleName). This allows us
+ * to to tell the compiler in a per-variable manner that a variable
+ * is unused
+ */
+#ifndef ACPI_UNUSED_VAR
+#define ACPI_UNUSED_VAR
+#endif
/*
Index: sys/dev/acpi/acpica/Subsystem/dbfileio.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/dbfileio.c,v
retrieving revision 1.14
diff -u -r1.14 dbfileio.c
--- sys/dev/acpi/acpica/Subsystem/dbfileio.c 29 Jan 2006 03:05:47 -0000 1.14
+++ sys/dev/acpi/acpica/Subsystem/dbfileio.c 7 Feb 2006 07:18:06 -0000
@@ -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)
- * xRevision: 1.86 $
+ * xRevision: 1.87 $
*
******************************************************************************/
@@ -252,8 +252,8 @@
if (TableLength != FileLength)
{
- ACPI_REPORT_WARNING ((
- "File length (0x%X) is not the same as the table length (0x%X)\n",
+ ACPI_WARNING ((AE_INFO,
+ "File length (0x%X) is not the same as the table length (0x%X)",
FileLength, TableLength));
}
if (Position > ACPI_UINT32_MAX)
{
- ACPI_REPORT_ERROR ((
- "Bit offset within field too large (> 0xFFFFFFFF)\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Bit offset within field too large (> 0xFFFFFFFF)"));
return_ACPI_STATUS (AE_SUPPORT);
}
if (ObjDesc->Method.ThreadCount == ACPI_UINT8_MAX)
{
- ACPI_REPORT_ERROR ((
- "Method reached maximum reentrancy limit (255)\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Method reached maximum reentrancy limit (255)"));
return_ACPI_STATUS (AE_AML_METHOD_LIMIT);
}
@@ -594,7 +594,7 @@
WalkState->MethodDesc->Method.Semaphore, 1);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not signal method semaphore\n"));
+ ACPI_ERROR ((AE_INFO, "Could not signal method semaphore"));
default:
- ACPI_REPORT_ERROR (("Unknown Integer type %X\n",
+ ACPI_ERROR ((AE_INFO, "Unknown Integer type %X",
OpInfo->Type));
Status = AE_AML_OPERAND_TYPE;
break;
@@ -756,7 +756,7 @@
default:
- ACPI_REPORT_ERROR (("Unimplemented data type: %X\n",
+ ACPI_ERROR ((AE_INFO, "Unimplemented data type: %X",
ACPI_GET_OBJECT_TYPE (ObjDesc)));
Status = AE_AML_OPERAND_TYPE;
Index: sys/dev/acpi/acpica/Subsystem/dsopcode.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/dsopcode.c,v
retrieving revision 1.13
diff -u -r1.13 dsopcode.c
--- sys/dev/acpi/acpica/Subsystem/dsopcode.c 29 Jan 2006 03:05:47 -0000 1.13
+++ sys/dev/acpi/acpica/Subsystem/dsopcode.c 7 Feb 2006 07:18:08 -0000
@@ -2,7 +2,7 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
- * xRevision: 1.105 $
+ * xRevision: 1.106 $
*
*****************************************************************************/
@@ -349,8 +349,8 @@
Node = ObjDesc->Buffer.Node;
if (!Node)
{
- ACPI_REPORT_ERROR ((
- "No pointer back to NS node in buffer obj %p\n", ObjDesc));
+ ACPI_ERROR ((AE_INFO,
+ "No pointer back to NS node in buffer obj %p", ObjDesc));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -398,8 +398,8 @@
Node = ObjDesc->Package.Node;
if (!Node)
{
- ACPI_REPORT_ERROR ((
- "No pointer back to NS node in package %p\n", ObjDesc));
+ ACPI_ERROR ((AE_INFO,
+ "No pointer back to NS node in package %p", ObjDesc));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -535,8 +535,8 @@
if (ACPI_GET_OBJECT_TYPE (BufferDesc) != ACPI_TYPE_BUFFER)
{
- ACPI_REPORT_ERROR ((
- "Target of Create Field is not a Buffer object - %s\n",
+ ACPI_ERROR ((AE_INFO,
+ "Target of Create Field is not a Buffer object - %s",
AcpiUtGetObjectTypeName (BufferDesc)));
Status = AE_AML_OPERAND_TYPE;
@@ -550,8 +550,8 @@
*/
if (ACPI_GET_DESCRIPTOR_TYPE (ResultDesc) != ACPI_DESC_TYPE_NAMED)
{
- ACPI_REPORT_ERROR ((
- "(%s) destination not a NS Node [%s]\n",
+ ACPI_ERROR ((AE_INFO,
+ "(%s) destination not a NS Node [%s]",
AcpiPsGetOpcodeName (AmlOpcode),
AcpiUtGetDescriptorName (ResultDesc)));
@@ -578,8 +578,8 @@
if (BitCount == 0)
{
- ACPI_REPORT_ERROR ((
- "Attempt to CreateField of length 0\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Attempt to CreateField of length zero"));
Status = AE_AML_OPERAND_VALUE;
goto Cleanup;
}
@@ -632,8 +632,8 @@
@@ -184,9 +184,8 @@
Status = AcpiDsResultPop (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not get result from predicate evaluation, %s\n",
- AcpiFormatException (Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Could not get result from predicate evaluation"));
- ACPI_REPORT_WARNING ((
- "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n",
+ ACPI_WARNING ((AE_INFO,
+ "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)",
BufferPtr, AcpiUtGetTypeName (Node->Type)));
Node->Type = ACPI_TYPE_ANY;
@@ -778,8 +778,8 @@
/* All other types are an error */
- ACPI_REPORT_ERROR ((
- "Invalid type (%s) for target of Scope operator [%4.4s]\n",
+ ACPI_ERROR ((AE_INFO,
+ "Invalid type (%s) for target of Scope operator [%4.4s]",
AcpiUtGetTypeName (Node->Type), BufferPtr));
if (WalkState->DataType != ACPI_DESC_TYPE_WALK)
{
- ACPI_REPORT_ERROR (("%p is not a valid walk state\n",
+ ACPI_ERROR ((AE_INFO, "%p is not a valid walk state",
WalkState));
return;
}
if (WalkState->ParserState.Scope)
{
- ACPI_REPORT_ERROR (("%p walk still has a scope list\n",
+ ACPI_ERROR ((AE_INFO, "%p walk still has a scope list",
WalkState));
}
@@ -1057,23 +1057,23 @@
State = WalkState->Results;
if (!State)
{
- ACPI_REPORT_ERROR (("No result object pushed! State=%p\n",
+ ACPI_ERROR ((AE_INFO, "No result object pushed! State=%p",
WalkState));
return (AE_NOT_EXIST);
}
if (Index >= ACPI_OBJ_NUM_OPERANDS)
{
- ACPI_REPORT_ERROR ((
- "Index out of range: %X Obj=%p State=%p Num=%X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Index out of range: %X Obj=%p State=%p Num=%X",
Index, Object, WalkState, State->Results.NumResults));
return (AE_BAD_PARAMETER);
}
@@ -662,9 +662,8 @@
Status = AcpiNsEvaluateByHandle (&Info);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "%s while evaluating method [%4.4s] for GPE[%2X]\n",
- AcpiFormatException (Status),
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "While evaluating method [%4.4s] for GPE[%2X]",
AcpiUtGetNodeName (LocalGpeEventInfo.Dispatch.MethodNode),
GpeNumber));
}
@@ -728,9 +727,8 @@
Status = AcpiHwClearGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "%s, Unable to clear GPE[%2X]\n",
- AcpiFormatException (Status), GpeNumber));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Unable to clear GPE[%2X]", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
}
@@ -772,9 +770,8 @@
Status = AcpiHwClearGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "%s, Unable to clear GPE[%2X]\n",
- AcpiFormatException (Status), GpeNumber));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Unable to clear GPE[%2X]", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
}
@@ -789,9 +786,8 @@
Status = AcpiEvDisableGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "%s, Unable to disable GPE[%2X]\n",
- AcpiFormatException (Status), GpeNumber));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Unable to disable GPE[%2X]", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
@@ -803,9 +799,9 @@
AcpiEvAsynchExecuteGpeMethod, GpeEventInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "%s, Unable to queue handler for GPE[%2X] - event disabled\n",
- AcpiFormatException (Status), GpeNumber));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Unable to queue handler for GPE[%2X] - event disabled",
+ GpeNumber));
}
break;
@@ -813,8 +809,8 @@
/* No handler or method to run! */
- ACPI_REPORT_ERROR ((
- "No handler or method for GPE[%2X], disabling event\n",
+ ACPI_ERROR ((AE_INFO,
+ "No handler or method for GPE[%2X], disabling event",
GpeNumber));
- ACPI_REPORT_INFO (("GPE %p was updated from wake/run to wake-only\n",
+ ACPI_INFO ((AE_INFO, "GPE %p was updated from wake/run to wake-only",
GpeEventInfo));
- ACPI_REPORT_ERROR ((
- "Unknown GPE method type: %s (name not of form _Lxx or _Exx)\n",
+ ACPI_ERROR ((AE_INFO,
+ "Unknown GPE method type: %s (name not of form _Lxx or _Exx)",
Name));
return_ACPI_STATUS (AE_OK);
}
@@ -402,8 +402,8 @@
{
/* Conversion failed; invalid method, just ignore it */
- ACPI_REPORT_ERROR ((
- "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)\n",
+ ACPI_ERROR ((AE_INFO,
+ "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)",
Name));
return_ACPI_STATUS (AE_OK);
}
@@ -596,7 +596,7 @@
ACPI_GPE_XRUPT_INFO *NextGpeXrupt;
ACPI_GPE_XRUPT_INFO *GpeXrupt;
ACPI_STATUS Status;
- ACPI_NATIVE_UINT Flags;
+ ACPI_CPU_FLAGS Flags;
@@ -1314,8 +1313,8 @@
if ((RegisterCount0) &&
(GpeNumberMax >= AcpiGbl_FADT->Gpe1Base))
{
- ACPI_REPORT_ERROR ((
- "GPE0 block (GPE 0 to %d) overlaps the GPE1 block (GPE %d to %d) - Ignoring GPE1\n",
+ ACPI_ERROR ((AE_INFO,
+ "GPE0 block (GPE 0 to %d) overlaps the GPE1 block (GPE %d to %d) - Ignoring GPE1",
GpeNumberMax, AcpiGbl_FADT->Gpe1Base,
AcpiGbl_FADT->Gpe1Base +
((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1)));
@@ -1335,9 +1334,8 @@
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not create GPE Block 1, %s\n",
- AcpiFormatException (Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Could not create GPE Block 1"));
}
/*
@@ -1365,8 +1363,8 @@
if (GpeNumberMax > ACPI_GPE_MAX)
{
- ACPI_REPORT_ERROR ((
- "Maximum GPE number from FADT is too large: 0x%X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Maximum GPE number from FADT is too large: 0x%X",
GpeNumberMax));
Status = AE_BAD_VALUE;
goto Cleanup;
Index: sys/dev/acpi/acpica/Subsystem/evmisc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/evmisc.c,v
retrieving revision 1.13
diff -u -r1.13 evmisc.c
--- sys/dev/acpi/acpica/Subsystem/evmisc.c 29 Jan 2006 03:05:47 -0000 1.13
+++ sys/dev/acpi/acpica/Subsystem/evmisc.c 7 Feb 2006 07:18:11 -0000
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evmisc - Miscellaneous event manager support functions
- * xRevision: 1.88 $
+ * xRevision: 1.89 $
*
*****************************************************************************/
@@ -417,7 +417,7 @@
AcpiGbl_GlobalLockThreadCount);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not signal Global Lock semaphore\n"));
+ ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
}
}
}
@@ -463,8 +463,8 @@
AcpiEvGlobalLockThread, Context);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not queue Global Lock thread, %s\n",
- AcpiFormatException (Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Could not queue Global Lock thread"));
return (ACPI_INTERRUPT_NOT_HANDLED);
}
@@ -509,8 +509,8 @@
*/
if (Status == AE_NO_HARDWARE_RESPONSE)
{
- ACPI_REPORT_ERROR ((
- "No response from Global Lock hardware, disabling lock\n"));
+ ACPI_ERROR ((AE_INFO,
+ "No response from Global Lock hardware, disabling lock"));
AcpiGbl_GlobalLockPresent = FALSE;
Status = AE_OK;
@@ -619,8 +619,8 @@
if (!AcpiGbl_GlobalLockThreadCount)
{
- ACPI_REPORT_WARNING ((
- "Cannot release HW Global Lock, it has not been acquired\n"));
+ ACPI_WARNING ((AE_INFO,
+ "Cannot release HW Global Lock, it has not been acquired"));
return_ACPI_STATUS (AE_NOT_ACQUIRED);
}
@@ -692,8 +692,8 @@
Status = AcpiDisableEvent ((UINT32) i, 0);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not disable fixed event %d\n", (UINT32) i));
+ ACPI_ERROR ((AE_INFO,
+ "Could not disable fixed event %d", (UINT32) i));
}
}
@@ -706,8 +706,8 @@
Status = AcpiEvRemoveSciHandler ();
if (ACPI_FAILURE(Status))
{
- ACPI_REPORT_ERROR ((
- "Could not remove SCI handler\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Could not remove SCI handler"));
}
}
if (!AcpiGbl_FADT)
{
- ACPI_REPORT_WARNING (("No FADT information present!\n"));
+ ACPI_WARNING ((AE_INFO, "No FADT information present!"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -169,7 +169,7 @@
Status = AcpiHwSetMode (ACPI_SYS_MODE_ACPI);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not transition to ACPI mode\n"));
+ ACPI_ERROR ((AE_INFO, "Could not transition to ACPI mode"));
return_ACPI_STATUS (Status);
}
@@ -205,7 +205,7 @@
if (!AcpiGbl_FADT)
{
- ACPI_REPORT_WARNING (("No FADT information present!\n"));
+ ACPI_WARNING ((AE_INFO, "No FADT information present!"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -222,7 +222,7 @@
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
+ ACPI_ERROR ((AE_INFO,
"Could not exit ACPI mode to legacy mode"));
return_ACPI_STATUS (Status);
}
@@ -288,8 +288,8 @@
if (Value != 1)
{
- ACPI_REPORT_ERROR ((
- "Could not enable %s event\n", AcpiUtGetEventName (Event)));
+ ACPI_ERROR ((AE_INFO,
+ "Could not enable %s event", AcpiUtGetEventName (Event)));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
@@ -519,8 +519,8 @@
if (Value != 0)
{
- ACPI_REPORT_ERROR ((
- "Could not disable %s events\n", AcpiUtGetEventName (Event)));
+ ACPI_ERROR ((AE_INFO,
+ "Could not disable %s events", AcpiUtGetEventName (Event)));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
if (ACPI_GET_OBJECT_TYPE (RgnDesc) != ACPI_TYPE_REGION)
{
- ACPI_REPORT_ERROR (("Needed Region, found type %X (%s)\n",
+ ACPI_ERROR ((AE_INFO, "Needed Region, found type %X (%s)",
ACPI_GET_OBJECT_TYPE (RgnDesc),
AcpiUtGetObjectTypeName (RgnDesc)));
@@ -258,8 +258,8 @@
* than the region itself. For example, a region of length one
* byte, and a field with Dword access specified.
*/
- ACPI_REPORT_ERROR ((
- "Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n",
+ ACPI_ERROR ((AE_INFO,
+ "Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)",
AcpiUtGetNodeName (ObjDesc->CommonField.Node),
ObjDesc->CommonField.AccessByteWidth,
AcpiUtGetNodeName (RgnDesc->Region.Node),
@@ -270,8 +270,8 @@
* Offset rounded up to next multiple of field width
* exceeds region length, indicate an error
*/
- ACPI_REPORT_ERROR ((
- "Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n",
+ ACPI_ERROR ((AE_INFO,
+ "Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)",
AcpiUtGetNodeName (ObjDesc->CommonField.Node),
ObjDesc->CommonField.BaseByteOffset,
FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth,
@@ -368,15 +368,15 @@
{
if (Status == AE_NOT_IMPLEMENTED)
{
- ACPI_REPORT_ERROR ((
- "Region %s(%X) not implemented\n",
+ ACPI_ERROR ((AE_INFO,
+ "Region %s(%X) not implemented",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId));
}
else if (Status == AE_NOT_EXIST)
{
- ACPI_REPORT_ERROR ((
- "Region %s(%X) has no handler\n",
+ ACPI_ERROR ((AE_INFO,
+ "Region %s(%X) has no handler",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId));
}
@@ -628,7 +628,7 @@
default:
- ACPI_REPORT_ERROR (("Wrong object type in field I/O %X\n",
+ ACPI_ERROR ((AE_INFO, "Wrong object type in field I/O %X",
ACPI_GET_OBJECT_TYPE (ObjDesc)));
Status = AE_AML_INTERNAL;
break;
@@ -737,8 +737,8 @@
default:
- ACPI_REPORT_ERROR ((
- "Unknown UpdateRule value: %X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Unknown UpdateRule value: %X",
(ObjDesc->CommonField.FieldFlags & AML_FIELD_UPDATE_RULE_MASK)));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
@@ -800,8 +800,8 @@
if (BufferLength < ACPI_ROUND_BITS_UP_TO_BYTES (
ObjDesc->CommonField.BitLength))
{
- ACPI_REPORT_ERROR ((
- "Field size %X (bits) is too large for buffer (%X)\n",
+ ACPI_ERROR ((AE_INFO,
+ "Field size %X (bits) is too large for buffer (%X)",
ObjDesc->CommonField.BitLength, BufferLength));
return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
@@ -921,8 +921,8 @@
if (BufferLength < ACPI_ROUND_BITS_UP_TO_BYTES (
ObjDesc->CommonField.BitLength))
{
- ACPI_REPORT_ERROR ((
- "Field size %X (bits) is too large for buffer (%X)\n",
+ ACPI_ERROR ((AE_INFO,
+ "Field size %X (bits) is too large for buffer (%X)",
ObjDesc->CommonField.BitLength, BufferLength));
/*
* Find the EndTag descriptor in each resource template.
- * Note: returned pointers point TO the EndTag, not past it.
- *
- * Compute the length of each resource template
+ * Note1: returned pointers point TO the EndTag, not past it.
+ * Note2: zero-length buffers are allowed; treated like one EndTag
*/
+
+ /* Get the length of the first resource template */
+
Status = AcpiUtGetResourceEndTag (Operand0, &EndTag);
if (ACPI_FAILURE (Status))
{
@@ -277,20 +280,23 @@
+ /* Get the length of the second resource template */
+
Status = AcpiUtGetResourceEndTag (Operand1, &EndTag);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
- /* Include the EndTag in the second template length */
+ Length1 = ACPI_PTR_DIFF (EndTag, Operand1->Buffer.Pointer);
+
+ /* Combine both lengths, minimum size will be 2 for EndTag */
if ('0' <= CharBuf[0] && CharBuf[0] <= '9')
{
- ACPI_REPORT_ERROR (("Invalid leading digit: %c\n", CharBuf[0]));
+ ACPI_ERROR ((AE_INFO, "Invalid leading digit: %c", CharBuf[0]));
return_ACPI_STATUS (AE_CTRL_PENDING);
}
@@ -327,8 +327,8 @@
* the required 4
*/
Status = AE_AML_BAD_NAME;
- ACPI_REPORT_ERROR ((
- "Bad character %02x in name, at %p\n",
+ ACPI_ERROR ((AE_INFO,
+ "Bad character %02x in name, at %p",
*AmlAddress, AmlAddress));
}
@@ -540,8 +540,8 @@
{
/* Ran out of segments after processing a prefix */
- ACPI_REPORT_ERROR ((
- "Malformed Name at %p\n", NameString));
+ ACPI_ERROR ((AE_INFO,
+ "Malformed Name at %p", NameString));
Status = AE_AML_BAD_NAME;
}
- ACPI_REPORT_ERROR (("Unknown AML opcode %X\n",
+ ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
break;
@@ -291,7 +291,7 @@
default: /* Unknown opcode */
- ACPI_REPORT_ERROR (("Unknown AML opcode %X\n",
+ ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
break;
@@ -337,7 +337,7 @@
default: /* Unknown opcode */
- ACPI_REPORT_ERROR (("Unknown AML opcode %X\n",
+ ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
@@ -471,8 +471,8 @@
if (Temp32 > 9)
{
- ACPI_REPORT_ERROR ((
- "BCD digit too large (not decimal): 0x%X\n",
+ ACPI_ERROR ((AE_INFO,
+ "BCD digit too large (not decimal): 0x%X",
Temp32));
Status = AE_AML_NUMERIC_OVERFLOW;
@@ -518,8 +518,8 @@
if (Digit > 0)
{
- ACPI_REPORT_ERROR ((
- "Integer too large to convert to BCD: %8.8X%8.8X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Integer too large to convert to BCD: %8.8X%8.8X",
ACPI_FORMAT_UINT64 (Operand[0]->Integer.Value)));
Status = AE_AML_NUMERIC_OVERFLOW;
goto Cleanup;
@@ -660,8 +660,8 @@
/* These are two obsolete opcodes */
- ACPI_REPORT_ERROR ((
- "%s is obsolete and not implemented\n",
+ ACPI_ERROR ((AE_INFO,
+ "%s is obsolete and not implemented",
AcpiPsGetOpcodeName (WalkState->Opcode)));
Status = AE_SUPPORT;
goto Cleanup;
@@ -669,7 +669,7 @@
default: /* Unknown opcode */
- ACPI_REPORT_ERROR (("Unknown AML opcode %X\n",
+ ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
@@ -789,9 +789,9 @@
Status = AcpiExResolveOperands (AML_LNOT_OP, &TempDesc, WalkState);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("%s: bad operand(s) %s\n",
- AcpiPsGetOpcodeName (WalkState->Opcode),
- AcpiFormatException(Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "While resolving operands for [%s]",
+ AcpiPsGetOpcodeName (WalkState->Opcode)));
goto Cleanup;
}
@@ -894,8 +894,8 @@
break;
default:
- ACPI_REPORT_ERROR ((
- "Operand is not Buf/Int/Str/Pkg - found type %s\n",
+ ACPI_ERROR ((AE_INFO,
+ "Operand is not Buf/Int/Str/Pkg - found type %s",
AcpiUtGetTypeName (Type)));
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
@@ -1091,8 +1091,8 @@
default:
- ACPI_REPORT_ERROR ((
- "Unknown Index TargetType %X in obj %p\n",
+ ACPI_ERROR ((AE_INFO,
+ "Unknown Index TargetType %X in obj %p",
Operand[0]->Reference.TargetType, Operand[0]));
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
@@ -1119,8 +1119,8 @@
+ /* Get the Index and Data registers */
+
ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (
Info->RegisterNode);
ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (
Info->DataRegisterNode);
- ObjDesc->IndexField.Value = (UINT32)
- (Info->FieldBitPosition / ACPI_MUL_8 (
- ObjDesc->Field.AccessByteWidth));
if (!ObjDesc->IndexField.DataObj || !ObjDesc->IndexField.IndexObj)
{
- ACPI_REPORT_ERROR (("Null Index Object during field prep\n"));
+ ACPI_ERROR ((AE_INFO, "Null Index Object during field prep"));
AcpiUtDeleteObjectDesc (ObjDesc);
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -625,6 +624,15 @@
AcpiUtAddReference (ObjDesc->IndexField.DataObj);
AcpiUtAddReference (ObjDesc->IndexField.IndexObj);
+ /*
+ * The value written to the Index register is the byte offset of the
+ * target field
+ * Note: may change code to: ACPI_DIV_8 (Info->FieldBitPosition)
+ */
+ ObjDesc->IndexField.Value = (UINT32)
+ (Info->FieldBitPosition / ACPI_MUL_8 (
+ ObjDesc->Field.AccessByteWidth));
+
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n",
ObjDesc->IndexField.StartFieldBitOffset,
Index: sys/dev/acpi/acpica/Subsystem/exregion.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/exregion.c,v
retrieving revision 1.13
diff -u -r1.13 exregion.c
--- sys/dev/acpi/acpica/Subsystem/exregion.c 29 Jan 2006 03:05:47 -0000 1.13
+++ sys/dev/acpi/acpica/Subsystem/exregion.c 7 Feb 2006 07:18:16 -0000
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exregion - ACPI default OpRegion (address space) handlers
- * xRevision: 1.94 $
+ * xRevision: 1.95 $
*
*****************************************************************************/
if (!SourceDesc)
{
- ACPI_REPORT_ERROR (("No object attached to node %p\n",
+ ACPI_ERROR ((AE_INFO, "No object attached to node %p",
Node));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
@@ -224,7 +224,7 @@
if (ACPI_GET_OBJECT_TYPE (SourceDesc) != ACPI_TYPE_PACKAGE)
{
- ACPI_REPORT_ERROR (("Object not a Package, type %s\n",
+ ACPI_ERROR ((AE_INFO, "Object not a Package, type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -244,7 +244,7 @@
if (ACPI_GET_OBJECT_TYPE (SourceDesc) != ACPI_TYPE_BUFFER)
{
- ACPI_REPORT_ERROR (("Object not a Buffer, type %s\n",
+ ACPI_ERROR ((AE_INFO, "Object not a Buffer, type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -264,7 +264,7 @@
if (ACPI_GET_OBJECT_TYPE (SourceDesc) != ACPI_TYPE_STRING)
{
- ACPI_REPORT_ERROR (("Object not a String, type %s\n",
+ ACPI_ERROR ((AE_INFO, "Object not a String, type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -280,7 +280,7 @@
if (ACPI_GET_OBJECT_TYPE (SourceDesc) != ACPI_TYPE_INTEGER)
{
- ACPI_REPORT_ERROR (("Object not a Integer, type %s\n",
+ ACPI_ERROR ((AE_INFO, "Object not a Integer, type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -324,8 +324,8 @@
if (!*StackPtr)
{
- ACPI_REPORT_ERROR (("Internal - null pointer\n"));
+ ACPI_ERROR ((AE_INFO, "Internal - null pointer"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
}
@@ -326,8 +326,8 @@
* A NULL object descriptor means an unitialized element of
* the package, can't dereference it
*/
- ACPI_REPORT_ERROR ((
- "Attempt to deref an Index to NULL pkg element Idx=%p\n",
+ ACPI_ERROR ((AE_INFO,
+ "Attempt to deref an Index to NULL pkg element Idx=%p",
StackDesc));
Status = AE_AML_UNINITIALIZED_ELEMENT;
}
@@ -338,8 +338,8 @@
ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
+
+ /*
+ * Resolve an alias object. The construction of these objects
+ * guarantees that there is only one level of alias indirection;
+ * thus, the attached object is always the aliased namespace node
+ */
+ if (ObjectType == ACPI_TYPE_LOCAL_ALIAS)
+ {
+ ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
+ *StackPtr = ObjDesc;
+ ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
+ }
break;
@@ -299,8 +312,8 @@
if (!AcpiUtValidObjectType (ObjectType))
{
- ACPI_REPORT_ERROR ((
- "Bad operand object type [%X]\n",
+ ACPI_ERROR ((AE_INFO,
+ "Bad operand object type [%X]",
ObjectType));
- ACPI_REPORT_ERROR ((
- "Target is not a Reference or Constant object - %s [%p]\n",
+ ACPI_ERROR ((AE_INFO,
+ "Target is not a Reference or Constant object - %s [%p]",
AcpiUtGetObjectTypeName (DestDesc), DestDesc));
- ACPI_REPORT_ERROR ((
- "Source must be Integer/Buffer/String type, not %s\n",
+ ACPI_ERROR ((AE_INFO,
+ "Source must be Integer/Buffer/String type, not %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@@ -607,8 +607,8 @@
default:
- ACPI_REPORT_ERROR ((
- "Target is not a Package or BufferField\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Target is not a Package or BufferField"));
Status = AE_AML_OPERAND_TYPE;
break;
}
Index: sys/dev/acpi/acpica/Subsystem/exstoren.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/exstoren.c,v
retrieving revision 1.13
diff -u -r1.13 exstoren.c
--- sys/dev/acpi/acpica/Subsystem/exstoren.c 29 Jan 2006 03:05:47 -0000 1.13
+++ sys/dev/acpi/acpica/Subsystem/exstoren.c 7 Feb 2006 07:18:17 -0000
@@ -3,7 +3,7 @@
*
* Module Name: exstoren - AML Interpreter object store support,
* Store to Node (namespace object)
- * xRevision: 1.66 $
+ * xRevision: 1.68 $
*
*****************************************************************************/
@@ -207,8 +207,8 @@
{
/* Conversion successful but still not a valid type */
- ACPI_REPORT_ERROR ((
- "Cannot assign type %s to %s (must be type Int/Str/Buf)\n",
+ ACPI_ERROR ((AE_INFO,
+ "Cannot assign type %s to %s (must be type Int/Str/Buf)",
AcpiUtGetObjectTypeName (SourceDesc),
AcpiUtGetTypeName (TargetType)));
Status = AE_AML_OPERAND_TYPE;
@@ -219,9 +219,11 @@
case ACPI_TYPE_LOCAL_ALIAS:
case ACPI_TYPE_LOCAL_METHOD_ALIAS:
- /* Aliases are resolved by AcpiExPrepOperands */
-
- ACPI_REPORT_ERROR (("Store into Alias - should never happen\n"));
+ /*
+ * All aliases should have been resolved earlier, during the
+ * operand resolution phase.
+ */
+ ACPI_ERROR ((AE_INFO, "Store into an unresolved Alias object"));
Status = AE_AML_INTERNAL;
break;
@@ -365,7 +367,7 @@
/*
* All other types come here.
*/
- ACPI_REPORT_WARNING (("Store into type %s not implemented\n",
+ ACPI_WARNING ((AE_INFO, "Store into type %s not implemented",
AcpiUtGetObjectTypeName (DestDesc)));
if (!AcpiGbl_FADT)
{
- ACPI_REPORT_ERROR (("No FADT is present\n"));
+ ACPI_ERROR ((AE_INFO, "No FADT is present"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -199,7 +199,7 @@
*/
if (!AcpiGbl_FADT->SmiCmd)
{
- ACPI_REPORT_ERROR (("No SMI_CMD in FADT, mode transition failed\n"));
+ ACPI_ERROR ((AE_INFO, "No SMI_CMD in FADT, mode transition failed"));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
@@ -212,8 +212,8 @@
*/
if (!AcpiGbl_FADT->AcpiEnable && !AcpiGbl_FADT->AcpiDisable)
{
- ACPI_REPORT_ERROR ((
- "No ACPI mode transition supported in this system (enable/disable both zero)\n"));
+ ACPI_ERROR ((AE_INFO,
+ "No ACPI mode transition supported in this system (enable/disable both zero)"));
return_ACPI_STATUS (AE_OK);
}
@@ -246,8 +246,8 @@
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not write mode change, %s\n",
- AcpiFormatException (Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Could not write ACPI mode change"));
return_ACPI_STATUS (Status);
}
@@ -268,7 +268,7 @@
Retry--;
}
- ACPI_REPORT_ERROR (("Hardware never changed modes\n"));
+ ACPI_ERROR ((AE_INFO, "Hardware did not change modes"));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
Index: sys/dev/acpi/acpica/Subsystem/hwregs.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/hwregs.c,v
retrieving revision 1.17
diff -u -r1.17 hwregs.c
--- sys/dev/acpi/acpica/Subsystem/hwregs.c 29 Jan 2006 03:05:47 -0000 1.17
+++ sys/dev/acpi/acpica/Subsystem/hwregs.c 7 Feb 2006 07:18:18 -0000
@@ -3,7 +3,7 @@
*
* Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers.
- * xRevision: 1.175 $
+ * xRevision: 1.176 $
*
******************************************************************************/
@@ -255,7 +255,7 @@
if (!Info.ReturnObject)
{
- ACPI_REPORT_ERROR (("No Sleep State object returned from [%s]\n",
+ ACPI_ERROR ((AE_INFO, "No Sleep State object returned from [%s]",
SleepStateName));
Status = AE_NOT_EXIST;
}
@@ -264,7 +264,7 @@
else if (ACPI_GET_OBJECT_TYPE (Info.ReturnObject) != ACPI_TYPE_PACKAGE)
{
- ACPI_REPORT_ERROR (("Sleep State return object is not a Package\n"));
+ ACPI_ERROR ((AE_INFO, "Sleep State return object is not a Package"));
Status = AE_AML_OPERAND_TYPE;
}
@@ -277,8 +277,8 @@
*/
else if (Info.ReturnObject->Package.Count < 2)
{
- ACPI_REPORT_ERROR ((
- "Sleep State return package does not have at least two elements\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Sleep State return package does not have at least two elements"));
Status = AE_AML_NO_OPERAND;
}
@@ -289,8 +289,8 @@
(ACPI_GET_OBJECT_TYPE (Info.ReturnObject->Package.Elements[1])
!= ACPI_TYPE_INTEGER))
{
- ACPI_REPORT_ERROR ((
- "Sleep State return package elements are not both Integers (%s, %s)\n",
+ ACPI_ERROR ((AE_INFO,
+ "Sleep State return package elements are not both Integers (%s, %s)",
AcpiUtGetObjectTypeName (Info.ReturnObject->Package.Elements[0]),
AcpiUtGetObjectTypeName (Info.ReturnObject->Package.Elements[1])));
Status = AE_AML_OPERAND_TYPE;
@@ -307,9 +307,8 @@
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "%s While evaluating SleepState [%s], bad Sleep object %p type %s\n",
- AcpiFormatException (Status),
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "While evaluating SleepState [%s], bad Sleep object %p type %s",
SleepStateName, Info.ReturnObject,
AcpiUtGetObjectTypeName (Info.ReturnObject)));
}
@@ -340,7 +339,7 @@
if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */
{
- ACPI_REPORT_ERROR ((
- "Could not create predefined name %s, %s\n",
- InitVal->Name, AcpiFormatException (Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Could not create predefined name %s",
+ InitVal->Name));
}
/*
@@ -214,8 +214,8 @@
Status = AcpiOsPredefinedOverride (InitVal, &Val);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not override predefined %s\n",
+ ACPI_ERROR ((AE_INFO,
+ "Could not override predefined %s",
InitVal->Name));
}
@@ -322,7 +322,7 @@
default:
- ACPI_REPORT_ERROR (("Unsupported initial type value %X\n",
+ ACPI_ERROR ((AE_INFO, "Unsupported initial type value %X",
InitVal->Type));
AcpiUtRemoveReference (ObjDesc);
ObjDesc = NULL;
@@ -438,7 +438,7 @@
PrefixNode = ScopeInfo->Scope.Node;
if (ACPI_GET_DESCRIPTOR_TYPE (PrefixNode) != ACPI_DESC_TYPE_NAMED)
{
- ACPI_REPORT_ERROR (("%p is not a namespace node [%s]\n",
+ ACPI_ERROR ((AE_INFO, "%p is not a namespace node [%s]",
PrefixNode, AcpiUtGetDescriptorName (PrefixNode)));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -535,8 +535,8 @@
{
/* Current scope has no parent scope */
- ACPI_REPORT_ERROR (
- ("ACPI path has too many parent prefixes (^) - reached beyond root node\n"));
+ ACPI_ERROR ((AE_INFO,
+ "ACPI path has too many parent prefixes (^) - reached beyond root node"));
return_ACPI_STATUS (AE_NOT_FOUND);
}
}
@@ -710,8 +710,8 @@
{
/* Complain about a type mismatch */
- ACPI_REPORT_WARNING ((
- "NsLookup: Type mismatch on %4.4s (%s), searching for (%s)\n",
+ ACPI_WARNING ((AE_INFO,
+ "NsLookup: Type mismatch on %4.4s (%s), searching for (%s)",
ACPI_CAST_PTR (char, &SimpleName),
AcpiUtGetTypeName (ThisNode->Type),
AcpiUtGetTypeName (TypeToCheckFor)));
Index: sys/dev/acpi/acpica/Subsystem/nsalloc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/nsalloc.c,v
retrieving revision 1.17
diff -u -r1.17 nsalloc.c
--- sys/dev/acpi/acpica/Subsystem/nsalloc.c 29 Jan 2006 03:05:47 -0000 1.17
+++ sys/dev/acpi/acpica/Subsystem/nsalloc.c 7 Feb 2006 07:18:18 -0000
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nsalloc - Namespace allocation and deletion utilities
- * xRevision: 1.99 $
+ * xRevision: 1.100 $
*
******************************************************************************/
@@ -393,7 +393,7 @@
if (ChildNode->Child)
{
- ACPI_REPORT_ERROR (("Found a grandchild! P=%p C=%p\n",
+ ACPI_ERROR ((AE_INFO, "Found a grandchild! P=%p C=%p",
ParentNode, ChildNode));
}
@@ -423,8 +423,8 @@
if (ChildNode->ReferenceCount != 1)
{
- ACPI_REPORT_WARNING ((
- "Existing references (%d) on node being deleted (%p)\n",
+ ACPI_WARNING ((AE_INFO,
+ "Existing references (%d) on node being deleted (%p)",
ChildNode->ReferenceCount, ChildNode));
}
if (!TableDesc->AmlStart)
{
- ACPI_REPORT_ERROR (("Null AML pointer\n"));
+ ACPI_ERROR ((AE_INFO, "Null AML pointer"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -193,7 +193,7 @@
if (!TableDesc->AmlLength)
{
- ACPI_REPORT_WARNING (("Zero-length AML block in table [%4.4s]\n",
+ ACPI_WARNING ((AE_INFO, "Zero-length AML block in table [%4.4s]",
TableDesc->Pointer->Signature));
return_ACPI_STATUS (AE_OK);
}
@@ -374,7 +374,7 @@
if (AcpiGbl_DSDT == NULL)
{
- ACPI_REPORT_ERROR (("DSDT is not in memory\n"));
+ ACPI_ERROR ((AE_INFO, "DSDT is not in memory"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
- ACPI_REPORT_ERROR ((
- "Null object, but type not ACPI_TYPE_ANY\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Null object, but type not ACPI_TYPE_ANY"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -330,13 +330,13 @@
*/
if (!Pathname)
{
- ACPI_REPORT_ERROR ((
- "Both Handle and Pathname are NULL\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Both Handle and Pathname are NULL"));
}
else
{
- ACPI_REPORT_ERROR ((
- "Handle is NULL and Pathname is relative\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Handle is NULL and Pathname is relative"));
}
- /*
- * Add to the Length field the length of the string
- * (add 1 for terminator)
- */
- UserPrt->Length += ObjDesc->String.Length + 1;
- break;
+ /*
+ * Add to the Length field the length of the string
+ * (add 1 for terminator)
+ */
+ UserPrt->Length += ObjDesc->String.Length + 1;
+ break;
- case ACPI_TYPE_INTEGER:
- /*
- * If this is a number, then the Source Name is NULL, since the
- * entire buffer was zeroed out, we can leave this alone.
- *
- * Add to the Length field the length of the UINT32 NULL
- */
- UserPrt->Length += sizeof (UINT32);
- break;
+ case ACPI_TYPE_INTEGER:
+ /*
+ * If this is a number, then the Source Name is NULL, since the
+ * entire buffer was zeroed out, we can leave this alone.
+ *
+ * Add to the Length field the length of the UINT32 NULL
+ */
+ UserPrt->Length += sizeof (UINT32);
+ break;
- default:
+ default:
- ACPI_REPORT_ERROR ((
- "(PRT[%X].Source) Need Ref/String/Integer, found %s\n",
- Index, AcpiUtGetObjectTypeName (ObjDesc)));
- return_ACPI_STATUS (AE_BAD_DATA);
+ ACPI_ERROR ((AE_INFO,
+ "(PRT[%X].Source) Need Ref/String/Integer, found %s",
+ Index, AcpiUtGetObjectTypeName (ObjDesc)));
+ return_ACPI_STATUS (AE_BAD_DATA);
+ }
}
/* Now align the current length */
@@ -432,8 +437,8 @@
}
else
{
- ACPI_REPORT_ERROR ((
- "(PRT[%X].SourceIndex) Need Integer, found %s\n",
+ ACPI_ERROR ((AE_INFO,
+ "(PRT[%X].SourceIndex) Need Integer, found %s",
Index, AcpiUtGetObjectTypeName (ObjDesc)));
return_ACPI_STATUS (AE_BAD_DATA);
}
Index: sys/dev/acpi/acpica/Subsystem/rsdump.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/rsdump.c,v
retrieving revision 1.15
diff -u -r1.15 rsdump.c
--- sys/dev/acpi/acpica/Subsystem/rsdump.c 29 Jan 2006 03:05:47 -0000 1.15
+++ sys/dev/acpi/acpica/Subsystem/rsdump.c 7 Feb 2006 07:18:23 -0000
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsdump - Functions to display the resource structures.
- * xRevision: 1.59 $
+ * xRevision: 1.60 $
*
******************************************************************************/
- /* Validate the Resource pointer, must be 32-bit aligned */
-
- if (((ACPI_NATIVE_UINT) Resource) & 0x3)
- {
- AcpiOsPrintf ("**** SET: Misaligned resource pointer: %p Type %2.2X Len %X\n",
- Resource, Resource->Type, Resource->Length);
- }
-
/*
* First table entry must be ACPI_RSC_INITxxx and must contain the
* table length (# of table entries)
@@ -610,7 +606,8 @@
break;
@@ -577,7 +577,7 @@
*/
if (AcpiGbl_FADT->Length < sizeof (FADT_DESCRIPTOR_REV1))
{
- ACPI_REPORT_ERROR (("FADT is invalid, too short: 0x%X\n",
+ ACPI_ERROR ((AE_INFO, "FADT is invalid, too short: 0x%X",
AcpiGbl_FADT->Length));
return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH);
}
@@ -596,8 +596,8 @@
{
/* Length is too short to be a V2.0 table */
- ACPI_REPORT_WARNING ((
- "Inconsistent FADT length (0x%X) and revision (0x%X), using FADT V1.0 portion of table\n",
+ ACPI_WARNING ((AE_INFO,
+ "Inconsistent FADT length (0x%X) and revision (0x%X), using FADT V1.0 portion of table",
AcpiGbl_FADT->Length, AcpiGbl_FADT->Revision));
if (AcpiGbl_FACS->Length < 64)
{
- ACPI_REPORT_WARNING ((
- "FACS is shorter than the ACPI specification allows: 0x%X, using anyway\n",
+ ACPI_WARNING ((AE_INFO,
+ "FACS is shorter than the ACPI specification allows: 0x%X, using anyway",
AcpiGbl_FACS->Length));
}
@@ -179,8 +179,8 @@
Status = AcpiTbGetTableBody (Address, &Header, TableInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not get ACPI table (size %X), %s\n",
- Header.Length, AcpiFormatException (Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Could not get ACPI table (size %X)", Header.Length));
return_ACPI_STATUS (Status);
}
@@ -241,8 +241,8 @@
sizeof (ACPI_TABLE_HEADER), (void *) &Header);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not map memory at %8.8X%8.8X for length %X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Could not map memory at %8.8X%8.8X for length %X",
ACPI_FORMAT_UINT64 (Address->Pointer.Physical),
sizeof (ACPI_TABLE_HEADER)));
return_ACPI_STATUS (Status);
@@ -257,7 +257,7 @@
default:
- ACPI_REPORT_ERROR (("Invalid address flags %X\n",
+ ACPI_ERROR ((AE_INFO, "Invalid address flags %X",
Address->PointerType));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -360,8 +360,7 @@
{
/* Some severe error from the OSL, but we basically ignore it */
if (ACPI_STRNCMP (Header.Signature, Signature, ACPI_NAME_SIZE))
{
- ACPI_REPORT_ERROR ((
- "Incorrect table signature - wanted [%s] found [%4.4s]\n",
+ ACPI_ERROR ((AE_INFO,
+ "Incorrect table signature - wanted [%s] found [%4.4s]",
Signature, Header.Signature));
return_ACPI_STATUS (AE_BAD_SIGNATURE);
}
@@ -339,7 +339,7 @@
Status = AcpiTbGetPrimaryTable (&Address, &TableInfo);
if ((Status != AE_OK) && (Status != AE_TABLE_NOT_SUPPORTED))
{
- ACPI_REPORT_WARNING (("%s, while getting table at %8.8X%8.8X\n",
+ ACPI_WARNING ((AE_INFO, "%s, while getting table at %8.8X%8.8X",
AcpiFormatException (Status),
ACPI_FORMAT_UINT64 (Address.Pointer.Value)));
}
@@ -349,7 +349,7 @@
if (!AcpiGbl_FADT)
{
- ACPI_REPORT_ERROR (("No FADT present in RSDT/XSDT\n"));
+ ACPI_ERROR ((AE_INFO, "No FADT present in RSDT/XSDT"));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -360,8 +360,8 @@
Status = AcpiTbConvertTableFadt ();
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not convert FADT to internal common format\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Could not convert FADT to internal common format"));
return_ACPI_STATUS (Status);
}
@@ -372,8 +372,8 @@
Status = AcpiTbGetSecondaryTable (&Address, FACS_SIG, &TableInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not get/install the FACS, %s\n",
- AcpiFormatException (Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Could not get/install the FACS"));
return_ACPI_STATUS (Status);
}
@@ -394,7 +394,7 @@
Status = AcpiTbGetSecondaryTable (&Address, DSDT_SIG, &TableInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not get/install the DSDT\n"));
+ ACPI_ERROR ((AE_INFO, "Could not get/install the DSDT"));
return_ACPI_STATUS (Status);
}
- ACPI_REPORT_ERROR ((
- "Invalid signature where RSDP indicates RSDT/XSDT should be located. RSDP:\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Invalid signature where RSDP indicates RSDT/XSDT should be located. RSDP:"));
ACPI_DUMP_BUFFER (AcpiGbl_RSDP, 20);
- ACPI_REPORT_ERROR ((
- "RSDT/XSDT signature at %X (%p) is invalid\n",
+ ACPI_ERROR ((AE_INFO,
+ "RSDT/XSDT signature at %X (%p) is invalid",
AcpiGbl_RSDP->RsdtPhysicalAddress,
(void *) (ACPI_NATIVE_UINT) AcpiGbl_RSDP->RsdtPhysicalAddress));
if (AcpiGbl_RootTableType == ACPI_TABLE_TYPE_RSDT)
{
- ACPI_REPORT_ERROR (("Looking for RSDT\n"))
+ ACPI_ERROR ((AE_INFO, "Looking for RSDT"));
}
else
{
- ACPI_REPORT_ERROR (("Looking for XSDT\n"))
+ ACPI_ERROR ((AE_INFO, "Looking for XSDT"));
}
ACPI_DUMP_BUFFER ((char *) TablePtr, 48);
@@ -355,9 +355,7 @@
Status = AcpiTbGetTable (&Address, &TableInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not get the RSDT/XSDT, %s\n",
- AcpiFormatException (Status)));
-
+ ACPI_EXCEPTION ((AE_INFO, Status, "Could not get the RSDT/XSDT"));
return_ACPI_STATUS (Status);
}
if (Checksum)
{
- ACPI_REPORT_WARNING ((
- "Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)\n",
+ ACPI_WARNING ((AE_INFO,
+ "Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)",
TableHeader->Signature, (UINT32) TableHeader->Checksum,
(UINT32) Checksum));
@@ -402,7 +402,7 @@
}
}
- ACPI_REPORT_ERROR (("TableId=%X does not exist\n", TableId));
+ ACPI_ERROR ((AE_INFO, "TableId=%X does not exist", TableId));
return (AE_BAD_PARAMETER);
}
#endif
Index: sys/dev/acpi/acpica/Subsystem/tbxface.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/Subsystem/tbxface.c,v
retrieving revision 1.13
diff -u -r1.13 tbxface.c
--- sys/dev/acpi/acpica/Subsystem/tbxface.c 29 Jan 2006 03:05:47 -0000 1.13
+++ sys/dev/acpi/acpica/Subsystem/tbxface.c 7 Feb 2006 07:18:24 -0000
@@ -2,7 +2,7 @@
*
* Module Name: tbxface - Public interfaces to the ACPI subsystem
* ACPI table oriented interfaces
- * xRevision: 1.72 $
+ * xRevision: 1.73 $
*
*****************************************************************************/
@@ -159,8 +159,7 @@
&RsdpAddress);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not get RSDP, %s\n",
- AcpiFormatException (Status)));
+ ACPI_EXCEPTION ((AE_INFO, Status, "Could not get the RSDP"));
goto ErrorExit;
}
@@ -527,9 +527,8 @@
Status = AcpiTbFindRsdp (&TableInfo, Flags);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "RSDP structure not found, %s Flags=%X\n",
- AcpiFormatException (Status), Flags));
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "RSDP structure not found - Flags=%X", Flags));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -645,8 +644,8 @@
ACPI_EBDA_PTR_LENGTH, (void *) &TablePtr);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not map memory at %8.8X for length %X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Could not map memory at %8.8X for length %X",
ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH));
return_ACPI_STATUS (Status);
@@ -672,8 +671,8 @@
ACPI_EBDA_WINDOW_SIZE, (void *) &TablePtr);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not map memory at %8.8X for length %X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Could not map memory at %8.8X for length %X",
PhysicalAddress, ACPI_EBDA_WINDOW_SIZE));
return_ACPI_STATUS (Status);
@@ -704,8 +703,8 @@
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR ((
- "Could not map memory at %8.8X for length %X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Could not map memory at %8.8X for length %X",
ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE));
return_ACPI_STATUS (Status);
@@ -773,7 +772,7 @@
/* A valid RSDP was not found */
- ACPI_REPORT_ERROR (("No valid RSDP was found\n"));
+ ACPI_ERROR ((AE_INFO, "No valid RSDP was found"));
return_ACPI_STATUS (AE_NOT_FOUND);
}
@@ -729,8 +729,8 @@
/*
* Packages as external input to control methods are not supported,
*/
- ACPI_REPORT_ERROR ((
- "Packages as parameters not implemented!\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Packages as parameters not implemented!"));
@@ -264,7 +264,7 @@
{
if (ExpectedReturnBtypes)
{
- ACPI_REPORT_MTERROR ("No object was returned from",
+ ACPI_ERROR_METHOD ("No object was returned from",
PrefixNode, Path, AE_NOT_EXIST);
if (!(ExpectedReturnBtypes & ReturnBtype))
{
- ACPI_REPORT_MTERROR ("Return object type is incorrect",
+ ACPI_ERROR_METHOD ("Return object type is incorrect",
PrefixNode, Path, AE_TYPE);
- ACPI_REPORT_ERROR ((
- "Type returned from %s was incorrect: %s, expected Btypes: %X\n",
+ ACPI_ERROR ((AE_INFO,
+ "Type returned from %s was incorrect: %s, expected Btypes: %X",
Path, AcpiUtGetObjectTypeName (Info.ReturnObject),
ExpectedReturnBtypes));
if (*OwnerId)
{
- ACPI_REPORT_ERROR (("Owner ID [%2.2X] already exists\n", *OwnerId));
+ ACPI_ERROR ((AE_INFO, "Owner ID [%2.2X] already exists", *OwnerId));
return_ACPI_STATUS (AE_ALREADY_EXISTS);
}
@@ -234,8 +234,8 @@
* methods, or there may be a bug where the IDs are not released.
*/
Status = AE_OWNER_ID_LIMIT;
- ACPI_REPORT_ERROR ((
- "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT\n"));
+ ACPI_ERROR ((AE_INFO,
+ "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT"));
@@ -634,6 +634,7 @@
* RETURN: Status, pointer to the end tag
*
* DESCRIPTION: Find the EndTag resource descriptor in an AML resource template
+ * Note: allows a buffer length of zero.
*
******************************************************************************/
@@ -655,6 +656,14 @@
Aml = ObjDesc->Buffer.Pointer;
EndAml = Aml + ObjDesc->Buffer.Length;
+ /* Allow a buffer length of zero */
+
+ if (!ObjDesc->Buffer.Length)
+ {
+ *EndTag = Aml;
+ return_ACPI_STATUS (AE_OK);
+ }
+
/* Walk the resource template, one descriptor per iteration */
while (Aml < EndAml)
@@ -671,6 +680,15 @@
if (AcpiUtGetResourceType (Aml) == ACPI_RESOURCE_NAME_END_TAG)
{
+ /*
+ * There must be at least one more byte in the buffer for
+ * the 2nd byte of the EndTag
+ */
+ if ((Aml + 1) >= EndAml)
+ {
+ return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
+ }
+
/* Return the pointer to the EndTag */