File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
compiler-rt/lib/sanitizer_common Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2014,6 +2014,18 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
2014
2014
return Unknown;
2015
2015
return esr & ESR_ELx_WNR ? Write : Read;
2016
2016
# elif defined(__loongarch__)
2017
+ // In the musl environment, the Linux kernel uapi sigcontext.h is not
2018
+ // included in signal.h. To avoid missing the SC_ADDRERR_{RD,WR} macros,
2019
+ // copy them here. The LoongArch Linux kernel uapi is already stable,
2020
+ // so there's no need to worry about the value changing.
2021
+ # ifndef SC_ADDRERR_RD
2022
+ // Address error was due to memory load
2023
+ # define SC_ADDRERR_RD (1 << 30 )
2024
+ # endif
2025
+ # ifndef SC_ADDRERR_WR
2026
+ // Address error was due to memory store
2027
+ # define SC_ADDRERR_WR (1 << 31 )
2028
+ # endif
2017
2029
u32 flags = ucontext->uc_mcontext .__flags ;
2018
2030
if (flags & SC_ADDRERR_RD)
2019
2031
return SignalContext::Read;
You can’t perform that action at this time.
0 commit comments