diff options
author | Aaron Durbin <adurbin@chromium.org> | 2013-10-24 10:14:06 -0500 |
---|---|---|
committer | Aaron Durbin <adurbin@google.com> | 2014-01-28 22:29:42 +0100 |
commit | f545abfd22a594ecb9c0678efa5278bb38a37a70 (patch) | |
tree | 60c77bc89c52293a316acc2fba2da3897ebeaea2 /src/include | |
parent | 16000c883ee121b82b943c613ab1ae6a5ed7e01c (diff) |
rmodule: consolidate rmodule stage loading
There are 3 places rmodule stages are loaded in the
existing code: cbfs and 2 in vboot_wrapper. Much of the
code is the same except for a few different cbmem entry
ids. Instead provide a common implementation in the
rmodule library itself.
A structure named rmod_stage_load is introduced to manage
the inputs and outputs from the new API.
BUG=chrome-os-partner:22866
BRANCH=None
TEST=Built and booted successfully.
Change-Id: I146055005557e04164e95de4aae8a2bde8713131
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174425
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/4897
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/rmodule.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/rmodule.h b/src/include/rmodule.h index 247711a0ae..41da3a9d2d 100644 --- a/src/include/rmodule.h +++ b/src/include/rmodule.h @@ -79,6 +79,26 @@ int rmodule_calc_region(unsigned int region_alignment, size_t rmodule_size, __attribute__ ((section (".module_header"))) = \ RMODULE_HEADER(entry_, type_) +/* Support for loading rmodule stages. This API is only available when + * using dynamic cbmem because it uses the dynamic cbmem API to obtain + * the backing store region for the stage. */ +#if CONFIG_DYNAMIC_CBMEM +struct cbfs_stage; +struct cbmem_entry; + +struct rmod_stage_load { + /* Inputs */ + uint32_t cbmem_id; + const char *name; + /* Outputs */ + const struct cbmem_entry *cbmem_entry; + void *entry; +}; + +/* Both of the following functions return 0 on success, -1 on error. */ +int rmodule_stage_load(struct rmod_stage_load *rsl, struct cbfs_stage *stage); +int rmodule_stage_load_from_cbfs(struct rmod_stage_load *rsl); +#endif /* Private data structures below should not be used directly. */ |