Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9cfde2028bc487982a4bfb0d20d2ca76366fa80d Commit: 9cfde2028bc487982a4bfb0d20d2ca76366fa80d Parent: 21a151d8ca3aa74ee79f9791a9d4dc370d3e0636 Author: Ralf Baechle <[EMAIL PROTECTED]> AuthorDate: Wed Feb 14 21:16:14 2007 +0000 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Thu Oct 11 23:46:15 2007 +0100
[MIPS] Optimize get_unaligned / put_unaligned implementations. Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- include/asm-mips/unaligned.h | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/include/asm-mips/unaligned.h b/include/asm-mips/unaligned.h index a004256..3249049 100644 --- a/include/asm-mips/unaligned.h +++ b/include/asm-mips/unaligned.h @@ -3,12 +3,27 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1996, 1999, 2000, 2001, 2003 by Ralf Baechle - * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc. + * Copyright (C) 2007 Ralf Baechle ([EMAIL PROTECTED]) */ -#ifndef _ASM_UNALIGNED_H -#define _ASM_UNALIGNED_H +#ifndef __ASM_GENERIC_UNALIGNED_H +#define __ASM_GENERIC_UNALIGNED_H -#include <asm-generic/unaligned.h> +#include <linux/compiler.h> -#endif /* _ASM_UNALIGNED_H */ +#define get_unaligned(ptr) \ +({ \ + struct __packed { \ + typeof(*(ptr)) __v; \ + } *__p = (void *) (ptr); \ + __p->__v; \ +}) + +#define put_unaligned(val, ptr) \ +do { \ + struct __packed { \ + typeof(*(ptr)) __v; \ + } *__p = (void *) (ptr); \ + __p->__v = (val); \ +} while(0) + +#endif /* __ASM_GENERIC_UNALIGNED_H */ - 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