Commit 61e2cd0a authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by H. Peter Anvin

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: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Link: http://lkml.kernel.org/r/4E5BCC40.3030501@goop.orgSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 229855d6
#ifndef ASM_X86_CMPXCHG_H #ifndef ASM_X86_CMPXCHG_H
#define ASM_X86_CMPXCHG_H #define ASM_X86_CMPXCHG_H
#include <linux/compiler.h>
#include <asm/alternative.h> /* Provides LOCK_PREFIX */ #include <asm/alternative.h> /* Provides LOCK_PREFIX */
/* Non-existant functions to indicate usage errors at link time. */ /*
extern void __xchg_wrong_size(void); * Non-existant functions to indicate usage errors at link time
extern void __cmpxchg_wrong_size(void); * (or compile-time if the compiler implements __compiletime_error().
extern void __xadd_wrong_size(void); */
extern void __xchg_wrong_size(void)
__compiletime_error("Bad argument size for xchg");
extern void __cmpxchg_wrong_size(void)
__compiletime_error("Bad argument size for cmpxchg");
extern void __xadd_wrong_size(void)
__compiletime_error("Bad argument size for xadd");
/* /*
* Constants for operation sizes. On 32-bit, the 64-bit size it set to * Constants for operation sizes. On 32-bit, the 64-bit size it set to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment