1 #ifndef LINUX_3_1_COMPAT_H
2 #define LINUX_3_1_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
8 #include <linux/security.h>
10 #define IS_ENABLED(option) defined(option)
12 #define genl_dump_check_consistent(cb, user_hdr, family)
14 #define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
17 #define PCMCIA_DEVICE_MANF_CARD_PROD_ID3(manf, card, v3, vh3) { \
18 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
19 PCMCIA_DEV_ID_MATCH_CARD_ID| \
20 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
23 .prod_id = { NULL, NULL, (v3), NULL }, \
24 .prod_id_hash = { 0, 0, (vh3), 0 }, }
27 * This has been defined in include/linux/security.h for some time, but was
28 * only given an EXPORT_SYMBOL for 3.1. Add a compat_* definition to avoid
29 * breaking the compile.
31 #define security_sk_clone(a, b) compat_security_sk_clone(a, b)
33 static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
38 * In many versions, several architectures do not seem to include an
39 * atomic64_t implementation, and do not include the software emulation from
40 * asm-generic/atomic64_t.
41 * Detect and handle this here.
43 #include <asm/atomic.h>
45 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)) && !defined(ATOMIC64_INIT) && !defined(CONFIG_X86) && !((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) && defined(CONFIG_ARM) && !defined(CONFIG_GENERIC_ATOMIC64))
46 #include <asm-generic/atomic64.h>
49 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) */
51 #endif /* LINUX_3_1_COMPAT_H */