Unchanged files that are off the vendor branch.

Approved by:	njl
MFC after:	1 week
This commit is contained in:
Mark Santcroos 2004-12-01 23:34:39 +00:00
parent 0228d5b66c
commit 8baa584183
9 changed files with 218 additions and 213 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
* $Revision: 158 $
* $Revision: 169 $
*
*****************************************************************************/
@ -137,12 +137,12 @@
/* Version string */
#define ACPI_CA_VERSION 0x20040527
#define ACPI_CA_VERSION 0x20041119
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
* but there is a large base of ASL/AML code in existing machines that check
* for the string below. The use of this string usually guarantees that
* for the string below. The use of this string usually guarantees that
* the ASL will execute down the most tested code path. Also, there is some
* code that will not execute the _OSI method unless _OS matches the string
* below. Therefore, change this string at your own risk.

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acenv.h - Generation environment specific items
* $Revision: 107 $
* $Revision: 109 $
*
*****************************************************************************/
@ -225,7 +225,7 @@
#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.
@ -305,6 +305,7 @@
#define ACPI_STRCAT(d,s) (void) strcat((d), (s))
#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (ACPI_SIZE)(n))
#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMCMP(s1,s2,n) memcmp((s1), (s2), (ACPI_SIZE)(n))
#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n))
@ -368,6 +369,7 @@ typedef char *va_list;
#define ACPI_STRCAT(d,s) (void) AcpiUtStrcat ((d), (s))
#define ACPI_STRNCAT(d,s,n) AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n))
#define ACPI_STRTOUL(d,s,n) AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMCMP(s1,s2,n) AcpiUtMemcmp((s1), (s2), (ACPI_SIZE)(n))
#define ACPI_MEMCPY(d,s,n) (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMSET(d,v,n) (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n))
#define ACPI_TOUPPER AcpiUtToUpper

View File

@ -263,13 +263,13 @@ AcpiOsGetPhysicalAddress (
ACPI_STATUS
AcpiOsInstallInterruptHandler (
UINT32 InterruptNumber,
OSD_HANDLER ServiceRoutine,
ACPI_OSD_HANDLER ServiceRoutine,
void *Context);
ACPI_STATUS
AcpiOsRemoveInterruptHandler (
UINT32 InterruptNumber,
OSD_HANDLER ServiceRoutine);
ACPI_OSD_HANDLER ServiceRoutine);
/*
@ -283,13 +283,16 @@ AcpiOsGetThreadId (
ACPI_STATUS
AcpiOsQueueForExecution (
UINT32 Priority,
OSD_EXECUTION_CALLBACK Function,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context);
void
AcpiOsWaitEventsComplete (
void *Context);
void
AcpiOsSleep (
UINT32 Seconds,
UINT32 Milliseconds);
ACPI_INTEGER Milliseconds);
void
AcpiOsStall (
@ -332,29 +335,32 @@ AcpiOsWriteMemory (
/*
* Platform and hardware-independent PCI configuration space access
* Note: Can't use "Register" as a parameter, changed to "Reg" --
* certain compilers complain.
*/
ACPI_STATUS
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Register,
UINT32 Reg,
void *Value,
UINT32 Width);
ACPI_STATUS
AcpiOsWritePciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Register,
UINT32 Reg,
ACPI_INTEGER Value,
UINT32 Width);
/*
* Interim function needed for PCI IRQ routing
*/
void
AcpiOsDerivePciId(
ACPI_HANDLE rhandle,
ACPI_HANDLE chandle,
ACPI_HANDLE Rhandle,
ACPI_HANDLE Chandle,
ACPI_PCI_ID **PciId);
/*
@ -371,7 +377,7 @@ AcpiOsWritable (
void *Pointer,
ACPI_SIZE Length);
UINT32
UINT64
AcpiOsGetTimer (
void);

View File

@ -371,6 +371,15 @@ AcpiInstallGpeHandler (
ACPI_EVENT_HANDLER Address,
void *Context);
ACPI_STATUS
AcpiInstallExceptionHandler (
ACPI_EXCEPTION_HANDLER Handler);
/*
* Event interfaces
*/
ACPI_STATUS
AcpiAcquireGlobalLock (
UINT16 Timeout,

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
* $Revision: 161 $
* $Revision: 164 $
*
*****************************************************************************/
@ -251,6 +251,12 @@ AcpiUtStrncpy (
const char *SrcString,
ACPI_SIZE Count);
int
AcpiUtMemcmp (
const char *Buffer1,
const char *Buffer2,
ACPI_SIZE Count);
int
AcpiUtStrncmp (
const char *String1,
@ -651,6 +657,10 @@ ACPI_OPERAND_OBJECT *
AcpiUtCreateBufferObject (
ACPI_SIZE BufferSize);
ACPI_OPERAND_OBJECT *
AcpiUtCreateStringObject (
ACPI_SIZE StringSize);
/*
* UtRefCnt - Object reference count management
@ -764,14 +774,14 @@ AcpiUtPrintString (
ACPI_STATUS
AcpiUtDivide (
ACPI_INTEGER *InDividend,
ACPI_INTEGER *InDivisor,
ACPI_INTEGER InDividend,
ACPI_INTEGER InDivisor,
ACPI_INTEGER *OutQuotient,
ACPI_INTEGER *OutRemainder);
ACPI_STATUS
AcpiUtShortDivide (
ACPI_INTEGER *InDividend,
ACPI_INTEGER InDividend,
UINT32 Divisor,
ACPI_INTEGER *OutQuotient,
UINT32 *OutRemainder);
@ -790,6 +800,10 @@ AcpiUtStrtoul64 (
UINT32 Base,
ACPI_INTEGER *RetInteger);
/* Values for Base above (16=Hex, 10=Decimal) */
#define ACPI_ANY_BASE 0
char *
AcpiUtStrupr (
char *SrcString);

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exfldio - Aml Field I/O
* $Revision: 106 $
* $Revision: 111 $
*
*****************************************************************************/
@ -212,6 +212,23 @@ AcpiExSetupRegion (
+ FieldDatumByteOffset
+ ObjDesc->CommonField.AccessByteWidth))
{
if (AcpiGbl_EnableInterpreterSlack)
{
/*
* Slack mode only: We will go ahead and allow access to this
* field if it is within the region length rounded up to the next
* access width boundary.
*/
if (ACPI_ROUND_UP (RgnDesc->Region.Length,
ObjDesc->CommonField.AccessByteWidth) >=
(ObjDesc->CommonField.BaseByteOffset +
(ACPI_NATIVE_UINT) ObjDesc->CommonField.AccessByteWidth +
FieldDatumByteOffset))
{
return_ACPI_STATUS (AE_OK);
}
}
if (RgnDesc->Region.Length < ObjDesc->CommonField.AccessByteWidth)
{
/*
@ -237,25 +254,6 @@ AcpiExSetupRegion (
FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth,
AcpiUtGetNodeName (RgnDesc->Region.Node), RgnDesc->Region.Length));
#ifndef ACPICA_PEDANTIC
{
/*
* Allow access to the field if it is within the region size
* rounded up to a multiple of the access byte width. This
* overcomes "off-by-one" programming errors in the AML often
* found in Toshiba laptops. These errors were allowed by
* the Microsoft ASL compiler.
*/
UINT32 rounded_length = ACPI_ROUND_UP(RgnDesc->Region.Length,
ObjDesc->CommonField.AccessByteWidth);
if (rounded_length >= (ObjDesc->CommonField.BaseByteOffset +
FieldDatumByteOffset +
ObjDesc->CommonField.AccessByteWidth)) {
return_ACPI_STATUS (AE_OK);
}
}
#endif
return_ACPI_STATUS (AE_AML_REGION_LIMIT);
}
@ -910,7 +908,7 @@ AcpiExCommonBufferSetup (
return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
}
/*
/*
* Create "actual" field byte count (minimum number of bytes that
* must be read), then convert to datum count (minimum number
* of datum-sized units that must be read)

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exsystem - Interface to OS services
* $Revision: 80 $
* $Revision: 81 $
*
*****************************************************************************/
@ -246,7 +246,7 @@ AcpiExSystemDoStall (
ACPI_STATUS
AcpiExSystemDoSuspend (
UINT32 HowLong)
ACPI_INTEGER HowLong)
{
ACPI_STATUS Status;
@ -258,8 +258,7 @@ AcpiExSystemDoSuspend (
AcpiExExitInterpreter ();
AcpiOsSleep ((UINT16) (HowLong / (UINT32) 1000),
(UINT16) (HowLong % (UINT32) 1000));
AcpiOsSleep (HowLong);
/* And now we must get the interpreter again */

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
* $Revision: 144 $
* $Revision: 146 $
*
*****************************************************************************/
@ -240,141 +240,143 @@ AcpiPsCompleteThisOp (
/* Delete this op and the subtree below it if asked to */
if (((WalkState->ParseFlags & ACPI_PARSE_TREE_MASK) == ACPI_PARSE_DELETE_TREE) &&
(WalkState->OpInfo->Class != AML_CLASS_ARGUMENT))
if (((WalkState->ParseFlags & ACPI_PARSE_TREE_MASK) != ACPI_PARSE_DELETE_TREE) ||
(WalkState->OpInfo->Class == AML_CLASS_ARGUMENT))
{
/* Make sure that we only delete this subtree */
if (Op->Common.Parent)
{
/*
* Check if we need to replace the operator and its subtree
* with a return value op (placeholder op)
*/
ParentInfo = AcpiPsGetOpcodeInfo (Op->Common.Parent->Common.AmlOpcode);
switch (ParentInfo->Class)
{
case AML_CLASS_CONTROL:
break;
case AML_CLASS_CREATE:
/*
* These opcodes contain TermArg operands. The current
* op must be replaced by a placeholder return op
*/
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
if (!ReplacementOp)
{
return_VOID;
}
break;
case AML_CLASS_NAMED_OBJECT:
/*
* These opcodes contain TermArg operands. The current
* op must be replaced by a placeholder return op
*/
if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_DATA_REGION_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_BUFFER_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
if (!ReplacementOp)
{
return_VOID;
}
}
if ((Op->Common.Parent->Common.AmlOpcode == AML_NAME_OP) &&
(WalkState->DescendingCallback != AcpiDsExecBeginOp))
{
if ((Op->Common.AmlOpcode == AML_BUFFER_OP) ||
(Op->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode);
if (!ReplacementOp)
{
return_VOID;
}
ReplacementOp->Named.Data = Op->Named.Data;
ReplacementOp->Named.Length = Op->Named.Length;
}
}
break;
default:
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
if (!ReplacementOp)
{
return_VOID;
}
}
/* We must unlink this op from the parent tree */
Prev = Op->Common.Parent->Common.Value.Arg;
if (Prev == Op)
{
/* This op is the first in the list */
if (ReplacementOp)
{
ReplacementOp->Common.Parent = Op->Common.Parent;
ReplacementOp->Common.Value.Arg = NULL;
ReplacementOp->Common.Node = Op->Common.Node;
Op->Common.Parent->Common.Value.Arg = ReplacementOp;
ReplacementOp->Common.Next = Op->Common.Next;
}
else
{
Op->Common.Parent->Common.Value.Arg = Op->Common.Next;
}
}
/* Search the parent list */
else while (Prev)
{
/* Traverse all siblings in the parent's argument list */
Next = Prev->Common.Next;
if (Next == Op)
{
if (ReplacementOp)
{
ReplacementOp->Common.Parent = Op->Common.Parent;
ReplacementOp->Common.Value.Arg = NULL;
ReplacementOp->Common.Node = Op->Common.Node;
Prev->Common.Next = ReplacementOp;
ReplacementOp->Common.Next = Op->Common.Next;
Next = NULL;
}
else
{
Prev->Common.Next = Op->Common.Next;
Next = NULL;
}
}
Prev = Next;
}
}
/* Now we can actually delete the subtree rooted at op */
AcpiPsDeleteParseTree (Op);
return_VOID;
}
/* Make sure that we only delete this subtree */
if (Op->Common.Parent)
{
/*
* Check if we need to replace the operator and its subtree
* with a return value op (placeholder op)
*/
ParentInfo = AcpiPsGetOpcodeInfo (Op->Common.Parent->Common.AmlOpcode);
switch (ParentInfo->Class)
{
case AML_CLASS_CONTROL:
break;
case AML_CLASS_CREATE:
/*
* These opcodes contain TermArg operands. The current
* op must be replaced by a placeholder return op
*/
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
if (!ReplacementOp)
{
goto Cleanup;
}
break;
case AML_CLASS_NAMED_OBJECT:
/*
* These opcodes contain TermArg operands. The current
* op must be replaced by a placeholder return op
*/
if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_DATA_REGION_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_BUFFER_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
if (!ReplacementOp)
{
goto Cleanup;
}
}
if ((Op->Common.Parent->Common.AmlOpcode == AML_NAME_OP) &&
(WalkState->DescendingCallback != AcpiDsExecBeginOp))
{
if ((Op->Common.AmlOpcode == AML_BUFFER_OP) ||
(Op->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode);
if (!ReplacementOp)
{
goto Cleanup;
}
ReplacementOp->Named.Data = Op->Named.Data;
ReplacementOp->Named.Length = Op->Named.Length;
}
}
break;
default:
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
if (!ReplacementOp)
{
goto Cleanup;
}
}
/* We must unlink this op from the parent tree */
Prev = Op->Common.Parent->Common.Value.Arg;
if (Prev == Op)
{
/* This op is the first in the list */
if (ReplacementOp)
{
ReplacementOp->Common.Parent = Op->Common.Parent;
ReplacementOp->Common.Value.Arg = NULL;
ReplacementOp->Common.Node = Op->Common.Node;
Op->Common.Parent->Common.Value.Arg = ReplacementOp;
ReplacementOp->Common.Next = Op->Common.Next;
}
else
{
Op->Common.Parent->Common.Value.Arg = Op->Common.Next;
}
}
/* Search the parent list */
else while (Prev)
{
/* Traverse all siblings in the parent's argument list */
Next = Prev->Common.Next;
if (Next == Op)
{
if (ReplacementOp)
{
ReplacementOp->Common.Parent = Op->Common.Parent;
ReplacementOp->Common.Value.Arg = NULL;
ReplacementOp->Common.Node = Op->Common.Node;
Prev->Common.Next = ReplacementOp;
ReplacementOp->Common.Next = Op->Common.Next;
Next = NULL;
}
else
{
Prev->Common.Next = Op->Common.Next;
Next = NULL;
}
}
Prev = Next;
}
}
Cleanup:
/* Now we can actually delete the subtree rooted at op */
AcpiPsDeleteParseTree (Op);
return_VOID;
}
@ -661,7 +663,8 @@ AcpiPsParseLoop (
PreOp = AcpiPsAllocOp (WalkState->Opcode);
if (!PreOp)
{
return_ACPI_STATUS (AE_NO_MEMORY);
Status = AE_NO_MEMORY;
goto CloseThisOp;
}
}
@ -690,7 +693,8 @@ AcpiPsParseLoop (
if (!GET_CURRENT_ARG_TYPE (WalkState->ArgTypes))
{
return_ACPI_STATUS (AE_AML_NO_OPERAND);
Status = AE_AML_NO_OPERAND;
goto CloseThisOp;
}
/* We know that this arg is a name, move to next arg */
@ -757,7 +761,8 @@ AcpiPsParseLoop (
Op = AcpiPsAllocOp (WalkState->Opcode);
if (!Op)
{
return_ACPI_STATUS (AE_NO_MEMORY);
Status = AE_NO_MEMORY;
goto CloseThisOp;
}
if (WalkState->OpInfo->Flags & AML_CREATE)
@ -936,7 +941,7 @@ AcpiPsParseLoop (
WalkState->ArgTypes, WalkState->ArgCount);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
goto CloseThisOp;
}
Op = NULL;
continue;
@ -1227,10 +1232,6 @@ AcpiPsParseAml (
ACPI_THREAD_STATE *Thread;
ACPI_THREAD_STATE *PrevWalkList = AcpiGbl_CurrentWalkList;
ACPI_WALK_STATE *PreviousWalkState;
#ifndef ACPICA_PEDANTIC
ACPI_OPERAND_OBJECT **CallerReturnDesc = WalkState->CallerReturnDesc;
ACPI_OPERAND_OBJECT *EffectiveReturnDesc = NULL;
#endif
ACPI_FUNCTION_TRACE ("PsParseAml");
@ -1297,7 +1298,7 @@ AcpiPsParseAml (
{
Status = AE_OK;
}
else if (Status != AE_OK)
else if ((Status != AE_OK) && (WalkState->MethodDesc))
{
ACPI_REPORT_METHOD_ERROR ("Method execution failed",
WalkState->MethodNode, NULL, Status);
@ -1331,17 +1332,6 @@ AcpiPsParseAml (
WalkState = AcpiDsPopWalkState (Thread);
#ifndef ACPICA_PEDANTIC
/* Save the last effective return value */
if (CallerReturnDesc && WalkState->ReturnDesc)
{
AcpiUtRemoveReference (EffectiveReturnDesc);
EffectiveReturnDesc = WalkState->ReturnDesc;
AcpiUtAddReference (EffectiveReturnDesc);
}
#endif
/* Reset the current scope to the beginning of scope stack */
AcpiDsScopeStackClear (WalkState);
@ -1404,19 +1394,6 @@ AcpiPsParseAml (
*/
else if (PreviousWalkState->CallerReturnDesc)
{
#ifndef ACPICA_PEDANTIC
/*
* Some AML code expects a return value without a ReturnOp.
* Return the saved effective return value instead.
*/
if (PreviousWalkState->ReturnDesc == NULL && EffectiveReturnDesc != NULL)
{
PreviousWalkState->ReturnDesc = EffectiveReturnDesc;
AcpiUtAddReference (PreviousWalkState->ReturnDesc);
}
#endif
*(PreviousWalkState->CallerReturnDesc) = PreviousWalkState->ReturnDesc; /* NULL if no return value */
}
else if (PreviousWalkState->ReturnDesc)
@ -1431,9 +1408,6 @@ AcpiPsParseAml (
/* Normal exit */
#ifndef ACPICA_PEDANTIC
AcpiUtRemoveReference (EffectiveReturnDesc);
#endif
AcpiExReleaseAllMutexes (Thread);
AcpiUtDeleteGenericState (ACPI_CAST_PTR (ACPI_GENERIC_STATE, Thread));
AcpiGbl_CurrentWalkList = PrevWalkList;

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbget - ACPI Table get* routines
* $Revision: 88 $
* $Revision: 90 $
*
*****************************************************************************/
@ -245,6 +245,9 @@ AcpiTbGetTableHeader (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Table Signature: [%4.4s]\n",
ReturnHeader->Signature));
return_ACPI_STATUS (AE_OK);
}