aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables/tbutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/tables/tbutils.c')
-rw-r--r--drivers/acpi/tables/tbutils.c67
1 files changed, 64 insertions, 3 deletions
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index e69d01d443d2..6fc1e36e6042 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -61,6 +61,67 @@ acpi_tb_handle_to_object (
61 61
62/******************************************************************************* 62/*******************************************************************************
63 * 63 *
64 * FUNCTION: acpi_tb_is_table_installed
65 *
66 * PARAMETERS: new_table_desc - Descriptor for new table being installed
67 *
68 * RETURN: Status - AE_ALREADY_EXISTS if the table is already installed
69 *
70 * DESCRIPTION: Determine if an ACPI table is already installed
71 *
72 * MUTEX: Table data structures should be locked
73 *
74 ******************************************************************************/
75
76acpi_status
77acpi_tb_is_table_installed (
78 struct acpi_table_desc *new_table_desc)
79{
80 struct acpi_table_desc *table_desc;
81
82
83 ACPI_FUNCTION_TRACE ("tb_is_table_installed");
84
85
86 /* Get the list descriptor and first table descriptor */
87
88 table_desc = acpi_gbl_table_lists[new_table_desc->type].next;
89
90 /* Examine all installed tables of this type */
91
92 while (table_desc) {
93 /* Compare Revision and oem_table_id */
94
95 if ((table_desc->loaded_into_namespace) &&
96 (table_desc->pointer->revision ==
97 new_table_desc->pointer->revision) &&
98 (!ACPI_MEMCMP (table_desc->pointer->oem_table_id,
99 new_table_desc->pointer->oem_table_id, 8))) {
100 /* This table is already installed */
101
102 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
103 "Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n",
104 new_table_desc->pointer->signature,
105 new_table_desc->pointer->revision,
106 new_table_desc->pointer->oem_table_id));
107
108 new_table_desc->owner_id = table_desc->owner_id;
109 new_table_desc->installed_desc = table_desc;
110
111 return_ACPI_STATUS (AE_ALREADY_EXISTS);
112 }
113
114 /* Get next table on the list */
115
116 table_desc = table_desc->next;
117 }
118
119 return_ACPI_STATUS (AE_OK);
120}
121
122
123/*******************************************************************************
124 *
64 * FUNCTION: acpi_tb_validate_table_header 125 * FUNCTION: acpi_tb_validate_table_header
65 * 126 *
66 * PARAMETERS: table_header - Logical pointer to the table 127 * PARAMETERS: table_header - Logical pointer to the table
@@ -157,7 +218,7 @@ acpi_tb_verify_table_checksum (
157 218
158 /* Compute the checksum on the table */ 219 /* Compute the checksum on the table */
159 220
160 checksum = acpi_tb_checksum (table_header, table_header->length); 221 checksum = acpi_tb_generate_checksum (table_header, table_header->length);
161 222
162 /* Return the appropriate exception */ 223 /* Return the appropriate exception */
163 224
@@ -175,7 +236,7 @@ acpi_tb_verify_table_checksum (
175 236
176/******************************************************************************* 237/*******************************************************************************
177 * 238 *
178 * FUNCTION: acpi_tb_checksum 239 * FUNCTION: acpi_tb_generate_checksum
179 * 240 *
180 * PARAMETERS: Buffer - Buffer to checksum 241 * PARAMETERS: Buffer - Buffer to checksum
181 * Length - Size of the buffer 242 * Length - Size of the buffer
@@ -187,7 +248,7 @@ acpi_tb_verify_table_checksum (
187 ******************************************************************************/ 248 ******************************************************************************/
188 249
189u8 250u8
190acpi_tb_checksum ( 251acpi_tb_generate_checksum (
191 void *buffer, 252 void *buffer,
192 u32 length) 253 u32 length)
193{ 254{