summaryrefslogtreecommitdiffstats
path: root/src/include/fmap.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-03-28 23:56:22 -0500
committerAaron Durbin <adurbin@chromium.org>2015-05-26 22:33:53 +0200
commit0424c95a6dafdb65070538d6c5aa394b75eb9850 (patch)
treef5bd9f485a1a44eece1662a29c1435a44ab5c58a /src/include/fmap.h
parentb6981c0f9c4ce89c4209c14fb326a414096f2ff1 (diff)
downloadcoreboot-0424c95a6dafdb65070538d6c5aa394b75eb9850.tar.gz
coreboot-0424c95a6dafdb65070538d6c5aa394b75eb9850.tar.bz2
coreboot-0424c95a6dafdb65070538d6c5aa394b75eb9850.zip
fmap: new API using region_device
Instead of being pointer based use the region infrastrucutre. Additionally, this removes the need for arch-specific compilation paths. The users of the new API can use the region APIs to memory map or read the region provided by the new fmap API. Change-Id: Ie36e9ff9cb554234ec394b921f029eeed6845aee Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/9170 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/include/fmap.h')
-rw-r--r--src/include/fmap.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/include/fmap.h b/src/include/fmap.h
new file mode 100644
index 000000000000..e575bbf3fc95
--- /dev/null
+++ b/src/include/fmap.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 Google Inc.
+ *
+ * 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.
+ */
+
+#ifndef _FMAP_H_
+#define _FMAP_H_
+
+#include <region.h>
+
+/* Locate the named area in the fmap and fill in a region device representing
+ * that area. The region is a sub-region of the readonly boot media. Return
+ * 0 on success, < 0 on error. */
+int fmap_locate_area_as_rdev(const char *name, struct region_device *area);
+
+/* Locate the named area in the fmap and fill in a region with the
+ * offset and size of that area within the boot media. Return 0 on success,
+ * < 0 on error. */
+int fmap_locate_area(const char *name, struct region *r);
+
+#endif