Skip to content

Commit

Permalink
tools/virtio: fix build after 4.2 changes
Browse files Browse the repository at this point in the history
more stubs, mostly

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Michael S. Tsirkin committed Sep 9, 2015
1 parent 997e120 commit ddab2c0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/virtio/asm/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define mb() __sync_synchronize()

#define smp_mb() mb()
# define dma_rmb() barrier()
# define dma_wmb() barrier()
# define smp_rmb() barrier()
# define smp_wmb() barrier()
/* Weak barriers should be used. If not - it's a bug */
Expand Down
3 changes: 3 additions & 0 deletions tools/virtio/linux/export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define EXPORT_SYMBOL_GPL(sym) extern typeof(sym) sym
#define EXPORT_SYMBOL(sym) extern typeof(sym) sym

8 changes: 8 additions & 0 deletions tools/virtio/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

typedef unsigned long long dma_addr_t;
typedef size_t __kernel_size_t;
typedef unsigned int __wsum;

struct page {
unsigned long long dummy;
Expand All @@ -47,6 +48,13 @@ static inline void *kmalloc(size_t s, gfp_t gfp)
return __kmalloc_fake;
return malloc(s);
}
static inline void *kzalloc(size_t s, gfp_t gfp)
{
void *p = kmalloc(s, gfp);

memset(p, 0, s);
return p;
}

static inline void kfree(void *p)
{
Expand Down

0 comments on commit ddab2c0

Please sign in to comment.