acpigen: Add functions to generate _STA() and _PRW()
commitabe2de8854fe1d1ed2b836da3069470dd6b04d6c
authorDuncan Laurie <dlaurie@chromium.org>
Mon, 9 May 2016 18:08:46 +0000 (9 11:08 -0700)
committerDuncan Laurie <dlaurie@google.com>
Mon, 16 May 2016 17:55:59 +0000 (16 19:55 +0200)
tree6e1f96795733229984972ef8329a3785f51a5727
parentf7c3876c28634a70390edeb527c865516444e627
acpigen: Add functions to generate _STA() and _PRW()

Add helper functions for generating some common objects:

acpigen_write_STA(status) will generate a status method that will
indicate the device status as provided:
  Method (_STA) { Return (status) }

Full status byte configuration is possible and macros are provided for
the common status bytes used for generated code:
ACPI_STATUS_DEVICE_ALL_OFF = 0x0
ACPI_STATUS_DEVICE_ALL_ON  = 0xF

acpigen_write_PRW() will generate a Power Resoruce for Wake that describes
the GPE that will wake a particular device:
  Name (_PRW, Package (2) { wake, level }

Change-Id: I10277f0f3820d272d3975abf34b9a8de577782e5
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14795
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
src/arch/x86/acpigen.c
src/arch/x86/include/arch/acpigen.h