38456 ipf mostly ignores locking in NetBSD
This commit is contained in:
parent
60886a044c
commit
552614e264
28
sys/dist/ipf/netinet/ip_compat.h
vendored
28
sys/dist/ipf/netinet/ip_compat.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ip_compat.h,v 1.22 2008/07/24 09:37:58 darrenr Exp $ */
|
||||
/* $NetBSD: ip_compat.h,v 1.23 2008/11/06 09:51:57 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1993-2001, 2003 by Darren Reed.
|
||||
@ -797,6 +797,28 @@ typedef unsigned int u_32_t;
|
||||
# ifdef _KERNEL
|
||||
# if (__NetBSD_Version__ >= 499000000)
|
||||
typedef char * caddr_t;
|
||||
# ifdef _KERNEL
|
||||
# include <sys/rwlock.h>
|
||||
# define USE_MUTEXES 1
|
||||
# define KMUTEX_T kmutex_t
|
||||
# define KRWLOCK_T krwlock_t
|
||||
# define MUTEX_DESTROY(x) mutex_destroy(&(x)->ipf_lk)
|
||||
# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk)
|
||||
# define MUTEX_ENTER(x) mutex_enter(&(x)->ipf_lk)
|
||||
# define MUTEX_EXIT(x) mutex_exit(&(x)->ipf_lk)
|
||||
# define MUTEX_INIT(x,y) mutex_init(&(x)->ipf_lk, MUTEX_DRIVER,\
|
||||
IPL_SOFTNET)
|
||||
# define MUTEX_NUKE(x) bzero((x), sizeof(*(x)))
|
||||
# define READ_ENTER(x) rw_enter(&(x)->ipf_lk, RW_READER)
|
||||
# define RWLOCK_INIT(x, y) rw_init(&(x)->ipf_lk)
|
||||
# define RWLOCK_EXIT(x) rw_exit(&(x)->ipf_lk)
|
||||
# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk)
|
||||
# define WRITE_ENTER(x) rw_enter(&(x)->ipf_lk, RW_WRITER)
|
||||
# define SPL_SCHED(x) ;
|
||||
# define SPL_NET(x) ;
|
||||
# define SPL_IMP(x) ;
|
||||
# define SPL_X(x) ;
|
||||
# endif
|
||||
# endif
|
||||
# if (__NetBSD_Version__ >= 399001400)
|
||||
# define KMALLOCS(a, b, c) (a) = (b)malloc((c), _M_IPF, M_NOWAIT)
|
||||
@ -1471,7 +1493,7 @@ typedef union {
|
||||
#ifdef KMUTEX_T
|
||||
struct {
|
||||
KMUTEX_T ipf_slk;
|
||||
char *ipf_lname;
|
||||
const char *ipf_lname;
|
||||
} ipf_lkun_s;
|
||||
#endif
|
||||
eMmutex_t ipf_emu;
|
||||
@ -1481,7 +1503,7 @@ typedef union {
|
||||
#ifdef KRWLOCK_T
|
||||
struct {
|
||||
KRWLOCK_T ipf_slk;
|
||||
char *ipf_lname;
|
||||
const char *ipf_lname;
|
||||
int ipf_sr;
|
||||
int ipf_sw;
|
||||
u_int ipf_magic;
|
||||
|
Loading…
Reference in New Issue
Block a user