aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2022-09-08 00:04:42 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2022-10-17 20:37:02 +0000
commitfe9e99ff9c9d9028dccb1bb1537af46beabcb691 (patch)
treede7f4b4bd6e1c05b03311e61cce82ad696616f37
parent9ecbe62e7e51036a2f6a6c59c8ebac9c72dd56da (diff)
systm.h: change pause from #define to inline function
There are drivers are using (*pause)(x, y) function pointers and depending on how "pause" is used it gets replaced by pause_sbt causing compile time failures. Given "pause" is a generic enough name change it from a #define to an inline function to avoid replacements where it should not. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D36489 (cherry picked from commit 7ea1cac248574ed06c7823ffbfb9a60157240e57)
-rw-r--r--sys/sys/systm.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index b2b84d0fc722..bccf88573991 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -428,8 +428,11 @@ int msleep_spin_sbt(const void * _Nonnull chan, struct mtx *mtx,
0, C_HARDCLOCK)
int pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr,
int flags);
-#define pause(wmesg, timo) \
- pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK)
+static __inline int
+pause(const char *wmesg, int timo)
+{
+ return (pause_sbt(wmesg, tick_sbt * timo, 0, C_HARDCLOCK));
+}
#define pause_sig(wmesg, timo) \
pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK | C_CATCH)
#define tsleep(chan, pri, wmesg, timo) \