|
37 | 37 | # include <asm/ptrace.h>
|
38 | 38 | #endif
|
39 | 39 | #include <sys/user.h> // for user_regs_struct
|
40 |
| -#if SANITIZER_ANDROID && SANITIZER_MIPS |
41 |
| -# include <asm/reg.h> // for mips SP register in sys/user.h |
42 |
| -#endif |
43 |
| -#include <sys/wait.h> // for signal-related stuff |
44 |
| - |
45 |
| -#ifdef sa_handler |
46 |
| -# undef sa_handler |
47 |
| -#endif |
48 |
| - |
49 |
| -#ifdef sa_sigaction |
50 |
| -# undef sa_sigaction |
51 |
| -#endif |
52 |
| - |
53 |
| -#include "sanitizer_common.h" |
54 |
| -#include "sanitizer_flags.h" |
55 |
| -#include "sanitizer_libc.h" |
56 |
| -#include "sanitizer_linux.h" |
57 |
| -#include "sanitizer_mutex.h" |
58 |
| -#include "sanitizer_placement_new.h" |
| 40 | +# if SANITIZER_MIPS |
| 41 | +// clang-format off |
| 42 | +# include <asm/sgidefs.h> // <asm/sgidefs.h> must be included before <asm/reg.h> |
| 43 | +# include <asm/reg.h> // for mips SP register |
| 44 | +// clang-format on |
| 45 | +# endif |
| 46 | +# include <sys/wait.h> // for signal-related stuff |
| 47 | + |
| 48 | +# ifdef sa_handler |
| 49 | +# undef sa_handler |
| 50 | +# endif |
| 51 | + |
| 52 | +# ifdef sa_sigaction |
| 53 | +# undef sa_sigaction |
| 54 | +# endif |
| 55 | + |
| 56 | +# include "sanitizer_common.h" |
| 57 | +# include "sanitizer_flags.h" |
| 58 | +# include "sanitizer_libc.h" |
| 59 | +# include "sanitizer_linux.h" |
| 60 | +# include "sanitizer_mutex.h" |
| 61 | +# include "sanitizer_placement_new.h" |
59 | 62 |
|
60 | 63 | // Sufficiently old kernel headers don't provide this value, but we can still
|
61 | 64 | // call prctl with it. If the runtime kernel is new enough, the prctl call will
|
@@ -510,11 +513,7 @@ typedef pt_regs regs_struct;
|
510 | 513 |
|
511 | 514 | #elif defined(__mips__)
|
512 | 515 | typedef struct user regs_struct;
|
513 |
| -# if SANITIZER_ANDROID |
514 |
| -# define REG_SP regs[EF_R29] |
515 |
| -# else |
516 |
| -# define REG_SP regs[EF_REG29] |
517 |
| -# endif |
| 516 | +# define REG_SP regs[EF_R29] |
518 | 517 |
|
519 | 518 | #elif defined(__aarch64__)
|
520 | 519 | typedef struct user_pt_regs regs_struct;
|
|
0 commit comments