summaryrefslogtreecommitdiff
path: root/src/lib/cbfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/cbfs.c')
-rw-r--r--src/lib/cbfs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 5a2f63f95d..19737a4192 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -187,6 +187,18 @@ size_t cbfs_boot_load_struct(const char *name, void *buf, size_t buf_size)
buf, buf_size, compression_algo);
}
+size_t cbfs_prog_stage_section(struct prog *pstage, uintptr_t *base)
+{
+ struct cbfs_stage stage;
+ const struct region_device *fh = prog_rdev(pstage);
+
+ if (rdev_readat(fh, &stage, 0, sizeof(stage)) != sizeof(stage))
+ return 0;
+
+ *base = (uintptr_t)stage.load;
+ return stage.memlen;
+}
+
int cbfs_prog_stage_load(struct prog *pstage)
{
struct cbfs_stage stage;