From 09e01d5dd7ae21e979177b64d88141a12763a8ee Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 16 Oct 2020 06:50:02 -0700 Subject: [PATCH] npdm: fix display of address/size for mmio --- npdm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npdm.c b/npdm.c index 8457ec5..235dd62 100644 --- a/npdm.c +++ b/npdm.c @@ -304,7 +304,7 @@ void kac_print(const uint32_t *descriptors, uint32_t num_descriptors) { break; case 6: /* Map IO/Normal. */ cur_mmio = calloc(1, sizeof(kac_mmio_t)); - cur_mmio->address = (desc & 0xFFFFFF) << 12; + cur_mmio->address = (uint64_t)(desc & 0xFFFFFF) << 12; cur_mmio->is_ro = desc >> 24; if (i == num_descriptors - 1) { fprintf(stderr, "Error: Invalid Kernel Access Control Descriptors!\n"); @@ -316,7 +316,7 @@ void kac_print(const uint32_t *descriptors, uint32_t num_descriptors) { exit(EXIT_FAILURE); } desc >>= 7; - cur_mmio->size = (desc & 0xFFFFFF) << 12; + cur_mmio->size = (uint64_t)(desc & 0xFFFFFF) << 12; cur_mmio->is_norm = desc >> 24; kac_add_mmio(&kac, cur_mmio); break;