From 467bfe07b40e61f9f50515bb0ecb8f9f474bb6dc Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 14 Feb 2007 21:16:14 +0000 Subject: [PATCH] --- yaml --- r: 66203 b: refs/heads/master c: 9cfde2028bc487982a4bfb0d20d2ca76366fa80d h: refs/heads/master i: 66201: a2c0cb099b532cdf737a1f426f8de7edf55c3dd5 66199: 4ebacfef37cbe7519923a7834dd991e98eb7bd12 v: v3 --- [refs] | 2 +- trunk/include/asm-mips/unaligned.h | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 6e6e791c37b1..868cb4633d98 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 21a151d8ca3aa74ee79f9791a9d4dc370d3e0636 +refs/heads/master: 9cfde2028bc487982a4bfb0d20d2ca76366fa80d diff --git a/trunk/include/asm-mips/unaligned.h b/trunk/include/asm-mips/unaligned.h index a0042563838a..3249049e93aa 100644 --- a/trunk/include/asm-mips/unaligned.h +++ b/trunk/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 (ralf@linux-mips.org) */ -#ifndef _ASM_UNALIGNED_H -#define _ASM_UNALIGNED_H +#ifndef __ASM_GENERIC_UNALIGNED_H +#define __ASM_GENERIC_UNALIGNED_H -#include +#include -#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 */