aboutsummaryrefslogtreecommitdiff
path: root/executer
diff options
context:
space:
mode:
Diffstat (limited to 'executer')
-rw-r--r--executer/exconfig.c4
-rw-r--r--executer/exconvrt.c3
-rw-r--r--executer/exfield.c3
-rw-r--r--executer/exoparg1.c28
-rw-r--r--executer/exoparg6.c7
-rw-r--r--executer/exregion.c38
6 files changed, 44 insertions, 39 deletions
diff --git a/executer/exconfig.c b/executer/exconfig.c
index 8c08165251a1..d0acdd5f8030 100644
--- a/executer/exconfig.c
+++ b/executer/exconfig.c
@@ -263,15 +263,13 @@ AcpiExLoadTableOp (
/* Table not found, return an Integer=0 and AE_OK */
- DdbHandle = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ DdbHandle = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!DdbHandle)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
- DdbHandle->Integer.Value = 0;
*ReturnDesc = DdbHandle;
-
return_ACPI_STATUS (AE_OK);
}
diff --git a/executer/exconvrt.c b/executer/exconvrt.c
index e7d853032989..fd8fec1c711e 100644
--- a/executer/exconvrt.c
+++ b/executer/exconvrt.c
@@ -260,7 +260,7 @@ AcpiExConvertToInteger (
/* Create a new integer */
- ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ ReturnDesc = AcpiUtCreateIntegerObject (Result);
if (!ReturnDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -271,7 +271,6 @@ AcpiExConvertToInteger (
/* Save the Result */
- ReturnDesc->Integer.Value = Result;
AcpiExTruncateFor32bitTable (ReturnDesc);
*ResultDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);
diff --git a/executer/exfield.c b/executer/exfield.c
index 0ee522c572a4..503e8e6b370b 100644
--- a/executer/exfield.c
+++ b/executer/exfield.c
@@ -249,14 +249,13 @@ AcpiExReadDataFromField (
{
/* Field will fit within an Integer (normal case) */
- BufferDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ BufferDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!BufferDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Length = AcpiGbl_IntegerByteWidth;
- BufferDesc->Integer.Value = 0;
Buffer = &BufferDesc->Integer.Value;
}
diff --git a/executer/exoparg1.c b/executer/exoparg1.c
index 70085693ba49..4a90b9c9506d 100644
--- a/executer/exoparg1.c
+++ b/executer/exoparg1.c
@@ -183,13 +183,12 @@ AcpiExOpcode_0A_0T_1R (
/* Create a return object of type Integer */
- ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ ReturnDesc = AcpiUtCreateIntegerObject (AcpiOsGetTimer ());
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
- ReturnDesc->Integer.Value = AcpiOsGetTimer ();
break;
default: /* Unknown opcode */
@@ -733,7 +732,7 @@ AcpiExOpcode_1A_0T_1R (
{
case AML_LNOT_OP: /* LNot (Operand) */
- ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
@@ -838,14 +837,12 @@ AcpiExOpcode_1A_0T_1R (
/* Allocate a descriptor to hold the type. */
- ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) Type);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
-
- ReturnDesc->Integer.Value = Type;
break;
@@ -917,14 +914,12 @@ AcpiExOpcode_1A_0T_1R (
* Now that we have the size of the object, create a result
* object to hold the value
*/
- ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ ReturnDesc = AcpiUtCreateIntegerObject (Value);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
-
- ReturnDesc->Integer.Value = Value;
break;
@@ -1089,21 +1084,18 @@ AcpiExOpcode_1A_0T_1R (
* NOTE: index into a buffer is NOT a pointer to a
* sub-buffer of the main buffer, it is only a pointer to a
* single element (byte) of the buffer!
+ *
+ * Since we are returning the value of the buffer at the
+ * indexed location, we don't need to add an additional
+ * reference to the buffer itself.
*/
- ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ ReturnDesc = AcpiUtCreateIntegerObject ((UINT64)
+ TempDesc->Buffer.Pointer[Operand[0]->Reference.Value]);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
-
- /*
- * Since we are returning the value of the buffer at the
- * indexed location, we don't need to add an additional
- * reference to the buffer itself.
- */
- ReturnDesc->Integer.Value =
- TempDesc->Buffer.Pointer[Operand[0]->Reference.Value];
break;
diff --git a/executer/exoparg6.c b/executer/exoparg6.c
index 96c16a33bd08..c2609471dd7c 100644
--- a/executer/exoparg6.c
+++ b/executer/exoparg6.c
@@ -344,8 +344,9 @@ AcpiExOpcode_6A_0T_1R (
}
/* Create an integer for the return value */
+ /* Default return value is ACPI_INTEGER_MAX if no match found */
- ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
+ ReturnDesc = AcpiUtCreateIntegerObject (ACPI_INTEGER_MAX);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
@@ -353,10 +354,6 @@ AcpiExOpcode_6A_0T_1R (
}
- /* Default return value if no match found */
-
- ReturnDesc->Integer.Value = ACPI_INTEGER_MAX;
-
/*
* Examine each element until a match is found. Both match conditions
* must be satisfied for a match to occur. Within the loop,
diff --git a/executer/exregion.c b/executer/exregion.c
index 958dc4e06705..5a37be25950e 100644
--- a/executer/exregion.c
+++ b/executer/exregion.c
@@ -157,7 +157,8 @@ AcpiExSystemMemorySpaceHandler (
void *LogicalAddrPtr = NULL;
ACPI_MEM_SPACE_CONTEXT *MemInfo = RegionContext;
UINT32 Length;
- ACPI_SIZE WindowSize;
+ ACPI_SIZE MapLength;
+ ACPI_SIZE PageBoundaryMapLength;
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
UINT32 Remainder;
#endif
@@ -227,26 +228,45 @@ AcpiExSystemMemorySpaceHandler (
}
/*
- * Don't attempt to map memory beyond the end of the region, and
- * constrain the maximum mapping size to something reasonable.
+ * October 2009: Attempt to map from the requested address to the
+ * end of the region. However, we will never map more than one
+ * page, nor will we cross a page boundary.
*/
- WindowSize = (ACPI_SIZE)
+ MapLength = (ACPI_SIZE)
((MemInfo->Address + MemInfo->Length) - Address);
- if (WindowSize > ACPI_SYSMEM_REGION_WINDOW_SIZE)
+ /*
+ * If mapping the entire remaining portion of the region will cross
+ * a page boundary, just map up to the page boundary, do not cross.
+ * On some systems, crossing a page boundary while mapping regions
+ * can cause warnings if the pages have different attributes
+ * due to resource management.
+ *
+ * This has the added benefit of constraining a single mapping to
+ * one page, which is similar to the original code that used a 4k
+ * maximum window.
+ */
+ PageBoundaryMapLength =
+ ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address;
+ if (PageBoundaryMapLength == 0)
+ {
+ PageBoundaryMapLength = ACPI_DEFAULT_PAGE_SIZE;
+ }
+
+ if (MapLength > PageBoundaryMapLength)
{
- WindowSize = ACPI_SYSMEM_REGION_WINDOW_SIZE;
+ MapLength = PageBoundaryMapLength;
}
/* Create a new mapping starting at the address given */
MemInfo->MappedLogicalAddress = AcpiOsMapMemory (
- (ACPI_PHYSICAL_ADDRESS) Address, WindowSize);
+ (ACPI_PHYSICAL_ADDRESS) Address, MapLength);
if (!MemInfo->MappedLogicalAddress)
{
ACPI_ERROR ((AE_INFO,
"Could not map memory at %8.8X%8.8X, size %X",
- ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) WindowSize));
+ ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) MapLength));
MemInfo->MappedLength = 0;
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -254,7 +274,7 @@ AcpiExSystemMemorySpaceHandler (
/* Save the physical address and mapping size */
MemInfo->MappedPhysicalAddress = Address;
- MemInfo->MappedLength = WindowSize;
+ MemInfo->MappedLength = MapLength;
}
/*