diff options
author | Dean Michael Berris <dberris@google.com> | 2016-09-20 14:35:57 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2016-09-20 14:35:57 +0000 |
commit | d1617cdc492adf585551db5e3881dffb00e3ee20 (patch) | |
tree | a88f21c1a6e8171bc1121c1b12bc00ee0e9ad7e5 /compiler-rt/lib/xray/xray_interface_internal.h | |
parent | e2fd4b107cd9cb0f40c5786d8229bd5f24802046 (diff) | |
download | bcm5719-llvm-d1617cdc492adf585551db5e3881dffb00e3ee20.tar.gz bcm5719-llvm-d1617cdc492adf585551db5e3881dffb00e3ee20.zip |
[XRay] ARM 32-bit no-Thumb support in compiler-rt
This is a port of XRay to ARM 32-bit, without Thumb support yet.
This is one of 3 commits to different repositories of XRay ARM port. The other 2 are:
https://reviews.llvm.org/D23931 (LLVM)
https://reviews.llvm.org/D23932 (Clang test)
Differential Revision: https://reviews.llvm.org/D23933
llvm-svn: 281971
Diffstat (limited to 'compiler-rt/lib/xray/xray_interface_internal.h')
-rw-r--r-- | compiler-rt/lib/xray/xray_interface_internal.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler-rt/lib/xray/xray_interface_internal.h b/compiler-rt/lib/xray/xray_interface_internal.h index 6208c110e6d..3465b67d51c 100644 --- a/compiler-rt/lib/xray/xray_interface_internal.h +++ b/compiler-rt/lib/xray/xray_interface_internal.h @@ -16,18 +16,30 @@ #define XRAY_INTERFACE_INTERNAL_H #include "xray/xray_interface.h" +#include "sanitizer_common/sanitizer_platform.h" #include <cstddef> #include <cstdint> extern "C" { struct XRaySledEntry { +#if SANITIZER_WORDSIZE == 64 uint64_t Address; uint64_t Function; unsigned char Kind; unsigned char AlwaysInstrument; unsigned char Padding[14]; // Need 32 bytes +#elif SANITIZER_WORDSIZE == 32 + uint32_t Address; + uint32_t Function; + unsigned char Kind; + unsigned char AlwaysInstrument; + unsigned char Padding[6]; // Need 16 bytes +#else + #error "Unsupported word size." +#endif }; + } namespace __xray { @@ -37,6 +49,16 @@ struct XRaySledMap { size_t Entries; }; +bool patchFunctionEntry(const bool Enable, const uint32_t FuncId, const XRaySledEntry& Sled); +bool patchFunctionExit(const bool Enable, const uint32_t FuncId, const XRaySledEntry& Sled); + } // namespace __xray +extern "C" { +// The following functions have to be defined in assembler, on a per-platform +// basis. See xray_trampoline_*.S files for implementations. +extern void __xray_FunctionEntry(); +extern void __xray_FunctionExit(); +} + #endif |