.. | .. |
---|
3 | 3 | * |
---|
4 | 4 | * Module Name: evevent - Fixed Event handling and dispatch |
---|
5 | 5 | * |
---|
6 | | - * Copyright (C) 2000 - 2018, Intel Corp. |
---|
| 6 | + * Copyright (C) 2000 - 2020, Intel Corp. |
---|
7 | 7 | * |
---|
8 | 8 | *****************************************************************************/ |
---|
9 | 9 | |
---|
.. | .. |
---|
130 | 130 | |
---|
131 | 131 | /* |
---|
132 | 132 | * Initialize the structure that keeps track of fixed event handlers and |
---|
133 | | - * enable the fixed events. |
---|
| 133 | + * disable all of the fixed events. |
---|
134 | 134 | */ |
---|
135 | 135 | for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { |
---|
136 | 136 | acpi_gbl_fixed_event_handlers[i].handler = NULL; |
---|
.. | .. |
---|
265 | 265 | handler) (acpi_gbl_fixed_event_handlers[event].context)); |
---|
266 | 266 | } |
---|
267 | 267 | |
---|
| 268 | +/******************************************************************************* |
---|
| 269 | + * |
---|
| 270 | + * FUNCTION: acpi_any_fixed_event_status_set |
---|
| 271 | + * |
---|
| 272 | + * PARAMETERS: None |
---|
| 273 | + * |
---|
| 274 | + * RETURN: TRUE or FALSE |
---|
| 275 | + * |
---|
| 276 | + * DESCRIPTION: Checks the PM status register for active fixed events |
---|
| 277 | + * |
---|
| 278 | + ******************************************************************************/ |
---|
| 279 | + |
---|
| 280 | +u32 acpi_any_fixed_event_status_set(void) |
---|
| 281 | +{ |
---|
| 282 | + acpi_status status; |
---|
| 283 | + u32 in_status; |
---|
| 284 | + u32 in_enable; |
---|
| 285 | + u32 i; |
---|
| 286 | + |
---|
| 287 | + status = acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &in_enable); |
---|
| 288 | + if (ACPI_FAILURE(status)) { |
---|
| 289 | + return (FALSE); |
---|
| 290 | + } |
---|
| 291 | + |
---|
| 292 | + status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &in_status); |
---|
| 293 | + if (ACPI_FAILURE(status)) { |
---|
| 294 | + return (FALSE); |
---|
| 295 | + } |
---|
| 296 | + |
---|
| 297 | + /* |
---|
| 298 | + * Check for all possible Fixed Events and dispatch those that are active |
---|
| 299 | + */ |
---|
| 300 | + for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { |
---|
| 301 | + |
---|
| 302 | + /* Both the status and enable bits must be on for this event */ |
---|
| 303 | + |
---|
| 304 | + if ((in_status & acpi_gbl_fixed_event_info[i].status_bit_mask) && |
---|
| 305 | + (in_enable & acpi_gbl_fixed_event_info[i].enable_bit_mask)) { |
---|
| 306 | + return (TRUE); |
---|
| 307 | + } |
---|
| 308 | + } |
---|
| 309 | + |
---|
| 310 | + return (FALSE); |
---|
| 311 | +} |
---|
| 312 | + |
---|
268 | 313 | #endif /* !ACPI_REDUCED_HARDWARE */ |
---|