diff options
author | Ruslan Bukin <br@FreeBSD.org> | 2015-07-01 13:59:26 +0000 |
---|---|---|
committer | Ruslan Bukin <br@FreeBSD.org> | 2015-07-01 13:59:26 +0000 |
commit | 27e54fb59e46cc309e9bdbd0697cafb11938c23c (patch) | |
tree | df641c79945fd22332a00f95edb13412b05c5f8e /lib/libproc/proc_bkpt.c | |
parent | 2206ec827cdecf0182dc47b238df6a5aab0a2298 (diff) | |
download | src-27e54fb59e46cc309e9bdbd0697cafb11938c23c.tar.gz src-27e54fb59e46cc309e9bdbd0697cafb11938c23c.zip |
Make libproc compilable on AArch64.
Notes
Notes:
svn path=/head/; revision=285003
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 1e4a6cc92835..50d8a9d67908 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 |