display_options: Support printing a 32-bit value
On 64-bit machines we don't always want to show 16 hex digits, particularly if the value is 32-bit. Add a new function to show a 32-bit value. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -104,6 +104,7 @@ char *display_options_get_banner_priv(bool newlines, const char *build_tag,
|
||||
/* Print a numeric value (for use in arch_print_bdinfo()) */
|
||||
void lprint_num_l(const char *name, ulong value);
|
||||
void lprint_num_ll(const char *name, unsigned long long value);
|
||||
void lprint_num_32(const char *name, u32 value);
|
||||
|
||||
/* Print a string value (for use in arch_print_bdinfo()) */
|
||||
void lprint_str(const char *name, const char *str);
|
||||
|
||||
@@ -263,3 +263,8 @@ void lprint_num_ll(const char *name, unsigned long long value)
|
||||
{
|
||||
printf("%-12s= 0x%.*llx\n", name, 2 * (int)sizeof(ulong), value);
|
||||
}
|
||||
|
||||
void lprint_num_32(const char *name, u32 value)
|
||||
{
|
||||
printf("%-12s= 0x%08x\n", name, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user