diff options
author | sam <sam@FreeBSD.org> | 2003-10-10 23:14:21 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-10-10 23:14:21 +0000 |
commit | 98e4036e5b9788802df7a257f689e91e34ba113d (patch) | |
tree | 19eca30476b376783a2f5001bee71fcf95a9fd63 /sys/dev/em/if_em.h | |
parent | 592158f5ce62f282f2676d220c95a828787891d4 (diff) | |
download | FreeBSD-src-98e4036e5b9788802df7a257f689e91e34ba113d.zip FreeBSD-src-98e4036e5b9788802df7a257f689e91e34ba113d.tar.gz |
locking fixups:
o correct recursive locking when polling and in em_82547_move_tail
o destroy mutex on detach
o add EM_LOCK_ASSERT and similar macros for creating+deleteing the mtx
Submitted by: Daniel Eischen <eischen@vigrid.com>
Diffstat (limited to 'sys/dev/em/if_em.h')
-rw-r--r-- | sys/dev/em/if_em.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/em/if_em.h b/sys/dev/em/if_em.h index 167f74b..8818165 100644 --- a/sys/dev/em/if_em.h +++ b/sys/dev/em/if_em.h @@ -425,7 +425,11 @@ struct adapter { struct em_hw_stats stats; }; -#define EM_LOCK(_sc) mtx_lock(&(_sc)->mtx) -#define EM_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define EM_LOCK_INIT(_sc, _name) \ + mtx_init(&(_sc)->mtx, _name, MTX_NETWORK_LOCK, MTX_DEF) +#define EM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx) +#define EM_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define EM_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define EM_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED) #endif /* _EM_H_DEFINED_ */ |