HIBERNATE that needs to be in MD code.
ok gkoehler
-/* $OpenBSD: acpi_machdep.c,v 1.96 2022/02/09 23:54:32 deraadt Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.97 2022/02/10 16:41:51 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
DEVNAME(sc));
return (ECANCELED);
}
+
+ /*
+ * XXX
+ * Flag to disk drivers that they should "power down" the disk
+ * when we get to DVACT_POWERDOWN.
+ */
+ boothowto |= RB_POWERDOWN;
+ config_suspend_all(DVACT_POWERDOWN);
+ boothowto &= ~RB_POWERDOWN;
}
#endif
- /*
- * XXX
- * Flag to disk drivers that they should "power down" the disk
- * when we get to DVACT_POWERDOWN.
- */
- boothowto |= RB_POWERDOWN;
- config_suspend_all(DVACT_POWERDOWN);
- boothowto &= ~RB_POWERDOWN;
-
acpi_sleep_pm(sc, state);
printf("%s: acpi_sleep_pm failed", DEVNAME(sc));
return (ECANCELED);
-/* $OpenBSD: acpi_machdep.c,v 1.78 2022/02/09 23:54:34 deraadt Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.79 2022/02/10 16:41:53 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
DEVNAME(sc));
return (ECANCELED);
}
+
+ /* XXX
+ * Flag to disk drivers that they should "power down" the disk
+ * when we get to DVACT_POWERDOWN.
+ */
+ boothowto |= RB_POWERDOWN;
+ config_suspend_all(DVACT_POWERDOWN);
+ boothowto &= ~RB_POWERDOWN;
}
#endif
- /* XXX
- * Flag to disk drivers that they should "power down" the disk
- * when we get to DVACT_POWERDOWN.
- */
- boothowto |= RB_POWERDOWN;
- config_suspend_all(DVACT_POWERDOWN);
- boothowto &= ~RB_POWERDOWN;
-
acpi_sleep_pm(sc, state);
printf("%s: acpi_sleep_pm failed", DEVNAME(sc));
return (ECANCELED);
-/* $OpenBSD: subr_suspend.c,v 1.1 2022/02/08 17:25:12 deraadt Exp $ */
+/* $OpenBSD: subr_suspend.c,v 1.2 2022/02/10 16:41:53 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
#include <sys/buf.h>
#include <sys/malloc.h>
#include <sys/pool.h>
+#include <sys/reboot.h>
#include <sys/proc.h>
#include <sys/sensors.h>
#include <sys/sysctl.h>
if (sleep_setstate(v))
goto fail_pts;
+ if (sleepmode == SLEEP_SUSPEND) {
+ /*
+ * XXX
+ * Flag to disk drivers that they should "power down" the disk
+ * when we get to DVACT_POWERDOWN.
+ */
+ boothowto |= RB_POWERDOWN;
+ config_suspend_all(DVACT_POWERDOWN);
+ boothowto &= ~RB_POWERDOWN;
+ }
+
gosleep(v);
#ifdef HIBERNATE