summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-10-26 17:04:28 +0000
committerStefan Reinauer <stepan@openbios.org>2009-10-26 17:04:28 +0000
commit3b314023802c7429012e5f09652047e0b32fb97a (patch)
tree897ca57220eac3007d0864cc47205103b91417da /src/include
parenta769344d437d608a2e714a01cdb847a2a69d0826 (diff)
CBMEM high table memory manager.
This code adds a very simple toc based memory manager for the high tables area. The purpose of this code is to make it simpler and more reliable to find certain data structures in memory. This will also make it possible to have ACPI S3 Resume working without an ugly hole at 31MB. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4860 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cbmem.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/include/cbmem.h b/src/include/cbmem.h
new file mode 100644
index 0000000000..5048a5d1ff
--- /dev/null
+++ b/src/include/cbmem.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2009 coresystems GmbH
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * 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 _CBMEM_H_
+#define _CBMEM_H_
+
+/* Reserve 64k for ACPI and other tables */
+#define HIGH_MEMORY_TABLES ( 64 * 1024 )
+
+#if CONFIG_HAVE_ACPI_RESUME
+#define HIGH_MEMORY_SIZE ( 1024 * 1024 )
+#define HIGH_MEMORY_SAVE ( HIGH_MEMORY_SIZE - HIGH_MEMORY_TABLES )
+#else
+#define HIGH_MEMORY_SIZE HIGH_MEMORY_TABLES
+#endif
+
+#define CBMEM_ID_FREESPACE 0x46524545
+#define CBMEM_ID_GDT 0x4c474454
+#define CBMEM_ID_ACPI 0x41435049
+#define CBMEM_ID_CBTABLE 0x43425442
+#define CBMEM_ID_PIRQ 0x49525154
+#define CBMEM_ID_MPTABLE 0x534d5054
+#define CBMEM_ID_RESUME 0x5245534d
+#define CBMEM_ID_NONE 0x00000000
+
+void cbmem_initialize(void);
+
+void cbmem_init(u64 baseaddr, u64 size);
+int cbmem_reinit(u64 baseaddr);
+void *cbmem_add(u32 id, u64 size);
+void *cbmem_find(u32 id);
+
+#endif