|
2 | 2 | #ifndef _PERF_DWARF_REGS_H_
|
3 | 3 | #define _PERF_DWARF_REGS_H_
|
4 | 4 | #include "annotate.h"
|
| 5 | +#include <elf.h> |
| 6 | + |
| 7 | +#ifndef EM_AARCH64 |
| 8 | +#define EM_AARCH64 183 /* ARM 64 bit */ |
| 9 | +#endif |
| 10 | + |
| 11 | +#ifndef EM_CSKY |
| 12 | +#define EM_CSKY 252 /* C-SKY */ |
| 13 | +#endif |
| 14 | +#ifndef EF_CSKY_ABIV1 |
| 15 | +#define EF_CSKY_ABIV1 0X10000000 |
| 16 | +#endif |
| 17 | +#ifndef EF_CSKY_ABIV2 |
| 18 | +#define EF_CSKY_ABIV2 0X20000000 |
| 19 | +#endif |
| 20 | + |
| 21 | +#ifndef EM_LOONGARCH |
| 22 | +#define EM_LOONGARCH 258 /* LoongArch */ |
| 23 | +#endif |
| 24 | + |
| 25 | +/* EM_HOST gives the ELF machine for host, EF_HOST gives additional flags. */ |
| 26 | +#if defined(__x86_64__) |
| 27 | + #define EM_HOST EM_X86_64 |
| 28 | +#elif defined(__i386__) |
| 29 | + #define EM_HOST EM_386 |
| 30 | +#elif defined(__aarch64__) |
| 31 | + #define EM_HOST EM_AARCH64 |
| 32 | +#elif defined(__arm__) |
| 33 | + #define EM_HOST EM_ARM |
| 34 | +#elif defined(__alpha__) |
| 35 | + #define EM_HOST EM_ALPHA |
| 36 | +#elif defined(__arc__) |
| 37 | + #define EM_HOST EM_ARC |
| 38 | +#elif defined(__AVR__) |
| 39 | + #define EM_HOST EM_AVR |
| 40 | +#elif defined(__AVR32__) |
| 41 | + #define EM_HOST EM_AVR32 |
| 42 | +#elif defined(__bfin__) |
| 43 | + #define EM_HOST EM_BLACKFIN |
| 44 | +#elif defined(__csky__) |
| 45 | + #define EM_HOST EM_CSKY |
| 46 | + #if defined(__CSKYABIV2__) |
| 47 | + #define EF_HOST EF_CSKY_ABIV2 |
| 48 | + #else |
| 49 | + #define EF_HOST EF_CSKY_ABIV1 |
| 50 | + #endif |
| 51 | +#elif defined(__cris__) |
| 52 | + #define EM_HOST EM_CRIS |
| 53 | +#elif defined(__hppa__) // HP PA-RISC |
| 54 | + #define EM_HOST EM_PARISC |
| 55 | +#elif defined(__loongarch__) |
| 56 | + #define EM_HOST EM_LOONGARCH |
| 57 | +#elif defined(__mips__) |
| 58 | + #define EM_HOST EM_MIPS |
| 59 | +#elif defined(__m32r__) |
| 60 | + #define EM_HOST EM_M32R |
| 61 | +#elif defined(__microblaze__) |
| 62 | + #define EM_HOST EM_MICROBLAZE |
| 63 | +#elif defined(__MSP430__) |
| 64 | + #define EM_HOST EM_MSP430 |
| 65 | +#elif defined(__powerpc64__) |
| 66 | + #define EM_HOST EM_PPC64 |
| 67 | +#elif defined(__powerpc__) |
| 68 | + #define EM_HOST EM_PPC |
| 69 | +#elif defined(__riscv) |
| 70 | + #define EM_HOST EM_RISCV |
| 71 | +#elif defined(__s390x__) |
| 72 | + #define EM_HOST EM_S390 |
| 73 | +#elif defined(__sh__) |
| 74 | + #define EM_HOST EM_SH |
| 75 | +#elif defined(__sparc64__) || defined(__sparc__) |
| 76 | + #define EM_HOST EM_SPARC |
| 77 | +#elif defined(__xtensa__) |
| 78 | + #define EM_HOST EM_XTENSA |
| 79 | +#else |
| 80 | + /* Unknown host ELF machine type. */ |
| 81 | + #define EM_HOST EM_NONE |
| 82 | +#endif |
| 83 | + |
| 84 | +#if !defined(EF_HOST) |
| 85 | + #define EF_HOST 0 |
| 86 | +#endif |
5 | 87 |
|
6 | 88 | #define DWARF_REG_PC 0xd3af9c /* random number */
|
7 | 89 | #define DWARF_REG_FB 0xd3affb /* random number */
|
|
0 commit comments