From: Avi Kivity <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h index 052d561..1f1aa72 100644 --- a/kernel/external-module-compat.h +++ b/kernel/external-module-compat.h @@ -648,3 +648,26 @@ static inline struct page *__kvm_vm_fault(struct vm_area_struct *vma, #endif #endif + +/* simple vfs attribute getter signature has changed to add a return code */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) + +#define MAKE_SIMPLE_ATTRIBUTE_GETTER(x) \ + static u64 x(void *v) \ + { \ + u64 ret = 0; \ + \ + __##x(v, &ret); \ + return ret; \ + } + +#else + +#define MAKE_SIMPLE_ATTRIBUTE_GETTER(x) \ + static int x(void *v, u64 *val) \ + { \ + return __##x(v, val); \ + } + +#endif diff --git a/kernel/hack-module.awk b/kernel/hack-module.awk index 5187c96..df2a0b2 100644 --- a/kernel/hack-module.awk +++ b/kernel/hack-module.awk @@ -40,6 +40,15 @@ $0 = "\t.VMA_OPS_FAULT(fault) = VMA_OPS_FAULT_FUNC(" fcn ")," } +/^static int .*_stat_get/ { + $3 = "__" $3 +} + +/DEFINE_SIMPLE_ATTRIBUTE.*_stat_get/ { + name = gensub(/,/, "", "g", $2); + print "MAKE_SIMPLE_ATTRIBUTE_GETTER(" name ")" +} + { sub(/linux\/mm_types\.h/, "linux/mm.h") } { print } ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ kvm-commits mailing list kvm-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-commits