Skip to content

Commit

Permalink
[ARM] Move processor_modes[] to .../process.c
Browse files Browse the repository at this point in the history
bad_mode() currently prints the mode which caused the exception, and
then causes an oops dump to be printed which again displays this
information (since the CPSR in the struct pt_regs is correct.)  This
leads to processor_modes[] being shared between traps.c and process.c
with a local declaration of it.

We can clean this up by moving processor_modes[] to process.c and
removing the duplication, resulting in processor_modes[] becoming
static.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Feb 6, 2007
1 parent d941caa commit ae0a846
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ common_invalid:
@ cpsr_<exception>, "old_r0"

mov r0, sp
and r2, r6, #0x1f
b bad_mode

/*
Expand Down
8 changes: 7 additions & 1 deletion arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@
#include <asm/uaccess.h>
#include <asm/mach/time.h>

extern const char *processor_modes[];
static const char *processor_modes[] = {
"USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
"UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26",
"USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" ,
"UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32"
};

extern void setup_mm_for_reboot(char mode);

static volatile int hlt_counter;
Expand Down
12 changes: 2 additions & 10 deletions arch/arm/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@
#include "ptrace.h"
#include "signal.h"

const char *processor_modes[]=
{ "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
"UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26",
"USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" ,
"UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32"
};

static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };

#ifdef CONFIG_DEBUG_USER
Expand Down Expand Up @@ -337,12 +330,11 @@ asmlinkage void do_unexp_fiq (struct pt_regs *regs)
* It never returns, and never tries to sync. We hope that we can at least
* dump out some state information...
*/
asmlinkage void bad_mode(struct pt_regs *regs, int reason, int proc_mode)
asmlinkage void bad_mode(struct pt_regs *regs, int reason)
{
console_verbose();

printk(KERN_CRIT "Bad mode in %s handler detected: mode %s\n",
handler[reason], processor_modes[proc_mode]);
printk(KERN_CRIT "Bad mode in %s handler detected\n", handler[reason]);

die("Oops - bad mode", regs, 0);
local_irq_disable();
Expand Down

0 comments on commit ae0a846

Please sign in to comment.