From 1cb31580f850f346fd64fa96e6b998674145c72f Mon Sep 17 00:00:00 2001 From: Nelly Vouzoukidou Date: Tue, 7 Mar 2023 17:03:41 +0000 Subject: [PATCH] Guard registers definitions for riscv64 Guarding the definitions of registers with `#if definded(__USE_GNU)`. This resolves a name conflict with the mesa3d library when Virgl is enabled. Test: launch_cvd -console=true -guest_enforce_security=false\ --gpu_mode=drm_virgl Change-Id: I4402500eff74e26343700c099dd397b8a19a5ee3 --- libc/include/sys/ucontext.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libc/include/sys/ucontext.h b/libc/include/sys/ucontext.h index 8e5873d03..cefe17755 100644 --- a/libc/include/sys/ucontext.h +++ b/libc/include/sys/ucontext.h @@ -316,6 +316,8 @@ typedef struct ucontext { #define NGREG 32 +#if defined(__USE_GNU) + #define REG_PC 0 #define REG_RA 1 #define REG_SP 2 @@ -323,6 +325,8 @@ typedef struct ucontext { #define REG_S0 8 #define REG_A0 10 +#endif // defined(__USE_GNU) + typedef unsigned long __riscv_mc_gp_state[NGREG]; typedef unsigned long greg_t;