| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************** | 
 | 2 |  * | 
 | 3 |  * Module Name: tbxface - Public interfaces to the ACPI subsystem | 
 | 4 |  *                         ACPI table oriented interfaces | 
 | 5 |  * | 
 | 6 |  *****************************************************************************/ | 
 | 7 |  | 
 | 8 | /* | 
| Bob Moore | 6c9deb7 | 2007-02-02 19:48:24 +0300 | [diff] [blame] | 9 |  * Copyright (C) 2000 - 2007, R. Byron Moore | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 |  * All rights reserved. | 
 | 11 |  * | 
 | 12 |  * Redistribution and use in source and binary forms, with or without | 
 | 13 |  * modification, are permitted provided that the following conditions | 
 | 14 |  * are met: | 
 | 15 |  * 1. Redistributions of source code must retain the above copyright | 
 | 16 |  *    notice, this list of conditions, and the following disclaimer, | 
 | 17 |  *    without modification. | 
 | 18 |  * 2. Redistributions in binary form must reproduce at minimum a disclaimer | 
 | 19 |  *    substantially similar to the "NO WARRANTY" disclaimer below | 
 | 20 |  *    ("Disclaimer") and any redistribution must be conditioned upon | 
 | 21 |  *    including a substantially similar Disclaimer requirement for further | 
 | 22 |  *    binary redistribution. | 
 | 23 |  * 3. Neither the names of the above-listed copyright holders nor the names | 
 | 24 |  *    of any contributors may be used to endorse or promote products derived | 
 | 25 |  *    from this software without specific prior written permission. | 
 | 26 |  * | 
 | 27 |  * Alternatively, this software may be distributed under the terms of the | 
 | 28 |  * GNU General Public License ("GPL") version 2 as published by the Free | 
 | 29 |  * Software Foundation. | 
 | 30 |  * | 
 | 31 |  * NO WARRANTY | 
 | 32 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
 | 33 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
 | 34 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR | 
 | 35 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 
 | 36 |  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 
 | 37 |  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 
 | 38 |  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 
 | 39 |  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 
 | 40 |  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 
 | 41 |  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 
 | 42 |  * POSSIBILITY OF SUCH DAMAGES. | 
 | 43 |  */ | 
 | 44 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | #include <acpi/acpi.h> | 
 | 46 | #include <acpi/acnamesp.h> | 
 | 47 | #include <acpi/actables.h> | 
 | 48 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | #define _COMPONENT          ACPI_TABLES | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 50 | ACPI_MODULE_NAME("tbxface") | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 52 | /* Local prototypes */ | 
 | 53 | static acpi_status acpi_tb_load_namespace(void); | 
 | 54 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | /******************************************************************************* | 
 | 56 |  * | 
| Bob Moore | 77389e1 | 2007-02-02 19:48:20 +0300 | [diff] [blame] | 57 |  * FUNCTION:    acpi_allocate_root_table | 
 | 58 |  * | 
 | 59 |  * PARAMETERS:  initial_table_count - Size of initial_table_array, in number of | 
 | 60 |  *                                    struct acpi_table_desc structures | 
 | 61 |  * | 
 | 62 |  * RETURN:      Status | 
 | 63 |  * | 
 | 64 |  * DESCRIPTION: Allocate a root table array. Used by i_aSL compiler and | 
 | 65 |  *              acpi_initialize_tables. | 
 | 66 |  * | 
 | 67 |  ******************************************************************************/ | 
 | 68 |  | 
 | 69 | acpi_status acpi_allocate_root_table(u32 initial_table_count) | 
 | 70 | { | 
 | 71 |  | 
 | 72 | 	acpi_gbl_root_table_list.size = initial_table_count; | 
 | 73 | 	acpi_gbl_root_table_list.flags = ACPI_ROOT_ALLOW_RESIZE; | 
 | 74 |  | 
 | 75 | 	return (acpi_tb_resize_root_table_list()); | 
 | 76 | } | 
 | 77 |  | 
 | 78 | /******************************************************************************* | 
 | 79 |  * | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 80 |  * FUNCTION:    acpi_initialize_tables | 
 | 81 |  * | 
 | 82 |  * PARAMETERS:  initial_table_array - Pointer to an array of pre-allocated | 
 | 83 |  *                                    struct acpi_table_desc structures. If NULL, the | 
 | 84 |  *                                    array is dynamically allocated. | 
 | 85 |  *              initial_table_count - Size of initial_table_array, in number of | 
 | 86 |  *                                    struct acpi_table_desc structures | 
 | 87 |  *              allow_realloc       - Flag to tell Table Manager if resize of | 
 | 88 |  *                                    pre-allocated array is allowed. Ignored | 
 | 89 |  *                                    if initial_table_array is NULL. | 
 | 90 |  * | 
 | 91 |  * RETURN:      Status | 
 | 92 |  * | 
 | 93 |  * DESCRIPTION: Initialize the table manager, get the RSDP and RSDT/XSDT. | 
 | 94 |  * | 
 | 95 |  * NOTE:        Allows static allocation of the initial table array in order | 
 | 96 |  *              to avoid the use of dynamic memory in confined environments | 
 | 97 |  *              such as the kernel boot sequence where it may not be available. | 
 | 98 |  * | 
 | 99 |  *              If the host OS memory managers are initialized, use NULL for | 
 | 100 |  *              initial_table_array, and the table will be dynamically allocated. | 
 | 101 |  * | 
 | 102 |  ******************************************************************************/ | 
 | 103 |  | 
| Alexey Starikovskiy | ad71860 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 104 | acpi_status __init | 
| Bob Moore | 77389e1 | 2007-02-02 19:48:20 +0300 | [diff] [blame] | 105 | acpi_initialize_tables(struct acpi_table_desc * initial_table_array, | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 106 | 		       u32 initial_table_count, u8 allow_resize) | 
 | 107 | { | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 108 | 	acpi_physical_address rsdp_address; | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 109 | 	acpi_status status; | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 110 |  | 
 | 111 | 	ACPI_FUNCTION_TRACE(acpi_initialize_tables); | 
 | 112 |  | 
 | 113 | 	/* | 
 | 114 | 	 * Set up the Root Table Array | 
 | 115 | 	 * Allocate the table array if requested | 
 | 116 | 	 */ | 
 | 117 | 	if (!initial_table_array) { | 
| Bob Moore | 77389e1 | 2007-02-02 19:48:20 +0300 | [diff] [blame] | 118 | 		status = acpi_allocate_root_table(initial_table_count); | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 119 | 		if (ACPI_FAILURE(status)) { | 
 | 120 | 			return_ACPI_STATUS(status); | 
 | 121 | 		} | 
 | 122 | 	} else { | 
 | 123 | 		/* Root Table Array has been statically allocated by the host */ | 
 | 124 |  | 
| Bob Moore | a4bbb81 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 125 | 		ACPI_MEMSET(initial_table_array, 0, | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 126 | 			    initial_table_count * | 
| Bob Moore | a4bbb81 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 127 | 			    sizeof(struct acpi_table_desc)); | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 128 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 129 | 		acpi_gbl_root_table_list.tables = initial_table_array; | 
 | 130 | 		acpi_gbl_root_table_list.size = initial_table_count; | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 131 | 		acpi_gbl_root_table_list.flags = ACPI_ROOT_ORIGIN_UNKNOWN; | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 132 | 		if (allow_resize) { | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 133 | 			acpi_gbl_root_table_list.flags |= | 
 | 134 | 			    ACPI_ROOT_ALLOW_RESIZE; | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 135 | 		} | 
 | 136 | 	} | 
 | 137 |  | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 138 | 	/* Get the address of the RSDP */ | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 139 |  | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 140 | 	rsdp_address = acpi_os_get_root_pointer(); | 
 | 141 | 	if (!rsdp_address) { | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 142 | 		return_ACPI_STATUS(AE_NOT_FOUND); | 
 | 143 | 	} | 
 | 144 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 145 | 	/* | 
 | 146 | 	 * Get the root table (RSDT or XSDT) and extract all entries to the local | 
 | 147 | 	 * Root Table Array. This array contains the information of the RSDT/XSDT | 
 | 148 | 	 * in a common, more useable format. | 
 | 149 | 	 */ | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 150 | 	status = | 
 | 151 | 	    acpi_tb_parse_root_table(rsdp_address, ACPI_TABLE_ORIGIN_MAPPED); | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 152 | 	return_ACPI_STATUS(status); | 
 | 153 | } | 
 | 154 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 155 | /******************************************************************************* | 
 | 156 |  * | 
 | 157 |  * FUNCTION:    acpi_reallocate_root_table | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 |  * | 
 | 159 |  * PARAMETERS:  None | 
 | 160 |  * | 
 | 161 |  * RETURN:      Status | 
 | 162 |  * | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 163 |  * DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the | 
 | 164 |  *              root list from the previously provided scratch area. Should | 
 | 165 |  *              be called once dynamic memory allocation is available in the | 
 | 166 |  *              kernel | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 |  * | 
 | 168 |  ******************************************************************************/ | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 169 | acpi_status acpi_reallocate_root_table(void) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | { | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 171 | 	struct acpi_table_desc *tables; | 
 | 172 | 	acpi_size new_size; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 174 | 	ACPI_FUNCTION_TRACE(acpi_reallocate_root_table); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 176 | 	/* | 
 | 177 | 	 * Only reallocate the root table if the host provided a static buffer | 
 | 178 | 	 * for the table array in the call to acpi_initialize_tables. | 
 | 179 | 	 */ | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 180 | 	if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 181 | 		return_ACPI_STATUS(AE_SUPPORT); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | 	} | 
 | 183 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 184 | 	new_size = | 
 | 185 | 	    (acpi_gbl_root_table_list.count + | 
 | 186 | 	     ACPI_ROOT_TABLE_SIZE_INCREMENT) * sizeof(struct acpi_table_desc); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 188 | 	/* Create new array and copy the old array */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 190 | 	tables = ACPI_ALLOCATE_ZEROED(new_size); | 
 | 191 | 	if (!tables) { | 
 | 192 | 		return_ACPI_STATUS(AE_NO_MEMORY); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | 	} | 
 | 194 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 195 | 	ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, new_size); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 197 | 	acpi_gbl_root_table_list.size = acpi_gbl_root_table_list.count; | 
 | 198 | 	acpi_gbl_root_table_list.tables = tables; | 
 | 199 | 	acpi_gbl_root_table_list.flags = | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 200 | 	    ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 202 | 	return_ACPI_STATUS(AE_OK); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 203 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | /******************************************************************************* | 
 | 205 |  * | 
 | 206 |  * FUNCTION:    acpi_load_table | 
 | 207 |  * | 
 | 208 |  * PARAMETERS:  table_ptr       - pointer to a buffer containing the entire | 
 | 209 |  *                                table to be loaded | 
 | 210 |  * | 
 | 211 |  * RETURN:      Status | 
 | 212 |  * | 
 | 213 |  * DESCRIPTION: This function is called to load a table from the caller's | 
| Bob Moore | f6dd922 | 2006-07-07 20:44:38 -0400 | [diff] [blame] | 214 |  *              buffer. The buffer must contain an entire ACPI Table including | 
 | 215 |  *              a valid header. The header fields will be verified, and if it | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 |  *              is determined that the table is invalid, the call will fail. | 
 | 217 |  * | 
 | 218 |  ******************************************************************************/ | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 219 | acpi_status acpi_load_table(struct acpi_table_header *table_ptr) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 221 | 	acpi_status status; | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 222 | 	acpi_native_uint table_index; | 
| Alexey Starikovskiy | 428f211 | 2007-02-02 19:48:22 +0300 | [diff] [blame] | 223 | 	struct acpi_table_desc table_desc; | 
 | 224 |  | 
 | 225 | 	if (!table_ptr) | 
 | 226 | 		return AE_BAD_PARAMETER; | 
 | 227 |  | 
 | 228 | 	ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc)); | 
 | 229 | 	table_desc.pointer = table_ptr; | 
 | 230 | 	table_desc.length = table_ptr->length; | 
 | 231 | 	table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 232 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 233 | 	/* | 
 | 234 | 	 * Install the new table into the local data structures | 
 | 235 | 	 */ | 
| Alexey Starikovskiy | 428f211 | 2007-02-02 19:48:22 +0300 | [diff] [blame] | 236 | 	status = acpi_tb_add_table(&table_desc, &table_index); | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 237 | 	if (ACPI_FAILURE(status)) { | 
| Alexey Starikovskiy | 428f211 | 2007-02-02 19:48:22 +0300 | [diff] [blame] | 238 | 		return status; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | 	} | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 240 | 	status = acpi_ns_load_table(table_index, acpi_gbl_root_node); | 
| Alexey Starikovskiy | 428f211 | 2007-02-02 19:48:22 +0300 | [diff] [blame] | 241 | 	return status; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 242 | } | 
 | 243 |  | 
| Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 244 | ACPI_EXPORT_SYMBOL(acpi_load_table) | 
 | 245 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 246 | /****************************************************************************** | 
 | 247 |  * | 
 | 248 |  * FUNCTION:    acpi_get_table_header | 
 | 249 |  * | 
 | 250 |  * PARAMETERS:  Signature           - ACPI signature of needed table | 
 | 251 |  *              Instance            - Which instance (for SSDTs) | 
| Alexey Starikovskiy | 428f211 | 2007-02-02 19:48:22 +0300 | [diff] [blame] | 252 |  *              out_table_header    - The pointer to the table header to fill | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 253 |  * | 
 | 254 |  * RETURN:      Status and pointer to mapped table header | 
 | 255 |  * | 
 | 256 |  * DESCRIPTION: Finds an ACPI table header. | 
 | 257 |  * | 
 | 258 |  * NOTE:        Caller is responsible in unmapping the header with | 
 | 259 |  *              acpi_os_unmap_memory | 
 | 260 |  * | 
 | 261 |  *****************************************************************************/ | 
 | 262 | acpi_status | 
 | 263 | acpi_get_table_header(char *signature, | 
 | 264 | 		      acpi_native_uint instance, | 
| Alexey Starikovskiy | 428f211 | 2007-02-02 19:48:22 +0300 | [diff] [blame] | 265 | 		      struct acpi_table_header *out_table_header) | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 266 | { | 
 | 267 | 	acpi_native_uint i; | 
 | 268 | 	acpi_native_uint j; | 
| Alexey Starikovskiy | 428f211 | 2007-02-02 19:48:22 +0300 | [diff] [blame] | 269 | 	struct acpi_table_header *header; | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 270 |  | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 271 | 	/* Parameter validation */ | 
 | 272 |  | 
 | 273 | 	if (!signature || !out_table_header) { | 
 | 274 | 		return (AE_BAD_PARAMETER); | 
 | 275 | 	} | 
 | 276 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 277 | 	/* | 
 | 278 | 	 * Walk the root table list | 
 | 279 | 	 */ | 
 | 280 | 	for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) { | 
 | 281 | 		if (!ACPI_COMPARE_NAME | 
 | 282 | 		    (&(acpi_gbl_root_table_list.tables[i].signature), | 
 | 283 | 		     signature)) { | 
 | 284 | 			continue; | 
 | 285 | 		} | 
 | 286 |  | 
 | 287 | 		if (++j < instance) { | 
 | 288 | 			continue; | 
 | 289 | 		} | 
 | 290 |  | 
| Alexey Starikovskiy | 428f211 | 2007-02-02 19:48:22 +0300 | [diff] [blame] | 291 | 		if (!acpi_gbl_root_table_list.tables[i].pointer) { | 
 | 292 | 			if ((acpi_gbl_root_table_list.tables[i]. | 
 | 293 | 			     flags & ACPI_TABLE_ORIGIN_MASK) == | 
 | 294 | 			    ACPI_TABLE_ORIGIN_MAPPED) { | 
 | 295 | 				header = | 
 | 296 | 				    acpi_os_map_memory(acpi_gbl_root_table_list. | 
 | 297 | 						       tables[i].address, | 
 | 298 | 						       sizeof(struct | 
 | 299 | 							      acpi_table_header)); | 
 | 300 | 				if (!header) { | 
 | 301 | 					return AE_NO_MEMORY; | 
 | 302 | 				} | 
 | 303 | 				ACPI_MEMCPY(out_table_header, header, | 
 | 304 | 					    sizeof(struct acpi_table_header)); | 
 | 305 | 				acpi_os_unmap_memory(header, | 
 | 306 | 						     sizeof(struct | 
 | 307 | 							    acpi_table_header)); | 
 | 308 | 			} else { | 
 | 309 | 				return AE_NOT_FOUND; | 
 | 310 | 			} | 
 | 311 | 		} else { | 
 | 312 | 			ACPI_MEMCPY(out_table_header, | 
 | 313 | 				    acpi_gbl_root_table_list.tables[i].pointer, | 
 | 314 | 				    sizeof(struct acpi_table_header)); | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 315 | 		} | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 316 | 		return (AE_OK); | 
 | 317 | 	} | 
 | 318 |  | 
 | 319 | 	return (AE_NOT_FOUND); | 
 | 320 | } | 
 | 321 |  | 
 | 322 | ACPI_EXPORT_SYMBOL(acpi_get_table_header) | 
 | 323 |  | 
 | 324 |  | 
 | 325 | /****************************************************************************** | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 |  * | 
| John Keller | 0f0fe1a | 2006-12-19 12:56:19 -0800 | [diff] [blame] | 327 |  * FUNCTION:    acpi_unload_table_id | 
 | 328 |  * | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 329 |  * PARAMETERS:  id            - Owner ID of the table to be removed. | 
| John Keller | 0f0fe1a | 2006-12-19 12:56:19 -0800 | [diff] [blame] | 330 |  * | 
 | 331 |  * RETURN:      Status | 
 | 332 |  * | 
 | 333 |  * DESCRIPTION: This routine is used to force the unload of a table (by id) | 
 | 334 |  * | 
 | 335 |  ******************************************************************************/ | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 336 | acpi_status acpi_unload_table_id(acpi_owner_id id) | 
| John Keller | 0f0fe1a | 2006-12-19 12:56:19 -0800 | [diff] [blame] | 337 | { | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 338 | 	int i; | 
 | 339 | 	acpi_status status = AE_NOT_EXIST; | 
| John Keller | 0f0fe1a | 2006-12-19 12:56:19 -0800 | [diff] [blame] | 340 |  | 
| John Keller | ecb5f75 | 2007-02-15 14:08:30 -0600 | [diff] [blame] | 341 | 	ACPI_FUNCTION_TRACE(acpi_unload_table_id); | 
| John Keller | 0f0fe1a | 2006-12-19 12:56:19 -0800 | [diff] [blame] | 342 |  | 
| John Keller | ecb5f75 | 2007-02-15 14:08:30 -0600 | [diff] [blame] | 343 | 	/* Find table in the global table list */ | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 344 | 	for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 
 | 345 | 		if (id != acpi_gbl_root_table_list.tables[i].owner_id) { | 
 | 346 | 			continue; | 
 | 347 | 		} | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 348 | 		/* | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 349 | 		* Delete all namespace objects owned by this table. Note that these | 
 | 350 | 		* objects can appear anywhere in the namespace by virtue of the AML | 
 | 351 | 		* "Scope" operator. Thus, we need to track ownership by an ID, not | 
 | 352 | 		* simply a position within the hierarchy | 
 | 353 | 		*/ | 
 | 354 | 		acpi_tb_delete_namespace_by_owner(i); | 
| John Keller | ecb5f75 | 2007-02-15 14:08:30 -0600 | [diff] [blame] | 355 | 		status = acpi_tb_release_owner_id(i); | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 356 | 		acpi_tb_set_table_loaded_flag(i, FALSE); | 
| John Keller | ecb5f75 | 2007-02-15 14:08:30 -0600 | [diff] [blame] | 357 | 		break; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 358 | 	} | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 359 | 	return_ACPI_STATUS(status); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 360 | } | 
 | 361 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 362 | ACPI_EXPORT_SYMBOL(acpi_unload_table_id) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 |  | 
 | 364 | /******************************************************************************* | 
 | 365 |  * | 
 | 366 |  * FUNCTION:    acpi_get_table | 
 | 367 |  * | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 368 |  * PARAMETERS:  Signature           - ACPI signature of needed table | 
 | 369 |  *              Instance            - Which instance (for SSDTs) | 
 | 370 |  *              out_table           - Where the pointer to the table is returned | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 371 |  * | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 372 |  * RETURN:      Status and pointer to table | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 |  * | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 374 |  * DESCRIPTION: Finds and verifies an ACPI table. | 
 | 375 |  * | 
 | 376 |  *****************************************************************************/ | 
 | 377 | acpi_status | 
 | 378 | acpi_get_table(char *signature, | 
 | 379 | 	       acpi_native_uint instance, struct acpi_table_header ** out_table) | 
 | 380 | { | 
 | 381 | 	acpi_native_uint i; | 
 | 382 | 	acpi_native_uint j; | 
 | 383 | 	acpi_status status; | 
 | 384 |  | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 385 | 	/* Parameter validation */ | 
 | 386 |  | 
 | 387 | 	if (!signature || !out_table) { | 
 | 388 | 		return (AE_BAD_PARAMETER); | 
 | 389 | 	} | 
 | 390 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 391 | 	/* | 
 | 392 | 	 * Walk the root table list | 
 | 393 | 	 */ | 
 | 394 | 	for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) { | 
 | 395 | 		if (!ACPI_COMPARE_NAME | 
 | 396 | 		    (&(acpi_gbl_root_table_list.tables[i].signature), | 
 | 397 | 		     signature)) { | 
 | 398 | 			continue; | 
 | 399 | 		} | 
 | 400 |  | 
 | 401 | 		if (++j < instance) { | 
 | 402 | 			continue; | 
 | 403 | 		} | 
 | 404 |  | 
 | 405 | 		status = | 
 | 406 | 		    acpi_tb_verify_table(&acpi_gbl_root_table_list.tables[i]); | 
 | 407 | 		if (ACPI_SUCCESS(status)) { | 
 | 408 | 			*out_table = acpi_gbl_root_table_list.tables[i].pointer; | 
 | 409 | 		} | 
 | 410 |  | 
| Alexey Starikovskiy | ad71860 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 411 | 		if (!acpi_gbl_permanent_mmap) { | 
| Randy Dunlap | 70c0846 | 2007-02-13 16:11:36 -0800 | [diff] [blame] | 412 | 			acpi_gbl_root_table_list.tables[i].pointer = NULL; | 
| Alexey Starikovskiy | ad71860 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 413 | 		} | 
 | 414 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 415 | 		return (status); | 
 | 416 | 	} | 
 | 417 |  | 
 | 418 | 	return (AE_NOT_FOUND); | 
 | 419 | } | 
 | 420 |  | 
 | 421 | ACPI_EXPORT_SYMBOL(acpi_get_table) | 
 | 422 |  | 
 | 423 | /******************************************************************************* | 
 | 424 |  * | 
 | 425 |  * FUNCTION:    acpi_get_table_by_index | 
 | 426 |  * | 
 | 427 |  * PARAMETERS:  table_index         - Table index | 
 | 428 |  *              Table               - Where the pointer to the table is returned | 
 | 429 |  * | 
 | 430 |  * RETURN:      Status and pointer to the table | 
 | 431 |  * | 
 | 432 |  * DESCRIPTION: Obtain a table by an index into the global table list. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 433 |  * | 
 | 434 |  ******************************************************************************/ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 435 | acpi_status | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 436 | acpi_get_table_by_index(acpi_native_uint table_index, | 
 | 437 | 			struct acpi_table_header ** table) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 439 | 	acpi_status status; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 440 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 441 | 	ACPI_FUNCTION_TRACE(acpi_get_table_by_index); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 442 |  | 
| Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 443 | 	/* Parameter validation */ | 
 | 444 |  | 
 | 445 | 	if (!table) { | 
 | 446 | 		return_ACPI_STATUS(AE_BAD_PARAMETER); | 
 | 447 | 	} | 
 | 448 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 449 | 	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 450 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 451 | 	/* Validate index */ | 
 | 452 |  | 
 | 453 | 	if (table_index >= acpi_gbl_root_table_list.count) { | 
 | 454 | 		(void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 455 | 		return_ACPI_STATUS(AE_BAD_PARAMETER); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 456 | 	} | 
 | 457 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 458 | 	if (!acpi_gbl_root_table_list.tables[table_index].pointer) { | 
 | 459 |  | 
 | 460 | 		/* Table is not mapped, map it */ | 
 | 461 |  | 
 | 462 | 		status = | 
 | 463 | 		    acpi_tb_verify_table(&acpi_gbl_root_table_list. | 
 | 464 | 					 tables[table_index]); | 
 | 465 | 		if (ACPI_FAILURE(status)) { | 
 | 466 | 			(void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 
 | 467 | 			return_ACPI_STATUS(status); | 
 | 468 | 		} | 
 | 469 | 	} | 
 | 470 |  | 
 | 471 | 	*table = acpi_gbl_root_table_list.tables[table_index].pointer; | 
 | 472 | 	(void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 
 | 473 | 	return_ACPI_STATUS(AE_OK); | 
 | 474 | } | 
 | 475 |  | 
 | 476 | ACPI_EXPORT_SYMBOL(acpi_get_table_by_index) | 
 | 477 |  | 
 | 478 | /******************************************************************************* | 
 | 479 |  * | 
 | 480 |  * FUNCTION:    acpi_tb_load_namespace | 
 | 481 |  * | 
 | 482 |  * PARAMETERS:  None | 
 | 483 |  * | 
 | 484 |  * RETURN:      Status | 
 | 485 |  * | 
 | 486 |  * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in | 
 | 487 |  *              the RSDT/XSDT. | 
 | 488 |  * | 
 | 489 |  ******************************************************************************/ | 
 | 490 | static acpi_status acpi_tb_load_namespace(void) | 
 | 491 | { | 
 | 492 | 	acpi_status status; | 
 | 493 | 	struct acpi_table_header *table; | 
 | 494 | 	acpi_native_uint i; | 
 | 495 |  | 
 | 496 | 	ACPI_FUNCTION_TRACE(tb_load_namespace); | 
 | 497 |  | 
 | 498 | 	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 
 | 499 |  | 
 | 500 | 	/* | 
 | 501 | 	 * Load the namespace. The DSDT is required, but any SSDT and PSDT tables | 
 | 502 | 	 * are optional. | 
 | 503 | 	 */ | 
 | 504 | 	if (!acpi_gbl_root_table_list.count || | 
 | 505 | 	    !ACPI_COMPARE_NAME(& | 
 | 506 | 			       (acpi_gbl_root_table_list. | 
 | 507 | 				tables[ACPI_TABLE_INDEX_DSDT].signature), | 
 | 508 | 			       ACPI_SIG_DSDT) | 
 | 509 | 	    || | 
 | 510 | 	    ACPI_FAILURE(acpi_tb_verify_table | 
 | 511 | 			 (&acpi_gbl_root_table_list. | 
 | 512 | 			  tables[ACPI_TABLE_INDEX_DSDT]))) { | 
 | 513 | 		status = AE_NO_ACPI_TABLES; | 
 | 514 | 		goto unlock_and_exit; | 
 | 515 | 	} | 
 | 516 |  | 
 | 517 | 	/* | 
 | 518 | 	 * Find DSDT table | 
 | 519 | 	 */ | 
 | 520 | 	status = | 
 | 521 | 	    acpi_os_table_override(acpi_gbl_root_table_list. | 
 | 522 | 				   tables[ACPI_TABLE_INDEX_DSDT].pointer, | 
 | 523 | 				   &table); | 
 | 524 | 	if (ACPI_SUCCESS(status) && table) { | 
 | 525 | 		/* | 
 | 526 | 		 * DSDT table has been found | 
 | 527 | 		 */ | 
| Bob Moore | 035f994 | 2007-02-02 19:48:24 +0300 | [diff] [blame] | 528 | 		acpi_tb_delete_table(&acpi_gbl_root_table_list. | 
 | 529 | 				     tables[ACPI_TABLE_INDEX_DSDT]); | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 530 | 		acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].pointer = | 
 | 531 | 		    table; | 
 | 532 | 		acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].length = | 
 | 533 | 		    table->length; | 
 | 534 | 		acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].flags = | 
 | 535 | 		    ACPI_TABLE_ORIGIN_UNKNOWN; | 
 | 536 |  | 
 | 537 | 		ACPI_INFO((AE_INFO, "Table DSDT replaced by host OS")); | 
 | 538 | 		acpi_tb_print_table_header(0, table); | 
 | 539 | 	} | 
 | 540 |  | 
 | 541 | 	status = | 
 | 542 | 	    acpi_tb_verify_table(&acpi_gbl_root_table_list. | 
 | 543 | 				 tables[ACPI_TABLE_INDEX_DSDT]); | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 544 | 	if (ACPI_FAILURE(status)) { | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 545 |  | 
 | 546 | 		/* A valid DSDT is required */ | 
 | 547 |  | 
 | 548 | 		status = AE_NO_ACPI_TABLES; | 
 | 549 | 		goto unlock_and_exit; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 550 | 	} | 
 | 551 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 552 | 	(void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 553 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 554 | 	/* | 
 | 555 | 	 * Load and parse tables. | 
 | 556 | 	 */ | 
 | 557 | 	status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 558 | 	if (ACPI_FAILURE(status)) { | 
 | 559 | 		return_ACPI_STATUS(status); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 560 | 	} | 
 | 561 |  | 
 | 562 | 	/* | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 563 | 	 * Load any SSDT or PSDT tables. Note: Loop leaves tables locked | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 564 | 	 */ | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 565 | 	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 
 | 566 | 	for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 
 | 567 | 		if ((!ACPI_COMPARE_NAME | 
 | 568 | 		     (&(acpi_gbl_root_table_list.tables[i].signature), | 
 | 569 | 		      ACPI_SIG_SSDT) | 
 | 570 | 		     && | 
 | 571 | 		     !ACPI_COMPARE_NAME(& | 
 | 572 | 					(acpi_gbl_root_table_list.tables[i]. | 
 | 573 | 					 signature), ACPI_SIG_PSDT)) | 
 | 574 | 		    || | 
 | 575 | 		    ACPI_FAILURE(acpi_tb_verify_table | 
 | 576 | 				 (&acpi_gbl_root_table_list.tables[i]))) { | 
 | 577 | 			continue; | 
 | 578 | 		} | 
 | 579 |  | 
 | 580 | 		/* Ignore errors while loading tables, get as many as possible */ | 
 | 581 |  | 
 | 582 | 		(void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 
 | 583 | 		(void)acpi_ns_load_table(i, acpi_gbl_root_node); | 
 | 584 | 		(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 585 | 	} | 
 | 586 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 587 | 	ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 588 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 589 |       unlock_and_exit: | 
 | 590 | 	(void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 
 | 591 | 	return_ACPI_STATUS(status); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 592 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 593 |  | 
| Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 594 | /******************************************************************************* | 
 | 595 |  * | 
 | 596 |  * FUNCTION:    acpi_load_tables | 
 | 597 |  * | 
 | 598 |  * PARAMETERS:  None | 
 | 599 |  * | 
 | 600 |  * RETURN:      Status | 
 | 601 |  * | 
 | 602 |  * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT | 
 | 603 |  * | 
 | 604 |  ******************************************************************************/ | 
 | 605 |  | 
 | 606 | acpi_status acpi_load_tables(void) | 
 | 607 | { | 
 | 608 | 	acpi_status status; | 
 | 609 |  | 
 | 610 | 	ACPI_FUNCTION_TRACE(acpi_load_tables); | 
 | 611 |  | 
 | 612 | 	/* | 
 | 613 | 	 * Load the namespace from the tables | 
 | 614 | 	 */ | 
 | 615 | 	status = acpi_tb_load_namespace(); | 
 | 616 | 	if (ACPI_FAILURE(status)) { | 
 | 617 | 		ACPI_EXCEPTION((AE_INFO, status, | 
 | 618 | 				"While loading namespace from ACPI tables")); | 
 | 619 | 	} | 
 | 620 |  | 
 | 621 | 	return_ACPI_STATUS(status); | 
 | 622 | } | 
 | 623 |  | 
 | 624 | ACPI_EXPORT_SYMBOL(acpi_load_tables) |