I have been looking over your ACPI code at https://github.com/omarrx024/lai/tree/master/src and https://omarrx024.github.io/docs/lai.html. The second URL has information about what the OS is to provide, namely, "acpi_scan()".
It looks like this function is suppose to return a "structure" filled with data such as:
Code: Select all
typedef struct acpi_aml_t { // AML tables, DSDT and SSDT
acpi_header_t header;
bit8u *data;
} acpi_aml_t;
This looks funny to me.
For example, if this is the case, the "acpi_scan()" function will only be called for the DSDT and SSDT tables. Then it is suppose to return the AML code at these two tables. Will the "acpi_scan()" function ever be called for something else?
Also, it doesn't look like your code ever frees the memory used by both the acpi_aml_t structure, nor the data pointed to by "data". Is this the responsibility of the caller?
I guess I am just wondering why your definition of "acpi_scan()" says the the signature can be any ACPI table, though your code assumes it will return a type of acpi_aml_t which is only beneficial to the DSDT and SSDT tables.
Would you please explain a little more?
Thank you,
Ben