diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-10-15 07:57:47 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@inhelltoy.tec.linutronix.de> | 2007-10-17 14:17:10 -0400 |
commit | 003a46cfff308ee0d879dfa89b9a7c65b2a481bf (patch) | |
tree | 234552110912d4b9d6519474823e98e1a1726d16 /include/asm-x86/unaligned.h | |
parent | 217d115cd5d7d2bef7db7839b93ce5dc2867c392 (diff) |
x86: unify some more trivial include/asm-x86/ 32/64 variants
Scripted unification.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/unaligned.h')
-rw-r--r-- | include/asm-x86/unaligned.h | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/include/asm-x86/unaligned.h b/include/asm-x86/unaligned.h index 68067150fbcb..913598d4f761 100644 --- a/include/asm-x86/unaligned.h +++ b/include/asm-x86/unaligned.h | |||
@@ -1,5 +1,37 @@ | |||
1 | #ifdef CONFIG_X86_32 | 1 | #ifndef _ASM_X86_UNALIGNED_H |
2 | # include "unaligned_32.h" | 2 | #define _ASM_X86_UNALIGNED_H |
3 | #else | 3 | |
4 | # include "unaligned_64.h" | 4 | /* |
5 | #endif | 5 | * The x86 can do unaligned accesses itself. |
6 | * | ||
7 | * The strange macros are there to make sure these can't | ||
8 | * be misused in a way that makes them not work on other | ||
9 | * architectures where unaligned accesses aren't as simple. | ||
10 | */ | ||
11 | |||
12 | /** | ||
13 | * get_unaligned - get value from possibly mis-aligned location | ||
14 | * @ptr: pointer to value | ||
15 | * | ||
16 | * This macro should be used for accessing values larger in size than | ||
17 | * single bytes at locations that are expected to be improperly aligned, | ||
18 | * e.g. retrieving a u16 value from a location not u16-aligned. | ||
19 | * | ||
20 | * Note that unaligned accesses can be very expensive on some architectures. | ||
21 | */ | ||
22 | #define get_unaligned(ptr) (*(ptr)) | ||
23 | |||
24 | /** | ||
25 | * put_unaligned - put value to a possibly mis-aligned location | ||
26 | * @val: value to place | ||
27 | * @ptr: pointer to location | ||
28 | * | ||
29 | * This macro should be used for placing values larger in size than | ||
30 | * single bytes at locations that are expected to be improperly aligned, | ||
31 | * e.g. writing a u16 value to a location not u16-aligned. | ||
32 | * | ||
33 | * Note that unaligned accesses can be very expensive on some architectures. | ||
34 | */ | ||
35 | #define put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) | ||
36 | |||
37 | #endif /* _ASM_X86_UNALIGNED_H */ | ||