Module Name: src
Committed By: jruoho
Date: Mon Mar 8 11:45:45 UTC 2010
Modified Files:
src/sys/dev/acpi: acpi_bat.c
Log Message:
Use the predefined ACPI_STA_BATTERY_PRESENT instead of defining a local one.
To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/acpi/acpi_bat.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/dev/acpi/acpi_bat.c
diff -u src/sys/dev/acpi/acpi_bat.c:1.84 src/sys/dev/acpi/acpi_bat.c:1.85
--- src/sys/dev/acpi/acpi_bat.c:1.84 Fri Mar 5 14:00:16 2010
+++ src/sys/dev/acpi/acpi_bat.c Mon Mar 8 11:45:45 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_bat.c,v 1.84 2010/03/05 14:00:16 jruoho Exp $ */
+/* $NetBSD: acpi_bat.c,v 1.85 2010/03/08 11:45:45 jruoho Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.84 2010/03/05 14:00:16 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.85 2010/03/08 11:45:45 jruoho Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -166,19 +166,6 @@
#define ACPIBAT_ST_CRITICAL 0x00000004 /* battery is critical */
/*
- * Flags for battery status from _STA return. Note that
- * this differs from the conventional evaluation of _STA:
- *
- * "Unlike most other devices, when a battery is inserted or
- * removed from the system, the device itself (the battery bay)
- * is still considered to be present in the system. For most
- * systems, the _STA for this device will always return a value
- * with bits 0-3 set and will toggle bit 4 to indicate the actual
- * presence of a battery. (ACPI 3.0, sec. 10.2.1, p. 320.)"
- */
-#define ACPIBAT_STA_PRESENT 0x00000010 /* battery present */
-
-/*
* A value used when _BST or _BIF is teporarily unknown (see ibid.).
*/
#define ACPIBAT_VAL_UNKNOWN 0xFFFFFFFF
@@ -318,7 +305,7 @@
sc->sc_sensor[ACPIBAT_PRESENT].state = ENVSYS_SVALID;
- if ((val & ACPIBAT_STA_PRESENT) == 0) {
+ if ((val & ACPI_STA_BATTERY_PRESENT) == 0) {
sc->sc_sensor[ACPIBAT_PRESENT].value_cur = 0;
return 0;
}