Commit 1bb9fb0a authored by Russell King's avatar Russell King

ARM: mm: alignment: use "u32" for 32-bit instructions

Rather than using "unsigned long", use "u32" for 32-bit instructions in
the alignment fault handler.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 67e15fa5
...@@ -324,7 +324,7 @@ union offset_union { ...@@ -324,7 +324,7 @@ union offset_union {
__put32_unaligned_check("strbt", val, addr) __put32_unaligned_check("strbt", val, addr)
static void static void
do_alignment_finish_ldst(unsigned long addr, unsigned long instr, struct pt_regs *regs, union offset_union offset) do_alignment_finish_ldst(unsigned long addr, u32 instr, struct pt_regs *regs, union offset_union offset)
{ {
if (!LDST_U_BIT(instr)) if (!LDST_U_BIT(instr))
offset.un = -offset.un; offset.un = -offset.un;
...@@ -337,7 +337,7 @@ do_alignment_finish_ldst(unsigned long addr, unsigned long instr, struct pt_regs ...@@ -337,7 +337,7 @@ do_alignment_finish_ldst(unsigned long addr, unsigned long instr, struct pt_regs
} }
static int static int
do_alignment_ldrhstrh(unsigned long addr, unsigned long instr, struct pt_regs *regs) do_alignment_ldrhstrh(unsigned long addr, u32 instr, struct pt_regs *regs)
{ {
unsigned int rd = RD_BITS(instr); unsigned int rd = RD_BITS(instr);
...@@ -386,8 +386,7 @@ do_alignment_ldrhstrh(unsigned long addr, unsigned long instr, struct pt_regs *r ...@@ -386,8 +386,7 @@ do_alignment_ldrhstrh(unsigned long addr, unsigned long instr, struct pt_regs *r
} }
static int static int
do_alignment_ldrdstrd(unsigned long addr, unsigned long instr, do_alignment_ldrdstrd(unsigned long addr, u32 instr, struct pt_regs *regs)
struct pt_regs *regs)
{ {
unsigned int rd = RD_BITS(instr); unsigned int rd = RD_BITS(instr);
unsigned int rd2; unsigned int rd2;
...@@ -449,7 +448,7 @@ do_alignment_ldrdstrd(unsigned long addr, unsigned long instr, ...@@ -449,7 +448,7 @@ do_alignment_ldrdstrd(unsigned long addr, unsigned long instr,
} }
static int static int
do_alignment_ldrstr(unsigned long addr, unsigned long instr, struct pt_regs *regs) do_alignment_ldrstr(unsigned long addr, u32 instr, struct pt_regs *regs)
{ {
unsigned int rd = RD_BITS(instr); unsigned int rd = RD_BITS(instr);
...@@ -498,7 +497,7 @@ do_alignment_ldrstr(unsigned long addr, unsigned long instr, struct pt_regs *reg ...@@ -498,7 +497,7 @@ do_alignment_ldrstr(unsigned long addr, unsigned long instr, struct pt_regs *reg
* PU = 10 A B * PU = 10 A B
*/ */
static int static int
do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *regs) do_alignment_ldmstm(unsigned long addr, u32 instr, struct pt_regs *regs)
{ {
unsigned int rd, rn, correction, nr_regs, regbits; unsigned int rd, rn, correction, nr_regs, regbits;
unsigned long eaddr, newaddr; unsigned long eaddr, newaddr;
...@@ -539,7 +538,7 @@ do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *reg ...@@ -539,7 +538,7 @@ do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *reg
* processor for us. * processor for us.
*/ */
if (addr != eaddr) { if (addr != eaddr) {
pr_err("LDMSTM: PC = %08lx, instr = %08lx, " pr_err("LDMSTM: PC = %08lx, instr = %08x, "
"addr = %08lx, eaddr = %08lx\n", "addr = %08lx, eaddr = %08lx\n",
instruction_pointer(regs), instr, addr, eaddr); instruction_pointer(regs), instr, addr, eaddr);
show_regs(regs); show_regs(regs);
...@@ -716,10 +715,10 @@ thumb2arm(u16 tinstr) ...@@ -716,10 +715,10 @@ thumb2arm(u16 tinstr)
* 2. Register name Rt from ARMv7 is same as Rd from ARMv6 (Rd is Rt) * 2. Register name Rt from ARMv7 is same as Rd from ARMv6 (Rd is Rt)
*/ */
static void * static void *
do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs, do_alignment_t32_to_handler(u32 *pinstr, struct pt_regs *regs,
union offset_union *poffset) union offset_union *poffset)
{ {
unsigned long instr = *pinstr; u32 instr = *pinstr;
u16 tinst1 = (instr >> 16) & 0xffff; u16 tinst1 = (instr >> 16) & 0xffff;
u16 tinst2 = instr & 0xffff; u16 tinst2 = instr & 0xffff;
...@@ -767,7 +766,7 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs, ...@@ -767,7 +766,7 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,
return NULL; return NULL;
} }
static int alignment_get_arm(struct pt_regs *regs, u32 *ip, unsigned long *inst) static int alignment_get_arm(struct pt_regs *regs, u32 *ip, u32 *inst)
{ {
u32 instr = 0; u32 instr = 0;
int fault; int fault;
...@@ -801,9 +800,10 @@ static int ...@@ -801,9 +800,10 @@ static int
do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{ {
union offset_union uninitialized_var(offset); union offset_union uninitialized_var(offset);
unsigned long instr = 0, instrptr; unsigned long instrptr;
int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); int (*handler)(unsigned long addr, u32 instr, struct pt_regs *regs);
unsigned int type; unsigned int type;
u32 instr = 0;
u16 tinstr = 0; u16 tinstr = 0;
int isize = 4; int isize = 4;
int thumb2_32b = 0; int thumb2_32b = 0;
...@@ -954,7 +954,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) ...@@ -954,7 +954,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
* Oops, we didn't handle the instruction. * Oops, we didn't handle the instruction.
*/ */
pr_err("Alignment trap: not handling instruction " pr_err("Alignment trap: not handling instruction "
"%0*lx at [<%08lx>]\n", "%0*x at [<%08lx>]\n",
isize << 1, isize << 1,
isize == 2 ? tinstr : instr, instrptr); isize == 2 ? tinstr : instr, instrptr);
ai_skipped += 1; ai_skipped += 1;
...@@ -964,7 +964,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) ...@@ -964,7 +964,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
ai_user += 1; ai_user += 1;
if (ai_usermode & UM_WARN) if (ai_usermode & UM_WARN)
printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%0*lx " printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%0*x "
"Address=0x%08lx FSR 0x%03x\n", current->comm, "Address=0x%08lx FSR 0x%03x\n", current->comm,
task_pid_nr(current), instrptr, task_pid_nr(current), instrptr,
isize << 1, isize << 1,
......
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