nic_uio: fix build with freebsd 10
authorOlivier Matz <olivier.matz@6wind.com>
Fri, 25 Apr 2014 11:59:45 +0000 (13:59 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 29 Apr 2014 23:31:30 +0000 (01:31 +0200)
Compiling the DPDK under FreeBSD gives the following error due to a
missing include <sys/rwlock.h>.

In file included from nic_uio.c:52:
@/vm/vm_pager.h:126:2: error: implicit declaration of function 'rw_assert' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
        VM_OBJECT_ASSERT_WLOCKED(object);
        ^
@/vm/vm_object.h:226:2: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
        rw_assert(&(object)->lock, RA_WLOCKED)
        ^
In file included from nic_uio.c:52:
@/vm/vm_pager.h:126:2: error: use of undeclared identifier 'RA_WLOCKED'
@/vm/vm_object.h:226:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
        rw_assert(&(object)->lock, RA_WLOCKED)
                                   ^
In file included from nic_uio.c:52:
@/vm/vm_pager.h:143:2: error: use of undeclared identifier 'RA_WLOCKED'
        VM_OBJECT_ASSERT_WLOCKED(object);
        ^
@/vm/vm_object.h:226:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
        rw_assert(&(object)->lock, RA_WLOCKED)
                                   ^
In file included from nic_uio.c:52:
@/vm/vm_pager.h:167:2: error: use of undeclared identifier 'RA_WLOCKED'
        VM_OBJECT_ASSERT_WLOCKED(object);
        ^
@/vm/vm_object.h:226:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
        rw_assert(&(object)->lock, RA_WLOCKED)
                                   ^
In file included from nic_uio.c:52:
@/vm/vm_pager.h:190:2: error: use of undeclared identifier 'RA_WLOCKED'
        VM_OBJECT_ASSERT_WLOCKED(m->object);
        ^
@/vm/vm_object.h:226:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
        rw_assert(&(object)->lock, RA_WLOCKED)
                                   ^

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
lib/librte_eal/bsdapp/nic_uio/nic_uio.c

index ce97dfc..c10e9aa 100644 (file)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/bus.h> /* structs, prototypes for pci bus stuff and DEVMETHOD */
 #include <sys/rman.h>
 #include <sys/systm.h>
+#include <sys/rwlock.h>
 #include <sys/proc.h>
 
 #include <machine/bus.h>