diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-12-09 08:29:00 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-12-09 08:46:35 +0100 |
commit | 2ace85e0ef891874c808322c249615a460c0cd38 (patch) | |
tree | f1abb67274588e4983e6684065cb1195970a760c /include/bootsource.h | |
parent | 4fca6dbea1fa79b853c41a4d503d29778cbe6490 (diff) | |
download | barebox-2ace85e0ef891874c808322c249615a460c0cd38.tar.gz |
bootsource: export bootsource_to_string()
bootsource_str which translates enum bootsource to a string is not
exported to other parts of barebox. Define a new bootsource_to_string()
that provides access. This can be useful for board code debugging
prints, especially in PBL, where the $bootsource environment variable
is not available.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221209072900.3769403-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/bootsource.h')
-rw-r--r-- | include/bootsource.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/bootsource.h b/include/bootsource.h index 9ca4fcc525..381776a85a 100644 --- a/include/bootsource.h +++ b/include/bootsource.h @@ -20,6 +20,7 @@ enum bootsource { BOOTSOURCE_NET, BOOTSOURCE_CAN, BOOTSOURCE_JTAG, + BOOTSOURCE_MAX, }; #define BOOTSOURCE_INSTANCE_UNKNOWN -1 @@ -28,6 +29,7 @@ enum bootsource bootsource_get(void); int bootsource_get_instance(void); void bootsource_set_alias_name(const char *name); char *bootsource_get_alias_name(void); +const char *bootsource_to_string(enum bootsource src); const char *bootsource_get_alias_stem(enum bootsource bs); int bootsource_of_alias_xlate(enum bootsource bs, int instance); |