Patch Set 5:

Just a note as I have not looked at this in detail yet but some of these acpigen sequences are similar to ones I am adding helpers for: https://review.coreboot.org/c/coreboot/+/41985

Your use cases look a bit different and the functions might need different variants than what these use (string vs operator, etc) but it might be useful to see if any of the acpigen you are using could be similarly extracted.

If we had an acpi data type abstraction we could condense some of these multiple functions that all do the same thing with different data types...

Gotcha, will rebase and see if I can use some of those (the more the better).

Perhaps something like a tagged union of ACPI data types?
enum asl_type {
ASL_INTEGER,
ASL_BYTE,
ASL_STRING,
etc.
};
and struct asl_value {
enum asl_type type;
union {
you get the idea
};
};

View Change

To view, visit change 41894. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib30072d1d0748b31bcab240a0fd0e2f12d34aaa4
Gerrit-Change-Number: 41894
Gerrit-PatchSet: 5
Gerrit-Owner: Tim Wawrzynczak <twawrzynczak@chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie@chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub@google.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik@intel.com>
Gerrit-Reviewer: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Aaron Durbin <adurbin@chromium.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Comment-Date: Wed, 03 Jun 2020 21:01:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment