diff options
author | imp <imp@FreeBSD.org> | 2004-06-16 20:27:50 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-06-16 20:27:50 +0000 |
commit | 215cb1d7ccdd2e25e2236c1c9c4d0e58afa41587 (patch) | |
tree | 2898d1c9f60026512c5db09abcdece214dc198d5 /sys | |
parent | 0fb9c0032d9da15b91f564b65fe1f95a3e8a3b80 (diff) | |
download | FreeBSD-src-215cb1d7ccdd2e25e2236c1c9c4d0e58afa41587.zip FreeBSD-src-215cb1d7ccdd2e25e2236c1c9c4d0e58afa41587.tar.gz |
o Return ai_batteries as 0xffffffff instead of -1. This is a nop change, but
placates gcc which seems to like to complain about -1 being assigned to
an unsigned value. It is well defined and intended, but since signess bugs
are being hunted just change to 0xffffffff.
o Mask the lower 8 bits, not the lower 4 bits for the ai_capabilities word.
All 8 bits are defined and the 0xf was almost certainly a typo.
o Define APM_UNKNOWN to 0xff for emulation layer.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/bios/apm.c | 4 | ||||
-rw-r--r-- | sys/i386/bios/apm.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 768bd06..4aeedd1 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -675,11 +675,11 @@ apm_get_info(apm_info_t aip) sc->bios.r.ecx = 0; sc->bios.r.edx = 0; if (apm_bioscall()) { - aip->ai_batteries = -1; /* Unknown */ + aip->ai_batteries = 0xffffffff; /* Unknown */ aip->ai_capabilities = 0xff00; /* Unknown, with no bits set */ } else { aip->ai_batteries = sc->bios.r.ebx & 0xff; - aip->ai_capabilities = sc->bios.r.ecx & 0xf; + aip->ai_capabilities = sc->bios.r.ecx & 0xff; } bzero(aip->ai_spare, sizeof aip->ai_spare); diff --git a/sys/i386/bios/apm.h b/sys/i386/bios/apm.h index 038d7d8..660b42c 100644 --- a/sys/i386/bios/apm.h +++ b/sys/i386/bios/apm.h @@ -20,6 +20,7 @@ #define APM_NEVENTS 16 #define APM_NPMEV 13 +#define APM_UNKNOWN 0xff /* static data */ struct apm_softc { |