Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4252c659a4e7f4260e4bdc87538578236c51ab2d Commit: 4252c659a4e7f4260e4bdc87538578236c51ab2d Parent: 1e6760c5c4589d02a6877fb256b99c33dd8f1ede Author: Magnus Damm <[EMAIL PROTECTED]> AuthorDate: Thu Feb 7 19:58:46 2008 +0900 Committer: Paul Mundt <[EMAIL PROTECTED]> CommitDate: Thu Feb 14 14:22:09 2008 +0900
sh: add byte support to the sign extension code This patch adds byte support to the sign extension code. Unaligned access traps should never be generated on 8-bit io operations, but we will use this code for trapped io and we do need byte support there. Signed-off-by: Magnus Damm <[EMAIL PROTECTED]> Signed-off-by: Paul Mundt <[EMAIL PROTECTED]> --- arch/sh/kernel/traps_32.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index 7154a7b..2e7dd2e 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c @@ -150,14 +150,24 @@ static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err) static inline void sign_extend(unsigned int count, unsigned char *dst) { #ifdef __LITTLE_ENDIAN__ + if ((count == 1) && dst[0] & 0x80) { + dst[1] = 0xff; + dst[2] = 0xff; + dst[3] = 0xff; + } if ((count == 2) && dst[1] & 0x80) { dst[2] = 0xff; dst[3] = 0xff; } #else - if ((count == 2) && dst[2] & 0x80) { + if ((count == 1) && dst[3] & 0x80) { + dst[2] = 0xff; + dst[1] = 0xff; dst[0] = 0xff; + } + if ((count == 2) && dst[2] & 0x80) { dst[1] = 0xff; + dst[0] = 0xff; } #endif } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html