From c09381f54c05105b6b94b2ccc665006ff203b1cd Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 12 Nov 2008 15:35:14 +0000 Subject: [PATCH] --- yaml --- r: 118847 b: refs/heads/master c: b308bf3be1f75207c307eea9ada90e0b76194911 h: refs/heads/master i: 118845: 0d43a9117b33a2e2d1727e8f8f60f35c8d8fd403 118843: ed4112a860c65183b99ce03b63ea794bb534e91d 118839: aebfa1313eba980b1f909c1dbcaf45f15d953628 118831: 0bcdcb84de05dd43d87673ed71e9a6187e482ec8 118815: 468fc948cf9d13a911701a5acfec5ef3db163569 118783: e9cfd9d0e9c7c1ce7a6051b7a72d180d1d5e5070 v: v3 --- [refs] | 2 +- trunk/arch/mn10300/mm/misalignment.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 9ef0cc61bdc7..8187e80d9972 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ee6e740cf7e5605b353af539eb9a6e17948747b6 +refs/heads/master: b308bf3be1f75207c307eea9ada90e0b76194911 diff --git a/trunk/arch/mn10300/mm/misalignment.c b/trunk/arch/mn10300/mm/misalignment.c index ab03bac497cb..614c32b6325b 100644 --- a/trunk/arch/mn10300/mm/misalignment.c +++ b/trunk/arch/mn10300/mm/misalignment.c @@ -43,11 +43,11 @@ #endif static int misalignment_addr(unsigned long *registers, unsigned params, - unsigned opcode, unsigned disp, + unsigned opcode, unsigned long disp, void **_address, unsigned long **_postinc); static int misalignment_reg(unsigned long *registers, unsigned params, - unsigned opcode, unsigned disp, + unsigned opcode, unsigned long disp, unsigned long **_register); static const unsigned Dreg_index[] = { @@ -304,13 +304,13 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) const struct exception_table_entry *fixup; const struct mn10300_opcode *pop; unsigned long *registers = (unsigned long *) regs; - unsigned long data, *store, *postinc; + unsigned long data, *store, *postinc, disp; mm_segment_t seg; siginfo_t info; - uint32_t opcode, disp, noc, xo, xm; + uint32_t opcode, noc, xo, xm; uint8_t *pc, byte; void *address; - unsigned tmp, npop; + unsigned tmp, npop, dispsz, loop; kdebug("==>misalignment({pc=%lx})", regs->pc); @@ -445,17 +445,17 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) /* grab the extra displacement (note it's LSB first) */ disp = 0; - tmp = format_tbl[pop->format].dispsz >> 3; - while (tmp > 0) { - tmp--; - disp <<= 8; - + dispsz = format_tbl[pop->format].dispsz; + for (loop = 0; loop < dispsz; loop += 8) { pc++; if (__get_user(byte, pc) != 0) goto fetch_error; - disp |= byte; + disp |= byte << loop; + kdebug("{%p} disp[%02x]=%02x", pc, loop, byte); } + kdebug("disp=%lx", disp); + set_fs(KERNEL_XDS); if (fixup || regs->epsw & EPSW_nSL) set_fs(seg); @@ -538,7 +538,7 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) * determine the address that was being accessed */ static int misalignment_addr(unsigned long *registers, unsigned params, - unsigned opcode, unsigned disp, + unsigned opcode, unsigned long disp, void **_address, unsigned long **_postinc) { unsigned long *postinc = NULL, address = 0, tmp; @@ -644,7 +644,7 @@ static int misalignment_addr(unsigned long *registers, unsigned params, * determine the register that is acting as source/dest */ static int misalignment_reg(unsigned long *registers, unsigned params, - unsigned opcode, unsigned disp, + unsigned opcode, unsigned long disp, unsigned long **_register) { params &= 0x7fffffff;