@@ -1825,7 +1825,7 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1825
1825
#else
1826
1826
uptr err = ucontext->uc_mcontext .gregs [REG_ERR];
1827
1827
#endif // SANITIZER_FREEBSD
1828
- return err & PF_WRITE ? WRITE : READ ;
1828
+ return err & PF_WRITE ? Write : Read ;
1829
1829
#elif defined(__mips__)
1830
1830
uint32_t *exception_source;
1831
1831
uint32_t faulty_instruction;
@@ -1848,7 +1848,7 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1848
1848
case 0x2a : // swl
1849
1849
case 0x2e : // swr
1850
1850
#endif
1851
- return SignalContext::WRITE ;
1851
+ return SignalContext::Write ;
1852
1852
1853
1853
case 0x20 : // lb
1854
1854
case 0x24 : // lbu
@@ -1863,27 +1863,27 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1863
1863
case 0x22 : // lwl
1864
1864
case 0x26 : // lwr
1865
1865
#endif
1866
- return SignalContext::READ ;
1866
+ return SignalContext::Read ;
1867
1867
#if __mips_isa_rev == 6
1868
1868
case 0x3b : // pcrel
1869
1869
op_code = (faulty_instruction >> 19 ) & 0x3 ;
1870
1870
switch (op_code) {
1871
1871
case 0x1 : // lwpc
1872
1872
case 0x2 : // lwupc
1873
- return SignalContext::READ ;
1873
+ return SignalContext::Read ;
1874
1874
}
1875
1875
#endif
1876
1876
}
1877
- return SignalContext::UNKNOWN ;
1877
+ return SignalContext::Unknown ;
1878
1878
#elif defined(__arm__)
1879
1879
static const uptr FSR_WRITE = 1U << 11 ;
1880
1880
uptr fsr = ucontext->uc_mcontext .error_code ;
1881
- return fsr & FSR_WRITE ? WRITE : READ ;
1881
+ return fsr & FSR_WRITE ? Write : Read ;
1882
1882
#elif defined(__aarch64__)
1883
1883
static const u64 ESR_ELx_WNR = 1U << 6 ;
1884
1884
u64 esr;
1885
- if (!Aarch64GetESR (ucontext, &esr)) return UNKNOWN ;
1886
- return esr & ESR_ELx_WNR ? WRITE : READ ;
1885
+ if (!Aarch64GetESR (ucontext, &esr)) return Unknown ;
1886
+ return esr & ESR_ELx_WNR ? Write : Read ;
1887
1887
#elif defined(__sparc__)
1888
1888
// Decode the instruction to determine the access type.
1889
1889
// From OpenSolaris $SRC/uts/sun4/os/trap.c (get_accesstype).
@@ -1899,7 +1899,7 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1899
1899
#endif
1900
1900
#endif
1901
1901
u32 instr = *(u32 *)pc;
1902
- return (instr >> 21 ) & 1 ? WRITE: READ ;
1902
+ return (instr >> 21 ) & 1 ? Write: Read ;
1903
1903
#elif defined(__riscv)
1904
1904
#if SANITIZER_FREEBSD
1905
1905
unsigned long pc = ucontext->uc_mcontext .mc_gpregs .gp_sepc ;
@@ -1919,7 +1919,7 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1919
1919
#if __riscv_xlen == 64
1920
1920
case 0b10'011 : // c.ldsp (rd != x0)
1921
1921
#endif
1922
- return rd ? SignalContext::READ : SignalContext::UNKNOWN ;
1922
+ return rd ? SignalContext::Read : SignalContext::Unknown ;
1923
1923
case 0b00'010 : // c.lw
1924
1924
#if __riscv_flen >= 32 && __riscv_xlen == 32
1925
1925
case 0b10'011 : // c.flwsp
@@ -1931,7 +1931,7 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1931
1931
case 0b00'001 : // c.fld
1932
1932
case 0b10'001 : // c.fldsp
1933
1933
#endif
1934
- return SignalContext::READ ;
1934
+ return SignalContext::Read ;
1935
1935
case 0b00'110 : // c.sw
1936
1936
case 0b10'110 : // c.swsp
1937
1937
#if __riscv_flen >= 32 || __riscv_xlen == 64
@@ -1942,9 +1942,9 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1942
1942
case 0b00'101 : // c.fsd
1943
1943
case 0b10'101 : // c.fsdsp
1944
1944
#endif
1945
- return SignalContext::WRITE ;
1945
+ return SignalContext::Write ;
1946
1946
default :
1947
- return SignalContext::UNKNOWN ;
1947
+ return SignalContext::Unknown ;
1948
1948
}
1949
1949
}
1950
1950
#endif
@@ -1962,9 +1962,9 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1962
1962
#endif
1963
1963
case 0b100 : // lbu
1964
1964
case 0b101 : // lhu
1965
- return SignalContext::READ ;
1965
+ return SignalContext::Read ;
1966
1966
default :
1967
- return SignalContext::UNKNOWN ;
1967
+ return SignalContext::Unknown ;
1968
1968
}
1969
1969
case 0b0100011 : // stores
1970
1970
switch (funct3) {
@@ -1974,9 +1974,9 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1974
1974
#if __riscv_xlen == 64
1975
1975
case 0b011 : // sd
1976
1976
#endif
1977
- return SignalContext::WRITE ;
1977
+ return SignalContext::Write ;
1978
1978
default :
1979
- return SignalContext::UNKNOWN ;
1979
+ return SignalContext::Unknown ;
1980
1980
}
1981
1981
#if __riscv_flen >= 32
1982
1982
case 0b0000111 : // floating-point loads
@@ -1985,27 +1985,27 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
1985
1985
#if __riscv_flen == 64
1986
1986
case 0b011 : // fld
1987
1987
#endif
1988
- return SignalContext::READ ;
1988
+ return SignalContext::Read ;
1989
1989
default :
1990
- return SignalContext::UNKNOWN ;
1990
+ return SignalContext::Unknown ;
1991
1991
}
1992
1992
case 0b0100111 : // floating-point stores
1993
1993
switch (funct3) {
1994
1994
case 0b010 : // fsw
1995
1995
#if __riscv_flen == 64
1996
1996
case 0b011 : // fsd
1997
1997
#endif
1998
- return SignalContext::WRITE ;
1998
+ return SignalContext::Write ;
1999
1999
default :
2000
- return SignalContext::UNKNOWN ;
2000
+ return SignalContext::Unknown ;
2001
2001
}
2002
2002
#endif
2003
2003
default :
2004
- return SignalContext::UNKNOWN ;
2004
+ return SignalContext::Unknown ;
2005
2005
}
2006
2006
#else
2007
2007
(void )ucontext;
2008
- return UNKNOWN ; // FIXME: Implement.
2008
+ return Unknown ; // FIXME: Implement.
2009
2009
#endif
2010
2010
}
2011
2011
0 commit comments