ia64/xen-unstable

changeset 11995:9f0b88aaf170

PV-on-HVM: Include compatibility kzalloc implementation for kernels
before 2.6.14.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
author Ian Campbell <ian.campbell@xensource.com>
date Wed Oct 25 13:58:30 2006 +0100 (2006-10-25)
parents db0d3f22e149
children fc68e3ef9139
files unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
line diff
     1.1 --- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h	Wed Oct 25 13:58:30 2006 +0100
     1.2 +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h	Wed Oct 25 13:58:30 2006 +0100
     1.3 @@ -41,4 +41,8 @@ unsigned long wait_for_completion_timeou
     1.4  signed long schedule_timeout_interruptible(signed long timeout);
     1.5  #endif
     1.6  
     1.7 +#if defined(_LINUX_SLAB_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
     1.8 +void *kzalloc(size_t size, int flags);
     1.9  #endif
    1.10 +
    1.11 +#endif
     2.1 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c	Wed Oct 25 13:58:30 2006 +0100
     2.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c	Wed Oct 25 13:58:30 2006 +0100
     2.3 @@ -4,6 +4,7 @@
     2.4  #include <linux/mm.h>
     2.5  #include <linux/module.h>
     2.6  #include <linux/sched.h>
     2.7 +#include <linux/slab.h>
     2.8  
     2.9  #include <xen/platform-compat.h>
    2.10  
    2.11 @@ -97,3 +98,19 @@ signed long schedule_timeout_interruptib
    2.12  }
    2.13  EXPORT_SYMBOL(schedule_timeout_interruptible);
    2.14  #endif
    2.15 +
    2.16 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
    2.17 +/**
    2.18 + * kzalloc - allocate memory. The memory is set to zero.
    2.19 + * @size: how many bytes of memory are required.
    2.20 + * @flags: the type of memory to allocate.
    2.21 + */
    2.22 +void *kzalloc(size_t size, int flags)
    2.23 +{
    2.24 +	void *ret = kmalloc(size, flags);
    2.25 +	if (ret)
    2.26 +		memset(ret, 0, size);
    2.27 +	return ret;
    2.28 +}
    2.29 +EXPORT_SYMBOL(kzalloc);
    2.30 +#endif