xen: cleancache shim to Xen Transcendent Memory
[linux-2.6/next.git] / arch / x86 / include / asm / jump_label.h
blob574dbc22893a9301914def19c5004b9ec1b851fe
1 #ifndef _ASM_X86_JUMP_LABEL_H
2 #define _ASM_X86_JUMP_LABEL_H
4 #ifdef __KERNEL__
6 #include <linux/types.h>
7 #include <asm/nops.h>
9 #define JUMP_LABEL_NOP_SIZE 5
11 # define JUMP_LABEL_INITIAL_NOP ".byte 0xe9 \n\t .long 0\n\t"
13 # define JUMP_LABEL(key, label) \
14 do { \
15 asm goto("1:" \
16 JUMP_LABEL_INITIAL_NOP \
17 ".pushsection __jump_table, \"aw\" \n\t"\
18 _ASM_PTR "1b, %l[" #label "], %c0 \n\t" \
19 ".popsection \n\t" \
20 : : "i" (key) : : label); \
21 } while (0)
23 #endif /* __KERNEL__ */
25 #ifdef CONFIG_X86_64
26 typedef u64 jump_label_t;
27 #else
28 typedef u32 jump_label_t;
29 #endif
31 struct jump_entry {
32 jump_label_t code;
33 jump_label_t target;
34 jump_label_t key;
37 #endif