Skip to content

Commit 03336b1

Browse files
Ard Biesheuvelctmarinas
authored andcommitted
arm64: prevent potential circular header dependencies in asm/bug.h
Currently, using BUG_ON() in header files is cumbersome, due to the fact that asm/bug.h transitively includes a lot of other header files, resulting in the actual BUG_ON() invocation appearing before its definition in the preprocessor input. So let's reverse the #include dependency between asm/bug.h and asm/debug-monitors.h, by moving the definition of BUG_BRK_IMM from the latter to the former. Also fix up one user of asm/debug-monitors.h which relied on a transitive include. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 369bc9a commit 03336b1

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

arch/arm64/include/asm/bug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#ifndef _ARCH_ARM64_ASM_BUG_H
1919
#define _ARCH_ARM64_ASM_BUG_H
2020

21-
#include <asm/debug-monitors.h>
21+
#define BUG_BRK_IMM 0x800
2222

2323
#ifdef CONFIG_GENERIC_BUG
2424
#define HAVE_ARCH_BUG

arch/arm64/include/asm/debug-monitors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <linux/errno.h>
2222
#include <linux/types.h>
23+
#include <asm/bug.h>
2324
#include <asm/esr.h>
2425
#include <asm/insn.h>
2526
#include <asm/ptrace.h>
@@ -57,7 +58,6 @@
5758
#define FAULT_BRK_IMM 0x100
5859
#define KGDB_DYN_DBG_BRK_IMM 0x400
5960
#define KGDB_COMPILED_DBG_BRK_IMM 0x401
60-
#define BUG_BRK_IMM 0x800
6161

6262
/*
6363
* BRK instruction encoding

arch/arm64/kvm/hyp/debug-sr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/compiler.h>
1919
#include <linux/kvm_host.h>
2020

21+
#include <asm/debug-monitors.h>
2122
#include <asm/kvm_asm.h>
2223
#include <asm/kvm_mmu.h>
2324

0 commit comments

Comments
 (0)