Changed Timeout parameters to 16-bit to match ACPI spec.

date	2002.11.04.19.11.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:57:52 +00:00
parent 8bb22603ba
commit 406144a772
2 changed files with 44 additions and 110 deletions

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exsystem - Interface to OS services
* $Revision: 1.73 $
* $Revision: 1.74 $
*
*****************************************************************************/
@ -143,7 +143,7 @@
ACPI_STATUS
AcpiExSystemWaitSemaphore (
ACPI_HANDLE Semaphore,
UINT32 Timeout)
UINT16 Timeout)
{
ACPI_STATUS Status;
ACPI_STATUS Status2;
@ -300,12 +300,12 @@ AcpiExSystemAcquireMutex (
*/
if (ObjDesc->Mutex.Semaphore == AcpiGbl_GlobalLockSemaphore)
{
Status = AcpiEvAcquireGlobalLock ((UINT32) TimeDesc->Integer.Value);
Status = AcpiEvAcquireGlobalLock ((UINT16) TimeDesc->Integer.Value);
return_ACPI_STATUS (Status);
}
Status = AcpiExSystemWaitSemaphore (ObjDesc->Mutex.Semaphore,
(UINT32) TimeDesc->Integer.Value);
(UINT16) TimeDesc->Integer.Value);
return_ACPI_STATUS (Status);
}
@ -415,7 +415,7 @@ AcpiExSystemWaitEvent (
if (ObjDesc)
{
Status = AcpiExSystemWaitSemaphore (ObjDesc->Event.Semaphore,
(UINT32) TimeDesc->Integer.Value);
(UINT16) TimeDesc->Integer.Value);
}
return_ACPI_STATUS (Status);

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exutils - interpreter/scanner utilities
* $Revision: 1.95 $
* $Revision: 1.106 $
*
*****************************************************************************/
@ -142,6 +142,8 @@
ACPI_MODULE_NAME ("exutils")
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: AcpiExEnterInterpreter
@ -210,41 +212,11 @@ AcpiExExitInterpreter (void)
}
/*******************************************************************************
*
* FUNCTION: AcpiExValidateObjectType
*
* PARAMETERS: Type Object type to validate
*
* DESCRIPTION: Determine if a type is a valid ACPI object type
*
******************************************************************************/
BOOLEAN
AcpiExValidateObjectType (
ACPI_OBJECT_TYPE Type)
{
ACPI_FUNCTION_ENTRY ();
if ((Type > ACPI_TYPE_MAX && Type < INTERNAL_TYPE_BEGIN) ||
(Type > INTERNAL_TYPE_MAX))
{
return (FALSE);
}
return (TRUE);
}
/*******************************************************************************
*
* FUNCTION: AcpiExTruncateFor32bitTable
*
* PARAMETERS: ObjDesc - Object to be truncated
* WalkState - Current walk state
* (A method must be executing)
*
* RETURN: none
*
@ -255,8 +227,7 @@ AcpiExValidateObjectType (
void
AcpiExTruncateFor32bitTable (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
ACPI_OPERAND_OBJECT *ObjDesc)
{
ACPI_FUNCTION_ENTRY ();
@ -267,13 +238,12 @@ AcpiExTruncateFor32bitTable (
* a control method
*/
if ((!ObjDesc) ||
(ObjDesc->Common.Type != ACPI_TYPE_INTEGER) ||
(!WalkState->MethodNode))
(ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER))
{
return;
}
if (WalkState->MethodNode->Flags & ANOBJ_DATA_WIDTH_32)
if (AcpiGbl_IntegerByteWidth == 4)
{
/*
* We are running a method that exists in a 32-bit ACPI table.
@ -316,7 +286,7 @@ AcpiExAcquireGlobalLock (
{
/* We should attempt to get the lock, wait forever */
Status = AcpiEvAcquireGlobalLock (ACPI_UINT32_MAX);
Status = AcpiEvAcquireGlobalLock (ACPI_WAIT_FOREVER);
if (ACPI_SUCCESS (Status))
{
Locked = TRUE;
@ -366,9 +336,12 @@ AcpiExReleaseGlobalLock (
{
/* Report the error, but there isn't much else we can do */
ACPI_REPORT_ERROR (("Could not release ACPI Global Lock\n"));
ACPI_REPORT_ERROR (("Could not release ACPI Global Lock, %s\n",
AcpiFormatException (Status)));
}
}
return_VOID;
}
@ -388,72 +361,31 @@ AcpiExDigitsNeeded (
ACPI_INTEGER Value,
UINT32 Base)
{
UINT32 NumDigits = 0;
UINT32 NumDigits;
ACPI_INTEGER CurrentValue;
ACPI_INTEGER Quotient;
ACPI_FUNCTION_TRACE ("ExDigitsNeeded");
if (Base < 1)
/*
* ACPI_INTEGER is unsigned, so we don't worry about a '-'
*/
CurrentValue = Value;
NumDigits = 0;
while (CurrentValue)
{
ACPI_REPORT_ERROR (("ExDigitsNeeded: Internal error - Invalid base\n"));
}
else
{
/*
* ACPI_INTEGER is unsigned, which is why we don't worry about a '-'
*/
for (NumDigits = 1;
(AcpiUtShortDivide (&Value, Base, &Value, NULL));
++NumDigits)
{ ; }
(void) AcpiUtShortDivide (&CurrentValue, Base, &Quotient, NULL);
NumDigits++;
CurrentValue = Quotient;
}
return_VALUE (NumDigits);
}
/*******************************************************************************
*
* FUNCTION: ntohl
*
* PARAMETERS: Value - Value to be converted
*
* DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes)
*
******************************************************************************/
static UINT32
_ntohl (
UINT32 Value)
{
union
{
UINT32 Value;
UINT8 Bytes[4];
} Out;
union
{
UINT32 Value;
UINT8 Bytes[4];
} In;
ACPI_FUNCTION_ENTRY ();
In.Value = Value;
Out.Bytes[0] = In.Bytes[3];
Out.Bytes[1] = In.Bytes[2];
Out.Bytes[2] = In.Bytes[1];
Out.Bytes[3] = In.Bytes[0];
return (Out.Value);
}
/*******************************************************************************
*
* FUNCTION: AcpiExEisaIdToString
@ -470,23 +402,23 @@ AcpiExEisaIdToString (
UINT32 NumericId,
NATIVE_CHAR *OutString)
{
UINT32 id;
UINT32 EisaId;
ACPI_FUNCTION_ENTRY ();
/* swap to big-endian to get contiguous bits */
/* Swap ID to big-endian to get contiguous bits */
id = _ntohl (NumericId);
EisaId = AcpiUtDwordByteSwap (NumericId);
OutString[0] = (char) ('@' + ((id >> 26) & 0x1f));
OutString[1] = (char) ('@' + ((id >> 21) & 0x1f));
OutString[2] = (char) ('@' + ((id >> 16) & 0x1f));
OutString[3] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) id, 12);
OutString[4] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) id, 8);
OutString[5] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) id, 4);
OutString[6] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) id, 0);
OutString[0] = (char) ('@' + (((unsigned long) EisaId >> 26) & 0x1f));
OutString[1] = (char) ('@' + ((EisaId >> 21) & 0x1f));
OutString[2] = (char) ('@' + ((EisaId >> 16) & 0x1f));
OutString[3] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 12);
OutString[4] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 8);
OutString[5] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 4);
OutString[6] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 0);
OutString[7] = 0;
}
@ -510,6 +442,7 @@ AcpiExUnsignedIntegerToString (
UINT32 Count;
UINT32 DigitsNeeded;
UINT32 Remainder;
ACPI_INTEGER Quotient;
ACPI_FUNCTION_ENTRY ();
@ -520,9 +453,10 @@ AcpiExUnsignedIntegerToString (
for (Count = DigitsNeeded; Count > 0; Count--)
{
(void) AcpiUtShortDivide (&Value, 10, &Value, &Remainder);
OutString[Count-1] = (NATIVE_CHAR) ('0' + Remainder);
(void) AcpiUtShortDivide (&Value, 10, &Quotient, &Remainder);
OutString[Count-1] = (NATIVE_CHAR) ('0' + Remainder);\
Value = Quotient;
}
}
#endif