1/****************************************************************************** 2 * 3 * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable 4 * 5 *****************************************************************************/ 6 7/****************************************************************************** 8 * 9 * 1. Copyright Notice 10 * 11 * Some or all of this work - Copyright (c) 1999 - 2009, 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 117#define __EVXFEVNT_C__ 118 119#include <contrib/dev/acpica/include/acpi.h> 120#include <contrib/dev/acpica/include/accommon.h> 121#include <contrib/dev/acpica/include/acevents.h> 122#include <contrib/dev/acpica/include/acnamesp.h> 123#include <contrib/dev/acpica/include/actables.h> 124 125#define _COMPONENT ACPI_EVENTS 126 ACPI_MODULE_NAME ("evxfevnt") 127 128/* Local prototypes */ 129 130static ACPI_STATUS 131AcpiEvGetGpeDevice ( 132 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 133 ACPI_GPE_BLOCK_INFO *GpeBlock, 134 void *Context); 135 136 137/******************************************************************************* 138 * 139 * FUNCTION: AcpiEnable 140 * 141 * PARAMETERS: None 142 * 143 * RETURN: Status 144 * 145 * DESCRIPTION: Transfers the system into ACPI mode. 146 * 147 ******************************************************************************/ 148 149ACPI_STATUS 150AcpiEnable ( 151 void) 152{ 153 ACPI_STATUS Status = AE_OK; 154 155 156 ACPI_FUNCTION_TRACE (AcpiEnable); 157 158 159 /* ACPI tables must be present */ 160 161 if (!AcpiTbTablesLoaded ()) 162 { 163 return_ACPI_STATUS (AE_NO_ACPI_TABLES); 164 } 165 166 /* Check current mode */ 167 168 if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI) 169 { 170 ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "System is already in ACPI mode\n")); 171 } 172 else 173 { 174 /* Transition to ACPI mode */ 175 176 Status = AcpiHwSetMode (ACPI_SYS_MODE_ACPI); 177 if (ACPI_FAILURE (Status)) 178 { 179 ACPI_ERROR ((AE_INFO, "Could not transition to ACPI mode")); 180 return_ACPI_STATUS (Status); 181 } 182 183 ACPI_DEBUG_PRINT ((ACPI_DB_INIT, 184 "Transition to ACPI mode successful\n")); 185 } 186 187 return_ACPI_STATUS (Status); 188} 189 190ACPI_EXPORT_SYMBOL (AcpiEnable) 191 192 193/******************************************************************************* 194 * 195 * FUNCTION: AcpiDisable 196 * 197 * PARAMETERS: None 198 * 199 * RETURN: Status 200 * 201 * DESCRIPTION: Transfers the system into LEGACY (non-ACPI) mode. 202 * 203 ******************************************************************************/ 204 205ACPI_STATUS 206AcpiDisable ( 207 void) 208{ 209 ACPI_STATUS Status = AE_OK; 210 211 212 ACPI_FUNCTION_TRACE (AcpiDisable); 213 214 215 if (AcpiHwGetMode() == ACPI_SYS_MODE_LEGACY) 216 { 217 ACPI_DEBUG_PRINT ((ACPI_DB_INIT, 218 "System is already in legacy (non-ACPI) mode\n")); 219 } 220 else 221 { 222 /* Transition to LEGACY mode */ 223 224 Status = AcpiHwSetMode (ACPI_SYS_MODE_LEGACY); 225 226 if (ACPI_FAILURE (Status)) 227 { 228 ACPI_ERROR ((AE_INFO, 229 "Could not exit ACPI mode to legacy mode")); 230 return_ACPI_STATUS (Status); 231 } 232 233 ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI mode disabled\n")); 234 } 235 236 return_ACPI_STATUS (Status); 237} 238 239ACPI_EXPORT_SYMBOL (AcpiDisable) 240 241 242/******************************************************************************* 243 * 244 * FUNCTION: AcpiEnableEvent 245 * 246 * PARAMETERS: Event - The fixed eventto be enabled 247 * Flags - Reserved 248 * 249 * RETURN: Status 250 * 251 * DESCRIPTION: Enable an ACPI event (fixed) 252 * 253 ******************************************************************************/ 254 255ACPI_STATUS 256AcpiEnableEvent ( 257 UINT32 Event, 258 UINT32 Flags) 259{ 260 ACPI_STATUS Status = AE_OK; 261 UINT32 Value; 262 263 264 ACPI_FUNCTION_TRACE (AcpiEnableEvent); 265 266 267 /* Decode the Fixed Event */ 268 269 if (Event > ACPI_EVENT_MAX) 270 { 271 return_ACPI_STATUS (AE_BAD_PARAMETER); 272 } 273 274 /* 275 * Enable the requested fixed event (by writing a one to the enable 276 * register bit) 277 */ 278 Status = AcpiWriteBitRegister ( 279 AcpiGbl_FixedEventInfo[Event].EnableRegisterId, 280 ACPI_ENABLE_EVENT); 281 if (ACPI_FAILURE (Status)) 282 { 283 return_ACPI_STATUS (Status); 284 } 285 286 /* Make sure that the hardware responded */ 287 288 Status = AcpiReadBitRegister ( 289 AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value); 290 if (ACPI_FAILURE (Status)) 291 { 292 return_ACPI_STATUS (Status); 293 } 294 295 if (Value != 1) 296 { 297 ACPI_ERROR ((AE_INFO, 298 "Could not enable %s event", AcpiUtGetEventName (Event))); 299 return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE); 300 } 301 302 return_ACPI_STATUS (Status); 303} 304 305ACPI_EXPORT_SYMBOL (AcpiEnableEvent) 306 307 308/******************************************************************************* 309 * 310 * FUNCTION: AcpiSetGpeType 311 * 312 * PARAMETERS: GpeDevice - Parent GPE Device 313 * GpeNumber - GPE level within the GPE block 314 * Type - New GPE type 315 * 316 * RETURN: Status 317 * 318 * DESCRIPTION: Set the type of an individual GPE 319 * 320 ******************************************************************************/ 321 322ACPI_STATUS 323AcpiSetGpeType ( 324 ACPI_HANDLE GpeDevice, 325 UINT32 GpeNumber, 326 UINT8 Type) 327{ 328 ACPI_STATUS Status = AE_OK; 329 ACPI_GPE_EVENT_INFO *GpeEventInfo; 330 331 332 ACPI_FUNCTION_TRACE (AcpiSetGpeType); 333 334 335 /* Ensure that we have a valid GPE number */ 336 337 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); 338 if (!GpeEventInfo) 339 { 340 Status = AE_BAD_PARAMETER; 341 goto UnlockAndExit; 342 } 343 344 if ((GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK) == Type) 345 { 346 return_ACPI_STATUS (AE_OK); 347 } 348 349 /* Set the new type (will disable GPE if currently enabled) */ 350 351 Status = AcpiEvSetGpeType (GpeEventInfo, Type); 352 353UnlockAndExit: 354 return_ACPI_STATUS (Status); 355} 356 357ACPI_EXPORT_SYMBOL (AcpiSetGpeType) 358 359 360/******************************************************************************* 361 * 362 * FUNCTION: AcpiEnableGpe 363 * 364 * PARAMETERS: GpeDevice - Parent GPE Device 365 * GpeNumber - GPE level within the GPE block 366 * Flags - Just enable, or also wake enable? 367 * Called from ISR or not 368 * 369 * RETURN: Status 370 * 371 * DESCRIPTION: Enable an ACPI event (general purpose) 372 * 373 ******************************************************************************/ 374 375ACPI_STATUS 376AcpiEnableGpe ( 377 ACPI_HANDLE GpeDevice, 378 UINT32 GpeNumber, 379 UINT32 Flags) 380{ 381 ACPI_STATUS Status = AE_OK; 382 ACPI_GPE_EVENT_INFO *GpeEventInfo; 383 384 385 ACPI_FUNCTION_TRACE (AcpiEnableGpe); 386 387 388 /* Use semaphore lock if not executing at interrupt level */ 389 390 if (Flags & ACPI_NOT_ISR) 391 { 392 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); 393 if (ACPI_FAILURE (Status)) 394 { 395 return_ACPI_STATUS (Status); 396 } 397 } 398 399 /* Ensure that we have a valid GPE number */ 400 401 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); 402 if (!GpeEventInfo) 403 { 404 Status = AE_BAD_PARAMETER; 405 goto UnlockAndExit; 406 } 407 408 /* Perform the enable */ 409 410 Status = AcpiEvEnableGpe (GpeEventInfo, TRUE); 411 412UnlockAndExit: 413 if (Flags & ACPI_NOT_ISR) 414 { 415 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); 416 } 417 return_ACPI_STATUS (Status); 418} 419 420ACPI_EXPORT_SYMBOL (AcpiEnableGpe) 421 422 423/******************************************************************************* 424 * 425 * FUNCTION: AcpiDisableGpe 426 * 427 * PARAMETERS: GpeDevice - Parent GPE Device 428 * GpeNumber - GPE level within the GPE block 429 * Flags - Just disable, or also wake disable? 430 * Called from ISR or not 431 * 432 * RETURN: Status 433 * 434 * DESCRIPTION: Disable an ACPI event (general purpose) 435 * 436 ******************************************************************************/ 437 438ACPI_STATUS 439AcpiDisableGpe ( 440 ACPI_HANDLE GpeDevice, 441 UINT32 GpeNumber, 442 UINT32 Flags) 443{ 444 ACPI_STATUS Status = AE_OK; 445 ACPI_GPE_EVENT_INFO *GpeEventInfo; 446 447 448 ACPI_FUNCTION_TRACE (AcpiDisableGpe); 449 450 451 /* Use semaphore lock if not executing at interrupt level */ 452 453 if (Flags & ACPI_NOT_ISR) 454 { 455 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); 456 if (ACPI_FAILURE (Status)) 457 { 458 return_ACPI_STATUS (Status); 459 } 460 } 461 462 /* Ensure that we have a valid GPE number */ 463 464 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); 465 if (!GpeEventInfo) 466 { 467 Status = AE_BAD_PARAMETER; 468 goto UnlockAndExit; 469 } 470 471 Status = AcpiEvDisableGpe (GpeEventInfo); 472 473UnlockAndExit: 474 if (Flags & ACPI_NOT_ISR) 475 { 476 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); 477 } 478 return_ACPI_STATUS (Status); 479} 480 481ACPI_EXPORT_SYMBOL (AcpiDisableGpe) 482 483 484/******************************************************************************* 485 * 486 * FUNCTION: AcpiDisableEvent 487 * 488 * PARAMETERS: Event - The fixed eventto be enabled 489 * Flags - Reserved 490 * 491 * RETURN: Status 492 * 493 * DESCRIPTION: Disable an ACPI event (fixed) 494 * 495 ******************************************************************************/ 496 497ACPI_STATUS 498AcpiDisableEvent ( 499 UINT32 Event, 500 UINT32 Flags) 501{ 502 ACPI_STATUS Status = AE_OK; 503 UINT32 Value; 504 505 506 ACPI_FUNCTION_TRACE (AcpiDisableEvent); 507 508 509 /* Decode the Fixed Event */ 510 511 if (Event > ACPI_EVENT_MAX) 512 { 513 return_ACPI_STATUS (AE_BAD_PARAMETER); 514 } 515 516 /* 517 * Disable the requested fixed event (by writing a zero to the enable 518 * register bit) 519 */ 520 Status = AcpiWriteBitRegister ( 521 AcpiGbl_FixedEventInfo[Event].EnableRegisterId, 522 ACPI_DISABLE_EVENT); 523 if (ACPI_FAILURE (Status)) 524 { 525 return_ACPI_STATUS (Status); 526 } 527 528 Status = AcpiReadBitRegister ( 529 AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value); 530 if (ACPI_FAILURE (Status)) 531 { 532 return_ACPI_STATUS (Status); 533 } 534 535 if (Value != 0) 536 { 537 ACPI_ERROR ((AE_INFO, 538 "Could not disable %s events", AcpiUtGetEventName (Event))); 539 return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE); 540 } 541 542 return_ACPI_STATUS (Status); 543} 544 545ACPI_EXPORT_SYMBOL (AcpiDisableEvent) 546 547 548/******************************************************************************* 549 * 550 * FUNCTION: AcpiClearEvent 551 * 552 * PARAMETERS: Event - The fixed event to be cleared 553 * 554 * RETURN: Status 555 * 556 * DESCRIPTION: Clear an ACPI event (fixed) 557 * 558 ******************************************************************************/ 559 560ACPI_STATUS 561AcpiClearEvent ( 562 UINT32 Event) 563{ 564 ACPI_STATUS Status = AE_OK; 565 566 567 ACPI_FUNCTION_TRACE (AcpiClearEvent); 568 569 570 /* Decode the Fixed Event */ 571 572 if (Event > ACPI_EVENT_MAX) 573 { 574 return_ACPI_STATUS (AE_BAD_PARAMETER); 575 } 576 577 /* 578 * Clear the requested fixed event (By writing a one to the status 579 * register bit) 580 */ 581 Status = AcpiWriteBitRegister ( 582 AcpiGbl_FixedEventInfo[Event].StatusRegisterId, 583 ACPI_CLEAR_STATUS); 584 585 return_ACPI_STATUS (Status); 586} 587 588ACPI_EXPORT_SYMBOL (AcpiClearEvent) 589 590 591/******************************************************************************* 592 * 593 * FUNCTION: AcpiClearGpe 594 * 595 * PARAMETERS: GpeDevice - Parent GPE Device 596 * GpeNumber - GPE level within the GPE block 597 * Flags - Called from an ISR or not 598 * 599 * RETURN: Status 600 * 601 * DESCRIPTION: Clear an ACPI event (general purpose) 602 * 603 ******************************************************************************/ 604 605ACPI_STATUS 606AcpiClearGpe ( 607 ACPI_HANDLE GpeDevice, 608 UINT32 GpeNumber, 609 UINT32 Flags) 610{ 611 ACPI_STATUS Status = AE_OK; 612 ACPI_GPE_EVENT_INFO *GpeEventInfo; 613 614 615 ACPI_FUNCTION_TRACE (AcpiClearGpe); 616 617 618 /* Use semaphore lock if not executing at interrupt level */ 619 620 if (Flags & ACPI_NOT_ISR) 621 { 622 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); 623 if (ACPI_FAILURE (Status)) 624 { 625 return_ACPI_STATUS (Status); 626 } 627 } 628 629 /* Ensure that we have a valid GPE number */ 630 631 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); 632 if (!GpeEventInfo) 633 { 634 Status = AE_BAD_PARAMETER; 635 goto UnlockAndExit; 636 } 637 638 Status = AcpiHwClearGpe (GpeEventInfo); 639 640UnlockAndExit: 641 if (Flags & ACPI_NOT_ISR) 642 { 643 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); 644 } 645 return_ACPI_STATUS (Status); 646} 647 648ACPI_EXPORT_SYMBOL (AcpiClearGpe) 649 650 651/******************************************************************************* 652 * 653 * FUNCTION: AcpiGetEventStatus 654 * 655 * PARAMETERS: Event - The fixed event 656 * EventStatus - Where the current status of the event will 657 * be returned 658 * 659 * RETURN: Status 660 * 661 * DESCRIPTION: Obtains and returns the current status of the event 662 * 663 ******************************************************************************/ 664 665ACPI_STATUS 666AcpiGetEventStatus ( 667 UINT32 Event, 668 ACPI_EVENT_STATUS *EventStatus) 669{ 670 ACPI_STATUS Status = AE_OK; 671 672 673 ACPI_FUNCTION_TRACE (AcpiGetEventStatus); 674 675 676 if (!EventStatus) 677 { 678 return_ACPI_STATUS (AE_BAD_PARAMETER); 679 } 680 681 /* Decode the Fixed Event */ 682 683 if (Event > ACPI_EVENT_MAX) 684 { 685 return_ACPI_STATUS (AE_BAD_PARAMETER); 686 } 687 688 /* Get the status of the requested fixed event */ 689 690 Status = AcpiReadBitRegister ( 691 AcpiGbl_FixedEventInfo[Event].StatusRegisterId, EventStatus); 692 693 return_ACPI_STATUS (Status); 694} 695 696ACPI_EXPORT_SYMBOL (AcpiGetEventStatus) 697 698 699/******************************************************************************* 700 * 701 * FUNCTION: AcpiGetGpeStatus 702 * 703 * PARAMETERS: GpeDevice - Parent GPE Device 704 * GpeNumber - GPE level within the GPE block 705 * Flags - Called from an ISR or not 706 * EventStatus - Where the current status of the event will 707 * be returned 708 * 709 * RETURN: Status 710 * 711 * DESCRIPTION: Get status of an event (general purpose) 712 * 713 ******************************************************************************/ 714 715ACPI_STATUS 716AcpiGetGpeStatus ( 717 ACPI_HANDLE GpeDevice, 718 UINT32 GpeNumber, 719 UINT32 Flags, 720 ACPI_EVENT_STATUS *EventStatus) 721{ 722 ACPI_STATUS Status = AE_OK; 723 ACPI_GPE_EVENT_INFO *GpeEventInfo; 724 725 726 ACPI_FUNCTION_TRACE (AcpiGetGpeStatus); 727 728 729 /* Use semaphore lock if not executing at interrupt level */ 730 731 if (Flags & ACPI_NOT_ISR) 732 { 733 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); 734 if (ACPI_FAILURE (Status)) 735 { 736 return_ACPI_STATUS (Status); 737 } 738 } 739 740 /* Ensure that we have a valid GPE number */ 741 742 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); 743 if (!GpeEventInfo) 744 { 745 Status = AE_BAD_PARAMETER; 746 goto UnlockAndExit; 747 } 748 749 /* Obtain status on the requested GPE number */ 750 751 Status = AcpiHwGetGpeStatus (GpeEventInfo, EventStatus); 752 753UnlockAndExit: 754 if (Flags & ACPI_NOT_ISR) 755 { 756 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); 757 } 758 return_ACPI_STATUS (Status); 759} 760 761ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus) 762 763 764/******************************************************************************* 765 * 766 * FUNCTION: AcpiInstallGpeBlock 767 * 768 * PARAMETERS: GpeDevice - Handle to the parent GPE Block Device 769 * GpeBlockAddress - Address and SpaceID 770 * RegisterCount - Number of GPE register pairs in the block 771 * InterruptNumber - H/W interrupt for the block 772 * 773 * RETURN: Status 774 * 775 * DESCRIPTION: Create and Install a block of GPE registers 776 * 777 ******************************************************************************/ 778 779ACPI_STATUS 780AcpiInstallGpeBlock ( 781 ACPI_HANDLE GpeDevice, 782 ACPI_GENERIC_ADDRESS *GpeBlockAddress, 783 UINT32 RegisterCount, 784 UINT32 InterruptNumber) 785{ 786 ACPI_STATUS Status; 787 ACPI_OPERAND_OBJECT *ObjDesc; 788 ACPI_NAMESPACE_NODE *Node; 789 ACPI_GPE_BLOCK_INFO *GpeBlock; 790 791 792 ACPI_FUNCTION_TRACE (AcpiInstallGpeBlock); 793 794 795 if ((!GpeDevice) || 796 (!GpeBlockAddress) || 797 (!RegisterCount)) 798 { 799 return_ACPI_STATUS (AE_BAD_PARAMETER); 800 } 801 802 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); 803 if (ACPI_FAILURE (Status)) 804 { 805 return (Status); 806 } 807
|