[PATCH 1/1] trace: conserve gd register on RISC-V

Heinrich Schuchardt xypron.glpk at gmx.de
Sat Oct 17 09:37:18 CEST 2020


An UEFI application may change the value of the register that gd lives in.
But some of our functions like get_ticks() access this register. So we
have to set the gd register to the U-Boot value when entering a trace
point and set it back to the application value when exiting the trace
point.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 lib/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/trace.c b/lib/trace.c
index 831283c283..defc9716d8 100644
--- a/lib/trace.c
+++ b/lib/trace.c
@@ -57,7 +57,7 @@ static inline uintptr_t __attribute__((no_instrument_function))
 	return offset / FUNC_SITE_SIZE;
 }

-#if defined(CONFIG_EFI_LOADER) && defined(CONFIG_ARM)
+#if defined(CONFIG_EFI_LOADER) && (defined(CONFIG_ARM) || defined(CONFIG_RISCV))

 /**
  * trace_gd - the value of the gd register
--
2.28.0



More information about the U-Boot mailing list