Deleted Added
full compact
tbinstal.c (229989) tbinstal.c (231844)
1/******************************************************************************
2 *
3 * Module Name: tbinstal - ACPI table installation and removal
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

--- 114 unchanged lines hidden (view full) ---

123
124ACPI_STATUS
125AcpiTbAddTable (
126 ACPI_TABLE_DESC *TableDesc,
127 UINT32 *TableIndex)
128{
129 UINT32 i;
130 ACPI_STATUS Status = AE_OK;
1/******************************************************************************
2 *
3 * Module Name: tbinstal - ACPI table installation and removal
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

--- 114 unchanged lines hidden (view full) ---

123
124ACPI_STATUS
125AcpiTbAddTable (
126 ACPI_TABLE_DESC *TableDesc,
127 UINT32 *TableIndex)
128{
129 UINT32 i;
130 ACPI_STATUS Status = AE_OK;
131 ACPI_TABLE_HEADER *OverrideTable = NULL;
132
133
134 ACPI_FUNCTION_TRACE (TbAddTable);
135
136
137 if (!TableDesc->Pointer)
138 {
139 Status = AcpiTbVerifyTable (TableDesc);

--- 97 unchanged lines hidden (view full) ---

237 Status = AE_OK;
238 goto PrintHeader;
239 }
240 }
241
242 /*
243 * ACPI Table Override:
244 * Allow the host to override dynamically loaded tables.
131
132
133 ACPI_FUNCTION_TRACE (TbAddTable);
134
135
136 if (!TableDesc->Pointer)
137 {
138 Status = AcpiTbVerifyTable (TableDesc);

--- 97 unchanged lines hidden (view full) ---

236 Status = AE_OK;
237 goto PrintHeader;
238 }
239 }
240
241 /*
242 * ACPI Table Override:
243 * Allow the host to override dynamically loaded tables.
244 * NOTE: the table is fully mapped at this point, and the mapping will
245 * be deleted by TbTableOverride if the table is actually overridden.
245 */
246 */
246 Status = AcpiOsTableOverride (TableDesc->Pointer, &OverrideTable);
247 if (ACPI_SUCCESS (Status) && OverrideTable)
248 {
249 ACPI_INFO ((AE_INFO,
250 "%4.4s @ 0x%p Table override, replaced with:",
251 TableDesc->Pointer->Signature,
252 ACPI_CAST_PTR (void, TableDesc->Address)));
247 (void) AcpiTbTableOverride (TableDesc->Pointer, TableDesc);
253
248
254 /* We can delete the table that was passed as a parameter */
255
256 AcpiTbDeleteTable (TableDesc);
257
258 /* Setup descriptor for the new table */
259
260 TableDesc->Address = ACPI_PTR_TO_PHYSADDR (OverrideTable);
261 TableDesc->Pointer = OverrideTable;
262 TableDesc->Length = OverrideTable->Length;
263 TableDesc->Flags = ACPI_TABLE_ORIGIN_OVERRIDE;
264 }
265
266 /* Add the table to the global root table list */
267
268 Status = AcpiTbStoreTable (TableDesc->Address, TableDesc->Pointer,
269 TableDesc->Length, TableDesc->Flags, TableIndex);
270 if (ACPI_FAILURE (Status))
271 {
272 goto Release;
273 }

--- 4 unchanged lines hidden (view full) ---

278Release:
279 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
280 return_ACPI_STATUS (Status);
281}
282
283
284/*******************************************************************************
285 *
249 /* Add the table to the global root table list */
250
251 Status = AcpiTbStoreTable (TableDesc->Address, TableDesc->Pointer,
252 TableDesc->Length, TableDesc->Flags, TableIndex);
253 if (ACPI_FAILURE (Status))
254 {
255 goto Release;
256 }

--- 4 unchanged lines hidden (view full) ---

261Release:
262 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
263 return_ACPI_STATUS (Status);
264}
265
266
267/*******************************************************************************
268 *
269 * FUNCTION: AcpiTbTableOverride
270 *
271 * PARAMETERS: TableHeader - Header for the original table
272 * TableDesc - Table descriptor initialized for the
273 * original table. May or may not be mapped.
274 *
275 * RETURN: Pointer to the entire new table. NULL if table not overridden.
276 * If overridden, installs the new table within the input table
277 * descriptor.
278 *
279 * DESCRIPTION: Attempt table override by calling the OSL override functions.
280 * Note: If the table is overridden, then the entire new table
281 * is mapped and returned by this function.
282 *
283 ******************************************************************************/
284
285ACPI_TABLE_HEADER *
286AcpiTbTableOverride (
287 ACPI_TABLE_HEADER *TableHeader,
288 ACPI_TABLE_DESC *TableDesc)
289{
290 ACPI_STATUS Status;
291 ACPI_TABLE_HEADER *NewTable = NULL;
292 ACPI_PHYSICAL_ADDRESS NewAddress = 0;
293 UINT32 NewTableLength = 0;
294 UINT8 NewFlags;
295 char *OverrideType;
296
297
298 /* (1) Attempt logical override (returns a logical address) */
299
300 Status = AcpiOsTableOverride (TableHeader, &NewTable);
301 if (ACPI_SUCCESS (Status) && NewTable)
302 {
303 NewAddress = ACPI_PTR_TO_PHYSADDR (NewTable);
304 NewTableLength = NewTable->Length;
305 NewFlags = ACPI_TABLE_ORIGIN_OVERRIDE;
306 OverrideType = "Logical";
307 goto FinishOverride;
308 }
309
310 /* (2) Attempt physical override (returns a physical address) */
311
312 Status = AcpiOsPhysicalTableOverride (TableHeader,
313 &NewAddress, &NewTableLength);
314 if (ACPI_SUCCESS (Status) && NewAddress && NewTableLength)
315 {
316 /* Map the entire new table */
317
318 NewTable = AcpiOsMapMemory (NewAddress, NewTableLength);
319 if (!NewTable)
320 {
321 ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
322 "%4.4s %p Attempted physical table override failed",
323 TableHeader->Signature,
324 ACPI_CAST_PTR (void, TableDesc->Address)));
325 return (NULL);
326 }
327
328 OverrideType = "Physical";
329 NewFlags = ACPI_TABLE_ORIGIN_MAPPED;
330 goto FinishOverride;
331 }
332
333 return (NULL); /* There was no override */
334
335
336FinishOverride:
337
338 ACPI_INFO ((AE_INFO,
339 "%4.4s %p %s table override, new table: %p",
340 TableHeader->Signature,
341 ACPI_CAST_PTR (void, TableDesc->Address),
342 OverrideType, NewTable));
343
344 /* We can now unmap/delete the original table (if fully mapped) */
345
346 AcpiTbDeleteTable (TableDesc);
347
348 /* Setup descriptor for the new table */
349
350 TableDesc->Address = NewAddress;
351 TableDesc->Pointer = NewTable;
352 TableDesc->Length = NewTableLength;
353 TableDesc->Flags = NewFlags;
354
355 return (NewTable);
356}
357
358
359/*******************************************************************************
360 *
286 * FUNCTION: AcpiTbResizeRootTableList
287 *
288 * PARAMETERS: None
289 *
290 * RETURN: Status
291 *
292 * DESCRIPTION: Expand the size of global table array
293 *

--- 438 unchanged lines hidden ---
361 * FUNCTION: AcpiTbResizeRootTableList
362 *
363 * PARAMETERS: None
364 *
365 * RETURN: Status
366 *
367 * DESCRIPTION: Expand the size of global table array
368 *

--- 438 unchanged lines hidden ---