Commit db0d07fa authored by Max Filippov's avatar Max Filippov

xtensa: clean up function declarations in traps.c

Drop 'extern' from all function declarations and move those that need to
be visible from traps.c to traps.h. Add 'asmlinkage' to declarations of
fucntions defined in assembly. Add 'static' to declarations and
definitions only used locally. Add argument names in declarations.
Drop unused second argument from do_multihit and do_page_fault.
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent 725aea87
...@@ -39,8 +39,22 @@ struct exc_table { ...@@ -39,8 +39,22 @@ struct exc_table {
* void (*)(struct pt_regs *regs, unsigned long exccause); * void (*)(struct pt_regs *regs, unsigned long exccause);
*/ */
extern void * __init trap_set_handler(int cause, void *handler); extern void * __init trap_set_handler(int cause, void *handler);
extern void do_unhandled(struct pt_regs *regs, unsigned long exccause);
void fast_second_level_miss(void); asmlinkage void fast_illegal_instruction_user(void);
asmlinkage void fast_syscall_user(void);
asmlinkage void fast_alloca(void);
asmlinkage void fast_unaligned(void);
asmlinkage void fast_second_level_miss(void);
asmlinkage void fast_store_prohibited(void);
asmlinkage void fast_coprocessor(void);
asmlinkage void kernel_exception(void);
asmlinkage void user_exception(void);
asmlinkage void system_call(struct pt_regs *regs);
void do_IRQ(int hwirq, struct pt_regs *regs);
void do_page_fault(struct pt_regs *regs);
void do_unhandled(struct pt_regs *regs, unsigned long exccause);
/* Initialize minimal exc_table structure sufficient for basic paging */ /* Initialize minimal exc_table structure sufficient for basic paging */
static inline void __init early_trap_init(void) static inline void __init early_trap_init(void)
......
...@@ -48,25 +48,16 @@ ...@@ -48,25 +48,16 @@
* Machine specific interrupt handlers * Machine specific interrupt handlers
*/ */
extern void kernel_exception(void); static void do_illegal_instruction(struct pt_regs *regs);
extern void user_exception(void); static void do_interrupt(struct pt_regs *regs);
#if XTENSA_FAKE_NMI
extern void fast_illegal_instruction_user(void); static void do_nmi(struct pt_regs *regs);
extern void fast_syscall_user(void); #endif
extern void fast_alloca(void); #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
extern void fast_unaligned(void); static void do_unaligned_user(struct pt_regs *regs);
extern void fast_second_level_miss(void); #endif
extern void fast_store_prohibited(void); static void do_multihit(struct pt_regs *regs);
extern void fast_coprocessor(void); static void do_debug(struct pt_regs *regs);
extern void do_illegal_instruction (struct pt_regs*);
extern void do_interrupt (struct pt_regs*);
extern void do_nmi(struct pt_regs *);
extern void do_unaligned_user (struct pt_regs*);
extern void do_multihit (struct pt_regs*, unsigned long);
extern void do_page_fault (struct pt_regs*, unsigned long);
extern void do_debug (struct pt_regs*);
extern void system_call (struct pt_regs*);
/* /*
* The vector table must be preceded by a save area (which * The vector table must be preceded by a save area (which
...@@ -197,7 +188,7 @@ void do_unhandled(struct pt_regs *regs, unsigned long exccause) ...@@ -197,7 +188,7 @@ void do_unhandled(struct pt_regs *regs, unsigned long exccause)
* Multi-hit exception. This if fatal! * Multi-hit exception. This if fatal!
*/ */
void do_multihit(struct pt_regs *regs, unsigned long exccause) static void do_multihit(struct pt_regs *regs)
{ {
die("Caught multihit exception", regs, SIGKILL); die("Caught multihit exception", regs, SIGKILL);
} }
...@@ -206,8 +197,6 @@ void do_multihit(struct pt_regs *regs, unsigned long exccause) ...@@ -206,8 +197,6 @@ void do_multihit(struct pt_regs *regs, unsigned long exccause)
* IRQ handler. * IRQ handler.
*/ */
extern void do_IRQ(int, struct pt_regs *);
#if XTENSA_FAKE_NMI #if XTENSA_FAKE_NMI
#define IS_POW2(v) (((v) & ((v) - 1)) == 0) #define IS_POW2(v) (((v) & ((v) - 1)) == 0)
...@@ -240,7 +229,7 @@ irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_id); ...@@ -240,7 +229,7 @@ irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_id);
DEFINE_PER_CPU(unsigned long, nmi_count); DEFINE_PER_CPU(unsigned long, nmi_count);
void do_nmi(struct pt_regs *regs) static void do_nmi(struct pt_regs *regs)
{ {
struct pt_regs *old_regs = set_irq_regs(regs); struct pt_regs *old_regs = set_irq_regs(regs);
...@@ -253,7 +242,7 @@ void do_nmi(struct pt_regs *regs) ...@@ -253,7 +242,7 @@ void do_nmi(struct pt_regs *regs)
} }
#endif #endif
void do_interrupt(struct pt_regs *regs) static void do_interrupt(struct pt_regs *regs)
{ {
static const unsigned int_level_mask[] = { static const unsigned int_level_mask[] = {
0, 0,
...@@ -303,8 +292,7 @@ void do_interrupt(struct pt_regs *regs) ...@@ -303,8 +292,7 @@ void do_interrupt(struct pt_regs *regs)
* Illegal instruction. Fatal if in kernel space. * Illegal instruction. Fatal if in kernel space.
*/ */
void static void do_illegal_instruction(struct pt_regs *regs)
do_illegal_instruction(struct pt_regs *regs)
{ {
__die_if_kernel("Illegal instruction in kernel", regs, SIGKILL); __die_if_kernel("Illegal instruction in kernel", regs, SIGKILL);
...@@ -324,8 +312,7 @@ do_illegal_instruction(struct pt_regs *regs) ...@@ -324,8 +312,7 @@ do_illegal_instruction(struct pt_regs *regs)
*/ */
#if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
void static void do_unaligned_user(struct pt_regs *regs)
do_unaligned_user (struct pt_regs *regs)
{ {
__die_if_kernel("Unhandled unaligned exception in kernel", __die_if_kernel("Unhandled unaligned exception in kernel",
regs, SIGKILL); regs, SIGKILL);
...@@ -346,8 +333,7 @@ do_unaligned_user (struct pt_regs *regs) ...@@ -346,8 +333,7 @@ do_unaligned_user (struct pt_regs *regs)
* breakpoint structures to debug registers intact, so that * breakpoint structures to debug registers intact, so that
* DEBUGCAUSE.DBNUM could be used in case of data breakpoint hit. * DEBUGCAUSE.DBNUM could be used in case of data breakpoint hit.
*/ */
void static void do_debug(struct pt_regs *regs)
do_debug(struct pt_regs *regs)
{ {
#ifdef CONFIG_HAVE_HW_BREAKPOINT #ifdef CONFIG_HAVE_HW_BREAKPOINT
int ret = check_hw_breakpoint(regs); int ret = check_hw_breakpoint(regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment