summaryrefslogtreecommitdiff
path: root/src/arch/i386/include
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2009-02-01 18:35:15 +0000
committerRudolf Marek <r.marek@assembler.cz>2009-02-01 18:35:15 +0000
commit293b5f52253ec0e5edb38e9f7113afc7e8f8ba6e (patch)
treed0ab38cd89f3ceace9ee3de1cddd6bb5d9acea1a /src/arch/i386/include
parent1c49bc9744c2e9044ddd1c8d20a1728f57eda85c (diff)
Following patch adds dynamic ACPI AML code generator which can be used to
generate run-time ACPI ASL code. Moreover it demonstrates its use on Asus M2V-MX SE where the SSDT table is generated by new function k8acpi_write_vars (technically similar to update_ssdt). But lot of nicer. x Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3925 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/i386/include')
-rw-r--r--src/arch/i386/include/arch/acpi.h3
-rw-r--r--src/arch/i386/include/arch/acpigen.h37
2 files changed, 40 insertions, 0 deletions
diff --git a/src/arch/i386/include/arch/acpi.h b/src/arch/i386/include/arch/acpi.h
index a71fb319f5..beb1d5f5b5 100644
--- a/src/arch/i386/include/arch/acpi.h
+++ b/src/arch/i386/include/arch/acpi.h
@@ -29,6 +29,7 @@ typedef unsigned long long u64;
#define MCFG_NAME "MCFG"
#define SRAT_NAME "SRAT"
#define SLIT_NAME "SLIT"
+#define SSDT_NAME "SSDT"
#define RSDT_TABLE "RSDT "
#define HPET_TABLE "AMD64 "
@@ -293,6 +294,8 @@ unsigned long write_acpi_tables(unsigned long addr);
unsigned long acpi_fill_madt(unsigned long current);
unsigned long acpi_fill_mcfg(unsigned long current);
unsigned long acpi_fill_srat(unsigned long current);
+unsigned long acpi_fill_ssdt_generator(unsigned long current, char *oem_table_id);
+void acpi_create_ssdt_generator(acpi_header_t *ssdt, char *oem_table_id);
void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs,void *dsdt);
/* These can be used by the target port */
diff --git a/src/arch/i386/include/arch/acpigen.h b/src/arch/i386/include/arch/acpigen.h
new file mode 100644
index 0000000000..710593c005
--- /dev/null
+++ b/src/arch/i386/include/arch/acpigen.h
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2009 Rudolf Marek <r.marek@assembler.cz>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License v2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef LIBACPI_H
+#define LIBACPI_H
+#include <assert.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+void acpigen_patch_len(int len);
+void acpigen_set_current(char *curr);
+char *acpigen_get_current(void);
+int acpigen_write_package(int nr_el);
+int acpigen_write_byte(unsigned int data);
+int acpigen_emit_byte(unsigned char data);
+int acpigen_emit_stream(char *data, int size);
+int acpigen_write_dword(unsigned int data);
+int acpigen_write_name(char *name);
+int acpigen_write_name_dword(char *name, uint32_t val);
+int acpigen_write_name_byte(char *name, uint8_t val);
+int acpigen_write_scope(char *name);
+#endif