acpigen: Add ability to auto-generate _DSM Function 0

Since the value returned by _DSM function 0 for a given UUID is trivial
to calculate, add the ability to do so to the
acpigen_write_dsm() functions.

Change-Id: Id9be050442485b42202cf91649aa94e56f35032a
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56459
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Tim Wawrzynczak
2021-07-14 15:56:57 -06:00
parent e2b8f30bee
commit d96f3a25b4
2 changed files with 50 additions and 4 deletions

View File

@@ -441,11 +441,14 @@ void acpigen_write_create_qword_field(uint8_t op, size_t byte_offset, const char
* This function takes as input uuid for the device, set of callbacks and
* argument to pass into the callbacks. Callbacks should ensure that Local0 and
* Local1 are left untouched. Use of Local2-Local7 is permitted in callbacks.
* If the first callback is NULL, then a default implementation of Function 0
* will be autogenerated, returning a package of bits corresponding to the
* function callbacks that are non-NULL.
*/
void acpigen_write_dsm(const char *uuid, void (**callbacks)(void *),
size_t count, void *arg);
void acpigen_write_dsm_uuid_arr(struct dsm_uuid *ids, size_t count);
void acpigen_write_dsm_uuid_arr(struct dsm_uuid *ids, size_t count);
/*
* Generate ACPI AML code for _CPC (Continuous Performance Control).
* Execute the package function once to create a global table, then