summaryrefslogtreecommitdiff
path: root/src/arch/x86/acpigen.c
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2019-08-08 12:47:30 +0200
committerPatrick Rudolph <siro@das-labor.org>2019-12-12 13:16:57 +0000
commit32bae49435bc6eb2f590ad685ff63076c5c16436 (patch)
tree21cbe01250bf2e0a4f75161636124450250af599 /src/arch/x86/acpigen.c
parent9fe3d692c741a873317d0b1738b12145ff9c800e (diff)
downloadcoreboot-32bae49435bc6eb2f590ad685ff63076c5c16436.tar.xz
acpigen: Add methods for mutex operations
Tested on Linux 5.2: Dumped and decoded the ACPI tables using iasl. Change-Id: I79310b0f9e2297cf8428d11598935164caf95968 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37637 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/arch/x86/acpigen.c')
-rw-r--r--src/arch/x86/acpigen.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c
index 1d75889018..cc724a0cc1 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/arch/x86/acpigen.c
@@ -403,6 +403,37 @@ void acpigen_write_opregion(struct opregion *opreg)
acpigen_write_integer(opreg->regionlen);
}
+/*
+ * Generate ACPI AML code for Mutex
+ * Arg0: Pointer to name of mutex
+ * Arg1: Initial value of mutex
+ */
+void acpigen_write_mutex(const char *name, const uint8_t flags)
+{
+ /* MutexOp */
+ acpigen_emit_ext_op(MUTEX_OP);
+ /* NameString 4 chars only */
+ acpigen_emit_simple_namestring(name);
+ acpigen_emit_byte(flags);
+}
+
+void acpigen_write_acquire(const char *name, const uint16_t val)
+{
+ /* AcquireOp */
+ acpigen_emit_ext_op(ACQUIRE_OP);
+ /* NameString 4 chars only */
+ acpigen_emit_simple_namestring(name);
+ acpigen_emit_word(val);
+}
+
+void acpigen_write_release(const char *name)
+{
+ /* ReleaseOp */
+ acpigen_emit_ext_op(RELEASE_OP);
+ /* NameString 4 chars only */
+ acpigen_emit_simple_namestring(name);
+}
+
static void acpigen_write_field_length(uint32_t len)
{
uint8_t i, j;