Add an enum for the riscv64 <sys/ucontext.h> register constants.

That lets us have idempotent #defines to reduce namespace pollution.

Bug: http://b/279405445
Test: treehugger
Change-Id: I00312cc8911025696cf0eea2d70e3219ab361613
This commit is contained in:
Elliott Hughes 2023-05-03 17:45:41 +00:00
parent 20fa28e564
commit 7fc63f2c9a

View file

@ -318,12 +318,20 @@ typedef struct ucontext {
#if defined(__USE_GNU)
#define REG_PC 0
#define REG_RA 1
#define REG_SP 2
#define REG_TP 4
#define REG_S0 8
#define REG_A0 10
enum {
REG_PC = 0,
#define REG_PC REG_PC
REG_RA = 1,
#define REG_RA REG_RA
REG_SP = 2,
#define REG_SP REG_SP
REG_TP = 4,
#define REG_TP REG_TP
REG_S0 = 8,
#define REG_S0 REG_S0
REG_A0 = 10,
#define REG_A0 REG_A0
};
#endif // defined(__USE_GNU)