xlat: introduce XLAT_STYLE_FMT_D
As there are some possible users for it, apparently. * defs.h (XLAT_STYLE_FORMAT_MASK): Update the value in order to accommodate XLAT_STYLE_FMT_D. (enum xlat_style) <XLAT_STYLE_FMT_D>: New enumeration entity. (printxval64_d, printxval_d): New function, a shorthand for printxvals_ex with a single xlat and XLAT_STYLE_FMT_D xlat style. * xlat.c (sprint_xlat_val): Handle XLAT_STYLE_FMT_D.
This commit is contained in:
parent
d451b0e283
commit
78be7e9d8a
15
defs.h
15
defs.h
@ -587,7 +587,7 @@ extern void printaddr(kernel_ulong_t addr);
|
||||
|
||||
#define XLAT_STYLE_VERBOSITY_MASK (XLAT_STYLE_RAW | XLAT_STYLE_ABBREV)
|
||||
#define XLAT_STYLE_FORMAT_SHIFT 2
|
||||
#define XLAT_STYLE_FORMAT_MASK (1 << XLAT_STYLE_FORMAT_SHIFT)
|
||||
#define XLAT_STYLE_FORMAT_MASK (3 << XLAT_STYLE_FORMAT_SHIFT)
|
||||
|
||||
enum xlat_style {
|
||||
/**
|
||||
@ -610,6 +610,7 @@ enum xlat_style {
|
||||
|
||||
XLAT_STYLE_FMT_X = 0 << XLAT_STYLE_FORMAT_SHIFT,
|
||||
XLAT_STYLE_FMT_U = 1 << XLAT_STYLE_FORMAT_SHIFT,
|
||||
XLAT_STYLE_FMT_D = 2 << XLAT_STYLE_FORMAT_SHIFT,
|
||||
};
|
||||
|
||||
extern enum xlat_style xlat_verbosity;
|
||||
@ -866,6 +867,18 @@ printxval_u(const struct xlat *x, const unsigned int val, const char *dflt)
|
||||
return printxvals_ex(val, dflt, XLAT_STYLE_FMT_U, x, NULL);
|
||||
}
|
||||
|
||||
static inline int
|
||||
printxval64_d(const struct xlat *x, const int64_t val, const char *dflt)
|
||||
{
|
||||
return printxvals_ex(val, dflt, XLAT_STYLE_FMT_D, x, NULL);
|
||||
}
|
||||
|
||||
static inline int
|
||||
printxval_d(const struct xlat *x, const int val, const char *dflt)
|
||||
{
|
||||
return printxvals_ex(val, dflt, XLAT_STYLE_FMT_D, x, NULL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr,
|
||||
enum iov_decode decode_iov)
|
||||
|
Loading…
x
Reference in New Issue
Block a user