minor fixes for safecopy & safemap tests
[minix.git] / drivers / acpi / tables / tbxface.c
blobba1a026e86883ecad756821aaaa197143c75fee6
1 /******************************************************************************
3 * Module Name: tbxface - Public interfaces to the ACPI subsystem
4 * ACPI table oriented interfaces
6 *****************************************************************************/
8 /******************************************************************************
10 * 1. Copyright Notice
12 * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
13 * All rights reserved.
15 * 2. License
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
41 * 3. Conditions
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
81 * 4. Disclaimer and Export Compliance
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
115 *****************************************************************************/
117 #define __TBXFACE_C__
119 #include "acpi.h"
120 #include "accommon.h"
121 #include "acnamesp.h"
122 #include "actables.h"
124 #define _COMPONENT ACPI_TABLES
125 ACPI_MODULE_NAME ("tbxface")
127 /* Local prototypes */
129 static ACPI_STATUS
130 AcpiTbLoadNamespace (
131 void);
134 /*******************************************************************************
136 * FUNCTION: AcpiAllocateRootTable
138 * PARAMETERS: InitialTableCount - Size of InitialTableArray, in number of
139 * ACPI_TABLE_DESC structures
141 * RETURN: Status
143 * DESCRIPTION: Allocate a root table array. Used by iASL compiler and
144 * AcpiInitializeTables.
146 ******************************************************************************/
148 ACPI_STATUS
149 AcpiAllocateRootTable (
150 UINT32 InitialTableCount)
153 AcpiGbl_RootTableList.MaxTableCount = InitialTableCount;
154 AcpiGbl_RootTableList.Flags = ACPI_ROOT_ALLOW_RESIZE;
156 return (AcpiTbResizeRootTableList ());
160 /*******************************************************************************
162 * FUNCTION: AcpiInitializeTables
164 * PARAMETERS: InitialTableArray - Pointer to an array of pre-allocated
165 * ACPI_TABLE_DESC structures. If NULL, the
166 * array is dynamically allocated.
167 * InitialTableCount - Size of InitialTableArray, in number of
168 * ACPI_TABLE_DESC structures
169 * AllowRealloc - Flag to tell Table Manager if resize of
170 * pre-allocated array is allowed. Ignored
171 * if InitialTableArray is NULL.
173 * RETURN: Status
175 * DESCRIPTION: Initialize the table manager, get the RSDP and RSDT/XSDT.
177 * NOTE: Allows static allocation of the initial table array in order
178 * to avoid the use of dynamic memory in confined environments
179 * such as the kernel boot sequence where it may not be available.
181 * If the host OS memory managers are initialized, use NULL for
182 * InitialTableArray, and the table will be dynamically allocated.
184 ******************************************************************************/
186 ACPI_STATUS
187 AcpiInitializeTables (
188 ACPI_TABLE_DESC *InitialTableArray,
189 UINT32 InitialTableCount,
190 BOOLEAN AllowResize)
192 ACPI_PHYSICAL_ADDRESS RsdpAddress;
193 ACPI_STATUS Status;
196 ACPI_FUNCTION_TRACE (AcpiInitializeTables);
200 * Set up the Root Table Array
201 * Allocate the table array if requested
203 if (!InitialTableArray)
205 Status = AcpiAllocateRootTable (InitialTableCount);
206 if (ACPI_FAILURE (Status))
208 return_ACPI_STATUS (Status);
211 else
213 /* Root Table Array has been statically allocated by the host */
215 ACPI_MEMSET (InitialTableArray, 0,
216 (ACPI_SIZE) InitialTableCount * sizeof (ACPI_TABLE_DESC));
218 AcpiGbl_RootTableList.Tables = InitialTableArray;
219 AcpiGbl_RootTableList.MaxTableCount = InitialTableCount;
220 AcpiGbl_RootTableList.Flags = ACPI_ROOT_ORIGIN_UNKNOWN;
221 if (AllowResize)
223 AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE;
227 /* Get the address of the RSDP */
229 RsdpAddress = AcpiOsGetRootPointer ();
230 if (!RsdpAddress)
232 return_ACPI_STATUS (AE_NOT_FOUND);
236 * Get the root table (RSDT or XSDT) and extract all entries to the local
237 * Root Table Array. This array contains the information of the RSDT/XSDT
238 * in a common, more useable format.
240 Status = AcpiTbParseRootTable (RsdpAddress);
241 return_ACPI_STATUS (Status);
244 ACPI_EXPORT_SYMBOL (AcpiInitializeTables)
247 /*******************************************************************************
249 * FUNCTION: AcpiReallocateRootTable
251 * PARAMETERS: None
253 * RETURN: Status
255 * DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the
256 * root list from the previously provided scratch area. Should
257 * be called once dynamic memory allocation is available in the
258 * kernel
260 ******************************************************************************/
262 ACPI_STATUS
263 AcpiReallocateRootTable (
264 void)
266 ACPI_TABLE_DESC *Tables;
267 ACPI_SIZE NewSize;
268 ACPI_SIZE CurrentSize;
271 ACPI_FUNCTION_TRACE (AcpiReallocateRootTable);
275 * Only reallocate the root table if the host provided a static buffer
276 * for the table array in the call to AcpiInitializeTables.
278 if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
280 return_ACPI_STATUS (AE_SUPPORT);
284 * Get the current size of the root table and add the default
285 * increment to create the new table size.
287 CurrentSize = (ACPI_SIZE)
288 AcpiGbl_RootTableList.CurrentTableCount * sizeof (ACPI_TABLE_DESC);
290 NewSize = CurrentSize +
291 (ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof (ACPI_TABLE_DESC));
293 /* Create new array and copy the old array */
295 Tables = ACPI_ALLOCATE_ZEROED (NewSize);
296 if (!Tables)
298 return_ACPI_STATUS (AE_NO_MEMORY);
301 ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, CurrentSize);
304 * Update the root table descriptor. The new size will be the current
305 * number of tables plus the increment, independent of the reserved
306 * size of the original table list.
308 AcpiGbl_RootTableList.Tables = Tables;
309 AcpiGbl_RootTableList.MaxTableCount =
310 AcpiGbl_RootTableList.CurrentTableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
311 AcpiGbl_RootTableList.Flags =
312 ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE;
314 return_ACPI_STATUS (AE_OK);
317 ACPI_EXPORT_SYMBOL (AcpiReallocateRootTable)
320 /*******************************************************************************
322 * FUNCTION: AcpiGetTableHeader
324 * PARAMETERS: Signature - ACPI signature of needed table
325 * Instance - Which instance (for SSDTs)
326 * OutTableHeader - The pointer to the table header to fill
328 * RETURN: Status and pointer to mapped table header
330 * DESCRIPTION: Finds an ACPI table header.
332 * NOTE: Caller is responsible in unmapping the header with
333 * AcpiOsUnmapMemory
335 ******************************************************************************/
337 ACPI_STATUS
338 AcpiGetTableHeader (
339 char *Signature,
340 UINT32 Instance,
341 ACPI_TABLE_HEADER *OutTableHeader)
343 UINT32 i;
344 UINT32 j;
345 ACPI_TABLE_HEADER *Header;
348 /* Parameter validation */
350 if (!Signature || !OutTableHeader)
352 return (AE_BAD_PARAMETER);
355 /* Walk the root table list */
357 for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
359 if (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
360 Signature))
362 continue;
365 if (++j < Instance)
367 continue;
370 if (!AcpiGbl_RootTableList.Tables[i].Pointer)
372 if ((AcpiGbl_RootTableList.Tables[i].Flags &
373 ACPI_TABLE_ORIGIN_MASK) ==
374 ACPI_TABLE_ORIGIN_MAPPED)
376 Header = AcpiOsMapMemory (
377 AcpiGbl_RootTableList.Tables[i].Address,
378 sizeof (ACPI_TABLE_HEADER));
379 if (!Header)
381 return AE_NO_MEMORY;
384 ACPI_MEMCPY (OutTableHeader, Header, sizeof(ACPI_TABLE_HEADER));
385 AcpiOsUnmapMemory (Header, sizeof(ACPI_TABLE_HEADER));
387 else
389 return AE_NOT_FOUND;
392 else
394 ACPI_MEMCPY (OutTableHeader,
395 AcpiGbl_RootTableList.Tables[i].Pointer,
396 sizeof(ACPI_TABLE_HEADER));
399 return (AE_OK);
402 return (AE_NOT_FOUND);
405 ACPI_EXPORT_SYMBOL (AcpiGetTableHeader)
408 /*******************************************************************************
410 * FUNCTION: AcpiGetTable
412 * PARAMETERS: Signature - ACPI signature of needed table
413 * Instance - Which instance (for SSDTs)
414 * OutTable - Where the pointer to the table is returned
416 * RETURN: Status and pointer to table
418 * DESCRIPTION: Finds and verifies an ACPI table.
420 ******************************************************************************/
422 ACPI_STATUS
423 AcpiGetTable (
424 char *Signature,
425 UINT32 Instance,
426 ACPI_TABLE_HEADER **OutTable)
428 UINT32 i;
429 UINT32 j;
430 ACPI_STATUS Status;
433 /* Parameter validation */
435 if (!Signature || !OutTable)
437 return (AE_BAD_PARAMETER);
440 /* Walk the root table list */
442 for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
444 if (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
445 Signature))
447 continue;
450 if (++j < Instance)
452 continue;
455 Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);
456 if (ACPI_SUCCESS (Status))
458 *OutTable = AcpiGbl_RootTableList.Tables[i].Pointer;
461 return (Status);
464 return (AE_NOT_FOUND);
467 ACPI_EXPORT_SYMBOL (AcpiGetTable)
470 /*******************************************************************************
472 * FUNCTION: AcpiGetTableByIndex
474 * PARAMETERS: TableIndex - Table index
475 * Table - Where the pointer to the table is returned
477 * RETURN: Status and pointer to the table
479 * DESCRIPTION: Obtain a table by an index into the global table list.
481 ******************************************************************************/
483 ACPI_STATUS
484 AcpiGetTableByIndex (
485 UINT32 TableIndex,
486 ACPI_TABLE_HEADER **Table)
488 ACPI_STATUS Status;
491 ACPI_FUNCTION_TRACE (AcpiGetTableByIndex);
494 /* Parameter validation */
496 if (!Table)
498 return_ACPI_STATUS (AE_BAD_PARAMETER);
501 (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
503 /* Validate index */
505 if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
507 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
508 return_ACPI_STATUS (AE_BAD_PARAMETER);
511 if (!AcpiGbl_RootTableList.Tables[TableIndex].Pointer)
513 /* Table is not mapped, map it */
515 Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
516 if (ACPI_FAILURE (Status))
518 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
519 return_ACPI_STATUS (Status);
523 *Table = AcpiGbl_RootTableList.Tables[TableIndex].Pointer;
524 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
525 return_ACPI_STATUS (AE_OK);
528 ACPI_EXPORT_SYMBOL (AcpiGetTableByIndex)
531 /*******************************************************************************
533 * FUNCTION: AcpiTbLoadNamespace
535 * PARAMETERS: None
537 * RETURN: Status
539 * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in
540 * the RSDT/XSDT.
542 ******************************************************************************/
544 static ACPI_STATUS
545 AcpiTbLoadNamespace (
546 void)
548 ACPI_STATUS Status;
549 UINT32 i;
550 ACPI_TABLE_HEADER *NewDsdt;
553 ACPI_FUNCTION_TRACE (TbLoadNamespace);
556 (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
559 * Load the namespace. The DSDT is required, but any SSDT and
560 * PSDT tables are optional. Verify the DSDT.
562 if (!AcpiGbl_RootTableList.CurrentTableCount ||
563 !ACPI_COMPARE_NAME (
564 &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature),
565 ACPI_SIG_DSDT) ||
566 ACPI_FAILURE (AcpiTbVerifyTable (
567 &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT])))
569 Status = AE_NO_ACPI_TABLES;
570 goto UnlockAndExit;
574 * Save the DSDT pointer for simple access. This is the mapped memory
575 * address. We must take care here because the address of the .Tables
576 * array can change dynamically as tables are loaded at run-time. Note:
577 * .Pointer field is not validated until after call to AcpiTbVerifyTable.
579 AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer;
582 * Optionally copy the entire DSDT to local memory (instead of simply
583 * mapping it.) There are some BIOSs that corrupt or replace the original
584 * DSDT, creating the need for this option. Default is FALSE, do not copy
585 * the DSDT.
587 if (AcpiGbl_CopyDsdtLocally)
589 NewDsdt = AcpiTbCopyDsdt (ACPI_TABLE_INDEX_DSDT);
590 if (NewDsdt)
592 AcpiGbl_DSDT = NewDsdt;
597 * Save the original DSDT header for detection of table corruption
598 * and/or replacement of the DSDT from outside the OS.
600 ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT,
601 sizeof (ACPI_TABLE_HEADER));
603 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
605 /* Load and parse tables */
607 Status = AcpiNsLoadTable (ACPI_TABLE_INDEX_DSDT, AcpiGbl_RootNode);
608 if (ACPI_FAILURE (Status))
610 return_ACPI_STATUS (Status);
613 /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
615 (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
616 for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
618 if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
619 ACPI_SIG_SSDT) &&
620 !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
621 ACPI_SIG_PSDT)) ||
622 ACPI_FAILURE (AcpiTbVerifyTable (
623 &AcpiGbl_RootTableList.Tables[i])))
625 continue;
628 /* Ignore errors while loading tables, get as many as possible */
630 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
631 (void) AcpiNsLoadTable (i, AcpiGbl_RootNode);
632 (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
635 ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI Tables successfully acquired\n"));
637 UnlockAndExit:
638 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
639 return_ACPI_STATUS (Status);
643 /*******************************************************************************
645 * FUNCTION: AcpiLoadTables
647 * PARAMETERS: None
649 * RETURN: Status
651 * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT
653 ******************************************************************************/
655 ACPI_STATUS
656 AcpiLoadTables (
657 void)
659 ACPI_STATUS Status;
662 ACPI_FUNCTION_TRACE (AcpiLoadTables);
665 /* Load the namespace from the tables */
667 Status = AcpiTbLoadNamespace ();
668 if (ACPI_FAILURE (Status))
670 ACPI_EXCEPTION ((AE_INFO, Status,
671 "While loading namespace from ACPI tables"));
674 return_ACPI_STATUS (Status);
677 ACPI_EXPORT_SYMBOL (AcpiLoadTables)
680 /*******************************************************************************
682 * FUNCTION: AcpiInstallTableHandler
684 * PARAMETERS: Handler - Table event handler
685 * Context - Value passed to the handler on each event
687 * RETURN: Status
689 * DESCRIPTION: Install table event handler
691 ******************************************************************************/
693 ACPI_STATUS
694 AcpiInstallTableHandler (
695 ACPI_TABLE_HANDLER Handler,
696 void *Context)
698 ACPI_STATUS Status;
701 ACPI_FUNCTION_TRACE (AcpiInstallTableHandler);
704 if (!Handler)
706 return_ACPI_STATUS (AE_BAD_PARAMETER);
709 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
710 if (ACPI_FAILURE (Status))
712 return_ACPI_STATUS (Status);
715 /* Don't allow more than one handler */
717 if (AcpiGbl_TableHandler)
719 Status = AE_ALREADY_EXISTS;
720 goto Cleanup;
723 /* Install the handler */
725 AcpiGbl_TableHandler = Handler;
726 AcpiGbl_TableHandlerContext = Context;
728 Cleanup:
729 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
730 return_ACPI_STATUS (Status);
733 ACPI_EXPORT_SYMBOL (AcpiInstallTableHandler)
736 /*******************************************************************************
738 * FUNCTION: AcpiRemoveTableHandler
740 * PARAMETERS: Handler - Table event handler that was installed
741 * previously.
743 * RETURN: Status
745 * DESCRIPTION: Remove table event handler
747 ******************************************************************************/
749 ACPI_STATUS
750 AcpiRemoveTableHandler (
751 ACPI_TABLE_HANDLER Handler)
753 ACPI_STATUS Status;
756 ACPI_FUNCTION_TRACE (AcpiRemoveTableHandler);
759 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
760 if (ACPI_FAILURE (Status))
762 return_ACPI_STATUS (Status);
765 /* Make sure that the installed handler is the same */
767 if (!Handler ||
768 Handler != AcpiGbl_TableHandler)
770 Status = AE_BAD_PARAMETER;
771 goto Cleanup;
774 /* Remove the handler */
776 AcpiGbl_TableHandler = NULL;
778 Cleanup:
779 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
780 return_ACPI_STATUS (Status);
783 ACPI_EXPORT_SYMBOL (AcpiRemoveTableHandler)