Skip to content

Commit 9c46fca

Browse files
author
Russell King (Oracle)
committed
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>
1 parent 7890020 commit 9c46fca

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

arch/arm/mm/fault.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -115,32 +115,6 @@ static inline bool is_write_fault(unsigned int fsr)
115115
return (fsr & FSR_WRITE) && !(fsr & FSR_CM);
116116
}
117117

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-
144118
static void die_kernel_fault(const char *msg, struct mm_struct *mm,
145119
unsigned long addr, unsigned int fsr,
146120
struct pt_regs *regs)

arch/arm/mm/fault.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,32 @@ static inline int fsr_fs(unsigned int fsr)
3535
}
3636
#endif
3737

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+
3864
void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
3965
void early_abt_enable(void);
4066
asmlinkage void do_DataAbort(unsigned long addr, unsigned int fsr,

0 commit comments

Comments
 (0)