Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ARM: move is_permission_fault() and is_translation_fault() to fault.h

is_permission_fault() and is_translation_fault() are both conditional
on the FSR encodings, which are dependent on LPAE. We define the
constants in fault.h. Move these inline functions to fault.h to be
near the FSR definitions.

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

+26 -26
-26
arch/arm/mm/fault.c
··· 115 115 return (fsr & FSR_WRITE) && !(fsr & FSR_CM); 116 116 } 117 117 118 - static inline bool is_translation_fault(unsigned int fsr) 119 - { 120 - int fs = fsr_fs(fsr); 121 - #ifdef CONFIG_ARM_LPAE 122 - if ((fs & FS_MMU_NOLL_MASK) == FS_TRANS_NOLL) 123 - return true; 124 - #else 125 - if (fs == FS_L1_TRANS || fs == FS_L2_TRANS) 126 - return true; 127 - #endif 128 - return false; 129 - } 130 - 131 - static inline bool is_permission_fault(unsigned int fsr) 132 - { 133 - int fs = fsr_fs(fsr); 134 - #ifdef CONFIG_ARM_LPAE 135 - if ((fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL) 136 - return true; 137 - #else 138 - if (fs == FS_L1_PERM || fs == FS_L2_PERM) 139 - return true; 140 - #endif 141 - return false; 142 - } 143 - 144 118 static void die_kernel_fault(const char *msg, struct mm_struct *mm, 145 119 unsigned long addr, unsigned int fsr, 146 120 struct pt_regs *regs)
+26
arch/arm/mm/fault.h
··· 35 35 } 36 36 #endif 37 37 38 + static inline bool is_translation_fault(unsigned int fsr) 39 + { 40 + int fs = fsr_fs(fsr); 41 + #ifdef CONFIG_ARM_LPAE 42 + if ((fs & FS_MMU_NOLL_MASK) == FS_TRANS_NOLL) 43 + return true; 44 + #else 45 + if (fs == FS_L1_TRANS || fs == FS_L2_TRANS) 46 + return true; 47 + #endif 48 + return false; 49 + } 50 + 51 + static inline bool is_permission_fault(unsigned int fsr) 52 + { 53 + int fs = fsr_fs(fsr); 54 + #ifdef CONFIG_ARM_LPAE 55 + if ((fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL) 56 + return true; 57 + #else 58 + if (fs == FS_L1_PERM || fs == FS_L2_PERM) 59 + return true; 60 + #endif 61 + return false; 62 + } 63 + 38 64 void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs); 39 65 void early_abt_enable(void); 40 66 asmlinkage void do_DataAbort(unsigned long addr, unsigned int fsr,