]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
kern/ieee1275/ieee1275: Display successful memory claims when debugging
authorStefan Berger <stefanb@linux.ibm.com>
Thu, 30 Nov 2023 14:17:22 +0000 (09:17 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 5 Dec 2023 13:43:15 +0000 (14:43 +0100)
Display successful memory claims with exact address and rounded-down
MiB location and rounded-up size in MiB.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Pavithra Prakash <pavrampu@in.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Carolyn Scherrer <cpscherr@us.ibm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
grub-core/kern/ieee1275/ieee1275.c
include/grub/powerpc/ieee1275/ieee1275.h
include/grub/sparc64/ieee1275/ieee1275.h

index db870db472c2f139667ba9b50b4c7f24825827f9..36ca2dbfc76ab8dd4e2dfccb03b534107a61e37e 100644 (file)
@@ -590,6 +590,9 @@ grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align,
     *result = args.base;
   if (args.base == IEEE1275_CELL_INVALID)
     return -1;
+  grub_dprintf ("mmap", "CLAIMED: 0x%" PRIxGRUB_IEEE1275_CELL_T " (%"
+               PRIuGRUB_IEEE1275_CELL_T " MiB)  size: %" PRIuGRUB_SIZE " MiB\n",
+               args.base, args.base >> 20, ALIGN_UP (size, 1 << 20) >> 20);
   return 0;
 }
 
index 3c7683fad2af94bf79e6f2db3273bd2451bcb9f5..4eb20701881e2146c11e5af20c4b2b19880758bc 100644 (file)
@@ -25,4 +25,7 @@
 #define GRUB_IEEE1275_CELL_SIZEOF 4
 typedef grub_uint32_t grub_ieee1275_cell_t;
 
+#define PRIxGRUB_IEEE1275_CELL_T       PRIxGRUB_UINT32_T
+#define PRIuGRUB_IEEE1275_CELL_T       PRIuGRUB_UINT32_T
+
 #endif /* ! GRUB_IEEE1275_MACHINE_HEADER */
index 4b18468d8d654bb3fe62050e7a4f439e1544889c..ccc71aac6695ca8e2e2ebfc6329b0a6d06dd133b 100644 (file)
@@ -25,6 +25,9 @@
 #define GRUB_IEEE1275_CELL_SIZEOF 8
 typedef grub_uint64_t grub_ieee1275_cell_t;
 
+#define PRIxGRUB_IEEE1275_CELL_T       PRIxGRUB_UINT64_T
+#define PRIuGRUB_IEEE1275_CELL_T       PRIuGRUB_UINT64_T
+
 /* Encoding of 'mode' argument to grub_ieee1275_map_physical() */
 #define IEEE1275_MAP_WRITE     0x0001 /* Writable */
 #define IEEE1275_MAP_READ      0x0002 /* Readable */