2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 1999 Nick Sayer (who stole shamelessly from blank_saver)
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer,
12 * without modification, immediately at the beginning of the file.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #include <sys/param.h>
34 #include <sys/systm.h>
35 #include <sys/condvar.h>
36 #include <sys/kernel.h>
37 #include <sys/kthread.h>
39 #include <sys/module.h>
40 #include <sys/mutex.h>
41 #include <sys/consio.h>
44 #include <dev/fb/fbreg.h>
45 #include <dev/fb/splashreg.h>
46 #include <dev/syscons/syscons.h>
48 #include <sys/selinfo.h>
49 #include <machine/apm_bios.h>
50 #include <machine/pc/bios.h>
51 #include <machine/bus.h>
52 #include <i386/bios/apm.h>
54 extern int apm_display(int newstate);
56 extern struct apm_softc apm_softc;
61 apm_saver(video_adapter_t *adp, int blank)
63 if (!apm_softc.initialized || !apm_softc.active)
71 apm_display(!blanked);
77 apm_init(video_adapter_t *adp)
79 if (!apm_softc.initialized || !apm_softc.active)
80 printf("WARNING: apm_saver module requires apm enabled\n");
85 apm_term(video_adapter_t *adp)
90 static scrn_saver_t apm_module = {
91 "apm_saver", apm_init, apm_term, apm_saver, NULL,
94 SAVER_MODULE(apm_saver, apm_module);
95 MODULE_DEPEND(apm_saver, apm, 1, 1, 1);