summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/acpigen.c18
-rw-r--r--src/arch/x86/include/arch/acpigen.h3
2 files changed, 21 insertions, 0 deletions
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c
index a612149ef2..f274ea2177 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/arch/x86/acpigen.c
@@ -141,6 +141,12 @@ void acpigen_write_name_qword(const char *name, uint64_t val)
acpigen_write_qword(val);
}
+void acpigen_write_name_string(const char *name, const char *string)
+{
+ acpigen_write_name(name);
+ acpigen_write_string(string);
+}
+
void acpigen_emit_stream(const char *data, int size)
{
int i;
@@ -149,6 +155,18 @@ void acpigen_emit_stream(const char *data, int size)
}
}
+void acpigen_emit_string(const char *string)
+{
+ acpigen_emit_stream(string, string ? 0 : strlen(string));
+ acpigen_emit_byte('\0'); /* NUL */
+}
+
+void acpigen_write_string(const char *string)
+{
+ acpigen_emit_byte(0x0d);
+ acpigen_emit_string(string);
+}
+
/*
* The naming conventions for ACPI namespace names are a bit tricky as
* each element has to be 4 chars wide (»All names are a fixed 32 bits.«)
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index 9323475dfd..f718f51b25 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -32,12 +32,15 @@ void acpigen_emit_byte(unsigned char data);
void acpigen_emit_word(unsigned int data);
void acpigen_emit_dword(unsigned int data);
void acpigen_emit_stream(const char *data, int size);
+void acpigen_emit_string(const char *string);
void acpigen_emit_namestring(const char *namepath);
void acpigen_emit_eisaid(const char *eisaid);
void acpigen_write_word(unsigned int data);
void acpigen_write_dword(unsigned int data);
void acpigen_write_qword(uint64_t data);
+void acpigen_write_string(const char *string);
void acpigen_write_name(const char *name);
+void acpigen_write_name_string(const char *name, const char *string);
void acpigen_write_name_dword(const char *name, uint32_t val);
void acpigen_write_name_qword(const char *name, uint64_t val);
void acpigen_write_name_byte(const char *name, uint8_t val);