Re: Help on ACPI events reported to OS


Laszlo Ersek
 

+Igor, some comments below

On 07/27/20 10:15, Kumar G wrote:
Hi Experts,

I am moving from device tree world to acpi. I found the event notification
feature of acpi table interesting.

I have some questions over notification
- Is some hardware can generate events and notify OS by its own ?(if yes ,
please help me how) , I mean without calling any method from OS

- I may be wrong, but it looks OS needs to call a method in order to
execution of Notify function of acpi table
My (rusty) understanding is that hardware signals the OS with "general
purpose IO" and/or SCI (ACPI) interrupt. Then the OS invokes General
Purpose Event handlers (GPE handlers) from ACPI. In turn the GPE
handlers in ACPI parse the event, and invoke the proper OS functionality
via Notify().

So basically the hardware only tells the OS via SCI that "something ACPI
happened". The OS passes this to ACPI for handling (GPE handlers), which
in turn dispatch the event back to the proper OS handler, via Notify().

- Is this correct acpi tables are static piece of code, having no
thread/execution context, All execution in done from OS
No, this is not correct. AML methods can run in parallel, they can (and
need to) do explicit locking (there are ASL primitives for this). AML
methods have local variables, but they also operate on global objects in
the ACPI namespace (operation regions, device registers, ...) so
serialization in ACPI is important, if multiple hardware events can
occur concurrently.

Thanks
Laszlo



Thanks
Kumar G



Join discuss@edk2.groups.io to automatically receive all group messages.