Module Name:    src
Committed By:   dsl
Date:           Sun Sep 30 20:19:52 UTC 2012

Modified Files:
        src/sys/arch/i386/conf: files.i386
        src/sys/arch/i386/i386: genassym.cf machdep.c mainbus.c
Removed Files:
        src/sys/arch/i386/i386: apmbios.c apmcall.S

Log Message:
Remove the obvious parts of i386 Advanced power management 'apm' support.
This is the code that predates ACPI, and might once have been able to
  power down some laptops.
It hasn't been compiled for ages (it isn't it i386/ALL or any other
  standard kernel) and hasn't worked for even longer.
The APM specification was made obsolete by ACPI before it was widely
  implemented.
This will allow some other, even more dubious code be removed.
Unfortunately apmbios.h is used by the world !


To generate a diff of this commit:
cvs rdiff -u -r1.365 -r1.366 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.19 -r0 src/sys/arch/i386/i386/apmbios.c
cvs rdiff -u -r1.3 -r0 src/sys/arch/i386/i386/apmcall.S
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.730 -r1.731 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/i386/i386/mainbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.365 src/sys/arch/i386/conf/files.i386:1.366
--- src/sys/arch/i386/conf/files.i386:1.365	Thu Sep 27 18:28:55 2012
+++ src/sys/arch/i386/conf/files.i386	Sun Sep 30 20:19:51 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.365 2012/09/27 18:28:55 alnsn Exp $
+#	$NetBSD: files.i386,v 1.366 2012/09/30 20:19:51 dsl Exp $
 #
 # new style config file for i386 architecture
 #
@@ -322,11 +322,6 @@ file	arch/i386/isa/cmos.c		cmos needs-fl
 
 include "dev/apm/files.apm"
 
-# Advanced Power Management support (APM)
-attach	apm at apmbus with apmbios: bioscall
-file	arch/i386/i386/apmbios.c	apmbios	needs-flag
-file	arch/i386/i386/apmcall.S	apmbios
-
 #
 # Compatibility modules
 #

Index: src/sys/arch/i386/i386/genassym.cf
diff -u src/sys/arch/i386/i386/genassym.cf:1.92 src/sys/arch/i386/i386/genassym.cf:1.93
--- src/sys/arch/i386/i386/genassym.cf:1.92	Fri Apr 20 22:23:24 2012
+++ src/sys/arch/i386/i386/genassym.cf	Sun Sep 30 20:19:51 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.92 2012/04/20 22:23:24 rmind Exp $
+#	$NetBSD: genassym.cf,v 1.93 2012/09/30 20:19:51 dsl Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -108,10 +108,6 @@ ifndef XEN
 include "apmbios.h"
 endif
 endif
-if NAPMBIOS > 0
-include <machine/bioscall.h>
-include <machine/apmvar.h>
-endif
 
 include <compat/sys/signal.h>
 
@@ -264,24 +260,6 @@ else
 define	IH_NEXT			offsetof(struct intrhand, ih_next)
 endif
 
-if NAPMBIOS > 0
-define	APM_CODE32		offsetof(struct apm_connect_info, apm_code32_seg_base)
-define	APM_CODE16		offsetof(struct apm_connect_info, apm_code16_seg_base)
-define	APM_DATA		offsetof(struct apm_connect_info, apm_data_seg_base)
-define	APM_CODE32_LEN		offsetof(struct apm_connect_info, apm_code32_seg_len)
-define	APM_DATA_LEN		offsetof(struct apm_connect_info, apm_data_seg_len)
-define	APM_ENTRY		offsetof(struct apm_connect_info, apm_entrypt)
-define	APM_DETAIL		offsetof(struct apm_connect_info, apm_detail)
-define	APM_SIZE		sizeof(struct apm_connect_info)
-define	BIOSCALLREG_EAX		offsetof(struct bioscallregs, EAX)
-define	BIOSCALLREG_EBX		offsetof(struct bioscallregs, EBX)
-define	BIOSCALLREG_ECX		offsetof(struct bioscallregs, ECX)
-define	BIOSCALLREG_EDX		offsetof(struct bioscallregs, EDX)
-define	BIOSCALLREG_ESI		offsetof(struct bioscallregs, ESI)
-define	BIOSCALLREG_EDI		offsetof(struct bioscallregs, EDI)
-define	BIOSCALLREG_EFLAGS	offsetof(struct bioscallregs, EFLAGS)
-endif
-
 define	CPU_INFO_SELF		offsetof(struct cpu_info, ci_self)
 define	CPU_INFO_RESCHED	offsetof(struct cpu_info, ci_want_resched)
 define	CPU_INFO_WANT_PMAPLOAD	offsetof(struct cpu_info, ci_want_pmapload)

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.730 src/sys/arch/i386/i386/machdep.c:1.731
--- src/sys/arch/i386/i386/machdep.c:1.730	Fri Jul 27 22:55:29 2012
+++ src/sys/arch/i386/i386/machdep.c	Sun Sep 30 20:19:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.730 2012/07/27 22:55:29 drochner Exp $	*/
+/*	$NetBSD: machdep.c,v 1.731 2012/09/30 20:19:51 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.730 2012/07/27 22:55:29 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.731 2012/09/30 20:19:51 dsl Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -190,10 +190,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include <machine/acpi_machdep.h>
 #endif
 
-#if NAPMBIOS > 0
-#include <machine/apmvar.h>
-#endif
-
 #include "isa.h"
 #include "isadma.h"
 #include "npx.h"
@@ -894,21 +890,6 @@ haltsys:
 
 		acpi_enter_sleep_state(ACPI_STATE_S5);
 #endif
-#if NAPMBIOS > 0 && !defined(APM_NO_POWEROFF)
-		/* turn off, if we can.  But try to turn disk off and
-		 * wait a bit first--some disk drives are slow to clean up
-		 * and users have reported disk corruption.
-		 */
-		delay(500000);
-		apm_set_powstate(NULL, APM_DEV_DISK(APM_DEV_ALLUNITS),
-		    APM_SYS_OFF);
-		delay(500000);
-		apm_set_powstate(NULL, APM_DEV_ALLDEVS, APM_SYS_OFF);
-		printf("WARNING: APM powerdown failed!\n");
-		/*
-		 * RB_POWERDOWN implies RB_HALT... fall into it...
-		 */
-#endif
 	}
 
 #ifdef MULTIPROCESSOR

Index: src/sys/arch/i386/i386/mainbus.c
diff -u src/sys/arch/i386/i386/mainbus.c:1.94 src/sys/arch/i386/i386/mainbus.c:1.95
--- src/sys/arch/i386/i386/mainbus.c:1.94	Tue Feb  7 16:34:44 2012
+++ src/sys/arch/i386/i386/mainbus.c	Sun Sep 30 20:19:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.94 2012/02/07 16:34:44 dyoung Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.95 2012/09/30 20:19:52 dsl Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.94 2012/02/07 16:34:44 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.95 2012/09/30 20:19:52 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -64,11 +64,6 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 
 #include <machine/mpbiosvar.h>
 #include <machine/mpacpi.h>
 
-#if NAPMBIOS > 0
-#include <machine/bioscall.h>
-#include <machine/apmvar.h>
-#endif
-
 #if NPNPBIOS > 0
 #include <arch/i386/pnpbios/pnpbiosvar.h>
 #endif
@@ -318,14 +313,6 @@ mainbus_attach(device_t parent, device_t
 	}
 #endif
 
-#if NAPMBIOS > 0
-#if NACPICA > 0
-	if (acpi_active == 0)
-#endif
-	if (apm_busprobe())
-		config_found_ia(self, "apmbus", 0, 0);
-#endif
-
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 }

Reply via email to