evxface.c revision 67754
1/******************************************************************************
2 *
3 * Module Name: evxface - External interfaces for ACPI events
4 *              $Revision: 91 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, Intel Corp.  All rights
13 * reserved.
14 *
15 * 2. License
16 *
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.
21 *
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
28 *
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;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial prton 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.
54 *
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.
66 *
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.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
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.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
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.
90 *
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.
99 *
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.
114 *
115 *****************************************************************************/
116
117
118#define __EVXFACE_C__
119
120#include "acpi.h"
121#include "achware.h"
122#include "acnamesp.h"
123#include "acevents.h"
124#include "amlcode.h"
125#include "acinterp.h"
126
127#define _COMPONENT          EVENT_HANDLING
128        MODULE_NAME         ("evxface")
129
130
131/******************************************************************************
132 *
133 * FUNCTION:    AcpiInstallFixedEventHandler
134 *
135 * PARAMETERS:  Event           - Event type to enable.
136 *              Handler         - Pointer to the handler function for the
137 *                                event
138 *              Context         - Value passed to the handler on each GPE
139 *
140 * RETURN:      Status
141 *
142 * DESCRIPTION: Saves the pointer to the handler function and then enables the
143 *              event.
144 *
145 ******************************************************************************/
146
147ACPI_STATUS
148AcpiInstallFixedEventHandler (
149    UINT32                  Event,
150    FIXED_EVENT_HANDLER     Handler,
151    void                    *Context)
152{
153    ACPI_STATUS             Status = AE_OK;
154
155
156    FUNCTION_TRACE ("AcpiInstallFixedEventHandler");
157
158
159    /* Sanity check the parameters. */
160
161    if (Event >= NUM_FIXED_EVENTS)
162    {
163        return_ACPI_STATUS (AE_BAD_PARAMETER);
164    }
165
166    AcpiCmAcquireMutex (ACPI_MTX_EVENTS);
167
168    /* Don't allow two handlers. */
169
170    if (NULL != AcpiGbl_FixedEventHandlers[Event].Handler)
171    {
172        Status = AE_EXIST;
173        goto Cleanup;
174    }
175
176
177    /* Install the handler before enabling the event - just in case... */
178
179    AcpiGbl_FixedEventHandlers[Event].Handler = Handler;
180    AcpiGbl_FixedEventHandlers[Event].Context = Context;
181
182    if (1 != AcpiHwRegisterAccess (ACPI_WRITE,
183                                   ACPI_MTX_LOCK, Event + TMR_EN, 1))
184    {
185        DEBUG_PRINT (ACPI_WARN,
186            ("Could not write to fixed event enable register.\n"));
187
188        /* Remove the handler */
189
190        AcpiGbl_FixedEventHandlers[Event].Handler = NULL;
191        AcpiGbl_FixedEventHandlers[Event].Context = NULL;
192
193        Status = AE_ERROR;
194        goto Cleanup;
195    }
196
197    DEBUG_PRINT (ACPI_INFO,
198        ("Enabled fixed event %d.  Handler: %x\n", Event, Handler));
199
200
201Cleanup:
202    AcpiCmReleaseMutex (ACPI_MTX_EVENTS);
203    return_ACPI_STATUS (Status);
204}
205
206
207/******************************************************************************
208 *
209 * FUNCTION:    AcpiRemoveFixedEventHandler
210 *
211 * PARAMETERS:  Event           - Event type to disable.
212 *              Handler         - Address of the handler
213 *
214 * RETURN:      Status
215 *
216 * DESCRIPTION: Disables the event and unregisters the event handler.
217 *
218 ******************************************************************************/
219
220ACPI_STATUS
221AcpiRemoveFixedEventHandler (
222    UINT32                  Event,
223    FIXED_EVENT_HANDLER     Handler)
224{
225    ACPI_STATUS             Status = AE_OK;
226
227
228    FUNCTION_TRACE ("AcpiRemoveFixedEventHandler");
229
230
231    /* Sanity check the parameters. */
232
233    if (Event >= NUM_FIXED_EVENTS)
234    {
235        return_ACPI_STATUS (AE_BAD_PARAMETER);
236    }
237
238    AcpiCmAcquireMutex (ACPI_MTX_EVENTS);
239
240    /* Disable the event before removing the handler - just in case... */
241
242    if (0 != AcpiHwRegisterAccess (ACPI_WRITE,
243                                   ACPI_MTX_LOCK, Event + TMR_EN, 0))
244    {
245        DEBUG_PRINT (ACPI_WARN,
246            ("Could not write to fixed event enable register.\n"));
247        Status = AE_ERROR;
248        goto Cleanup;
249    }
250
251    /* Remove the handler */
252
253    AcpiGbl_FixedEventHandlers[Event].Handler = NULL;
254    AcpiGbl_FixedEventHandlers[Event].Context = NULL;
255
256    DEBUG_PRINT (ACPI_INFO, ("Disabled fixed event %d.\n", Event));
257
258Cleanup:
259    AcpiCmReleaseMutex (ACPI_MTX_EVENTS);
260    return_ACPI_STATUS (Status);
261}
262
263
264/******************************************************************************
265 *
266 * FUNCTION:    AcpiInstallNotifyHandler
267 *
268 * PARAMETERS:  Device          - The device for which notifies will be handled
269 *              HandlerType     - The type of handler:
270 *                                  ACPI_SYSTEM_NOTIFY: SystemHandler (00-7f)
271 *                                  ACPI_DEVICE_NOTIFY: DriverHandler (80-ff)
272 *              Handler         - Address of the handler
273 *              Context         - Value passed to the handler on each GPE
274 *
275 * RETURN:      Status
276 *
277 * DESCRIPTION: Install a handler for notifies on an ACPI device
278 *
279 ******************************************************************************/
280
281ACPI_STATUS
282AcpiInstallNotifyHandler (
283    ACPI_HANDLE             Device,
284    UINT32                  HandlerType,
285    NOTIFY_HANDLER          Handler,
286    void                    *Context)
287{
288    ACPI_OPERAND_OBJECT     *ObjDesc;
289    ACPI_OPERAND_OBJECT     *NotifyObj;
290    ACPI_NAMESPACE_NODE     *DeviceNode;
291    ACPI_STATUS             Status = AE_OK;
292
293
294    FUNCTION_TRACE ("AcpiInstallNotifyHandler");
295
296
297    /* Parameter validation */
298
299    if ((!Handler) ||
300        (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
301    {
302        return_ACPI_STATUS (AE_BAD_PARAMETER);
303    }
304
305    /* Convert and validate the device handle */
306
307    AcpiCmAcquireMutex (ACPI_MTX_NAMESPACE);
308
309    DeviceNode = AcpiNsConvertHandleToEntry (Device);
310    if (!DeviceNode)
311    {
312        Status = AE_BAD_PARAMETER;
313        goto UnlockAndExit;
314    }
315
316
317    /*
318     * Support for global notify handlers.  These handlers are invoked for
319     * every notifiy of the type specifiec
320     */
321
322    if (Device == ACPI_ROOT_OBJECT)
323    {
324        /*
325         *  Make sure the handler is not already installed.
326         */
327
328        if (((HandlerType == ACPI_SYSTEM_NOTIFY) &&
329              AcpiGbl_SysNotify.Handler) ||
330            ((HandlerType == ACPI_DEVICE_NOTIFY) &&
331              AcpiGbl_DrvNotify.Handler))
332        {
333            Status = AE_EXIST;
334            goto UnlockAndExit;
335        }
336
337        if (HandlerType == ACPI_SYSTEM_NOTIFY)
338        {
339            AcpiGbl_SysNotify.Node = DeviceNode;
340            AcpiGbl_SysNotify.Handler = Handler;
341            AcpiGbl_SysNotify.Context = Context;
342        }
343
344        else
345        {
346            AcpiGbl_DrvNotify.Node = DeviceNode;
347            AcpiGbl_DrvNotify.Handler = Handler;
348            AcpiGbl_DrvNotify.Context = Context;
349        }
350
351
352        /* Global notify handler installed */
353
354        goto UnlockAndExit;
355    }
356
357
358    /*
359     * These are the ONLY objects that can receive ACPI notifications
360     */
361
362    if ((DeviceNode->Type != ACPI_TYPE_DEVICE)     &&
363        (DeviceNode->Type != ACPI_TYPE_PROCESSOR)  &&
364        (DeviceNode->Type != ACPI_TYPE_POWER)      &&
365        (DeviceNode->Type != ACPI_TYPE_THERMAL))
366    {
367        Status = AE_BAD_PARAMETER;
368        goto UnlockAndExit;
369    }
370
371    /* Check for an existing internal object */
372
373    ObjDesc = AcpiNsGetAttachedObject ((ACPI_HANDLE) DeviceNode);
374    if (ObjDesc)
375    {
376        /*
377         *  The object exists.
378         *  Make sure the handler is not already installed.
379         */
380
381        if (((HandlerType == ACPI_SYSTEM_NOTIFY) &&
382              ObjDesc->Device.SysHandler) ||
383            ((HandlerType == ACPI_DEVICE_NOTIFY) &&
384              ObjDesc->Device.DrvHandler))
385        {
386            Status = AE_EXIST;
387            goto UnlockAndExit;
388        }
389    }
390
391    else
392    {
393        /* Create a new object */
394
395        ObjDesc = AcpiCmCreateInternalObject (DeviceNode->Type);
396        if (!ObjDesc)
397        {
398            Status = AE_NO_MEMORY;
399            goto UnlockAndExit;
400        }
401
402        /* Attach new object to the Node */
403
404        Status = AcpiNsAttachObject (Device, ObjDesc, (UINT8) DeviceNode->Type);
405
406        if (ACPI_FAILURE (Status))
407        {
408            goto UnlockAndExit;
409        }
410    }
411
412
413    /*
414     *  If we get here, we know that there is no handler installed
415     *  so let's party
416     */
417    NotifyObj = AcpiCmCreateInternalObject (INTERNAL_TYPE_NOTIFY);
418    if (!NotifyObj)
419    {
420        Status = AE_NO_MEMORY;
421        goto UnlockAndExit;
422    }
423
424    NotifyObj->NotifyHandler.Node = DeviceNode;
425    NotifyObj->NotifyHandler.Handler = Handler;
426    NotifyObj->NotifyHandler.Context = Context;
427
428
429    if (HandlerType == ACPI_SYSTEM_NOTIFY)
430    {
431        ObjDesc->Device.SysHandler = NotifyObj;
432    }
433
434    else
435    {
436        ObjDesc->Device.DrvHandler = NotifyObj;
437    }
438
439
440UnlockAndExit:
441    AcpiCmReleaseMutex (ACPI_MTX_NAMESPACE);
442    return_ACPI_STATUS (Status);
443}
444
445
446/*****************************************************************************
447 *
448 * FUNCTION:    AcpiRemoveNotifyHandler
449 *
450 * PARAMETERS:  Device          - The device for which notifies will be handled
451 *              HandlerType     - The type of handler:
452 *                                  ACPI_SYSTEM_NOTIFY: SystemHandler (00-7f)
453 *                                  ACPI_DEVICE_NOTIFY: DriverHandler (80-ff)
454 *              Handler         - Address of the handler
455 * RETURN:      Status
456 *
457 * DESCRIPTION: Remove a handler for notifies on an ACPI device
458 *
459 ******************************************************************************/
460
461ACPI_STATUS
462AcpiRemoveNotifyHandler (
463    ACPI_HANDLE             Device,
464    UINT32                  HandlerType,
465    NOTIFY_HANDLER          Handler)
466{
467    ACPI_OPERAND_OBJECT     *NotifyObj;
468    ACPI_OPERAND_OBJECT     *ObjDesc;
469    ACPI_NAMESPACE_NODE     *DeviceNode;
470    ACPI_STATUS             Status = AE_OK;
471
472
473    FUNCTION_TRACE ("AcpiRemoveNotifyHandler");
474
475
476    /* Parameter validation */
477
478    if ((!Handler) ||
479        (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
480    {
481        return_ACPI_STATUS (AE_BAD_PARAMETER);
482    }
483
484    AcpiCmAcquireMutex (ACPI_MTX_NAMESPACE);
485
486    /* Convert and validate the device handle */
487
488    DeviceNode = AcpiNsConvertHandleToEntry (Device);
489    if (!DeviceNode)
490    {
491        Status = AE_BAD_PARAMETER;
492        goto UnlockAndExit;
493    }
494
495    /*
496     * These are the ONLY objects that can receive ACPI notifications
497     */
498
499    if ((DeviceNode->Type != ACPI_TYPE_DEVICE)     &&
500        (DeviceNode->Type != ACPI_TYPE_PROCESSOR)  &&
501        (DeviceNode->Type != ACPI_TYPE_POWER)      &&
502        (DeviceNode->Type != ACPI_TYPE_THERMAL))
503    {
504        Status = AE_BAD_PARAMETER;
505        goto UnlockAndExit;
506    }
507
508    /* Check for an existing internal object */
509
510    ObjDesc = AcpiNsGetAttachedObject ((ACPI_HANDLE) DeviceNode);
511    if (!ObjDesc)
512    {
513        Status = AE_NOT_EXIST;
514        goto UnlockAndExit;
515    }
516
517    /*
518     *  The object exists.
519     *
520     *  Make sure the handler is installed.
521     */
522
523    if (HandlerType == ACPI_SYSTEM_NOTIFY)
524    {
525        NotifyObj = ObjDesc->Device.SysHandler;
526    }
527    else
528    {
529        NotifyObj = ObjDesc->Device.DrvHandler;
530    }
531
532    if ((!NotifyObj) ||
533        (NotifyObj->NotifyHandler.Handler != Handler))
534    {
535        Status = AE_BAD_PARAMETER;
536        goto UnlockAndExit;
537    }
538
539    /*
540     * Now we can remove the handler
541     */
542    if (HandlerType == ACPI_SYSTEM_NOTIFY)
543    {
544        ObjDesc->Device.SysHandler = NULL;
545    }
546    else
547    {
548        ObjDesc->Device.DrvHandler = NULL;
549    }
550
551    AcpiCmRemoveReference (NotifyObj);
552
553UnlockAndExit:
554    AcpiCmReleaseMutex (ACPI_MTX_NAMESPACE);
555    return_ACPI_STATUS (Status);
556}
557
558/******************************************************************************
559 *
560 * FUNCTION:    AcpiInstallGpeHandler
561 *
562 * PARAMETERS:  GpeNumber       - The GPE number.  The numbering scheme is
563 *                                bank 0 first, then bank 1.
564 *              Type            - Whether this GPE should be treated as an
565 *                                edge- or level-triggered interrupt.
566 *              Handler         - Address of the handler
567 *              Context         - Value passed to the handler on each GPE
568 *
569 * RETURN:      Status
570 *
571 * DESCRIPTION: Install a handler for a General Purpose Event.
572 *
573 ******************************************************************************/
574
575ACPI_STATUS
576AcpiInstallGpeHandler (
577    UINT32                  GpeNumber,
578    UINT32                  Type,
579    GPE_HANDLER             Handler,
580    void                    *Context)
581{
582    ACPI_STATUS             Status = AE_OK;
583
584    FUNCTION_TRACE ("AcpiInstallGpeHandler");
585
586    /* Parameter validation */
587
588    if (!Handler || (GpeNumber > NUM_GPE))
589    {
590        return_ACPI_STATUS (AE_BAD_PARAMETER);
591    }
592
593    /* Ensure that we have a valid GPE number */
594
595    if (AcpiGbl_GpeValid[GpeNumber] == ACPI_GPE_INVALID)
596    {
597        return_ACPI_STATUS (AE_BAD_PARAMETER);
598    }
599
600    AcpiCmAcquireMutex (ACPI_MTX_EVENTS);
601
602    /* Make sure that there isn't a handler there already */
603
604    if (AcpiGbl_GpeInfo[GpeNumber].Handler)
605    {
606        Status = AE_EXIST;
607        goto Cleanup;
608    }
609
610    /* Install the handler */
611
612    AcpiGbl_GpeInfo[GpeNumber].Handler = Handler;
613    AcpiGbl_GpeInfo[GpeNumber].Context = Context;
614    AcpiGbl_GpeInfo[GpeNumber].Type = (UINT8) Type;
615
616    /* Clear the GPE (of stale events), the enable it */
617
618    AcpiHwClearGpe (GpeNumber);
619    AcpiHwEnableGpe (GpeNumber);
620
621Cleanup:
622    AcpiCmReleaseMutex (ACPI_MTX_EVENTS);
623    return_ACPI_STATUS (Status);
624}
625
626
627/******************************************************************************
628 *
629 * FUNCTION:    AcpiRemoveGpeHandler
630 *
631 * PARAMETERS:  GpeNumber       - The event to remove a handler
632 *              Handler         - Address of the handler
633 *
634 * RETURN:      Status
635 *
636 * DESCRIPTION: Remove a handler for a General Purpose AcpiEvent.
637 *
638 ******************************************************************************/
639
640ACPI_STATUS
641AcpiRemoveGpeHandler (
642    UINT32                  GpeNumber,
643    GPE_HANDLER             Handler)
644{
645    ACPI_STATUS             Status = AE_OK;
646
647
648    FUNCTION_TRACE ("AcpiRemoveGpeHandler");
649
650
651    /* Parameter validation */
652
653    if (!Handler || (GpeNumber > NUM_GPE))
654    {
655        return_ACPI_STATUS (AE_BAD_PARAMETER);
656    }
657
658    /* Ensure that we have a valid GPE number */
659
660    if (AcpiGbl_GpeValid[GpeNumber] == ACPI_GPE_INVALID)
661    {
662        return_ACPI_STATUS (AE_BAD_PARAMETER);
663    }
664
665    /* Disable the GPE before removing the handler */
666
667    AcpiHwDisableGpe (GpeNumber);
668
669    AcpiCmAcquireMutex (ACPI_MTX_EVENTS);
670
671    /* Make sure that the installed handler is the same */
672
673    if (AcpiGbl_GpeInfo[GpeNumber].Handler != Handler)
674    {
675        AcpiHwEnableGpe (GpeNumber);
676        Status = AE_BAD_PARAMETER;
677        goto Cleanup;
678    }
679
680    /* Remove the handler */
681
682    AcpiGbl_GpeInfo[GpeNumber].Handler = NULL;
683    AcpiGbl_GpeInfo[GpeNumber].Context = NULL;
684
685Cleanup:
686    AcpiCmReleaseMutex (ACPI_MTX_EVENTS);
687    return_ACPI_STATUS (Status);
688}
689
690
691/******************************************************************************
692 *
693 * FUNCTION:    AcpiAcquireGlobalLock
694 *
695 * PARAMETERS:  Timeout         - How long the caller is willing to wait
696 *              OutHandle       - A handle to the lock if acquired
697 *
698 * RETURN:      Status
699 *
700 * DESCRIPTION: Acquire the ACPI Global Lock
701 *
702 ******************************************************************************/
703ACPI_STATUS
704AcpiAcquireGlobalLock (
705    void)
706{
707    ACPI_STATUS             Status;
708
709
710    AcpiAmlEnterInterpreter ();
711
712    /*
713     * TBD: [Restructure] add timeout param to internal interface, and
714     * perhaps INTERPRETER_LOCKED
715     */
716
717    Status = AcpiEvAcquireGlobalLock ();
718    AcpiAmlExitInterpreter ();
719
720    return (Status);
721}
722
723
724/******************************************************************************
725 *
726 * FUNCTION:    AcpiReleaseGlobalLock
727 *
728 * PARAMETERS:  Handle      - Returned from AcpiAcquireGlobalLock
729 *
730 * RETURN:      Status
731 *
732 * DESCRIPTION: Release the ACPI Global Lock
733 *
734 ******************************************************************************/
735
736ACPI_STATUS
737AcpiReleaseGlobalLock (
738    void)
739{
740    AcpiEvReleaseGlobalLock ();
741    return (AE_OK);
742}
743
744
745