diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2023-06-28 08:23:26 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2023-06-28 08:23:26 +0000 |
commit | 76401ff66afbf67b6f6aa86d8975c775e5646835 (patch) | |
tree | c940b1d81a0e321a088f9659035179cdbff1bbc9 /sys/dev/pci | |
parent | f8d70ade55f5d4ec6464845c1d9990b46055a949 (diff) |
First step at removing struct sleep_state.
Pass the timeout and sleep priority not only to sleep_setup() but also
to sleep_finish(). With that sls_timeout and sls_catch can be removed
from struct sleep_state.
The timeout is now setup first thing in sleep_finish() and no longer as
last thing in sleep_setup(). This should not cause a noticeable difference
since the code run between sleep_setup() and sleep_finish() is minimal.
OK kettenis@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/drm/drm_linux.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/if_myx.c | 6 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/pci/drm/drm_linux.c b/sys/dev/pci/drm/drm_linux.c index fb2dfe029d2..d710aebc5f0 100644 --- a/sys/dev/pci/drm/drm_linux.c +++ b/sys/dev/pci/drm/drm_linux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_linux.c,v 1.98 2023/06/01 10:21:26 claudio Exp $ */ +/* $OpenBSD: drm_linux.c,v 1.99 2023/06/28 08:23:25 claudio Exp $ */ /* * Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org> * Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org> @@ -135,14 +135,15 @@ schedule_timeout(long timeout) { struct sleep_state sls; unsigned long deadline; - int wait, spl, timo = 0; + int wait, spl, prio, timo = 0; MUTEX_ASSERT_LOCKED(&sch_mtx); KASSERT(!cold); if (timeout != MAX_SCHEDULE_TIMEOUT) timo = timeout; - sleep_setup(&sls, sch_ident, sch_priority, "schto", timo); + prio = sch_priority; + sleep_setup(&sls, sch_ident, prio, "schto"); wait = (sch_proc == curproc && timeout > 0); @@ -152,7 +153,7 @@ schedule_timeout(long timeout) if (timeout != MAX_SCHEDULE_TIMEOUT) deadline = jiffies + timeout; - sleep_finish(&sls, wait); + sleep_finish(&sls, prio, timo, wait); if (timeout != MAX_SCHEDULE_TIMEOUT) timeout = deadline - jiffies; diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 76012c1134a..4b07f0b97dd 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.116 2022/03/11 18:00:48 mpi Exp $ */ +/* $OpenBSD: if_myx.c,v 1.117 2023/06/28 08:23:25 claudio Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -1397,9 +1397,9 @@ myx_down(struct myx_softc *sc) (void)myx_cmd(sc, MYXCMD_SET_IFDOWN, &mc, NULL); while (sc->sc_state != MYX_S_OFF) { - sleep_setup(&sls, sts, PWAIT, "myxdown", 0); + sleep_setup(&sls, sts, PWAIT, "myxdown"); membar_consumer(); - sleep_finish(&sls, sc->sc_state != MYX_S_OFF); + sleep_finish(&sls, PWAIT, 0, sc->sc_state != MYX_S_OFF); } s = splnet(); |