summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rscalc.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /drivers/acpi/resources/rscalc.c
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'drivers/acpi/resources/rscalc.c')
-rw-r--r--drivers/acpi/resources/rscalc.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index 86ff91be8..bfceeac8b 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -2,7 +2,7 @@
*
* Module Name: rscalc - Acpi_rs_calculate_byte_stream_length
* Acpi_rs_calculate_list_length
- * $Revision: 18 $
+ * $Revision: 21 $
*
******************************************************************************/
@@ -27,6 +27,8 @@
#include "acpi.h"
#include "acresrc.h"
+#include "amlcode.h"
+#include "acnamesp.h"
#define _COMPONENT RESOURCE_MANAGER
MODULE_NAME ("rscalc")
@@ -704,6 +706,7 @@ acpi_rs_calculate_list_length (
*/
bytes_consumed = 2;
structure_size = RESOURCE_LENGTH;
+ byte_stream_buffer_length = bytes_parsed;
break;
@@ -810,7 +813,10 @@ acpi_rs_calculate_pci_routing_table_length (
name_found = FALSE;
for (table_index = 0; table_index < 4 && !name_found; table_index++) {
- if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) {
+ if ((ACPI_TYPE_STRING == (*sub_object_list)->common.type) ||
+ ((INTERNAL_TYPE_REFERENCE == (*sub_object_list)->common.type) &&
+ ((*sub_object_list)->reference.op_code == AML_NAMEPATH_OP)))
+ {
name_found = TRUE;
}
@@ -822,17 +828,22 @@ acpi_rs_calculate_pci_routing_table_length (
}
}
- temp_size_needed += (sizeof (PCI_ROUTING_TABLE) - 1);
+ temp_size_needed += (sizeof (PCI_ROUTING_TABLE) - 4);
/*
* Was a String type found?
*/
if (TRUE == name_found) {
- /*
- * The length String.Length field includes the
- * terminating NULL
- */
- temp_size_needed += (*sub_object_list)->string.length;
+ if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) {
+ /*
+ * The length String.Length field includes the
+ * terminating NULL
+ */
+ temp_size_needed += (*sub_object_list)->string.length;
+ }
+ else {
+ temp_size_needed += acpi_ns_get_pathname_length ((*sub_object_list)->reference.node);
+ }
}
else {
@@ -855,7 +866,7 @@ acpi_rs_calculate_pci_routing_table_length (
}
- *buffer_size_needed = temp_size_needed + sizeof (PCI_ROUTING_TABLE);
+ *buffer_size_needed = temp_size_needed;
return (AE_OK);
}