apm.c (24407) | apm.c (26657) |
---|---|
1/* 2 * APM (Advanced Power Management) BIOS Device Driver 3 * 4 * Copyright (c) 1994 UKAI, Fumitoshi. 5 * Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi <hosokawa@jp.FreeBSD.org> 6 * Copyright (c) 1996 Nate Williams <nate@FreeBSD.org> 7 * Copyright (c) 1997 Poul-Henning Kamp <phk@FreeBSD.org> 8 * 9 * This software may be used, modified, copied, and distributed, in 10 * both source and binary form provided that the above copyright and 11 * these terms are retained. Under no circumstances is the author 12 * responsible for the proper functioning of this software, nor does 13 * the author assume any responsibility for damages incurred with its 14 * use. 15 * 16 * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) 17 * | 1/* 2 * APM (Advanced Power Management) BIOS Device Driver 3 * 4 * Copyright (c) 1994 UKAI, Fumitoshi. 5 * Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi <hosokawa@jp.FreeBSD.org> 6 * Copyright (c) 1996 Nate Williams <nate@FreeBSD.org> 7 * Copyright (c) 1997 Poul-Henning Kamp <phk@FreeBSD.org> 8 * 9 * This software may be used, modified, copied, and distributed, in 10 * both source and binary form provided that the above copyright and 11 * these terms are retained. Under no circumstances is the author 12 * responsible for the proper functioning of this software, nor does 13 * the author assume any responsibility for damages incurred with its 14 * use. 15 * 16 * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) 17 * |
18 * $Id: apm.c,v 1.55 1997/03/29 11:06:37 phk Exp $ | 18 * $Id: apm.c,v 1.56 1997/03/30 09:08:00 phk Exp $ |
19 */ 20 21#include <sys/param.h> 22#include <sys/conf.h> 23#include <sys/kernel.h> 24#ifdef DEVFS 25#include <sys/devfsext.h> 26#endif /*DEVFS*/ --- 191 unchanged lines hidden (view full) --- 218 if (apm_int(&eax, &ebx, &ecx)) { 219 printf("Display off failure: errcode = %ld\n", 220 0xff & (eax >> 8)); 221 return 1; 222 } 223 return 0; 224} 225 | 19 */ 20 21#include <sys/param.h> 22#include <sys/conf.h> 23#include <sys/kernel.h> 24#ifdef DEVFS 25#include <sys/devfsext.h> 26#endif /*DEVFS*/ --- 191 unchanged lines hidden (view full) --- 218 if (apm_int(&eax, &ebx, &ecx)) { 219 printf("Display off failure: errcode = %ld\n", 220 0xff & (eax >> 8)); 221 return 1; 222 } 223 return 0; 224} 225 |
226/* 227 * Turn off the entire system. 228 */ 229void 230apm_display(void) 231{ 232 u_long eax, ebx, ecx; |
|
226 | 233 |
234 eax = (APM_BIOS << 8) | APM_SETPWSTATE; 235 ebx = PMDV_ALLDEV; 236 ecx = PMST_OFF; 237 apm_int(&eax, &ebx, &ecx); 238} 239 |
|
227/* APM Battery low handler */ 228static void 229apm_battery_low(void) 230{ 231 printf("\007\007 * * * BATTERY IS LOW * * * \007\007"); 232} 233 234/* APM hook manager */ --- 624 unchanged lines hidden --- | 240/* APM Battery low handler */ 241static void 242apm_battery_low(void) 243{ 244 printf("\007\007 * * * BATTERY IS LOW * * * \007\007"); 245} 246 247/* APM hook manager */ --- 624 unchanged lines hidden --- |