aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rslist.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-03-17 16:44:00 -0500
committerLen Brown <len.brown@intel.com>2006-06-14 01:22:20 -0400
commit61686124f47d7c4b78610346c5f8f9d8a6d46bb5 (patch)
tree6fd91b2c1749907e58ef136107e53d634d7978c4 /drivers/acpi/resources/rslist.c
parent144c87b4e03759214c362d267e01c2905f1ab095 (diff)
[ACPI] ACPICA 20060317
Implemented the use of a cache object for all internal namespace nodes. Since there are about 1000 static nodes in a typical system, this will decrease memory use for cache implementations that minimize per-allocation overhead (such as a slab allocator.) Removed the reference count mechanism for internal namespace nodes, since it was deemed unnecessary. This reduces the size of each namespace node by about 5%-10% on all platforms. Nodes are now 20 bytes for the 32-bit case, and 32 bytes for the 64-bit case. Optimized several internal data structures to reduce object size on 64-bit platforms by packing data within the 64-bit alignment. This includes the frequently used ACPI_OPERAND_OBJECT, of which there can be ~1000 static instances corresponding to the namespace objects. Added two new strings for the predefined _OSI method: "Windows 2001.1 SP1" and "Windows 2006". Split the allocation tracking mechanism out to a separate file, from utalloc.c to uttrack.c. This mechanism appears to be only useful for application-level code. Kernels may wish to not include uttrack.c in distributions. Removed all remnants of the obsolete ACPI_REPORT_* macros and the associated code. (These macros have been replaced by the ACPI_ERROR and ACPI_WARNING macros.) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/resources/rslist.c')
-rw-r--r--drivers/acpi/resources/rslist.c110
1 files changed, 39 insertions, 71 deletions
diff --git a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c
index 6f2d8de39523..50bbb19bf4ae 100644
--- a/drivers/acpi/resources/rslist.c
+++ b/drivers/acpi/resources/rslist.c
@@ -51,92 +51,60 @@ ACPI_MODULE_NAME("rslist")
51 * 51 *
52 * FUNCTION: acpi_rs_convert_aml_to_resources 52 * FUNCTION: acpi_rs_convert_aml_to_resources
53 * 53 *
54 * PARAMETERS: Aml - Pointer to the resource byte stream 54 * PARAMETERS: acpi_walk_aml_callback
55 * aml_length - Length of Aml 55 * resource_ptr - Pointer to the buffer that will
56 * output_buffer - Pointer to the buffer that will 56 * contain the output structures
57 * contain the output structures
58 * 57 *
59 * RETURN: Status 58 * RETURN: Status
60 * 59 *
61 * DESCRIPTION: Takes the resource byte stream and parses it, creating a 60 * DESCRIPTION: Convert an AML resource to an internal representation of the
62 * linked list of resources in the caller's output buffer 61 * resource that is aligned and easier to access.
63 * 62 *
64 ******************************************************************************/ 63 ******************************************************************************/
65acpi_status 64acpi_status
66acpi_rs_convert_aml_to_resources(u8 * aml, u32 aml_length, u8 * output_buffer) 65acpi_rs_convert_aml_to_resources(u8 * aml,
66 u32 length,
67 u32 offset,
68 u8 resource_index, void **resource_ptr)
67{ 69{
68 struct acpi_resource *resource = (void *)output_buffer; 70 struct acpi_resource *resource = *resource_ptr;
69 acpi_status status; 71 acpi_status status;
70 u8 resource_index;
71 u8 *end_aml;
72 72
73 ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources"); 73 ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources");
74 74
75 end_aml = aml + aml_length; 75 /*
76 76 * Check that the input buffer and all subsequent pointers into it
77 /* Loop until end-of-buffer or an end_tag is found */ 77 * are aligned on a native word boundary. Most important on IA64
78 78 */
79 while (aml < end_aml) { 79 if (ACPI_IS_MISALIGNED(resource)) {
80 /* 80 ACPI_WARNING((AE_INFO,
81 * Check that the input buffer and all subsequent pointers into it 81 "Misaligned resource pointer %p", resource));
82 * are aligned on a native word boundary. Most important on IA64 82 }
83 */
84 if (ACPI_IS_MISALIGNED(resource)) {
85 ACPI_WARNING((AE_INFO,
86 "Misaligned resource pointer %p",
87 resource));
88 }
89
90 /* Validate the Resource Type and Resource Length */
91
92 status = acpi_ut_validate_resource(aml, &resource_index);
93 if (ACPI_FAILURE(status)) {
94 return_ACPI_STATUS(status);
95 }
96
97 /* Convert the AML byte stream resource to a local resource struct */
98
99 status =
100 acpi_rs_convert_aml_to_resource(resource,
101 ACPI_CAST_PTR(union
102 aml_resource,
103 aml),
104 acpi_gbl_get_resource_dispatch
105 [resource_index]);
106 if (ACPI_FAILURE(status)) {
107 ACPI_EXCEPTION((AE_INFO, status,
108 "Could not convert AML resource (Type %X)",
109 *aml));
110 return_ACPI_STATUS(status);
111 }
112
113 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
114 "Type %.2X, Aml %.2X internal %.2X\n",
115 acpi_ut_get_resource_type(aml),
116 acpi_ut_get_descriptor_length(aml),
117 resource->length));
118
119 /* Normal exit on completion of an end_tag resource descriptor */
120
121 if (acpi_ut_get_resource_type(aml) ==
122 ACPI_RESOURCE_NAME_END_TAG) {
123 return_ACPI_STATUS(AE_OK);
124 }
125
126 /* Point to the next input AML resource */
127
128 aml += acpi_ut_get_descriptor_length(aml);
129
130 /* Point to the next structure in the output buffer */
131 83
132 resource = 84 /* Convert the AML byte stream resource to a local resource struct */
133 ACPI_ADD_PTR(struct acpi_resource, resource, 85
134 resource->length); 86 status =
87 acpi_rs_convert_aml_to_resource(resource,
88 ACPI_CAST_PTR(union aml_resource,
89 aml),
90 acpi_gbl_get_resource_dispatch
91 [resource_index]);
92 if (ACPI_FAILURE(status)) {
93 ACPI_EXCEPTION((AE_INFO, status,
94 "Could not convert AML resource (Type %X)",
95 *aml));
96 return_ACPI_STATUS(status);
135 } 97 }
136 98
137 /* Did not find an end_tag resource descriptor */ 99 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
100 "Type %.2X, aml_length %.2X internal_length %.2X\n",
101 acpi_ut_get_resource_type(aml), length,
102 resource->length));
138 103
139 return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG); 104 /* Point to the next structure in the output buffer */
105
106 *resource_ptr = ACPI_ADD_PTR(void, resource, resource->length);
107 return_ACPI_STATUS(AE_OK);
140} 108}
141 109
142/******************************************************************************* 110/*******************************************************************************