diff options
author | Simon Glass | 2022-07-30 15:52:19 -0600 |
---|---|---|
committer | Tom Rini | 2022-08-12 08:14:24 -0400 |
commit | 988cacaeedae920c13741c9ab2fc580f63a06c3a (patch) | |
tree | 5b2d7bc4a9a821179fd89658252469405f0cc747 /boot/bootmeth-uclass.c | |
parent | 10d16faa436c9f06bbcdeb6da35871a1b329b6b0 (diff) |
bootstd: Provide a bootmeth method to obtain state info
Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.
Add a new method for this, along with a sandbox test.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/bootmeth-uclass.c')
-rw-r--r-- | boot/bootmeth-uclass.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c index b8ba4eca7ab..1e276c0f26b 100644 --- a/boot/bootmeth-uclass.c +++ b/boot/bootmeth-uclass.c @@ -20,6 +20,16 @@ DECLARE_GLOBAL_DATA_PTR; +int bootmeth_get_state_desc(struct udevice *dev, char *buf, int maxsize) +{ + const struct bootmeth_ops *ops = bootmeth_get_ops(dev); + + if (!ops->get_state_desc) + return -ENOSYS; + + return ops->get_state_desc(dev, buf, maxsize); +} + int bootmeth_check(struct udevice *dev, struct bootflow_iter *iter) { const struct bootmeth_ops *ops = bootmeth_get_ops(dev); |