lib: sbi: Modify the boot time region flag prints
authorHimanshu Chauhan <hchauhan@ventanamicro.com>
Mon, 9 Jan 2023 05:20:39 +0000 (05:20 +0000)
committerAnup Patel <anup@brainfault.org>
Mon, 9 Jan 2023 12:34:19 +0000 (18:04 +0530)
With the finer permission semantics, the region access
permissions must be displayed separately for M and SU mode.

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Tested-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_domain.c

index b08d6e35a6941614e37e4856b3bb319c1501d1ba..60fda012d7b4f97622ae7be4270949ede4faf46f 100644 (file)
@@ -345,15 +345,25 @@ void sbi_domain_dump(const struct sbi_domain *dom, const char *suffix)
                           dom->index, i, suffix, rstart, rend);
 
                k = 0;
-               if (reg->flags & SBI_DOMAIN_MEMREGION_MMODE)
-                       sbi_printf("%cM", (k++) ? ',' : '(');
+
+               sbi_printf("M: ");
                if (reg->flags & SBI_DOMAIN_MEMREGION_MMIO)
                        sbi_printf("%cI", (k++) ? ',' : '(');
-               if (reg->flags & SBI_DOMAIN_MEMREGION_READABLE)
+               if (reg->flags & SBI_DOMAIN_MEMREGION_M_READABLE)
+                       sbi_printf("%cR", (k++) ? ',' : '(');
+               if (reg->flags & SBI_DOMAIN_MEMREGION_M_WRITABLE)
+                       sbi_printf("%cW", (k++) ? ',' : '(');
+               if (reg->flags & SBI_DOMAIN_MEMREGION_M_EXECUTABLE)
+                       sbi_printf("%cX", (k++) ? ',' : '(');
+               sbi_printf("%s ", (k++) ? ")" : "()");
+
+               k = 0;
+               sbi_printf("S/U: ");
+               if (reg->flags & SBI_DOMAIN_MEMREGION_SU_READABLE)
                        sbi_printf("%cR", (k++) ? ',' : '(');
-               if (reg->flags & SBI_DOMAIN_MEMREGION_WRITEABLE)
+               if (reg->flags & SBI_DOMAIN_MEMREGION_SU_WRITABLE)
                        sbi_printf("%cW", (k++) ? ',' : '(');
-               if (reg->flags & SBI_DOMAIN_MEMREGION_EXECUTABLE)
+               if (reg->flags & SBI_DOMAIN_MEMREGION_SU_EXECUTABLE)
                        sbi_printf("%cX", (k++) ? ',' : '(');
                sbi_printf("%s\n", (k++) ? ")" : "()");