evevent.c (71867) | evevent.c (73561) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: evevent - Fixed and General Purpose AcpiEvent 4 * handling and dispatch | 1/****************************************************************************** 2 * 3 * Module Name: evevent - Fixed and General Purpose AcpiEvent 4 * handling and dispatch |
5 * $Revision: 33 $ | 5 * $Revision: 34 $ |
6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * 13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. --- 130 unchanged lines hidden (view full) --- 144 void) 145{ 146 ACPI_STATUS Status; 147 148 149 FUNCTION_TRACE ("EvInitialize"); 150 151 | 6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * 13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. --- 130 unchanged lines hidden (view full) --- 144 void) 145{ 146 ACPI_STATUS Status; 147 148 149 FUNCTION_TRACE ("EvInitialize"); 150 151 |
152 /* Make sure we've got ACPI tables */ | 152 /* Make sure we have ACPI tables */ |
153 154 if (!AcpiGbl_DSDT) 155 { 156 DEBUG_PRINT (ACPI_WARN, ("EvInitialize: No ACPI tables present!\n")); 157 return_ACPI_STATUS (AE_NO_ACPI_TABLES); 158 } 159 160 --- 705 unchanged lines hidden (view full) --- 866 * dispatch the correct AML. 867 * 868 ******************************************************************************/ 869 870UINT32 871AcpiEvGpeDispatch ( 872 UINT32 GpeNumber) 873{ | 153 154 if (!AcpiGbl_DSDT) 155 { 156 DEBUG_PRINT (ACPI_WARN, ("EvInitialize: No ACPI tables present!\n")); 157 return_ACPI_STATUS (AE_NO_ACPI_TABLES); 158 } 159 160 --- 705 unchanged lines hidden (view full) --- 866 * dispatch the correct AML. 867 * 868 ******************************************************************************/ 869 870UINT32 871AcpiEvGpeDispatch ( 872 UINT32 GpeNumber) 873{ |
874 ACPI_GPE_LEVEL_INFO GpeInfo; | 874 ACPI_GPE_LEVEL_INFO GpeInfo; |
875 876 FUNCTION_TRACE ("EvGpeDispatch"); 877 878 /*DEBUG_INCREMENT_EVENT_COUNT (EVENT_GENERAL);*/ 879 880 /* 881 * Valid GPE number? 882 */ 883 if (AcpiGbl_GpeValid[GpeNumber] == ACPI_GPE_INVALID) 884 { 885 DEBUG_PRINT (ACPI_ERROR, ("Invalid GPE bit [%X].\n", GpeNumber)); 886 return_VALUE (INTERRUPT_NOT_HANDLED); 887 } 888 889 /* 890 * Disable the GPE. 891 */ 892 AcpiHwDisableGpe (GpeNumber); 893 | 875 876 FUNCTION_TRACE ("EvGpeDispatch"); 877 878 /*DEBUG_INCREMENT_EVENT_COUNT (EVENT_GENERAL);*/ 879 880 /* 881 * Valid GPE number? 882 */ 883 if (AcpiGbl_GpeValid[GpeNumber] == ACPI_GPE_INVALID) 884 { 885 DEBUG_PRINT (ACPI_ERROR, ("Invalid GPE bit [%X].\n", GpeNumber)); 886 return_VALUE (INTERRUPT_NOT_HANDLED); 887 } 888 889 /* 890 * Disable the GPE. 891 */ 892 AcpiHwDisableGpe (GpeNumber); 893 |
894 GpeInfo = AcpiGbl_GpeInfo [GpeNumber]; | 894 GpeInfo = AcpiGbl_GpeInfo [GpeNumber]; |
895 | 895 |
896 /* 897 * Edge-Triggered? 898 * --------------- 899 * If edge-triggered, clear the GPE status bit now. Note that 900 * level-triggered events are cleared after the GPE is serviced. 901 */ 902 if (GpeInfo.Type & ACPI_EVENT_EDGE_TRIGGERED) | 896 /* 897 * Edge-Triggered? 898 * --------------- 899 * If edge-triggered, clear the GPE status bit now. Note that 900 * level-triggered events are cleared after the GPE is serviced. 901 */ 902 if (GpeInfo.Type & ACPI_EVENT_EDGE_TRIGGERED) |
903 { | 903 { |
904 AcpiHwClearGpe (GpeNumber); 905 } 906 | 904 AcpiHwClearGpe (GpeNumber); 905 } |
907 /* 908 * Function Handler (e.g. EC)? 909 */ | 906 /* 907 * Function Handler (e.g. EC)? 908 */ |
910 if (GpeInfo.Handler) | 909 if (GpeInfo.Handler) |
911 { | 910 { |
912 /* Invoke function handler (at interrupt level). */ 913 GpeInfo.Handler (GpeInfo.Context); | 911 /* Invoke function handler (at interrupt level). */ 912 GpeInfo.Handler (GpeInfo.Context); |
914 | 913 |
915 /* Level-Triggered? */ 916 if (GpeInfo.Type & ACPI_EVENT_LEVEL_TRIGGERED) | 914 /* Level-Triggered? */ 915 if (GpeInfo.Type & ACPI_EVENT_LEVEL_TRIGGERED) |
917 { | 916 { |
918 AcpiHwClearGpe (GpeNumber); 919 } 920 921 /* Enable GPE */ 922 AcpiHwEnableGpe (GpeNumber); | 917 AcpiHwClearGpe (GpeNumber); |
923 } | 918 } |
924 /* 925 * Method Handler (e.g. _Exx/_Lxx)? 926 */ 927 else if (GpeInfo.MethodHandle) | 919 920 /* Enable GPE */ 921 AcpiHwEnableGpe (GpeNumber); 922 } 923 /* 924 * Method Handler (e.g. _Exx/_Lxx)? 925 */ 926 else if (GpeInfo.MethodHandle) |
928 { | 927 { |
929 if (ACPI_FAILURE(AcpiOsQueueForExecution (OSD_PRIORITY_GPE, | 928 if (ACPI_FAILURE(AcpiOsQueueForExecution (OSD_PRIORITY_GPE, |
930 AcpiEvAsynchExecuteGpeMethod, (void*)(NATIVE_UINT)GpeNumber))) | 929 AcpiEvAsynchExecuteGpeMethod, (void*)(NATIVE_UINT)GpeNumber))) |
931 { 932 /* 933 * Shoudn't occur, but if it does report an error. Note that 934 * the GPE will remain disabled until the ACPI Core Subsystem 935 * is restarted, or the handler is removed/reinstalled. 936 */ 937 REPORT_ERROR (("AcpiEvGpeDispatch: Unable to queue handler for GPE bit [%X]\n", GpeNumber)); 938 } | 930 { 931 /* 932 * Shoudn't occur, but if it does report an error. Note that 933 * the GPE will remain disabled until the ACPI Core Subsystem 934 * is restarted, or the handler is removed/reinstalled. 935 */ 936 REPORT_ERROR (("AcpiEvGpeDispatch: Unable to queue handler for GPE bit [%X]\n", GpeNumber)); |
939 } | 937 } |
940 /* 941 * No Handler? Report an error and leave the GPE disabled. 942 */ 943 else | 938 } 939 /* 940 * No Handler? Report an error and leave the GPE disabled. 941 */ 942 else |
944 { | 943 { |
945 REPORT_ERROR (("AcpiEvGpeDispatch: No installed handler for GPE [%X]\n", GpeNumber)); | 944 REPORT_ERROR (("AcpiEvGpeDispatch: No installed handler for GPE [%X]\n", GpeNumber)); |
946 | 945 |
947 /* Level-Triggered? */ 948 if (GpeInfo.Type & ACPI_EVENT_LEVEL_TRIGGERED) | 946 /* Level-Triggered? */ 947 if (GpeInfo.Type & ACPI_EVENT_LEVEL_TRIGGERED) |
949 { | 948 { |
950 AcpiHwClearGpe (GpeNumber); 951 } | 949 AcpiHwClearGpe (GpeNumber); |
952 } | 950 } |
951 } |
|
953 954 return_VALUE (INTERRUPT_HANDLED); 955} | 952 953 return_VALUE (INTERRUPT_HANDLED); 954} |