forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powerpc/traps: Enhance readability for trap types
Create a new header named traps.h, define macros to list ppc interrupt types in traps.h, replace the reference of the trap hex values with these macros. Referred the hex number in arch/powerpc/kernel/exceptions-64e.S, arch/powerpc/kernel/exceptions-64s.S and arch/powerpc/include/asm/kvm_asm.h. v2-v3: Correct the prefix of trap macros with INTERRUPT_, the previous prefix is TRAP_, which is not precise. This is suggested by Segher Boessenkool and Nicholas Piggin. v1-v2: Define more trap macros to replace more trap hexs in code, not just for the __show_regs function. This is suggested by Christophe Leroy. Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
- Loading branch information
1 parent
69931cc
commit d9dd965
Showing
9 changed files
with
78 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _ASM_PPC_TRAPS_H | ||
#define _ASM_PPC_TRAPS_H | ||
|
||
#if defined(CONFIG_BOOKE) || defined(CONFIG_4xx) | ||
#define INTERRUPT_MACHINE_CHECK 0x000 | ||
#define INTERRUPT_CRITICAL_INPUT 0x100 | ||
#define INTERRUPT_ALTIVEC_UNAVAIL 0x200 | ||
#define INTERRUPT_PERFMON 0x260 | ||
#define INTERRUPT_DOORBELL 0x280 | ||
#define INTERRUPT_DEBUG 0xd00 | ||
#elif defined(CONFIG_PPC_BOOK3S) | ||
#define INTERRUPT_SYSTEM_RESET 0x100 | ||
#define INTERRUPT_MACHINE_CHECK 0x200 | ||
#define INTERRUPT_DATA_SEGMENT 0x380 | ||
#define INTERRUPT_INST_SEGMENT 0x480 | ||
#define INTERRUPT_DOORBELL 0xa00 | ||
#define INTERRUPT_TRACE 0xd00 | ||
#define INTERRUPT_H_DATA_STORAGE 0xe00 | ||
#define INTERRUPT_PERFMON 0xf00 | ||
#define INTERRUPT_H_FAC_UNAVAIL 0xf80 | ||
#endif | ||
|
||
#define INTERRUPT_DATA_STORAGE 0x300 | ||
#define INTERRUPT_INST_STORAGE 0x400 | ||
#define INTERRUPT_ALIGNMENT 0x600 | ||
#define INTERRUPT_PROGRAM 0x700 | ||
#define INTERRUPT_FP_UNAVAIL 0x800 | ||
#define INTERRUPT_DECREMENTER 0x900 | ||
#define INTERRUPT_SYSCALL 0xc00 | ||
|
||
#endif /* _ASM_PPC_TRAPS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters