diff options
author | 2020-04-06 23:16:50 +0000 | |
---|---|---|
committer | 2020-04-06 23:16:50 +0000 | |
commit | 1fa3f0a0fe7b0ecfb57931a2dbbaba21d9aaccee (patch) | |
tree | 599bd6db06c1a4e658b87221e70f9e455db0eec6 | |
parent | Fix pubkey leak in CA process for ASN1_DN IDs. (diff) | |
download | wireguard-openbsd-1fa3f0a0fe7b0ecfb57931a2dbbaba21d9aaccee.tar.xz wireguard-openbsd-1fa3f0a0fe7b0ecfb57931a2dbbaba21d9aaccee.zip |
acpi(4): acpi_sleep(): tsleep(9) -> tsleep_nsec(9)
kettenis@ notes that ACPI integers are supposed to be unsigned, but
ours are signed. This is a much deeper problem than what I'm looking
to change with this conversion. To work around the issue for now we
can round the sleep interval up to 1 millisecond.
There is a very nasty-looking rwsleep(9) call elsewhere in
dev/acpi/dsdt.c that I'm going to leave as-is for now to avoid
breaking something.
With input from pirofti@, kettenis@, and mortimer@.
Tested by Lucas Raab, Moises Simon, mortimer@, and gkoehler@.
ok kettenis@
-rw-r--r-- | sys/dev/acpi/dsdt.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 3144514176e..bf69380f6d6 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.249 2019/10/16 01:43:50 mlarkin Exp $ */ +/* $OpenBSD: dsdt.c,v 1.250 2020/04/06 23:16:50 cheloha Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -465,15 +465,14 @@ void acpi_sleep(int ms, char *reason) { static int acpinowait; - int to = ms * hz / 1000; + + /* XXX ACPI integers are supposed to be unsigned. */ + ms = MAX(1, ms); if (cold) delay(ms * 1000); - else { - if (to <= 0) - to = 1; - tsleep(&acpinowait, PWAIT, reason, to); - } + else + tsleep_nsec(&acpinowait, PWAIT, reason, MSEC_TO_NSEC(ms)); } void |