diff options
author | br <br@FreeBSD.org> | 2015-07-01 13:59:26 +0000 |
---|---|---|
committer | br <br@FreeBSD.org> | 2015-07-01 13:59:26 +0000 |
commit | 3f083caafbe86f3e62d009c9bcfa224deae3797c (patch) | |
tree | df641c79945fd22332a00f95edb13412b05c5f8e /lib/libproc/proc_bkpt.c | |
parent | 3b0892b24966b6ee840e58fd31aa5b8bd82d0481 (diff) | |
download | FreeBSD-src-3f083caafbe86f3e62d009c9bcfa224deae3797c.zip FreeBSD-src-3f083caafbe86f3e62d009c9bcfa224deae3797c.tar.gz |
Make libproc compilable on AArch64.
Diffstat (limited to 'lib/libproc/proc_bkpt.c')
-rw-r--r-- | lib/libproc/proc_bkpt.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/libproc/proc_bkpt.c b/lib/libproc/proc_bkpt.c index 1e4a6cc..50d8a9d 100644 --- a/lib/libproc/proc_bkpt.c +++ b/lib/libproc/proc_bkpt.c @@ -42,18 +42,24 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include "_libproc.h" -#if defined(__i386__) || defined(__amd64__) -#define BREAKPOINT_INSTR 0xcc /* int 0x3 */ +#if defined(__aarch64__) +#define AARCH64_BRK 0xd4200000 +#define AARCH64_BRK_IMM16_SHIFT 5 +#define AARCH64_BRK_IMM16_VAL (0xd << AARCH64_BRK_IMM16_SHIFT) +#define BREAKPOINT_INSTR (AARCH64_BRK | AARCH64_BRK_IMM16_VAL) +#define BREAKPOINT_INSTR_SZ 4 +#elif defined(__amd64__) || defined(__i386__) +#define BREAKPOINT_INSTR 0xcc /* int 0x3 */ #define BREAKPOINT_INSTR_SZ 1 +#elif defined(__arm__) +#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */ +#define BREAKPOINT_INSTR_SZ 4 #elif defined(__mips__) -#define BREAKPOINT_INSTR 0xd /* break */ +#define BREAKPOINT_INSTR 0xd /* break */ #define BREAKPOINT_INSTR_SZ 4 #elif defined(__powerpc__) -#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ -#define BREAKPOINT_INSTR_SZ 4 -#elif defined(__arm__) -#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */ -#define BREAKPOINT_INSTR_SZ 4 +#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif |