aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/ttydevsw.h
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-04-17 18:34:49 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-04-17 18:34:49 +0000
commit23d5326823c740f2ddcd3268216d0a59b374457c (patch)
treef6d0e247891d6403320a9da2f4d2bab4abca18e2 /sys/sys/ttydevsw.h
parent490befd40a647bb9108c3f71fccb50137ac9a254 (diff)
downloadsrc-23d5326823c740f2ddcd3268216d0a59b374457c.tar.gz
src-23d5326823c740f2ddcd3268216d0a59b374457c.zip
tty: convert tty_lock_assert to tty_assert_locked to hide lock type
A later change, currently being iterated on in D24459, will in-fact change the lock type to an sx so that TTY drivers can sleep on it if they need to. Committing this ahead of time to make the review in question a little more palatable. tty_lock_assert() is unfortunately still needed for now in two places to make sure that the tty lock has not been recursed upon, for those scenarios where it's supplied by the TTY driver and possibly a mutex that is allowed to recurse. Suggested by: markj
Notes
Notes: svn path=/head/; revision=360051
Diffstat (limited to 'sys/sys/ttydevsw.h')
-rw-r--r--sys/sys/ttydevsw.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/sys/ttydevsw.h b/sys/sys/ttydevsw.h
index b189335c5e9d..d6b544e80323 100644
--- a/sys/sys/ttydevsw.h
+++ b/sys/sys/ttydevsw.h
@@ -86,7 +86,7 @@ static __inline int
ttydevsw_open(struct tty *tp)
{
- tty_lock_assert(tp, MA_OWNED);
+ tty_assert_locked(tp);
MPASS(!tty_gone(tp));
return (tp->t_devsw->tsw_open(tp));
@@ -96,7 +96,7 @@ static __inline void
ttydevsw_close(struct tty *tp)
{
- tty_lock_assert(tp, MA_OWNED);
+ tty_assert_locked(tp);
MPASS(!tty_gone(tp));
tp->t_devsw->tsw_close(tp);
@@ -106,7 +106,7 @@ static __inline void
ttydevsw_outwakeup(struct tty *tp)
{
- tty_lock_assert(tp, MA_OWNED);
+ tty_assert_locked(tp);
MPASS(!tty_gone(tp));
/* Prevent spurious wakeups. */
@@ -120,7 +120,7 @@ static __inline void
ttydevsw_inwakeup(struct tty *tp)
{
- tty_lock_assert(tp, MA_OWNED);
+ tty_assert_locked(tp);
MPASS(!tty_gone(tp));
/* Prevent spurious wakeups. */
@@ -134,7 +134,7 @@ static __inline int
ttydevsw_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
{
- tty_lock_assert(tp, MA_OWNED);
+ tty_assert_locked(tp);
MPASS(!tty_gone(tp));
return (tp->t_devsw->tsw_ioctl(tp, cmd, data, td));
@@ -145,7 +145,7 @@ ttydevsw_cioctl(struct tty *tp, int unit, u_long cmd, caddr_t data,
struct thread *td)
{
- tty_lock_assert(tp, MA_OWNED);
+ tty_assert_locked(tp);
MPASS(!tty_gone(tp));
return (tp->t_devsw->tsw_cioctl(tp, unit, cmd, data, td));
@@ -183,7 +183,7 @@ static __inline void
ttydevsw_pktnotify(struct tty *tp, char event)
{
- tty_lock_assert(tp, MA_OWNED);
+ tty_assert_locked(tp);
MPASS(!tty_gone(tp));
tp->t_devsw->tsw_pktnotify(tp, event);
@@ -202,7 +202,7 @@ static __inline bool
ttydevsw_busy(struct tty *tp)
{
- tty_lock_assert(tp, MA_OWNED);
+ tty_assert_locked(tp);
MPASS(!tty_gone(tp));
return (tp->t_devsw->tsw_busy(tp));