How to compile ACPICA to use only table functions

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
mrjbom
Member
Member
Posts: 317
Joined: Sun Jul 21, 2019 7:34 am

How to compile ACPICA to use only table functions

Post by mrjbom »

Hi.
I am trying to add ACPICA to my system, I have implemented the OSL functions described in the wiki, I have functions from the section "Environmental and ACPI Tables" and "Memory Management" and as far as I understand, the scheduler and synchronization functions are only needed for the full operation of ACPICA and I can already use the ACPICA table functions.

However, when compiling ACPICA refers to functions that I can't implement yet, can I use, for example, "#define" to make ACPICA compile only table functions?
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: How to compile ACPICA to use only table functions

Post by nexos »

I'm no ACPICA expert (I haven't ported it yet :D ), but create a stub for those functions that returns AE_ERROR.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: How to compile ACPICA to use only table functions

Post by bzt »

You don't need ACPICA to parse the tables. Here's an example (it does a little bit more than parsing the tables, it also searches AML bytecode to detect the IO ports for shutdown, but'll get the idea). Reading the ACPI tables is just a matter of defining some struct and casting memory.

Another great example how to use the ACPI tables without ACPICA is in OpenBSD. But that's a fully blown implementation, meaning also includes a minimal AML bytecode interpreter. I mean only check how it parses the tables, and don't mind the rest of the code.

Cheers,
bzt
User avatar
mrjbom
Member
Member
Posts: 317
Joined: Sun Jul 21, 2019 7:34 am

Re: How to compile ACPICA to use only table functions

Post by mrjbom »

bzt wrote:You don't need ACPICA to parse the tables. Here's an example (it does a little bit more than parsing the tables, it also searches AML bytecode to detect the IO ports for shutdown, but'll get the idea). Reading the ACPI tables is just a matter of defining some struct and casting memory.

Another great example how to use the ACPI tables without ACPICA is in OpenBSD. But that's a fully blown implementation, meaning also includes a minimal AML bytecode interpreter. I mean only check how it parses the tables, and don't mind the rest of the code.

Cheers,
bzt
As far as I understand, they only deal with tables, but I want to use other things in the future that only ACPICA provides.

In addition, I solved the question, ACPICA has a special #define that forces ACPICA not to compile unnecessary functions.
Thanks for answer!
Post Reply