summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Wojtas <mw@FreeBSD.org>2018-05-10 09:18:26 +0000
committerMarcin Wojtas <mw@FreeBSD.org>2018-05-10 09:18:26 +0000
commit5fa38c5c6ede652e7cc2497140ef2538648bdd48 (patch)
tree5b2b913f581f983a2b73e182fcdb288af50e1b2c
parentca61e2d994c3b6aa60cf067da743afec94e12597 (diff)
downloadsrc-test2-5fa38c5c6ede652e7cc2497140ef2538648bdd48.tar.gz
src-test2-5fa38c5c6ede652e7cc2497140ef2538648bdd48.zip
Notes
-rw-r--r--ena_plat.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/ena_plat.h b/ena_plat.h
index 3ac94f57cdeb..6312ac252aed 100644
--- a/ena_plat.h
+++ b/ena_plat.h
@@ -165,7 +165,7 @@ static inline long PTR_ERR(const void *ptr)
#define GENMASK(h, l) (((1U << ((h) - (l) + 1)) - 1) << (l))
#define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (64 - 1 - (h))))
-#define BIT(x) (1 << (x))
+#define BIT(x) (1UL << (x))
#define ENA_ABORT() BUG()
#define BUG() panic("ENA BUG")
@@ -244,7 +244,12 @@ static inline long PTR_ERR(const void *ptr)
timeout_us * hz / 1000 / 1000 ); \
mtx_unlock(&((waitqueue).mtx)); \
} while (0)
-#define ENA_WAIT_EVENT_SIGNAL(waitqueue) cv_broadcast(&((waitqueue).wq))
+#define ENA_WAIT_EVENT_SIGNAL(waitqueue) \
+ do { \
+ mtx_lock(&((waitqueue).mtx)); \
+ cv_broadcast(&((waitqueue).wq)); \
+ mtx_unlock(&((waitqueue).mtx)); \
+ } while (0)
#define dma_addr_t bus_addr_t
#define u8 uint8_t