-/* $OpenBSD: acpitz.c,v 1.35 2010/01/13 23:31:25 marco Exp $ */
+/* $OpenBSD: acpitz.c,v 1.36 2010/07/20 12:12:19 deraadt Exp $ */
/*
* Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org>
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
"debouncing\n", DEVNAME(sc), tmp, name);
}
- /* debounce value */
- if (cold)
- delay(1000000);
- else
- while (tsleep(sc, PWAIT, "tzsleep", hz) !=
- EWOULDBLOCK);
+ acpi_sleep(1000, "acpitz"); /* debounce: 1000 msec */
}
if (i >= ACPITZ_TMP_RETRY) {
printf("%s: %s: failed to read %s\n", DEVNAME(sc),
-/* $OpenBSD: acpivar.h,v 1.61 2010/07/19 16:57:27 deraadt Exp $ */
+/* $OpenBSD: acpivar.h,v 1.62 2010/07/20 12:12:19 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
void acpi_write_pmreg(struct acpi_softc *, int, int, int);
void acpi_poll(void *);
+void acpi_sleep(int, char *);
int acpi_matchhids(struct acpi_attach_args *, const char *[], const char *);
-/* $OpenBSD: dsdt.c,v 1.167 2010/07/19 16:57:27 deraadt Exp $ */
+/* $OpenBSD: dsdt.c,v 1.168 2010/07/20 12:12:20 deraadt Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
void *_acpi_os_malloc(size_t, const char *, int);
void _acpi_os_free(void *, const char *, int);
-void acpi_sleep(int);
void acpi_stall(int);
struct aml_value *aml_callosi(struct aml_scope *, struct aml_value *);
}
void
-acpi_sleep(int ms)
+acpi_sleep(int ms, char *reason)
{
+ static int acpinowait;
int to = ms * hz / 1000;
if (cold)
else {
if (to <= 0)
to = 1;
- while (tsleep(acpi_softc, PWAIT, "asleep", to) !=
- EWOULDBLOCK);
+ tsleep(&acpinowait, PWAIT, reason, to);
}
}
break;
case AMLOP_SLEEP:
/* Sleep: i */
- acpi_sleep(opargs[0]->v_integer);
+ acpi_sleep(opargs[0]->v_integer, "amlsleep");
break;
case AMLOP_NOTIFY:
/* Notify: Si */