diff options
| author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-02-23 02:56:45 -0500 |
|---|---|---|
| committer | Catalin Marinas <catalin.marinas@arm.com> | 2016-02-23 12:43:25 -0500 |
| commit | f98deee9a9f8c47d05a0f64d86440882dca772ff (patch) | |
| tree | 3c655411bd4c9b5714d99062203f39608c3a610f /arch | |
| parent | 8439e62a15614e8fcd43835d57b7245cd9870dc5 (diff) | |
arm64: move brk immediate argument definitions to separate header
Instead of reversing the header dependency between asm/bug.h and
asm/debug-monitors.h, split off the brk instruction immediate value
defines into a new header asm/brk-imm.h, and include it from both.
This solves the circular dependency issue that prevents BUG() from
being used in some header files, and keeps the definitions together.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm64/include/asm/brk-imm.h | 25 | ||||
| -rw-r--r-- | arch/arm64/include/asm/bug.h | 2 | ||||
| -rw-r--r-- | arch/arm64/include/asm/debug-monitors.h | 14 |
3 files changed, 27 insertions, 14 deletions
diff --git a/arch/arm64/include/asm/brk-imm.h b/arch/arm64/include/asm/brk-imm.h new file mode 100644 index 000000000000..ed693c5bcec0 --- /dev/null +++ b/arch/arm64/include/asm/brk-imm.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012 ARM Ltd. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __ASM_BRK_IMM_H | ||
| 10 | #define __ASM_BRK_IMM_H | ||
| 11 | |||
| 12 | /* | ||
| 13 | * #imm16 values used for BRK instruction generation | ||
| 14 | * Allowed values for kgdb are 0x400 - 0x7ff | ||
| 15 | * 0x100: for triggering a fault on purpose (reserved) | ||
| 16 | * 0x400: for dynamic BRK instruction | ||
| 17 | * 0x401: for compile time BRK instruction | ||
| 18 | * 0x800: kernel-mode BUG() and WARN() traps | ||
| 19 | */ | ||
| 20 | #define FAULT_BRK_IMM 0x100 | ||
| 21 | #define KGDB_DYN_DBG_BRK_IMM 0x400 | ||
| 22 | #define KGDB_COMPILED_DBG_BRK_IMM 0x401 | ||
| 23 | #define BUG_BRK_IMM 0x800 | ||
| 24 | |||
| 25 | #endif | ||
diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h index 679d49221998..561190d15881 100644 --- a/arch/arm64/include/asm/bug.h +++ b/arch/arm64/include/asm/bug.h | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | #ifndef _ARCH_ARM64_ASM_BUG_H | 18 | #ifndef _ARCH_ARM64_ASM_BUG_H |
| 19 | #define _ARCH_ARM64_ASM_BUG_H | 19 | #define _ARCH_ARM64_ASM_BUG_H |
| 20 | 20 | ||
| 21 | #define BUG_BRK_IMM 0x800 | 21 | #include <asm/brk-imm.h> |
| 22 | 22 | ||
| 23 | #ifdef CONFIG_GENERIC_BUG | 23 | #ifdef CONFIG_GENERIC_BUG |
| 24 | #define HAVE_ARCH_BUG | 24 | #define HAVE_ARCH_BUG |
diff --git a/arch/arm64/include/asm/debug-monitors.h b/arch/arm64/include/asm/debug-monitors.h index e893a1fca9c2..2fcb9b7c876c 100644 --- a/arch/arm64/include/asm/debug-monitors.h +++ b/arch/arm64/include/asm/debug-monitors.h | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
| 22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| 23 | #include <asm/bug.h> | 23 | #include <asm/brk-imm.h> |
| 24 | #include <asm/esr.h> | 24 | #include <asm/esr.h> |
| 25 | #include <asm/insn.h> | 25 | #include <asm/insn.h> |
| 26 | #include <asm/ptrace.h> | 26 | #include <asm/ptrace.h> |
| @@ -48,18 +48,6 @@ | |||
| 48 | #define BREAK_INSTR_SIZE AARCH64_INSN_SIZE | 48 | #define BREAK_INSTR_SIZE AARCH64_INSN_SIZE |
| 49 | 49 | ||
| 50 | /* | 50 | /* |
| 51 | * #imm16 values used for BRK instruction generation | ||
| 52 | * Allowed values for kgbd are 0x400 - 0x7ff | ||
| 53 | * 0x100: for triggering a fault on purpose (reserved) | ||
| 54 | * 0x400: for dynamic BRK instruction | ||
| 55 | * 0x401: for compile time BRK instruction | ||
| 56 | * 0x800: kernel-mode BUG() and WARN() traps | ||
| 57 | */ | ||
| 58 | #define FAULT_BRK_IMM 0x100 | ||
| 59 | #define KGDB_DYN_DBG_BRK_IMM 0x400 | ||
| 60 | #define KGDB_COMPILED_DBG_BRK_IMM 0x401 | ||
| 61 | |||
| 62 | /* | ||
| 63 | * BRK instruction encoding | 51 | * BRK instruction encoding |
| 64 | * The #imm16 value should be placed at bits[20:5] within BRK ins | 52 | * The #imm16 value should be placed at bits[20:5] within BRK ins |
| 65 | */ | 53 | */ |
