1 /******************************************************************************
3 * Module Name: aehandlers - Various handlers for acpiexec
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
152 #include "aecommon.h"
154 #define _COMPONENT ACPI_TOOLS
155 ACPI_MODULE_NAME ("aehandlers")
158 /* Local prototypes */
173 AeCommonNotifyHandler (
179 AeDeviceNotifyHandler (
191 AeAttachedDataHandler (
196 AeAttachedDataHandler2 (
202 ACPI_STRING InterfaceName,
205 #if (!ACPI_REDUCED_HARDWARE)
214 static char *TableEvents[] =
222 #endif /* !ACPI_REDUCED_HARDWARE */
225 static AE_DEBUG_REGIONS AeRegions;
228 /******************************************************************************
230 * FUNCTION: AeNotifyHandler(s)
232 * PARAMETERS: Standard notify handler parameters
236 * DESCRIPTION: Notify handlers for AcpiExec utility. Used by the ASL
237 * test suite(s) to communicate errors and other information to
238 * this utility via the Notify() operator. Tests notify handling
239 * and multiple notify handler support.
241 *****************************************************************************/
249 AeCommonNotifyHandler (Device, Value, 1);
258 AeCommonNotifyHandler (Device, Value, 2);
262 AeCommonNotifyHandler (
271 if (Value <= ACPI_MAX_SYS_NOTIFY)
282 "Method Error 0x%X: Results not equal\n", Value);
283 if (AcpiGbl_DebugFile)
285 AcpiOsPrintf (AE_PREFIX
286 "Method Error: Results not equal\n");
293 "Method Error: Incorrect numeric result\n");
294 if (AcpiGbl_DebugFile)
296 AcpiOsPrintf (AE_PREFIX
297 "Method Error: Incorrect numeric result\n");
304 "Method Error: An operand was overwritten\n");
305 if (AcpiGbl_DebugFile)
307 AcpiOsPrintf (AE_PREFIX
308 "Method Error: An operand was overwritten\n");
317 "Handler %u: Received a %s Notify on [%4.4s] %p Value 0x%2.2X (%s)\n",
318 HandlerId, Type, AcpiUtGetNodeName (Device), Device, Value,
319 AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY));
320 if (AcpiGbl_DebugFile)
322 AcpiOsPrintf (AE_PREFIX
323 "Handler %u: Received a %s notify, Value 0x%2.2X\n",
324 HandlerId, Type, Value);
327 (void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL);
333 /******************************************************************************
335 * FUNCTION: AeSystemNotifyHandler
337 * PARAMETERS: Standard notify handler parameters
341 * DESCRIPTION: System notify handler for AcpiExec utility. Used by the ASL
342 * test suite(s) to communicate errors and other information to
343 * this utility via the Notify() operator.
345 *****************************************************************************/
348 AeSystemNotifyHandler (
355 "Global: Received a System Notify on [%4.4s] %p Value 0x%2.2X (%s)\n",
356 AcpiUtGetNodeName (Device), Device, Value,
357 AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY));
358 if (AcpiGbl_DebugFile)
360 AcpiOsPrintf (AE_PREFIX
361 "Global: Received a System Notify, Value 0x%2.2X\n", Value);
364 (void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL);
368 /******************************************************************************
370 * FUNCTION: AeDeviceNotifyHandler
372 * PARAMETERS: Standard notify handler parameters
376 * DESCRIPTION: Device notify handler for AcpiExec utility. Used by the ASL
377 * test suite(s) to communicate errors and other information to
378 * this utility via the Notify() operator.
380 *****************************************************************************/
383 AeDeviceNotifyHandler (
390 "Global: Received a Device Notify on [%4.4s] %p Value 0x%2.2X (%s)\n",
391 AcpiUtGetNodeName (Device), Device, Value,
392 AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY));
393 if (AcpiGbl_DebugFile)
395 AcpiOsPrintf (AE_PREFIX
396 "Global: Received a Device Notify, Value 0x%2.2X\n", Value);
399 (void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL);
403 /******************************************************************************
405 * FUNCTION: AeTableHandler
407 * PARAMETERS: Table handler
411 * DESCRIPTION: System table handler for AcpiExec utility.
413 *****************************************************************************/
421 #if (!ACPI_REDUCED_HARDWARE)
423 #endif /* !ACPI_REDUCED_HARDWARE */
426 if (Event > ACPI_NUM_TABLE_EVENTS)
428 Event = ACPI_NUM_TABLE_EVENTS;
431 #if (!ACPI_REDUCED_HARDWARE)
432 /* Enable any GPEs associated with newly-loaded GPE methods */
434 Status = AcpiUpdateAllGpes ();
435 ACPI_CHECK_OK (AcpiUpdateAllGpes, Status);
437 printf (AE_PREFIX "Table Event %s, [%4.4s] %p\n",
439 ((ACPI_TABLE_HEADER *) Table)->Signature, Table);
440 #endif /* !ACPI_REDUCED_HARDWARE */
446 /******************************************************************************
448 * FUNCTION: AeGpeHandler
450 * DESCRIPTION: Common GPE handler for acpiexec
452 *****************************************************************************/
456 ACPI_HANDLE GpeDevice,
460 ACPI_NAMESPACE_NODE *DeviceNode = (ACPI_NAMESPACE_NODE *) GpeDevice;
463 AcpiOsPrintf (AE_PREFIX
464 "GPE Handler received GPE %02X (GPE block %4.4s)\n",
465 GpeNumber, GpeDevice ? DeviceNode->Name.Ascii : "FADT");
467 return (ACPI_REENABLE_GPE);
471 /******************************************************************************
473 * FUNCTION: AeGlobalEventHandler
475 * DESCRIPTION: Global GPE/Fixed event handler
477 *****************************************************************************/
480 AeGlobalEventHandler (
491 case ACPI_EVENT_TYPE_GPE:
496 case ACPI_EVENT_TYPE_FIXED:
498 TypeName = "FixedEvent";
503 TypeName = "UNKNOWN";
507 AcpiOsPrintf (AE_PREFIX
508 "Global Event Handler received: Type %s Number %.2X Dev %p\n",
509 TypeName, EventNumber, Device);
513 /******************************************************************************
515 * FUNCTION: AeAttachedDataHandler
517 * DESCRIPTION: Handler for deletion of nodes with attached data (attached via
520 *****************************************************************************/
523 AeAttachedDataHandler (
527 ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data);
529 ACPI_FUNCTION_NAME (AeAttachedDataHandler1);
532 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
533 "Received an attached data deletion at handler 1 on %4.4s\n",
538 /******************************************************************************
540 * FUNCTION: AeAttachedDataHandler2
542 * DESCRIPTION: Handler for deletion of nodes with attached data (attached via
545 *****************************************************************************/
548 AeAttachedDataHandler2 (
552 ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data);
554 ACPI_FUNCTION_NAME (AeAttachedDataHandler2);
557 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
558 "Received an attached data deletion at handler 2 on %4.4s\n",
563 /******************************************************************************
565 * FUNCTION: AeInterfaceHandler
567 * DESCRIPTION: Handler for _OSI invocations
569 *****************************************************************************/
573 ACPI_STRING InterfaceName,
576 ACPI_FUNCTION_NAME (AeInterfaceHandler);
579 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
580 "Received _OSI (\"%s\"), is %ssupported\n",
581 InterfaceName, Supported == 0 ? "not " : ""));
587 #if (!ACPI_REDUCED_HARDWARE)
588 /******************************************************************************
590 * FUNCTION: AeEventHandler, AeSciHandler
592 * DESCRIPTION: Handler for Fixed Events and SCIs
594 *****************************************************************************/
608 AcpiOsPrintf (AE_PREFIX
609 "Received an SCI at handler\n");
613 #endif /* !ACPI_REDUCED_HARDWARE */
616 /*******************************************************************************
618 * FUNCTION: AeInstallSciHandler
624 * DESCRIPTION: Install handler for SCIs. Exercise the code by doing an
625 * install/remove/install.
627 ******************************************************************************/
630 AeInstallSciHandler (
636 Status = AcpiInstallSciHandler (AeSciHandler, &AeMyContext);
637 if (ACPI_FAILURE (Status))
639 ACPI_EXCEPTION ((AE_INFO, Status,
640 "Could not install an SCI handler (1)"));
643 Status = AcpiRemoveSciHandler (AeSciHandler);
644 if (ACPI_FAILURE (Status))
646 ACPI_EXCEPTION ((AE_INFO, Status,
647 "Could not remove an SCI handler"));
650 Status = AcpiInstallSciHandler (AeSciHandler, &AeMyContext);
651 if (ACPI_FAILURE (Status))
653 ACPI_EXCEPTION ((AE_INFO, Status,
654 "Could not install an SCI handler (2)"));
661 /******************************************************************************
663 * FUNCTION: AeInstallLateHandlers
669 * DESCRIPTION: Install handlers for the AcpiExec utility.
671 *****************************************************************************/
674 AeInstallLateHandlers (
681 Status = AcpiGetHandle (NULL, "\\_TZ.TZ1", &Handle);
682 if (ACPI_SUCCESS (Status))
684 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
685 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
686 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
688 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
689 AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
690 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
692 Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
694 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
696 Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
698 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
700 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
701 AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
702 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
704 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
705 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
706 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
709 Status = AcpiGetHandle (NULL, "\\_PR.CPU0", &Handle);
710 if (ACPI_SUCCESS (Status))
712 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
713 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
714 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
716 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
717 AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
718 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
721 #if (!ACPI_REDUCED_HARDWARE)
722 if (!AcpiGbl_ReducedHardware)
724 /* Install a user SCI handler */
726 Status = AeInstallSciHandler ();
727 ACPI_CHECK_OK (AeInstallSciHandler, Status);
729 /* Install some fixed event handlers */
731 Status = AcpiInstallFixedEventHandler (
732 ACPI_EVENT_GLOBAL, AeEventHandler, NULL);
733 ACPI_CHECK_OK (AcpiInstallFixedEventHandler, Status);
735 Status = AcpiInstallFixedEventHandler (
736 ACPI_EVENT_RTC, AeEventHandler, NULL);
737 ACPI_CHECK_OK (AcpiInstallFixedEventHandler, Status);
739 #endif /* !ACPI_REDUCED_HARDWARE */
741 AeMyContext.Connection = NULL;
742 AeMyContext.AccessLength = 0xA5;
745 * We will install a handler for each EC device, directly under the EC
746 * device definition. This is unlike the other handlers which we install
747 * at the root node. Also install memory and I/O handlers at any PCI
750 AeInstallDeviceHandlers ();
753 * Install handlers for some of the "device driver" address spaces
754 * such as SMBus, etc.
756 AeInstallRegionHandlers ();
761 /******************************************************************************
763 * FUNCTION: AeInstallEarlyHandlers
769 * DESCRIPTION: Install handlers for the AcpiExec utility.
771 * Notes: Don't install handler for PCI_Config, we want to use the
772 * default handler to exercise that code.
774 *****************************************************************************/
777 AeInstallEarlyHandlers (
784 ACPI_FUNCTION_ENTRY ();
787 Status = AcpiInstallInterfaceHandler (AeInterfaceHandler);
788 if (ACPI_FAILURE (Status))
790 printf ("Could not install interface handler, %s\n",
791 AcpiFormatException (Status));
794 Status = AcpiInstallTableHandler (AeTableHandler, NULL);
795 if (ACPI_FAILURE (Status))
797 printf ("Could not install table handler, %s\n",
798 AcpiFormatException (Status));
801 Status = AcpiInstallExceptionHandler (AeExceptionHandler);
802 if (ACPI_FAILURE (Status))
804 printf ("Could not install exception handler, %s\n",
805 AcpiFormatException (Status));
808 /* Install global notify handlers */
810 Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT,
811 ACPI_SYSTEM_NOTIFY, AeSystemNotifyHandler, NULL);
812 if (ACPI_FAILURE (Status))
814 printf ("Could not install a global system notify handler, %s\n",
815 AcpiFormatException (Status));
818 Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT,
819 ACPI_DEVICE_NOTIFY, AeDeviceNotifyHandler, NULL);
820 if (ACPI_FAILURE (Status))
822 printf ("Could not install a global notify handler, %s\n",
823 AcpiFormatException (Status));
826 Status = AcpiGetHandle (NULL, "\\_SB", &Handle);
827 if (ACPI_SUCCESS (Status))
829 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
830 AeNotifyHandler1, NULL);
831 if (ACPI_FAILURE (Status))
833 printf ("Could not install a notify handler, %s\n",
834 AcpiFormatException (Status));
837 Status = AcpiRemoveNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
839 if (ACPI_FAILURE (Status))
841 printf ("Could not remove a notify handler, %s\n",
842 AcpiFormatException (Status));
845 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
846 AeNotifyHandler1, NULL);
847 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
849 Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
851 ACPI_CHECK_OK (AcpiRemoveNotifyHandler, Status);
854 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
855 AeNotifyHandler1, NULL);
856 if (ACPI_FAILURE (Status))
858 printf ("Could not install a notify handler, %s\n",
859 AcpiFormatException (Status));
863 /* Install two handlers for _SB_ */
865 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
866 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
867 ACPI_CHECK_OK(AcpiInstallNotifyHandler, Status);
869 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
870 AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
871 ACPI_CHECK_OK(AcpiInstallNotifyHandler, Status);
873 /* Attempt duplicate handler installation, should fail */
875 (void) AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
876 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x77777777));
878 Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
879 ACPI_CHECK_OK (AcpiAttachData, Status);
881 Status = AcpiDetachData (Handle, AeAttachedDataHandler);
882 ACPI_CHECK_OK (AcpiDetachData, Status);
884 /* Test attach data at the root object */
886 Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler,
888 ACPI_CHECK_OK (AcpiAttachData, Status);
890 Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler2,
892 ACPI_CHECK_OK (AcpiAttachData, Status);
894 /* Test support for multiple attaches */
896 Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
897 ACPI_CHECK_OK (AcpiAttachData, Status);
899 Status = AcpiAttachData (Handle, AeAttachedDataHandler2, Handle);
900 ACPI_CHECK_OK (AcpiAttachData, Status);
904 printf ("No _SB_ found, %s\n", AcpiFormatException (Status));
908 * Install handlers that will override the default handlers for some of
911 AeOverrideRegionHandlers ();
914 * Initialize the global Region Handler space
917 AeRegions.NumberOfRegions = 0;
918 AeRegions.RegionList = NULL;