aehandlers.c revision 1.1.1.11 1 /******************************************************************************
2 *
3 * Module Name: aehandlers - Various handlers for acpiexec
4 *
5 *****************************************************************************/
6
7 /*
8 * Copyright (C) 2000 - 2017, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44 #include "aecommon.h"
45
46 #define _COMPONENT ACPI_TOOLS
47 ACPI_MODULE_NAME ("aehandlers")
48
49
50 /* Local prototypes */
51
52 static void
53 AeNotifyHandler1 (
54 ACPI_HANDLE Device,
55 UINT32 Value,
56 void *Context);
57
58 static void
59 AeNotifyHandler2 (
60 ACPI_HANDLE Device,
61 UINT32 Value,
62 void *Context);
63
64 static void
65 AeCommonNotifyHandler (
66 ACPI_HANDLE Device,
67 UINT32 Value,
68 UINT32 HandlerId);
69
70 static void
71 AeDeviceNotifyHandler (
72 ACPI_HANDLE Device,
73 UINT32 Value,
74 void *Context);
75
76 static ACPI_STATUS
77 AeTableHandler (
78 UINT32 Event,
79 void *Table,
80 void *Context);
81
82 static void
83 AeAttachedDataHandler (
84 ACPI_HANDLE Object,
85 void *Data);
86
87 static void
88 AeAttachedDataHandler2 (
89 ACPI_HANDLE Object,
90 void *Data);
91
92 static UINT32
93 AeInterfaceHandler (
94 ACPI_STRING InterfaceName,
95 UINT32 Supported);
96
97 #if (!ACPI_REDUCED_HARDWARE)
98 static UINT32
99 AeEventHandler (
100 void *Context);
101
102 static UINT32
103 AeSciHandler (
104 void *Context);
105
106 static char *TableEvents[] =
107 {
108 "LOAD",
109 "UNLOAD",
110 "INSTALL",
111 "UNINSTALL",
112 "UNKNOWN"
113 };
114 #endif /* !ACPI_REDUCED_HARDWARE */
115
116
117 static AE_DEBUG_REGIONS AeRegions;
118
119
120 /******************************************************************************
121 *
122 * FUNCTION: AeNotifyHandler(s)
123 *
124 * PARAMETERS: Standard notify handler parameters
125 *
126 * RETURN: Status
127 *
128 * DESCRIPTION: Notify handlers for AcpiExec utility. Used by the ASL
129 * test suite(s) to communicate errors and other information to
130 * this utility via the Notify() operator. Tests notify handling
131 * and multiple notify handler support.
132 *
133 *****************************************************************************/
134
135 static void
136 AeNotifyHandler1 (
137 ACPI_HANDLE Device,
138 UINT32 Value,
139 void *Context)
140 {
141 AeCommonNotifyHandler (Device, Value, 1);
142 }
143
144 static void
145 AeNotifyHandler2 (
146 ACPI_HANDLE Device,
147 UINT32 Value,
148 void *Context)
149 {
150 AeCommonNotifyHandler (Device, Value, 2);
151 }
152
153 static void
154 AeCommonNotifyHandler (
155 ACPI_HANDLE Device,
156 UINT32 Value,
157 UINT32 HandlerId)
158 {
159 char *Type;
160
161
162 Type = "Device";
163 if (Value <= ACPI_MAX_SYS_NOTIFY)
164 {
165 Type = "System";
166 }
167
168 switch (Value)
169 {
170 #if 0
171 case 0:
172
173 printf (AE_PREFIX
174 "Method Error 0x%X: Results not equal\n", Value);
175 if (AcpiGbl_DebugFile)
176 {
177 AcpiOsPrintf (AE_PREFIX
178 "Method Error: Results not equal\n");
179 }
180 break;
181
182 case 1:
183
184 printf (AE_PREFIX
185 "Method Error: Incorrect numeric result\n");
186 if (AcpiGbl_DebugFile)
187 {
188 AcpiOsPrintf (AE_PREFIX
189 "Method Error: Incorrect numeric result\n");
190 }
191 break;
192
193 case 2:
194
195 printf (AE_PREFIX
196 "Method Error: An operand was overwritten\n");
197 if (AcpiGbl_DebugFile)
198 {
199 AcpiOsPrintf (AE_PREFIX
200 "Method Error: An operand was overwritten\n");
201 }
202 break;
203
204 #endif
205
206 default:
207
208 printf (AE_PREFIX
209 "Handler %u: Received a %s Notify on [%4.4s] %p Value 0x%2.2X (%s)\n",
210 HandlerId, Type, AcpiUtGetNodeName (Device), Device, Value,
211 AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY));
212 if (AcpiGbl_DebugFile)
213 {
214 AcpiOsPrintf (AE_PREFIX
215 "Handler %u: Received a %s notify, Value 0x%2.2X\n",
216 HandlerId, Type, Value);
217 }
218
219 (void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL);
220 break;
221 }
222 }
223
224
225 /******************************************************************************
226 *
227 * FUNCTION: AeSystemNotifyHandler
228 *
229 * PARAMETERS: Standard notify handler parameters
230 *
231 * RETURN: Status
232 *
233 * DESCRIPTION: System notify handler for AcpiExec utility. Used by the ASL
234 * test suite(s) to communicate errors and other information to
235 * this utility via the Notify() operator.
236 *
237 *****************************************************************************/
238
239 static void
240 AeSystemNotifyHandler (
241 ACPI_HANDLE Device,
242 UINT32 Value,
243 void *Context)
244 {
245
246 printf (AE_PREFIX
247 "Global: Received a System Notify on [%4.4s] %p Value 0x%2.2X (%s)\n",
248 AcpiUtGetNodeName (Device), Device, Value,
249 AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY));
250 if (AcpiGbl_DebugFile)
251 {
252 AcpiOsPrintf (AE_PREFIX
253 "Global: Received a System Notify, Value 0x%2.2X\n", Value);
254 }
255
256 (void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL);
257 }
258
259
260 /******************************************************************************
261 *
262 * FUNCTION: AeDeviceNotifyHandler
263 *
264 * PARAMETERS: Standard notify handler parameters
265 *
266 * RETURN: Status
267 *
268 * DESCRIPTION: Device notify handler for AcpiExec utility. Used by the ASL
269 * test suite(s) to communicate errors and other information to
270 * this utility via the Notify() operator.
271 *
272 *****************************************************************************/
273
274 static void
275 AeDeviceNotifyHandler (
276 ACPI_HANDLE Device,
277 UINT32 Value,
278 void *Context)
279 {
280
281 printf (AE_PREFIX
282 "Global: Received a Device Notify on [%4.4s] %p Value 0x%2.2X (%s)\n",
283 AcpiUtGetNodeName (Device), Device, Value,
284 AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY));
285 if (AcpiGbl_DebugFile)
286 {
287 AcpiOsPrintf (AE_PREFIX
288 "Global: Received a Device Notify, Value 0x%2.2X\n", Value);
289 }
290
291 (void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL);
292 }
293
294
295 /******************************************************************************
296 *
297 * FUNCTION: AeTableHandler
298 *
299 * PARAMETERS: Table handler
300 *
301 * RETURN: Status
302 *
303 * DESCRIPTION: System table handler for AcpiExec utility.
304 *
305 *****************************************************************************/
306
307 static ACPI_STATUS
308 AeTableHandler (
309 UINT32 Event,
310 void *Table,
311 void *Context)
312 {
313 #if (!ACPI_REDUCED_HARDWARE)
314 ACPI_STATUS Status;
315 #endif /* !ACPI_REDUCED_HARDWARE */
316
317
318 if (Event > ACPI_NUM_TABLE_EVENTS)
319 {
320 Event = ACPI_NUM_TABLE_EVENTS;
321 }
322
323 #if (!ACPI_REDUCED_HARDWARE)
324 /* Enable any GPEs associated with newly-loaded GPE methods */
325
326 Status = AcpiUpdateAllGpes ();
327 ACPI_CHECK_OK (AcpiUpdateAllGpes, Status);
328
329 printf (AE_PREFIX "Table Event %s, [%4.4s] %p\n",
330 TableEvents[Event],
331 ((ACPI_TABLE_HEADER *) Table)->Signature, Table);
332 #endif /* !ACPI_REDUCED_HARDWARE */
333
334 return (AE_OK);
335 }
336
337
338 /******************************************************************************
339 *
340 * FUNCTION: AeGpeHandler
341 *
342 * DESCRIPTION: Common GPE handler for acpiexec
343 *
344 *****************************************************************************/
345
346 UINT32
347 AeGpeHandler (
348 ACPI_HANDLE GpeDevice,
349 UINT32 GpeNumber,
350 void *Context)
351 {
352 ACPI_NAMESPACE_NODE *DeviceNode = (ACPI_NAMESPACE_NODE *) GpeDevice;
353
354
355 AcpiOsPrintf (AE_PREFIX
356 "GPE Handler received GPE %02X (GPE block %4.4s)\n",
357 GpeNumber, GpeDevice ? DeviceNode->Name.Ascii : "FADT");
358
359 return (ACPI_REENABLE_GPE);
360 }
361
362
363 /******************************************************************************
364 *
365 * FUNCTION: AeGlobalEventHandler
366 *
367 * DESCRIPTION: Global GPE/Fixed event handler
368 *
369 *****************************************************************************/
370
371 void
372 AeGlobalEventHandler (
373 UINT32 Type,
374 ACPI_HANDLE Device,
375 UINT32 EventNumber,
376 void *Context)
377 {
378 char *TypeName;
379
380
381 switch (Type)
382 {
383 case ACPI_EVENT_TYPE_GPE:
384
385 TypeName = "GPE";
386 break;
387
388 case ACPI_EVENT_TYPE_FIXED:
389
390 TypeName = "FixedEvent";
391 break;
392
393 default:
394
395 TypeName = "UNKNOWN";
396 break;
397 }
398
399 AcpiOsPrintf (AE_PREFIX
400 "Global Event Handler received: Type %s Number %.2X Dev %p\n",
401 TypeName, EventNumber, Device);
402 }
403
404
405 /******************************************************************************
406 *
407 * FUNCTION: AeAttachedDataHandler
408 *
409 * DESCRIPTION: Handler for deletion of nodes with attached data (attached via
410 * AcpiAttachData)
411 *
412 *****************************************************************************/
413
414 static void
415 AeAttachedDataHandler (
416 ACPI_HANDLE Object,
417 void *Data)
418 {
419 ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data);
420
421
422 AcpiOsPrintf (AE_PREFIX
423 "Received an attached data deletion (1) on %4.4s\n",
424 Node->Name.Ascii);
425 }
426
427
428 /******************************************************************************
429 *
430 * FUNCTION: AeAttachedDataHandler2
431 *
432 * DESCRIPTION: Handler for deletion of nodes with attached data (attached via
433 * AcpiAttachData)
434 *
435 *****************************************************************************/
436
437 static void
438 AeAttachedDataHandler2 (
439 ACPI_HANDLE Object,
440 void *Data)
441 {
442 ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data);
443
444
445 AcpiOsPrintf (AE_PREFIX
446 "Received an attached data deletion (2) on %4.4s\n",
447 Node->Name.Ascii);
448 }
449
450
451 /******************************************************************************
452 *
453 * FUNCTION: AeInterfaceHandler
454 *
455 * DESCRIPTION: Handler for _OSI invocations
456 *
457 *****************************************************************************/
458
459 static UINT32
460 AeInterfaceHandler (
461 ACPI_STRING InterfaceName,
462 UINT32 Supported)
463 {
464 ACPI_FUNCTION_NAME (AeInterfaceHandler);
465
466
467 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
468 "Received _OSI (\"%s\"), is %ssupported\n",
469 InterfaceName, Supported == 0 ? "not " : ""));
470
471 return (Supported);
472 }
473
474
475 #if (!ACPI_REDUCED_HARDWARE)
476 /******************************************************************************
477 *
478 * FUNCTION: AeEventHandler, AeSciHandler
479 *
480 * DESCRIPTION: Handler for Fixed Events and SCIs
481 *
482 *****************************************************************************/
483
484 static UINT32
485 AeEventHandler (
486 void *Context)
487 {
488 return (0);
489 }
490
491 static UINT32
492 AeSciHandler (
493 void *Context)
494 {
495
496 AcpiOsPrintf (AE_PREFIX
497 "Received an SCI at handler\n");
498 return (0);
499 }
500
501 #endif /* !ACPI_REDUCED_HARDWARE */
502
503
504 /*******************************************************************************
505 *
506 * FUNCTION: AeInstallSciHandler
507 *
508 * PARAMETERS: None
509 *
510 * RETURN: Status
511 *
512 * DESCRIPTION: Install handler for SCIs. Exercise the code by doing an
513 * install/remove/install.
514 *
515 ******************************************************************************/
516
517 static ACPI_STATUS
518 AeInstallSciHandler (
519 void)
520 {
521 ACPI_STATUS Status;
522
523
524 Status = AcpiInstallSciHandler (AeSciHandler, &AeMyContext);
525 if (ACPI_FAILURE (Status))
526 {
527 ACPI_EXCEPTION ((AE_INFO, Status,
528 "Could not install an SCI handler (1)"));
529 }
530
531 Status = AcpiRemoveSciHandler (AeSciHandler);
532 if (ACPI_FAILURE (Status))
533 {
534 ACPI_EXCEPTION ((AE_INFO, Status,
535 "Could not remove an SCI handler"));
536 }
537
538 Status = AcpiInstallSciHandler (AeSciHandler, &AeMyContext);
539 if (ACPI_FAILURE (Status))
540 {
541 ACPI_EXCEPTION ((AE_INFO, Status,
542 "Could not install an SCI handler (2)"));
543 }
544
545 return (Status);
546 }
547
548
549 /******************************************************************************
550 *
551 * FUNCTION: AeInstallLateHandlers
552 *
553 * PARAMETERS: None
554 *
555 * RETURN: Status
556 *
557 * DESCRIPTION: Install handlers for the AcpiExec utility.
558 *
559 *****************************************************************************/
560
561 ACPI_STATUS
562 AeInstallLateHandlers (
563 void)
564 {
565 ACPI_STATUS Status;
566 ACPI_HANDLE Handle;
567
568
569 Status = AcpiGetHandle (NULL, "\\_TZ.TZ1", &Handle);
570 if (ACPI_SUCCESS (Status))
571 {
572 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
573 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
574
575 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
576 AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
577
578 Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
579 AeNotifyHandler1);
580 Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
581 AeNotifyHandler2);
582
583 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
584 AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
585
586 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
587 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
588 }
589
590 Status = AcpiGetHandle (NULL, "\\_PR.CPU0", &Handle);
591 if (ACPI_SUCCESS (Status))
592 {
593 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
594 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
595
596 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
597 AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
598 }
599
600 #if (!ACPI_REDUCED_HARDWARE)
601 if (!AcpiGbl_ReducedHardware)
602 {
603 /* Install a user SCI handler */
604
605 Status = AeInstallSciHandler ();
606 ACPI_CHECK_OK (AeInstallSciHandler, Status);
607
608 /* Install some fixed event handlers */
609
610 Status = AcpiInstallFixedEventHandler (
611 ACPI_EVENT_GLOBAL, AeEventHandler, NULL);
612 ACPI_CHECK_OK (AcpiInstallFixedEventHandler, Status);
613
614 Status = AcpiInstallFixedEventHandler (
615 ACPI_EVENT_RTC, AeEventHandler, NULL);
616 ACPI_CHECK_OK (AcpiInstallFixedEventHandler, Status);
617 }
618 #endif /* !ACPI_REDUCED_HARDWARE */
619
620 AeMyContext.Connection = NULL;
621 AeMyContext.AccessLength = 0xA5;
622
623 /*
624 * We will install a handler for each EC device, directly under the EC
625 * device definition. This is unlike the other handlers which we install
626 * at the root node. Also install memory and I/O handlers at any PCI
627 * devices.
628 */
629 AeInstallDeviceHandlers ();
630
631 /*
632 * Install handlers for some of the "device driver" address spaces
633 * such as SMBus, etc.
634 */
635 AeInstallRegionHandlers ();
636 return (AE_OK);
637 }
638
639
640 /******************************************************************************
641 *
642 * FUNCTION: AeInstallEarlyHandlers
643 *
644 * PARAMETERS: None
645 *
646 * RETURN: Status
647 *
648 * DESCRIPTION: Install handlers for the AcpiExec utility.
649 *
650 * Notes: Don't install handler for PCI_Config, we want to use the
651 * default handler to exercise that code.
652 *
653 *****************************************************************************/
654
655 ACPI_STATUS
656 AeInstallEarlyHandlers (
657 void)
658 {
659 ACPI_STATUS Status;
660 ACPI_HANDLE Handle;
661
662
663 ACPI_FUNCTION_ENTRY ();
664
665
666 Status = AcpiInstallInterfaceHandler (AeInterfaceHandler);
667 if (ACPI_FAILURE (Status))
668 {
669 printf ("Could not install interface handler, %s\n",
670 AcpiFormatException (Status));
671 }
672
673 Status = AcpiInstallTableHandler (AeTableHandler, NULL);
674 if (ACPI_FAILURE (Status))
675 {
676 printf ("Could not install table handler, %s\n",
677 AcpiFormatException (Status));
678 }
679
680 Status = AcpiInstallExceptionHandler (AeExceptionHandler);
681 if (ACPI_FAILURE (Status))
682 {
683 printf ("Could not install exception handler, %s\n",
684 AcpiFormatException (Status));
685 }
686
687 /* Install global notify handlers */
688
689 Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT,
690 ACPI_SYSTEM_NOTIFY, AeSystemNotifyHandler, NULL);
691 if (ACPI_FAILURE (Status))
692 {
693 printf ("Could not install a global system notify handler, %s\n",
694 AcpiFormatException (Status));
695 }
696
697 Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT,
698 ACPI_DEVICE_NOTIFY, AeDeviceNotifyHandler, NULL);
699 if (ACPI_FAILURE (Status))
700 {
701 printf ("Could not install a global notify handler, %s\n",
702 AcpiFormatException (Status));
703 }
704
705 Status = AcpiGetHandle (NULL, "\\_SB", &Handle);
706 if (ACPI_SUCCESS (Status))
707 {
708 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
709 AeNotifyHandler1, NULL);
710 if (ACPI_FAILURE (Status))
711 {
712 printf ("Could not install a notify handler, %s\n",
713 AcpiFormatException (Status));
714 }
715
716 Status = AcpiRemoveNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
717 AeNotifyHandler1);
718 if (ACPI_FAILURE (Status))
719 {
720 printf ("Could not remove a notify handler, %s\n",
721 AcpiFormatException (Status));
722 }
723
724 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
725 AeNotifyHandler1, NULL);
726 ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
727
728 Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
729 AeNotifyHandler1);
730 ACPI_CHECK_OK (AcpiRemoveNotifyHandler, Status);
731
732 #if 0
733 Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
734 AeNotifyHandler1, NULL);
735 if (ACPI_FAILURE (Status))
736 {
737 printf ("Could not install a notify handler, %s\n",
738 AcpiFormatException (Status));
739 }
740 #endif
741
742 /* Install two handlers for _SB_ */
743
744 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
745 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
746
747 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
748 AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
749
750 /* Attempt duplicate handler installation, should fail */
751
752 Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
753 AeNotifyHandler1, ACPI_CAST_PTR (void, 0x77777777));
754
755 Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
756 ACPI_CHECK_OK (AcpiAttachData, Status);
757
758 Status = AcpiDetachData (Handle, AeAttachedDataHandler);
759 ACPI_CHECK_OK (AcpiDetachData, Status);
760
761 /* Test attach data at the root object */
762
763 Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler,
764 AcpiGbl_RootNode);
765 ACPI_CHECK_OK (AcpiAttachData, Status);
766
767 Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler2,
768 AcpiGbl_RootNode);
769 ACPI_CHECK_OK (AcpiAttachData, Status);
770
771 /* Test support for multiple attaches */
772
773 Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
774 ACPI_CHECK_OK (AcpiAttachData, Status);
775
776 Status = AcpiAttachData (Handle, AeAttachedDataHandler2, Handle);
777 ACPI_CHECK_OK (AcpiAttachData, Status);
778 }
779 else
780 {
781 printf ("No _SB_ found, %s\n", AcpiFormatException (Status));
782 }
783
784 /*
785 * Install handlers that will override the default handlers for some of
786 * the space IDs.
787 */
788 AeOverrideRegionHandlers ();
789
790 /*
791 * Initialize the global Region Handler space
792 * MCW 3/23/00
793 */
794 AeRegions.NumberOfRegions = 0;
795 AeRegions.RegionList = NULL;
796 return (AE_OK);
797 }
798