aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2011-08-29 17:47:58 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-08-29 20:20:40 -0400
commit61e2cd0acc248c14793cefd7e23e209be9e0b70d (patch)
tree218ddcf86ea6e7f2951c32e88e73ccdf753f9a2a /arch/x86/include
parent229855d6f3b40d01a903120c433d75e483a0b06d (diff)
x86, cmpxchg: Use __compiletime_error() to make usage messages a bit nicer
Use __compiletime_error() to produce a compile-time error rather than link-time, where available. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Link: http://lkml.kernel.org/r/4E5BCC40.3030501@goop.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/cmpxchg.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index 0d0d9cdd3309..5d3acdf5a7a6 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -1,12 +1,19 @@
1#ifndef ASM_X86_CMPXCHG_H 1#ifndef ASM_X86_CMPXCHG_H
2#define ASM_X86_CMPXCHG_H 2#define ASM_X86_CMPXCHG_H
3 3
4#include <linux/compiler.h>
4#include <asm/alternative.h> /* Provides LOCK_PREFIX */ 5#include <asm/alternative.h> /* Provides LOCK_PREFIX */
5 6
6/* Non-existant functions to indicate usage errors at link time. */ 7/*
7extern void __xchg_wrong_size(void); 8 * Non-existant functions to indicate usage errors at link time
8extern void __cmpxchg_wrong_size(void); 9 * (or compile-time if the compiler implements __compiletime_error().
9extern void __xadd_wrong_size(void); 10 */
11extern void __xchg_wrong_size(void)
12 __compiletime_error("Bad argument size for xchg");
13extern void __cmpxchg_wrong_size(void)
14 __compiletime_error("Bad argument size for cmpxchg");
15extern void __xadd_wrong_size(void)
16 __compiletime_error("Bad argument size for xadd");
10 17
11/* 18/*
12 * Constants for operation sizes. On 32-bit, the 64-bit size it set to 19 * Constants for operation sizes. On 32-bit, the 64-bit size it set to