summaryrefslogtreecommitdiff
path: root/src/include/rmodule.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-02-27 22:50:12 -0600
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-03-22 00:13:42 +0100
commitdd4a6d2357decf0cf505370234b378985c68f97f (patch)
tree6c656e9d13fbc39a9a88766d9b3f533a98a9f89b /src/include/rmodule.h
parent24d1d4b47274eb82893e6726472a991a36fce0aa (diff)
downloadcoreboot-dd4a6d2357decf0cf505370234b378985c68f97f.tar.xz
coreboot: dynamic cbmem requirement
Dynamic cbmem is now a requirement for relocatable ramstage. This patch replaces the reserve_* fields in the romstage_handoff structure by using the dynamic cbmem library. The haswell code is not moved over in this commit, but it should be safe because there is a hard requirement for DYNAMIC_CBMEM when using a reloctable ramstage. Change-Id: I59ab4552c3ae8c2c3982df458cd81a4a9b712cc2 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/2849 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/include/rmodule.h')
-rw-r--r--src/include/rmodule.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/include/rmodule.h b/src/include/rmodule.h
index 2d8fc0fdc8..631c63d219 100644
--- a/src/include/rmodule.h
+++ b/src/include/rmodule.h
@@ -41,13 +41,15 @@ int rmodule_entry_offset(const struct rmodule *m);
int rmodule_memory_size(const struct rmodule *m);
int rmodule_load(void *loc, struct rmodule *m);
int rmodule_load_alignment(const struct rmodule *m);
-/* Returns the an aligned pointer that reflects a region used below addr
- * based on the rmodule_size. i.e. the returned pointer up to addr is memory
- * that may be utilized by the rmodule. program_start and rmodule_start
- * are pointers updated to reflect where the rmodule program starts and where
- * the rmodule (including header) should be placed respectively. */
-void *rmodule_find_region_below(void *addr, size_t rmodule_size,
- void **program_start, void **rmodule_start);
+/* rmodule_calc_region() calculates the region size, offset to place an
+ * rmodule in memory, and load address offset based off of a region allocator
+ * with an alignment of region_alignment. This function helps place an rmodule
+ * in the same location in ram it will run from. The offset to place the
+ * rmodule into the region allocated of size region_size is returned. The
+ * load_offset is the address to load and relocate the rmodule.
+ * region_alignment must be a power of 2. */
+int rmodule_calc_region(unsigned int region_alignment, size_t rmodule_size,
+ size_t *region_size, int *load_offset);
#define FIELD_ENTRY(x_) ((u32)&x_)
#define RMODULE_HEADER(entry_, type_) \