1 /******************************************************************************
2  *
3  * Module Name: aetests - Miscellaneous tests for ACPICA public interfaces
4  *
5  *****************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp.
12  * All rights reserved.
13  *
14  * 2. License
15  *
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
19  * property rights.
20  *
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
27  *
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;
36  *
37  * The above copyright and patent license is granted only if the following
38  * conditions are met:
39  *
40  * 3. Conditions
41  *
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.
53  *
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
64  * make.
65  *
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
70  * distribution.
71  *
72  * 3.4. Intel retains all right, title, and interest in and to the Original
73  * Intel Code.
74  *
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.
79  *
80  * 4. Disclaimer and Export Compliance
81  *
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
88  * PARTICULAR PURPOSE.
89  *
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
97  * LIMITED REMEDY.
98  *
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.
113  *
114  *****************************************************************************
115  *
116  * Alternatively, you may choose to be licensed under the terms of the
117  * following license:
118  *
119  * Redistribution and use in source and binary forms, with or without
120  * modification, are permitted provided that the following conditions
121  * are met:
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.
133  *
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.
145  *
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.
149  *
150  *****************************************************************************/
151 
152 #include "aecommon.h"
153 
154 #define _COMPONENT          ACPI_TOOLS
155         ACPI_MODULE_NAME    ("aetests")
156 
157 /* Local prototypes */
158 
159 static void
160 AeMutexInterfaces (
161     void);
162 
163 static void
164 AeHardwareInterfaces (
165     void);
166 
167 static void
168 AeTestSleepData (
169     void);
170 
171 
172 /******************************************************************************
173  *
174  * FUNCTION:    AeMiscellaneousTests
175  *
176  * DESCRIPTION: Various ACPICA validation tests.
177  *
178  *****************************************************************************/
179 
180 void
181 AeMiscellaneousTests (
182     void)
183 {
184     ACPI_BUFFER             ReturnBuf;
185     char                    Buffer[32];
186     ACPI_STATUS             Status;
187     ACPI_STATISTICS         Stats;
188     ACPI_HANDLE             Handle;
189 
190 #if (!ACPI_REDUCED_HARDWARE)
191     UINT32                  Temp;
192     UINT32                  LockHandle1;
193     UINT32                  LockHandle2;
194     ACPI_VENDOR_UUID        Uuid = {0, {ACPI_INIT_UUID (0,0,0,0,0,0,0,0,0,0,0)}};
195 #endif /* !ACPI_REDUCED_HARDWARE */
196 
197 
198     Status = AcpiGetHandle (NULL, "\\", &Handle);
199     ACPI_CHECK_OK (AcpiGetHandle, Status);
200 
201     if (AcpiGbl_DoInterfaceTests)
202     {
203         /*
204          * Tests for AcpiLoadTable and AcpiUnloadParentTable
205          */
206 
207         /* Attempt unload of DSDT, should fail */
208 
209         Status = AcpiGetHandle (NULL, "\\_SB_", &Handle);
210         ACPI_CHECK_OK (AcpiGetHandle, Status);
211 
212         Status = AcpiUnloadParentTable (Handle);
213         ACPI_CHECK_STATUS (AcpiUnloadParentTable, Status, AE_TYPE);
214 
215         /* Load and unload SSDT4 */
216 
217         Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt4Code);
218         ACPI_CHECK_OK (AcpiLoadTable, Status);
219 
220         Status = AcpiGetHandle (NULL, "\\_T96", &Handle);
221         ACPI_CHECK_OK (AcpiGetHandle, Status);
222 
223         Status = AcpiUnloadParentTable (Handle);
224         ACPI_CHECK_OK (AcpiUnloadParentTable, Status);
225 
226         /* Re-load SSDT4 */
227 
228         Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt4Code);
229         ACPI_CHECK_OK (AcpiLoadTable, Status);
230 
231         /* Unload and re-load SSDT2 (SSDT2 is in the XSDT) */
232 
233         Status = AcpiGetHandle (NULL, "\\_T99", &Handle);
234         ACPI_CHECK_OK (AcpiGetHandle, Status);
235 
236         Status = AcpiUnloadParentTable (Handle);
237         ACPI_CHECK_OK (AcpiUnloadParentTable, Status);
238 
239         Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt2Code);
240         ACPI_CHECK_OK (AcpiLoadTable, Status);
241 
242         /* Load OEM9 table (causes table override) */
243 
244         Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt3Code);
245         ACPI_CHECK_OK (AcpiLoadTable, Status);
246     }
247 
248     AeHardwareInterfaces ();
249     AeGenericRegisters ();
250     AeSetupConfiguration (Ssdt3Code);
251 
252     AeTestBufferArgument();
253     AeTestPackageArgument ();
254     AeMutexInterfaces ();
255     AeTestSleepData ();
256 
257     /* Test _OSI install/remove */
258 
259     Status = AcpiInstallInterface ("");
260     ACPI_CHECK_STATUS (AcpiInstallInterface, Status, AE_BAD_PARAMETER);
261 
262     Status = AcpiInstallInterface ("TestString");
263     ACPI_CHECK_OK (AcpiInstallInterface, Status);
264 
265     Status = AcpiInstallInterface ("TestString");
266     ACPI_CHECK_STATUS (AcpiInstallInterface, Status, AE_ALREADY_EXISTS);
267 
268     Status = AcpiRemoveInterface ("Windows 2006");
269     ACPI_CHECK_OK (AcpiRemoveInterface, Status);
270 
271     Status = AcpiRemoveInterface ("TestString");
272     ACPI_CHECK_OK (AcpiRemoveInterface, Status);
273 
274     Status = AcpiRemoveInterface ("XXXXXX");
275     ACPI_CHECK_STATUS (AcpiRemoveInterface, Status, AE_NOT_EXIST);
276 
277     Status = AcpiInstallInterface ("AnotherTestString");
278     ACPI_CHECK_OK (AcpiInstallInterface, Status);
279 
280     /* Test _OSI execution */
281 
282     Status = ExecuteOSI ("Extended Address Space Descriptor", ACPI_UINT64_MAX);
283     ACPI_CHECK_OK (ExecuteOSI, Status);
284 
285     Status = ExecuteOSI ("Windows 2001", ACPI_UINT64_MAX);
286     ACPI_CHECK_OK (ExecuteOSI, Status);
287 
288     Status = ExecuteOSI ("MichiganTerminalSystem", 0);
289     ACPI_CHECK_OK (ExecuteOSI, Status);
290 
291 
292     ReturnBuf.Length = 32;
293     ReturnBuf.Pointer = Buffer;
294 
295     Status = AcpiGetName (ACPI_ROOT_OBJECT,
296         ACPI_FULL_PATHNAME_NO_TRAILING, &ReturnBuf);
297     ACPI_CHECK_OK (AcpiGetName, Status);
298 
299     /* Get Devices */
300 
301     Status = AcpiGetDevices (NULL, AeGetDevices, NULL, NULL);
302     ACPI_CHECK_OK (AcpiGetDevices, Status);
303 
304     Status = AcpiGetStatistics (&Stats);
305     ACPI_CHECK_OK (AcpiGetStatistics, Status);
306 
307 
308 #if (!ACPI_REDUCED_HARDWARE)
309 
310     Status = AcpiInstallGlobalEventHandler (AeGlobalEventHandler, NULL);
311     ACPI_CHECK_OK (AcpiInstallGlobalEventHandler, Status);
312 
313     /* If Hardware Reduced flag is set, we are all done */
314 
315     if (AcpiGbl_ReducedHardware)
316     {
317         return;
318     }
319 
320     Status = AcpiEnableEvent (ACPI_EVENT_GLOBAL, 0);
321     ACPI_CHECK_OK (AcpiEnableEvent, Status);
322 
323     /*
324      * GPEs: Handlers, enable/disable, etc.
325      */
326     Status = AcpiInstallGpeHandler (NULL, 0,
327         ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
328     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
329 
330     Status = AcpiEnableGpe (NULL, 0);
331     ACPI_CHECK_OK (AcpiEnableGpe, Status);
332 
333     Status = AcpiRemoveGpeHandler (NULL, 0, AeGpeHandler);
334     ACPI_CHECK_OK (AcpiRemoveGpeHandler, Status);
335 
336     Status = AcpiInstallGpeHandler (NULL, 0,
337         ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
338     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
339 
340     Status = AcpiEnableGpe (NULL, 0);
341     ACPI_CHECK_OK (AcpiEnableGpe, Status);
342 
343     Status = AcpiSetGpe (NULL, 0, ACPI_GPE_DISABLE);
344     ACPI_CHECK_OK (AcpiSetGpe, Status);
345 
346     Status = AcpiSetGpe (NULL, 0, ACPI_GPE_ENABLE);
347     ACPI_CHECK_OK (AcpiSetGpe, Status);
348 
349 
350     Status = AcpiInstallGpeHandler (NULL, 1,
351         ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
352     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
353 
354     Status = AcpiEnableGpe (NULL, 1);
355     ACPI_CHECK_OK (AcpiEnableGpe, Status);
356 
357 
358     Status = AcpiInstallGpeHandler (NULL, 2,
359         ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
360     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
361 
362     Status = AcpiEnableGpe (NULL, 2);
363     ACPI_CHECK_OK (AcpiEnableGpe, Status);
364 
365 
366     Status = AcpiInstallGpeHandler (NULL, 3,
367         ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
368     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
369 
370     Status = AcpiInstallGpeHandler (NULL, 4,
371         ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
372     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
373 
374     Status = AcpiInstallGpeHandler (NULL, 5,
375         ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
376     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
377 
378     Status = AcpiGetHandle (NULL, "\\_SB", &Handle);
379     ACPI_CHECK_OK (AcpiGetHandle, Status);
380 
381     Status = AcpiSetupGpeForWake (Handle, NULL, 5);
382     ACPI_CHECK_OK (AcpiSetupGpeForWake, Status);
383 
384     Status = AcpiSetGpeWakeMask (NULL, 5, ACPI_GPE_ENABLE);
385     ACPI_CHECK_OK (AcpiSetGpeWakeMask, Status);
386 
387     Status = AcpiSetupGpeForWake (Handle, NULL, 6);
388     ACPI_CHECK_OK (AcpiSetupGpeForWake, Status);
389 
390     Status = AcpiSetupGpeForWake (ACPI_ROOT_OBJECT, NULL, 6);
391     ACPI_CHECK_OK (AcpiSetupGpeForWake, Status);
392 
393     Status = AcpiSetupGpeForWake (Handle, NULL, 9);
394     ACPI_CHECK_OK (AcpiSetupGpeForWake, Status);
395 
396     Status = AcpiInstallGpeHandler (NULL, 0x19,
397         ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
398     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
399 
400     Status = AcpiEnableGpe (NULL, 0x19);
401     ACPI_CHECK_OK (AcpiEnableGpe, Status);
402 
403 
404     /* GPE block 1 */
405 
406     Status = AcpiInstallGpeHandler (NULL, 101,
407         ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
408     ACPI_CHECK_OK (AcpiInstallGpeHandler, Status);
409 
410     Status = AcpiEnableGpe (NULL, 101);
411     ACPI_CHECK_OK (AcpiEnableGpe, Status);
412 
413     Status = AcpiDisableGpe (NULL, 101);
414     ACPI_CHECK_OK (AcpiDisableGpe, Status);
415 
416     AfInstallGpeBlock ();
417 
418     /* Here is where the GPEs are actually "enabled" */
419 
420     Status = AcpiUpdateAllGpes ();
421     ACPI_CHECK_OK (AcpiUpdateAllGpes, Status);
422 
423     Status = AcpiGetHandle (NULL, "RSRC", &Handle);
424     if (ACPI_SUCCESS (Status))
425     {
426         ReturnBuf.Length = ACPI_ALLOCATE_BUFFER;
427 
428         Status = AcpiGetVendorResource (Handle, "_CRS", &Uuid, &ReturnBuf);
429         if (ACPI_SUCCESS (Status))
430         {
431             AcpiOsFree (ReturnBuf.Pointer);
432         }
433     }
434 
435     /* Test global lock */
436 
437     Status = AcpiAcquireGlobalLock (0xFFFF, &LockHandle1);
438     ACPI_CHECK_OK (AcpiAcquireGlobalLock, Status);
439 
440     Status = AcpiAcquireGlobalLock (0x5, &LockHandle2);
441     ACPI_CHECK_OK (AcpiAcquireGlobalLock, Status);
442 
443     Status = AcpiReleaseGlobalLock (LockHandle1);
444     ACPI_CHECK_OK (AcpiReleaseGlobalLock, Status);
445 
446     Status = AcpiReleaseGlobalLock (LockHandle2);
447     ACPI_CHECK_OK (AcpiReleaseGlobalLock, Status);
448 
449     /* Test timer interfaces */
450 
451     Status = AcpiGetTimerResolution (&Temp);
452     ACPI_CHECK_OK (AcpiGetTimerResolution, Status);
453 
454     Status = AcpiGetTimer (&Temp);
455     ACPI_CHECK_OK (AcpiGetTimer, Status);
456 
457     Status = AcpiGetTimerDuration (0x1000, 0x2000, &Temp);
458     ACPI_CHECK_OK (AcpiGetTimerDuration, Status);
459 
460 
461 #endif /* !ACPI_REDUCED_HARDWARE */
462 }
463 
464 
465 /******************************************************************************
466  *
467  * FUNCTION:    AeMutexInterfaces
468  *
469  * DESCRIPTION: Exercise the AML mutex access interfaces
470  *
471  *****************************************************************************/
472 
473 static void
474 AeMutexInterfaces (
475     void)
476 {
477     ACPI_STATUS             Status;
478     ACPI_HANDLE             MutexHandle;
479 
480 
481     /* Get a handle to an AML mutex */
482 
483     Status = AcpiGetHandle (NULL, "\\MTX1", &MutexHandle);
484     if (Status == AE_NOT_FOUND)
485     {
486         return;
487     }
488 
489     ACPI_CHECK_OK (AcpiGetHandle, Status);
490     if (ACPI_FAILURE (Status))
491     {
492         return;
493     }
494 
495     /* Acquire the  mutex */
496 
497     Status = AcpiAcquireMutex (NULL, "\\MTX1", 0xFFFF);
498     ACPI_CHECK_OK (AcpiAcquireMutex, Status);
499     if (ACPI_FAILURE (Status))
500     {
501         return;
502     }
503 
504     /* Release mutex with different parameters */
505 
506     Status = AcpiReleaseMutex (MutexHandle, NULL);
507     ACPI_CHECK_OK (AcpiReleaseMutex, Status);
508 }
509 
510 
511 /******************************************************************************
512  *
513  * FUNCTION:    AeHardwareInterfaces
514  *
515  * DESCRIPTION: Call various hardware support interfaces
516  *
517  *****************************************************************************/
518 
519 static void
520 AeHardwareInterfaces (
521     void)
522 {
523 #if (!ACPI_REDUCED_HARDWARE)
524 
525     ACPI_STATUS             Status;
526     UINT32                  Value;
527 
528 
529     /* If Hardware Reduced flag is set, we are all done */
530 
531     if (AcpiGbl_ReducedHardware)
532     {
533         return;
534     }
535 
536     Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, 1);
537     ACPI_CHECK_OK (AcpiWriteBitRegister, Status);
538 
539     Status = AcpiWriteBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, 1);
540     ACPI_CHECK_OK (AcpiWriteBitRegister, Status);
541 
542     Status = AcpiWriteBitRegister (ACPI_BITREG_SLEEP_ENABLE, 1);
543     ACPI_CHECK_OK (AcpiWriteBitRegister, Status);
544 
545     Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
546     ACPI_CHECK_OK (AcpiWriteBitRegister, Status);
547 
548 
549     Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &Value);
550     ACPI_CHECK_OK (AcpiReadBitRegister, Status);
551 
552     Status = AcpiReadBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, &Value);
553     ACPI_CHECK_OK (AcpiReadBitRegister, Status);
554 
555     Status = AcpiReadBitRegister (ACPI_BITREG_SLEEP_ENABLE, &Value);
556     ACPI_CHECK_OK (AcpiReadBitRegister, Status);
557 
558     Status = AcpiReadBitRegister (ACPI_BITREG_ARB_DISABLE, &Value);
559     ACPI_CHECK_OK (AcpiReadBitRegister, Status);
560 
561 #endif /* !ACPI_REDUCED_HARDWARE */
562 }
563 
564 
565 /******************************************************************************
566  *
567  * FUNCTION:    AeTestSleepData
568  *
569  * DESCRIPTION: Exercise the sleep/wake support (_S0, _S1, etc.)
570  *
571  *****************************************************************************/
572 
573 static void
574 AeTestSleepData (
575     void)
576 {
577     int                     State;
578     UINT8                   TypeA;
579     UINT8                   TypeB;
580     ACPI_STATUS             Status;
581 
582 
583     /* Attempt to get sleep data for all known sleep states */
584 
585     for (State = ACPI_STATE_S0; State <= ACPI_S_STATES_MAX; State++)
586     {
587         Status = AcpiGetSleepTypeData ((UINT8) State, &TypeA, &TypeB);
588 
589         /* All sleep methods are optional */
590 
591         if (Status != AE_NOT_FOUND)
592         {
593             ACPI_CHECK_OK (AcpiGetSleepTypeData, Status);
594         }
595     }
596 }
597