printk: print pointers on 64-bit properly
Needs a min-width of 16, not 8, for 64-bit. Some indentation oddities fixed. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
65e17a923f
commit
ec3aafbf78
2 changed files with 12 additions and 8 deletions
|
@ -219,12 +219,16 @@ void z_vprintk(out_func_t out, void *ctx, const char *fmt, va_list ap)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'p':
|
case 'p':
|
||||||
out('0', ctx);
|
out('0', ctx);
|
||||||
out('x', ctx);
|
out('x', ctx);
|
||||||
/* left-pad pointers with zeros */
|
/* left-pad pointers with zeros */
|
||||||
padding = PAD_ZERO_BEFORE;
|
padding = PAD_ZERO_BEFORE;
|
||||||
min_width = 8;
|
if (IS_ENABLED(CONFIG_64BIT)) {
|
||||||
/* Fall through */
|
min_width = 16;
|
||||||
|
} else {
|
||||||
|
min_width = 8;
|
||||||
|
}
|
||||||
|
/* Fall through */
|
||||||
case 'x':
|
case 'x':
|
||||||
case 'X': {
|
case 'X': {
|
||||||
unsigned long long x;
|
unsigned long long x;
|
||||||
|
|
|
@ -33,14 +33,14 @@ char *expected = "22 113 10000 32768 40000 22\n"
|
||||||
|
|
||||||
char *expected = "22 113 10000 32768 40000 22\n"
|
char *expected = "22 113 10000 32768 40000 22\n"
|
||||||
"p 112 -10000 -32768 -40000 -22\n"
|
"p 112 -10000 -32768 -40000 -22\n"
|
||||||
"0xcafebabe 0x0000beef\n"
|
"0xcafebabe 0x000000000000beef\n"
|
||||||
"0x1 0x01 0x0001 0x00000001 0x0000000000000001\n"
|
"0x1 0x01 0x0001 0x00000001 0x0000000000000001\n"
|
||||||
"0x1 0x 1 0x 1 0x 1\n"
|
"0x1 0x 1 0x 1 0x 1\n"
|
||||||
"42 42 0042 00000042\n"
|
"42 42 0042 00000042\n"
|
||||||
"-42 -42 -042 -0000042\n"
|
"-42 -42 -042 -0000042\n"
|
||||||
"42 42 42 42\n"
|
"42 42 42 42\n"
|
||||||
"42 42 0042 00000042\n"
|
"42 42 0042 00000042\n"
|
||||||
"255 42 abcdef 0x0000002a 42\n"
|
"255 42 abcdef 0x000000000000002a 42\n"
|
||||||
"68719476735 -1 18446744073709551615 ffffffffffffffff\n"
|
"68719476735 -1 18446744073709551615 ffffffffffffffff\n"
|
||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue