aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables/tbinstal.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-04 18:09:09 -0400
committerLen Brown <len.brown@intel.com>2005-08-04 18:09:09 -0400
commit5d2a22079c825669d91a3a200332f1053b4b61b0 (patch)
tree2e6e88bbcc3e17535fdf3103540b246b3658e20b /drivers/acpi/tables/tbinstal.c
parent1c5ad84516ae7ea4ec868436a910a6bd8d20215a (diff)
parentbd6dbdf3c7b9784fbf5d8500e427a954e27a976a (diff)
/home/lenb/src/to-akpm branch 'acpi-2.6.12'
Diffstat (limited to 'drivers/acpi/tables/tbinstal.c')
-rw-r--r--drivers/acpi/tables/tbinstal.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 629b64c8193d..698799901f55 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -124,9 +124,7 @@ acpi_tb_match_signature (
124 * 124 *
125 * RETURN: Status 125 * RETURN: Status
126 * 126 *
127 * DESCRIPTION: Load and validate all tables other than the RSDT. The RSDT must 127 * DESCRIPTION: Install the table into the global data structures.
128 * already be loaded and validated.
129 * Install the table into the global data structs.
130 * 128 *
131 ******************************************************************************/ 129 ******************************************************************************/
132 130
@@ -136,6 +134,7 @@ acpi_tb_install_table (
136{ 134{
137 acpi_status status; 135 acpi_status status;
138 136
137
139 ACPI_FUNCTION_TRACE ("tb_install_table"); 138 ACPI_FUNCTION_TRACE ("tb_install_table");
140 139
141 140
@@ -143,22 +142,33 @@ acpi_tb_install_table (
143 142
144 status = acpi_ut_acquire_mutex (ACPI_MTX_TABLES); 143 status = acpi_ut_acquire_mutex (ACPI_MTX_TABLES);
145 if (ACPI_FAILURE (status)) { 144 if (ACPI_FAILURE (status)) {
146 ACPI_REPORT_ERROR (("Could not acquire table mutex for [%4.4s], %s\n", 145 ACPI_REPORT_ERROR (("Could not acquire table mutex, %s\n",
147 table_info->pointer->signature, acpi_format_exception (status))); 146 acpi_format_exception (status)));
148 return_ACPI_STATUS (status); 147 return_ACPI_STATUS (status);
149 } 148 }
150 149
150 /*
151 * Ignore a table that is already installed. For example, some BIOS
152 * ASL code will repeatedly attempt to load the same SSDT.
153 */
154 status = acpi_tb_is_table_installed (table_info);
155 if (ACPI_FAILURE (status)) {
156 goto unlock_and_exit;
157 }
158
151 /* Install the table into the global data structure */ 159 /* Install the table into the global data structure */
152 160
153 status = acpi_tb_init_table_descriptor (table_info->type, table_info); 161 status = acpi_tb_init_table_descriptor (table_info->type, table_info);
154 if (ACPI_FAILURE (status)) { 162 if (ACPI_FAILURE (status)) {
155 ACPI_REPORT_ERROR (("Could not install ACPI table [%4.4s], %s\n", 163 ACPI_REPORT_ERROR (("Could not install table [%4.4s], %s\n",
156 table_info->pointer->signature, acpi_format_exception (status))); 164 table_info->pointer->signature, acpi_format_exception (status)));
157 } 165 }
158 166
159 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s located at %p\n", 167 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s located at %p\n",
160 acpi_gbl_table_data[table_info->type].name, table_info->pointer)); 168 acpi_gbl_table_data[table_info->type].name, table_info->pointer));
161 169
170
171unlock_and_exit:
162 (void) acpi_ut_release_mutex (ACPI_MTX_TABLES); 172 (void) acpi_ut_release_mutex (ACPI_MTX_TABLES);
163 return_ACPI_STATUS (status); 173 return_ACPI_STATUS (status);
164} 174}
@@ -251,6 +261,7 @@ acpi_tb_init_table_descriptor (
251{ 261{
252 struct acpi_table_list *list_head; 262 struct acpi_table_list *list_head;
253 struct acpi_table_desc *table_desc; 263 struct acpi_table_desc *table_desc;
264 acpi_status status;
254 265
255 266
256 ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type); 267 ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type);
@@ -263,6 +274,13 @@ acpi_tb_init_table_descriptor (
263 return_ACPI_STATUS (AE_NO_MEMORY); 274 return_ACPI_STATUS (AE_NO_MEMORY);
264 } 275 }
265 276
277 /* Get a new owner ID for the table */
278
279 status = acpi_ut_allocate_owner_id (&table_desc->owner_id);
280 if (ACPI_FAILURE (status)) {
281 return_ACPI_STATUS (status);
282 }
283
266 /* Install the table into the global data structure */ 284 /* Install the table into the global data structure */
267 285
268 list_head = &acpi_gbl_table_lists[table_type]; 286 list_head = &acpi_gbl_table_lists[table_type];
@@ -325,8 +343,6 @@ acpi_tb_init_table_descriptor (
325 table_desc->aml_start = (u8 *) (table_desc->pointer + 1), 343 table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
326 table_desc->aml_length = (u32) (table_desc->length - 344 table_desc->aml_length = (u32) (table_desc->length -
327 (u32) sizeof (struct acpi_table_header)); 345 (u32) sizeof (struct acpi_table_header));
328 table_desc->table_id = acpi_ut_allocate_owner_id (
329 ACPI_OWNER_TYPE_TABLE);
330 table_desc->loaded_into_namespace = FALSE; 346 table_desc->loaded_into_namespace = FALSE;
331 347
332 /* 348 /*
@@ -339,7 +355,7 @@ acpi_tb_init_table_descriptor (
339 355
340 /* Return Data */ 356 /* Return Data */
341 357
342 table_info->table_id = table_desc->table_id; 358 table_info->owner_id = table_desc->owner_id;
343 table_info->installed_desc = table_desc; 359 table_info->installed_desc = table_desc;
344 360
345 return_ACPI_STATUS (AE_OK); 361 return_ACPI_STATUS (AE_OK);