summaryrefslogtreecommitdiff
path: root/source/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler')
-rw-r--r--source/compiler/aslcompiler.l6
-rw-r--r--source/compiler/aslload.c9
-rw-r--r--source/compiler/aslmessages.c3
-rw-r--r--source/compiler/aslmessages.h3
-rw-r--r--source/compiler/aslparseop.c26
-rw-r--r--source/compiler/aslprepkg.c17
-rw-r--r--source/compiler/aslutils.c8
-rw-r--r--source/compiler/aslxref.c11
8 files changed, 71 insertions, 12 deletions
diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l
index 4016faeda806..8e448fb76ead 100644
--- a/source/compiler/aslcompiler.l
+++ b/source/compiler/aslcompiler.l
@@ -279,8 +279,8 @@ NamePathTail [.]{NameSeg}
/*
* Begin standard ASL grammar
*/
-[0-9][a-zA-Z0-9]* { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
- count (1); return (PARSEOP_INTEGER); }
+[0-9][a-zA-Z0-9]* { count (1); AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
+ return (PARSEOP_INTEGER); }
"Include" { count (1); return (PARSEOP_INCLUDE); }
"External" { count (1); return (PARSEOP_EXTERNAL); }
@@ -841,7 +841,6 @@ NamePathTail [.]{NameSeg}
* the required length.
*/
strcpy (s, "____");
- AcpiUtStrupr (AslCompilertext);
}
memcpy (s, AslCompilertext, strlen (AslCompilertext));
AslCompilerlval.s = s;
@@ -851,7 +850,6 @@ NamePathTail [.]{NameSeg}
{NameString} { char *s;
count (0);
s=UtLocalCacheCalloc (strlen (AslCompilertext)+1);
- AcpiUtStrupr (AslCompilertext);
strcpy (s, AslCompilertext);
AslCompilerlval.s = s;
DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
diff --git a/source/compiler/aslload.c b/source/compiler/aslload.c
index 454fa8f5f0db..c9fae99a9dd6 100644
--- a/source/compiler/aslload.c
+++ b/source/compiler/aslload.c
@@ -1404,9 +1404,16 @@ LdNamespace2Begin (
return (AE_OK);
}
- /* Save the target node within the alias node */
+ /* Save the target node within the alias node as well as type information */
Node->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
+ Node->Type = TargetNode->Type;
+ if (Node->Type == ACPI_TYPE_METHOD)
+ {
+ /* Save the parameter count for methods */
+
+ Node->Value = TargetNode->Value;
+ }
}
return (AE_OK);
diff --git a/source/compiler/aslmessages.c b/source/compiler/aslmessages.c
index eb3449409b53..320ad2aefa9b 100644
--- a/source/compiler/aslmessages.c
+++ b/source/compiler/aslmessages.c
@@ -381,6 +381,9 @@ const char *AslCompilerMsgs [] =
/* ASL_MSG_DUPLICATE_EXTERN_MISMATCH */ "Type mismatch between multiple external declarations detected",
/* ASL_MSG_DUPLICATE_EXTERN_FOUND_HERE */"Duplicate external declaration:",
/* ASL_MSG_CONDREF_NEEDS_EXTERNAL_DECL */"CondRefOf parameter requires External() declaration",
+/* ASL_MSG_EXTERNAL_FOUND_HERE */ "External declaration below ",
+/* ASL_MSG_LOWER_CASE_NAMESEG */ "At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case",
+/* ASL_MSG_LOWER_CASE_NAMEPATH */ "At least one lower case letter found in NamePath, ASL is case insensitive - converting to upper case",
};
/* Table compiler */
diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h
index 9a7215c63f23..8a2b5c6c7da7 100644
--- a/source/compiler/aslmessages.h
+++ b/source/compiler/aslmessages.h
@@ -383,6 +383,9 @@ typedef enum
ASL_MSG_DUPLICATE_EXTERN_MISMATCH,
ASL_MSG_DUPLICATE_EXTERN_FOUND_HERE,
ASL_MSG_CONDREF_NEEDS_EXTERNAL_DECL,
+ ASL_MSG_EXTERNAL_FOUND_HERE,
+ ASL_MSG_LOWER_CASE_NAMESEG,
+ ASL_MSG_LOWER_CASE_NAMEPATH,
/* These messages are used by the Data Table compiler only */
diff --git a/source/compiler/aslparseop.c b/source/compiler/aslparseop.c
index 46875413e439..51ef9b8c413c 100644
--- a/source/compiler/aslparseop.c
+++ b/source/compiler/aslparseop.c
@@ -388,6 +388,8 @@ TrCreateValuedLeafOp (
UINT64 Value)
{
ACPI_PARSE_OBJECT *Op;
+ UINT32 i;
+ char *StringPtr = NULL;
Op = TrAllocateOp (ParseOpcode);
@@ -408,11 +410,35 @@ TrCreateValuedLeafOp (
case PARSEOP_NAMESEG:
+ /* Check for mixed case (or all lower case). Issue a remark in this case */
+
+ for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
+ {
+ if (islower (Op->Asl.Value.Name[i]))
+ {
+ AcpiUtStrupr (&Op->Asl.Value.Name[i]);
+ AslError (ASL_REMARK, ASL_MSG_LOWER_CASE_NAMESEG, Op, Op->Asl.Value.Name);
+ break;
+ }
+ }
DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Op->Asl.Value.String);
break;
case PARSEOP_NAMESTRING:
+ /* Check for mixed case (or all lower case). Issue a remark in this case */
+
+ StringPtr = Op->Asl.Value.Name;
+ for (i = 0; *StringPtr; i++)
+ {
+ if (islower (*StringPtr))
+ {
+ AcpiUtStrupr (&Op->Asl.Value.Name[i]);
+ AslError (ASL_REMARK, ASL_MSG_LOWER_CASE_NAMEPATH, Op, Op->Asl.Value.Name);
+ break;
+ }
+ StringPtr++;
+ }
DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Op->Asl.Value.String);
break;
diff --git a/source/compiler/aslprepkg.c b/source/compiler/aslprepkg.c
index f3042caef432..35b947c84bdf 100644
--- a/source/compiler/aslprepkg.c
+++ b/source/compiler/aslprepkg.c
@@ -318,6 +318,17 @@ ApCheckPackage (
*/
for (i = 0; i < Count; i++)
{
+ if (!Op)
+ {
+ /*
+ * If we get to this point, it means that the package length
+ * is larger than the initializer list. Stop processing the
+ * package and return because we have run out of package
+ * elements to analyze.
+ */
+ return;
+ }
+
ApCheckObjectType (Predefined->Info.Name, Op,
Package->RetInfo.ObjectType1, i);
Op = Op->Asl.Next;
@@ -917,7 +928,7 @@ ApPackageTooSmall (
UINT32 ExpectedCount)
{
- sprintf (AslGbl_MsgBuffer, "%s: length %u, required minimum is %u",
+ sprintf (AslGbl_MsgBuffer, "%4.4s: length %u, required minimum is %u",
PredefinedName, Count, ExpectedCount);
AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, AslGbl_MsgBuffer);
@@ -946,7 +957,7 @@ ApZeroLengthPackage (
ACPI_PARSE_OBJECT *Op)
{
- sprintf (AslGbl_MsgBuffer, "%s: length is zero", PredefinedName);
+ sprintf (AslGbl_MsgBuffer, "%4.4s: length is zero", PredefinedName);
AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, AslGbl_MsgBuffer);
}
@@ -975,7 +986,7 @@ ApPackageTooLarge (
UINT32 ExpectedCount)
{
- sprintf (AslGbl_MsgBuffer, "%s: length is %u, only %u required",
+ sprintf (AslGbl_MsgBuffer, "%4.4s: length is %u, only %u required",
PredefinedName, Count, ExpectedCount);
AslError (ASL_REMARK, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, AslGbl_MsgBuffer);
diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c
index 42ef2c0b88c1..16fad62733f4 100644
--- a/source/compiler/aslutils.c
+++ b/source/compiler/aslutils.c
@@ -1074,14 +1074,16 @@ UtDoConstant (
{
ACPI_STATUS Status;
UINT64 ConvertedInteger;
- char ErrBuf[64];
+ char ErrBuf[128];
+ const ACPI_EXCEPTION_INFO *ExceptionInfo;
Status = AcpiUtStrtoul64 (String, &ConvertedInteger);
if (ACPI_FAILURE (Status))
{
- sprintf (ErrBuf, "While creating 64-bit constant: %s\n",
- AcpiFormatException (Status));
+ ExceptionInfo = AcpiUtValidateException ((ACPI_STATUS) Status);
+ sprintf (ErrBuf, " %s while converting to 64-bit integer",
+ ExceptionInfo->Description);
AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, AslGbl_CurrentLineNumber,
AslGbl_LogicalLineNumber, AslGbl_CurrentLineOffset,
diff --git a/source/compiler/aslxref.c b/source/compiler/aslxref.c
index 9306af200f50..163799a8beea 100644
--- a/source/compiler/aslxref.c
+++ b/source/compiler/aslxref.c
@@ -433,6 +433,7 @@ XfNamespaceLocateBegin (
UINT32 i;
ACPI_NAMESPACE_NODE *DeclarationParentMethod;
ACPI_PARSE_OBJECT *ReferenceParentMethod;
+ char *ExternalPath;
ACPI_FUNCTION_TRACE_PTR (XfNamespaceLocateBegin, Op);
@@ -1263,7 +1264,15 @@ XfNamespaceLocateBegin (
Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_CONDREFOF &&
!XfRefIsGuardedByIfCondRefOf (Node, Op))
{
- AslError (ASL_ERROR, ASL_MSG_UNDEFINED_EXTERNAL, Op, NULL);
+ ExternalPath = AcpiNsGetNormalizedPathname (Node, TRUE);
+ sprintf (AslGbl_MsgBuffer, "full path of external object: %s",
+ ExternalPath);
+ AslDualParseOpError (ASL_ERROR, ASL_MSG_UNDEFINED_EXTERNAL, Op, NULL,
+ ASL_MSG_EXTERNAL_FOUND_HERE, Node->Op, AslGbl_MsgBuffer);
+ if (ExternalPath)
+ {
+ ACPI_FREE (ExternalPath);
+ }
}
/* 5) Check for a connection object */