Subversion Repositories Kolibri OS

Rev

Rev 1498 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1498 Rev 2216
Line 6... Line 6...
6
 
6
 
7
/******************************************************************************
7
/******************************************************************************
8
 *
8
 *
9
 * 1. Copyright Notice
9
 * 1. Copyright Notice
10
 *
10
 *
11
 * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
11
 * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
12
 * All rights reserved.
12
 * All rights reserved.
13
 *
13
 *
14
 * 2. License
14
 * 2. License
15
 *
15
 *
Line 118... Line 118...
118
#define _COMPONENT          ACPI_TOOLS
118
#define _COMPONENT          ACPI_TOOLS
119
        ACPI_MODULE_NAME    ("aeexec")
119
        ACPI_MODULE_NAME    ("aeexec")
Line 120... Line 120...
120
 
120
 
Line 121... Line 121...
121
/* Local prototypes */
121
/* Local prototypes */
122
 
122
 
123
ACPI_STATUS
123
static ACPI_STATUS
Line 124... Line 124...
124
AeSetupConfiguration (
124
AeSetupConfiguration (
125
    void                    *RegionAddr);
125
    void                    *RegionAddr);
126
 
126
 
Line 127... Line 127...
127
void
127
static void
128
AfInstallGpeBlock (
128
AfInstallGpeBlock (
129
    void);
129
    void);
Line 130... Line 130...
130
 
130
 
131
void
131
static void
132
AeTestBufferArgument (
132
AeTestBufferArgument (
Line 133... Line 133...
133
    void);
133
    void);
134
 
134
 
135
void
135
static void
136
AeTestPackageArgument (
136
AeTestPackageArgument (
137
    void);
137
    void);
138
 
138
 
Line 139... Line 139...
139
ACPI_STATUS
139
static ACPI_STATUS
140
AeGetDevices (
140
AeGetDevices (
141
    ACPI_HANDLE             ObjHandle,
141
    ACPI_HANDLE             ObjHandle,
142
    UINT32                  NestingLevel,
142
    UINT32                  NestingLevel,
Line 143... Line 143...
143
    void                    *Context,
143
    void                    *Context,
144
    void                    **ReturnValue);
144
    void                    **ReturnValue);
145
 
145
 
Line 146... Line 146...
146
ACPI_STATUS
146
static ACPI_STATUS
147
ExecuteOSI (
147
ExecuteOSI (
148
    char                    *OsiString,
148
    char                    *OsiString,
Line 149... Line 149...
149
    UINT32                  ExpectedResult);
149
    UINT32                  ExpectedResult);
Line 170... Line 170...
170
 *
170
 *
171
 * DESCRIPTION: Call AML _CFG configuration control method
171
 * DESCRIPTION: Call AML _CFG configuration control method
172
 *
172
 *
173
 *****************************************************************************/
173
 *****************************************************************************/
Line 174... Line 174...
174
 
174
 
175
ACPI_STATUS
175
static ACPI_STATUS
176
AeSetupConfiguration (
176
AeSetupConfiguration (
177
    void                    *RegionAddr)
177
    void                    *RegionAddr)
178
{
-
 
179
    ACPI_STATUS             Status;
178
{
180
    ACPI_OBJECT_LIST        ArgList;
179
    ACPI_OBJECT_LIST        ArgList;
Line 181... Line 180...
181
    ACPI_OBJECT             Arg[3];
180
    ACPI_OBJECT             Arg[3];
Line 188... Line 187...
188
    ArgList.Pointer = Arg;
187
    ArgList.Pointer = Arg;
Line 189... Line 188...
189
 
188
 
190
    Arg[0].Type = ACPI_TYPE_INTEGER;
189
    Arg[0].Type = ACPI_TYPE_INTEGER;
Line 191... Line 190...
191
    Arg[0].Integer.Value = ACPI_TO_INTEGER (RegionAddr);
190
    Arg[0].Integer.Value = ACPI_TO_INTEGER (RegionAddr);
192
 
-
 
193
    Status = AcpiEvaluateObject (NULL, "\\_CFG", &ArgList, NULL);
191
 
194
 
192
    (void) AcpiEvaluateObject (NULL, "\\_CFG", &ArgList, NULL);
Line 195... Line 193...
195
    return (AE_OK);
193
    return (AE_OK);
Line 207... Line 205...
207
 * DESCRIPTION: Test GPE block device initialization. Requires test ASL with
205
 * DESCRIPTION: Test GPE block device initialization. Requires test ASL with
208
 *              A \GPE2 device.
206
 *              A \GPE2 device.
209
 *
207
 *
210
 *****************************************************************************/
208
 *****************************************************************************/
Line 211... Line 209...
211
 
209
 
212
void
210
static void
213
AfInstallGpeBlock (
211
AfInstallGpeBlock (
214
    void)
212
    void)
215
{
213
{
216
    ACPI_STATUS                 Status;
214
    ACPI_STATUS                 Status;
Line 233... Line 231...
233
 
231
 
234
    Status = AcpiGetHandle (NULL, "\\GPE2", &Handle2);
232
    Status = AcpiGetHandle (NULL, "\\GPE2", &Handle2);
235
    if (ACPI_SUCCESS (Status))
233
    if (ACPI_SUCCESS (Status))
236
    {
234
    {
-
 
235
        Status = AcpiInstallGpeBlock (Handle2, &BlockAddress, 7, 8);
-
 
236
        AE_CHECK_OK (AcpiInstallGpeBlock, Status);
-
 
237
 
-
 
238
        Status = AcpiInstallGpeHandler (Handle2, 8,
-
 
239
            ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
Line 237... Line 240...
237
        Status = AcpiInstallGpeBlock (Handle2, &BlockAddress, 7, 8);
240
        AE_CHECK_OK (AcpiInstallGpeHandler, Status);
238
 
241
 
Line 239... Line 242...
239
        AcpiInstallGpeHandler (Handle2, 8, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
242
        Status = AcpiEnableGpe (Handle2, 8);
-
 
243
        AE_CHECK_OK (AcpiEnableGpe, Status);
-
 
244
 
240
        AcpiEnableGpe (Handle2, 8, ACPI_GPE_TYPE_RUNTIME);
245
        Status = AcpiGetGpeDevice (0x30, &GpeDevice);
-
 
246
        AE_CHECK_OK (AcpiGetGpeDevice, Status);
-
 
247
 
241
 
248
        Status = AcpiGetGpeDevice (0x42, &GpeDevice);
-
 
249
        AE_CHECK_OK (AcpiGetGpeDevice, Status);
-
 
250
 
242
        Status = AcpiGetGpeDevice (0x30, &GpeDevice);
251
        Status = AcpiGetGpeDevice (AcpiCurrentGpeCount-1, &GpeDevice);
-
 
252
        AE_CHECK_OK (AcpiGetGpeDevice, Status);
Line 243... Line 253...
243
        Status = AcpiGetGpeDevice (0x42, &GpeDevice);
253
 
-
 
254
        Status = AcpiGetGpeDevice (AcpiCurrentGpeCount, &GpeDevice);
244
        Status = AcpiGetGpeDevice (AcpiCurrentGpeCount-1, &GpeDevice);
255
        AE_CHECK_STATUS (AcpiGetGpeDevice, Status, AE_NOT_EXIST);
Line 245... Line 256...
245
        Status = AcpiGetGpeDevice (AcpiCurrentGpeCount, &GpeDevice);
256
 
246
 
257
        Status = AcpiRemoveGpeHandler (Handle2, 8, AeGpeHandler);
247
        AcpiRemoveGpeHandler (Handle2, 8, AeGpeHandler);
258
        AE_CHECK_OK (AcpiRemoveGpeHandler, Status);
248
    }
259
    }
-
 
260
 
249
 
261
    Status = AcpiGetHandle (NULL, "\\GPE3", &Handle3);
250
    Status = AcpiGetHandle (NULL, "\\GPE3", &Handle3);
262
    if (ACPI_SUCCESS (Status))
Line 251... Line 263...
251
    if (ACPI_SUCCESS (Status))
263
    {
Line 252... Line 264...
252
    {
264
        Status = AcpiInstallGpeBlock (Handle3, &BlockAddress, 8, 11);
253
        Status = AcpiInstallGpeBlock (Handle3, &BlockAddress, 8, 11);
265
        AE_CHECK_OK (AcpiInstallGpeBlock, Status);
254
    }
266
    }
255
}
267
}
256
 
-
 
257
 
268
 
258
/* Test using a Buffer object as a method argument */
269
 
259
 
270
/* Test using a Buffer object as a method argument */
260
void
271
 
261
AeTestBufferArgument (
272
static void
Line 275... Line 286...
275
    BufArg.Buffer.Pointer = Buffer;
286
    BufArg.Buffer.Pointer = Buffer;
Line 276... Line 287...
276
 
287
 
277
    Params.Count = 1;
288
    Params.Count = 1;
Line 278... Line -...
278
    Params.Pointer = &BufArg;
-
 
279
 
289
    Params.Pointer = &BufArg;
280
 
290
 
Line 281... Line 291...
281
    Status = AcpiEvaluateObject (NULL, "\\BUF", &Params, NULL);
291
    (void) AcpiEvaluateObject (NULL, "\\BUF", &Params, NULL);
282
}
292
}
283
 
293
 
284
 
294
 
Line 285... Line 295...
285
ACPI_OBJECT                 PkgArg;
295
static ACPI_OBJECT                 PkgArg;
286
ACPI_OBJECT                 PkgElements[5];
296
static ACPI_OBJECT                 PkgElements[5];
287
ACPI_OBJECT                 Pkg2Elements[5];
297
static ACPI_OBJECT                 Pkg2Elements[5];
288
ACPI_OBJECT_LIST            Params;
298
static ACPI_OBJECT_LIST            Params;
289
 
299
 
290
 
300
 
291
/*
301
/*
292
 * Test using a Package object as an method argument
-
 
293
 */
-
 
Line 294... Line 302...
294
void
302
 * Test using a Package object as an method argument
Line 295... Line 303...
295
AeTestPackageArgument (
303
 */
296
    void)
304
static void
Line 333... Line 341...
333
    /* Parameter object */
341
    /* Parameter object */
Line 334... Line 342...
334
 
342
 
335
    Params.Count = 1;
343
    Params.Count = 1;
Line 336... Line 344...
336
    Params.Pointer = &PkgArg;
344
    Params.Pointer = &PkgArg;
337
 
345
 
Line 338... Line 346...
338
    Status = AcpiEvaluateObject (NULL, "\\_PKG", &Params, NULL);
346
    (void) AcpiEvaluateObject (NULL, "\\_PKG", &Params, NULL);
339
}
347
}
340
 
348
 
341
 
349
 
342
ACPI_STATUS
350
static ACPI_STATUS
343
AeGetDevices (
351
AeGetDevices (
Line 362... Line 370...
362
 *
370
 *
363
 * DESCRIPTION: Execute the internally implemented (in ACPICA) _OSI method.
371
 * DESCRIPTION: Execute the internally implemented (in ACPICA) _OSI method.
364
 *
372
 *
365
 *****************************************************************************/
373
 *****************************************************************************/
Line 366... Line 374...
366
 
374
 
367
ACPI_STATUS
375
static ACPI_STATUS
368
ExecuteOSI (
376
ExecuteOSI (
369
    char                    *OsiString,
377
    char                    *OsiString,
370
    UINT32                  ExpectedResult)
378
    UINT32                  ExpectedResult)
371
{
379
{
Line 432... Line 440...
432
 *
440
 *
433
 * DESCRIPTION: Call the AcpiRead/Write interfaces.
441
 * DESCRIPTION: Call the AcpiRead/Write interfaces.
434
 *
442
 *
435
 *****************************************************************************/
443
 *****************************************************************************/
Line 436... Line 444...
436
 
444
 
Line 437... Line 445...
437
ACPI_GENERIC_ADDRESS       GenericRegister;
445
static ACPI_GENERIC_ADDRESS       GenericRegister;
438
 
446
 
439
void
447
static void
440
AeGenericRegisters (
448
AeGenericRegisters (
441
    void)
449
    void)
442
{
450
{
Line 448... Line 456...
448
    GenericRegister.BitWidth = 64;
456
    GenericRegister.BitWidth = 64;
449
    GenericRegister.BitOffset = 0;
457
    GenericRegister.BitOffset = 0;
450
    GenericRegister.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO;
458
    GenericRegister.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO;
Line 451... Line 459...
451
 
459
 
-
 
460
    Status = AcpiRead (&Value, &GenericRegister);
-
 
461
    AE_CHECK_OK (AcpiRead, Status);
452
    Status = AcpiRead (&Value, &GenericRegister);
462
 
-
 
463
    Status = AcpiWrite (Value, &GenericRegister);
Line 453... Line 464...
453
    Status = AcpiWrite (Value, &GenericRegister);
464
    AE_CHECK_OK (AcpiWrite, Status);
454
 
465
 
455
    GenericRegister.Address = 0x12345678;
466
    GenericRegister.Address = 0x12345678;
Line 456... Line 467...
456
    GenericRegister.BitOffset = 0;
467
    GenericRegister.BitOffset = 0;
-
 
468
    GenericRegister.SpaceId = ACPI_ADR_SPACE_SYSTEM_MEMORY;
-
 
469
 
457
    GenericRegister.SpaceId = ACPI_ADR_SPACE_SYSTEM_MEMORY;
470
    Status = AcpiRead (&Value, &GenericRegister);
-
 
471
    AE_CHECK_OK (AcpiRead, Status);
458
 
472
 
Line 459... Line 473...
459
    Status = AcpiRead (&Value, &GenericRegister);
473
    Status = AcpiWrite (Value, &GenericRegister);
460
    Status = AcpiWrite (Value, &GenericRegister);
474
    AE_CHECK_OK (AcpiWrite, Status);
Line 467... Line 481...
467
 *
481
 *
468
 * DESCRIPTION: Call various hardware support interfaces
482
 * DESCRIPTION: Call various hardware support interfaces
469
 *
483
 *
470
 *****************************************************************************/
484
 *****************************************************************************/
Line 471... Line 485...
471
 
485
 
472
void
486
static void
473
AeHardwareInterfaces (
487
AeHardwareInterfaces (
474
    void)
488
    void)
475
{
489
{
476
    ACPI_STATUS             Status;
490
    ACPI_STATUS             Status;
Line 477... Line 491...
477
    UINT32                  Value;
491
    UINT32                  Value;
-
 
492
 
-
 
493
 
478
 
494
    Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, 1);
-
 
495
    AE_CHECK_OK (AcpiWriteBitRegister, Status);
-
 
496
 
479
 
497
    Status = AcpiWriteBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, 1);
-
 
498
    AE_CHECK_OK (AcpiWriteBitRegister, Status);
-
 
499
 
480
    Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, 1);
500
    Status = AcpiWriteBitRegister (ACPI_BITREG_SLEEP_ENABLE, 1);
-
 
501
    AE_CHECK_OK (AcpiWriteBitRegister, Status);
-
 
502
 
Line 481... Line 503...
481
    Status = AcpiWriteBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, 1);
503
    Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
-
 
504
    AE_CHECK_OK (AcpiWriteBitRegister, Status);
-
 
505
 
482
    Status = AcpiWriteBitRegister (ACPI_BITREG_SLEEP_ENABLE, 1);
506
 
-
 
507
    Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &Value);
-
 
508
    AE_CHECK_OK (AcpiReadBitRegister, Status);
483
    Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
509
 
-
 
510
    Status = AcpiReadBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, &Value);
-
 
511
    AE_CHECK_OK (AcpiReadBitRegister, Status);
484
 
512
 
-
 
513
    Status = AcpiReadBitRegister (ACPI_BITREG_SLEEP_ENABLE, &Value);
485
    Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &Value);
514
    AE_CHECK_OK (AcpiReadBitRegister, Status);
Line 486... Line 515...
486
    Status = AcpiReadBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, &Value);
515
 
487
    Status = AcpiReadBitRegister (ACPI_BITREG_SLEEP_ENABLE, &Value);
516
    Status = AcpiReadBitRegister (ACPI_BITREG_ARB_DISABLE, &Value);
Line 515... Line 544...
515
    AeGenericRegisters ();
544
    AeGenericRegisters ();
516
    AeSetupConfiguration (Ssdt3Code);
545
    AeSetupConfiguration (Ssdt3Code);
Line 517... Line 546...
517
 
546
 
518
    AeTestBufferArgument();
547
    AeTestBufferArgument();
-
 
548
    AeTestPackageArgument ();
-
 
549
 
-
 
550
 
-
 
551
    Status = AcpiInstallInterface ("");
-
 
552
    AE_CHECK_STATUS (AcpiInstallInterface, Status, AE_BAD_PARAMETER);
-
 
553
 
-
 
554
    Status = AcpiInstallInterface ("TestString");
-
 
555
    AE_CHECK_OK (AcpiInstallInterface, Status);
-
 
556
 
-
 
557
    Status = AcpiInstallInterface ("TestString");
-
 
558
    AE_CHECK_STATUS (AcpiInstallInterface, Status, AE_ALREADY_EXISTS);
-
 
559
 
-
 
560
    Status = AcpiRemoveInterface ("Windows 2006");
-
 
561
    AE_CHECK_OK (AcpiRemoveInterface, Status);
-
 
562
 
-
 
563
    Status = AcpiRemoveInterface ("TestString");
-
 
564
    AE_CHECK_OK (AcpiRemoveInterface, Status);
-
 
565
 
-
 
566
    Status = AcpiRemoveInterface ("XXXXXX");
-
 
567
    AE_CHECK_STATUS (AcpiRemoveInterface, Status, AE_NOT_EXIST);
-
 
568
 
-
 
569
    Status = AcpiInstallInterface ("AnotherTestString");
-
 
570
    AE_CHECK_OK (AcpiInstallInterface, Status);
-
 
571
 
519
    AeTestPackageArgument ();
572
 
-
 
573
    Status = ExecuteOSI ("Windows 2001", 0xFFFFFFFF);
-
 
574
    AE_CHECK_OK (ExecuteOSI, Status);
520
    ExecuteOSI ("Windows 2001", 0xFFFFFFFF);
575
 
-
 
576
    Status = ExecuteOSI ("MichiganTerminalSystem", 0);
Line 521... Line 577...
521
    ExecuteOSI ("MichiganTerminalSystem", 0);
577
    AE_CHECK_OK (ExecuteOSI, Status);
522
 
578
 
Line 523... Line 579...
523
 
579
 
-
 
580
    ReturnBuf.Length = 32;
-
 
581
    ReturnBuf.Pointer = Buffer;
524
    ReturnBuf.Length = 32;
582
 
-
 
583
    Status = AcpiGetName (AcpiGbl_RootNode, ACPI_FULL_PATHNAME, &ReturnBuf);
-
 
584
    AE_CHECK_OK (AcpiGetName, Status);
-
 
585
 
-
 
586
    Status = AcpiEnableEvent (ACPI_EVENT_GLOBAL, 0);
Line 525... Line 587...
525
    ReturnBuf.Pointer = Buffer;
587
    AE_CHECK_OK (AcpiEnableEvent, Status);
526
 
588
 
527
    AcpiGetName (AcpiGbl_RootNode, ACPI_FULL_PATHNAME, &ReturnBuf);
589
    Status = AcpiInstallGlobalEventHandler (AeGlobalEventHandler, NULL);
528
    AcpiEnableEvent (ACPI_EVENT_GLOBAL, 0);
590
    AE_CHECK_OK (AcpiInstallGlobalEventHandler, Status);
-
 
591
 
-
 
592
    /*
529
 
593
     * GPEs: Handlers, enable/disable, etc.
-
 
594
     */
-
 
595
    Status = AcpiInstallGpeHandler (NULL, 0, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
530
    /*
596
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
-
 
597
 
531
     * GPEs: Handlers, enable/disable, etc.
598
    Status = AcpiEnableGpe (NULL, 0);
532
     */
599
    AE_CHECK_OK (AcpiEnableGpe, Status);
-
 
600
 
-
 
601
    Status = AcpiRemoveGpeHandler (NULL, 0, AeGpeHandler);
533
    AcpiInstallGpeHandler (NULL, 0, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
602
    AE_CHECK_OK (AcpiRemoveGpeHandler, Status);
-
 
603
 
-
 
604
    Status = AcpiInstallGpeHandler (NULL, 0, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
534
    AcpiEnableGpe (NULL, 0, ACPI_GPE_TYPE_RUNTIME);
605
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
-
 
606
 
-
 
607
    Status = AcpiEnableGpe (NULL, 0);
535
    AcpiRemoveGpeHandler (NULL, 0, AeGpeHandler);
608
    AE_CHECK_OK (AcpiEnableGpe, Status);
-
 
609
 
-
 
610
    Status = AcpiSetGpe (NULL, 0, ACPI_GPE_DISABLE);
536
 
611
    AE_CHECK_OK (AcpiSetGpe, Status);
537
    AcpiInstallGpeHandler (NULL, 0, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
612
 
-
 
613
    Status = AcpiSetGpe (NULL, 0, ACPI_GPE_ENABLE);
-
 
614
    AE_CHECK_OK (AcpiSetGpe, Status);
538
    AcpiEnableGpe (NULL, 0, ACPI_GPE_TYPE_RUNTIME);
615
 
-
 
616
 
-
 
617
    Status = AcpiInstallGpeHandler (NULL, 1, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
539
    AcpiSetGpe (NULL, 0, ACPI_GPE_DISABLE);
618
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
540
    AcpiSetGpe (NULL, 0, ACPI_GPE_ENABLE);
619
 
-
 
620
    Status = AcpiEnableGpe (NULL, 1);
-
 
621
    AE_CHECK_OK (AcpiEnableGpe, Status);
541
 
622
 
-
 
623
 
-
 
624
    Status = AcpiInstallGpeHandler (NULL, 2, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
542
    AcpiInstallGpeHandler (NULL, 1, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
625
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
543
    AcpiEnableGpe (NULL, 1, ACPI_GPE_TYPE_RUNTIME);
626
 
-
 
627
    Status = AcpiEnableGpe (NULL, 2);
-
 
628
    AE_CHECK_OK (AcpiEnableGpe, Status);
544
 
629
 
-
 
630
 
-
 
631
    Status = AcpiInstallGpeHandler (NULL, 3, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
545
    AcpiInstallGpeHandler (NULL, 2, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
632
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
-
 
633
 
-
 
634
    Status = AcpiInstallGpeHandler (NULL, 4, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
-
 
635
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
-
 
636
 
-
 
637
    Status = AcpiInstallGpeHandler (NULL, 5, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
-
 
638
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
-
 
639
 
-
 
640
    Status = AcpiGetHandle (NULL, "\\_SB", &Handle);
-
 
641
    AE_CHECK_OK (AcpiGetHandle, Status);
-
 
642
 
-
 
643
    Status = AcpiSetupGpeForWake (Handle, NULL, 5);
-
 
644
    AE_CHECK_OK (AcpiSetupGpeForWake, Status);
-
 
645
 
-
 
646
    Status = AcpiSetGpeWakeMask (NULL, 5, ACPI_GPE_ENABLE);
-
 
647
    AE_CHECK_OK (AcpiGpeWakeup, Status);
-
 
648
 
546
    AcpiEnableGpe (NULL, 2, ACPI_GPE_TYPE_RUNTIME);
649
    Status = AcpiSetupGpeForWake (Handle, NULL, 6);
547
 
650
    AE_CHECK_OK (AcpiSetupGpeForWake, Status);
-
 
651
 
-
 
652
    Status = AcpiSetupGpeForWake (Handle, NULL, 9);
548
    AcpiInstallGpeHandler (NULL, 3, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
653
    AE_CHECK_OK (AcpiSetupGpeForWake, Status);
-
 
654
 
-
 
655
    Status = AcpiInstallGpeHandler (NULL, 0x19, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
549
    AcpiInstallGpeHandler (NULL, 4, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
656
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
550
    AcpiInstallGpeHandler (NULL, 5, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
657
 
-
 
658
    Status = AcpiEnableGpe (NULL, 0x19);
-
 
659
    AE_CHECK_OK (AcpiEnableGpe, Status);
551
 
660
 
-
 
661
 
-
 
662
    Status = AcpiInstallGpeHandler (NULL, 0x62, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
552
    AcpiInstallGpeHandler (NULL, 0x19, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
663
    AE_CHECK_OK (AcpiInstallGpeHandler, Status);
-
 
664
 
Line 553... Line 665...
553
    AcpiEnableGpe (NULL, 0x19, ACPI_GPE_TYPE_RUNTIME);
665
    Status = AcpiEnableGpe (NULL, 0x62);
Line -... Line 666...
-
 
666
    AE_CHECK_OK (AcpiEnableGpe, Status);
-
 
667
 
-
 
668
    Status = AcpiDisableGpe (NULL, 0x62);
-
 
669
    AE_CHECK_OK (AcpiDisableGpe, Status);
Line 554... Line 670...
554
 
670
 
555
    AcpiInstallGpeHandler (NULL, 0x62, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
671
    AfInstallGpeBlock ();
556
    AcpiEnableGpe (NULL, 0x62, ACPI_GPE_TYPE_RUNTIME);
672
 
557
    AcpiDisableGpe (NULL, 0x62, ACPI_GPE_TYPE_RUNTIME);
673
    /* Here is where the GPEs are actually "enabled" */
Line 572... Line 688...
572
    }
688
    }
Line 573... Line 689...
573
 
689
 
Line 574... Line 690...
574
    /* Test global lock */
690
    /* Test global lock */
575
 
-
 
576
    Status = AcpiAcquireGlobalLock (0xFFFF, &LockHandle1);
-
 
577
    if (ACPI_FAILURE (Status))
691
 
578
    {
-
 
Line 579... Line 692...
579
        AcpiOsPrintf ("Could not get GlobalLock, %X\n", Status);
692
    Status = AcpiAcquireGlobalLock (0xFFFF, &LockHandle1);
580
    }
-
 
581
 
-
 
582
    Status = AcpiAcquireGlobalLock (0x5, &LockHandle2);
693
    AE_CHECK_OK (AcpiAcquireGlobalLock, Status);
583
    if (ACPI_FAILURE (Status))
-
 
Line 584... Line 694...
584
    {
694
 
585
        AcpiOsPrintf ("Could not get GlobalLock, %X\n", Status);
-
 
586
    }
-
 
587
 
695
    Status = AcpiAcquireGlobalLock (0x5, &LockHandle2);
588
    Status = AcpiReleaseGlobalLock (LockHandle1);
-
 
Line 589... Line 696...
589
    if (ACPI_FAILURE (Status))
696
    AE_CHECK_OK (AcpiAcquireGlobalLock, Status);
590
    {
-
 
591
        AcpiOsPrintf ("Could not release GlobalLock, %X\n", Status);
-
 
592
    }
697
 
593
 
-
 
Line 594... Line 698...
594
    Status = AcpiReleaseGlobalLock (LockHandle2);
698
    Status = AcpiReleaseGlobalLock (LockHandle1);
Line 595... Line 699...
595
    if (ACPI_FAILURE (Status))
699
    AE_CHECK_OK (AcpiReleaseGlobalLock, Status);
596
    {
-
 
597
        AcpiOsPrintf ("Could not release GlobalLock, %X\n", Status);
-
 
598
    }
700
 
599
 
-
 
Line 600... Line 701...
600
    /* Get Devices */
701
    Status = AcpiReleaseGlobalLock (LockHandle2);
601
 
-
 
602
    Status = AcpiGetDevices (NULL, AeGetDevices, NULL, NULL);
-
 
603
    if (ACPI_FAILURE (Status))
702
    AE_CHECK_OK (AcpiReleaseGlobalLock, Status);
604
    {
-
 
605
        AcpiOsPrintf ("Could not AcpiGetDevices, %X\n", Status);
703