Improve progress print

This commit is contained in:
Rodrigo Arias Mallo 2024-08-21 09:31:09 +02:00
parent 1faef5b452
commit fd2b766760

View File

@ -1,5 +1,5 @@
diff --git a/lib/sbi/sbi_irqchip.c b/lib/sbi/sbi_irqchip.c diff --git a/lib/sbi/sbi_irqchip.c b/lib/sbi/sbi_irqchip.c
index 0ae604a..11656e0 100644 index 0ae604a..44601a4 100644
--- a/lib/sbi/sbi_irqchip.c --- a/lib/sbi/sbi_irqchip.c
+++ b/lib/sbi/sbi_irqchip.c +++ b/lib/sbi/sbi_irqchip.c
@@ -9,6 +9,9 @@ @@ -9,6 +9,9 @@
@ -25,7 +25,7 @@ index 0ae604a..11656e0 100644
return 0; return 0;
} }
@@ -47,8 +52,152 @@ void sbi_irqchip_exit(struct sbi_scratch *scratch) @@ -47,8 +52,151 @@ void sbi_irqchip_exit(struct sbi_scratch *scratch)
{ {
const struct sbi_platform *plat = sbi_platform_ptr(scratch); const struct sbi_platform *plat = sbi_platform_ptr(scratch);
@ -84,13 +84,12 @@ index 0ae604a..11656e0 100644
+static int supervisor_mode_code(void) +static int supervisor_mode_code(void)
+{ +{
+ sbi_printf("Hello from supervisor, waiting for interrupt\n"); + sbi_printf("Hello from supervisor, waiting for interrupt\n");
+ int count = 0; + int i = 0;
+ char *s = "-\\|/";
+ while (1) { + while (1) {
+ if (count == 10000) { + sbi_printf("\r%c", s[i++]);
+ sbi_printf("."); + if (i >= 4)
+ count = 0; + i = 0;
+ }
+ count++;
+ } + }
+ return 0; + return 0;
+} +}