[coreboot-gerrit] Change in coreboot[master]: lib/prog_loaders: Store CBFS type in struct prog
Patrick Rudolph (Code Review)
gerrit at coreboot.org
Thu May 3 11:40:30 CEST 2018
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/26028
Change subject: lib/prog_loaders: Store CBFS type in struct prog
......................................................................
lib/prog_loaders: Store CBFS type in struct prog
Store the type of the loaded program after locating the file and add a
method to retrieve the type.
Will be used to distinguish between SELF and FIT payloads.
Change-Id: Ic226e7e028d722ab9e3c6f7f1c22bde2a1cd8a85
Signed-off-by: Patrick Rudolph <patrick.rudolph at 9elements.com>
---
M src/include/program_loading.h
M src/lib/prog_loaders.c
2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/26028/1
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index 416e2e9..5eeef53 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -58,6 +58,7 @@
* payload. For architectures that use a bounce buffer
* then it would represent the bounce buffer. */
enum prog_type type;
+ uint32_t cbfs_type;
const char *name;
struct region_device rdev;
/* Entry to program with optional argument. It's up to the architecture
@@ -82,6 +83,11 @@
return prog->type;
}
+static inline uint32_t prog_cbfs_type(const struct prog *prog)
+{
+ return prog->cbfs_type;
+}
+
static inline struct region_device *prog_rdev(struct prog *prog)
{
return &prog->rdev;
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index 8a6d6af..04b573e 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -44,6 +44,8 @@
if (cbfs_boot_locate(&file, prog_name(prog), NULL))
return -1;
+ cbfsf_file_type(&file, &prog->cbfs_type);
+
cbfs_file_data(prog_rdev(prog), &file);
return 0;
--
To view, visit https://review.coreboot.org/26028
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic226e7e028d722ab9e3c6f7f1c22bde2a1cd8a85
Gerrit-Change-Number: 26028
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph at 9elements.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180503/b292359c/attachment-0001.html>
More information about the coreboot-gerrit
mailing list