mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 10:19:04 +00:00
acpidump: add printfield() helper
Reviewed by: markj Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44634
This commit is contained in:
parent
29a6b72775
commit
969a4b8be5
|
@ -156,6 +156,18 @@ printflag(uint64_t var, uint64_t mask, const char *name)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
printfield(uint64_t var, int lbit, int hbit, const char *name)
|
||||
{
|
||||
uint64_t mask;
|
||||
int len;
|
||||
|
||||
len = hbit - lbit + 1;
|
||||
mask = ((1 << (len + 1)) - 1) << lbit;
|
||||
printf("%c%s=%#jx", pf_sep, name, (uintmax_t)((var & mask) >> lbit));
|
||||
pf_sep = ',';
|
||||
}
|
||||
|
||||
static void
|
||||
acpi_print_string(char *s, size_t length)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue