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.
This commit is contained in:
parent
0fb9c0032d
commit
215cb1d7cc
@ -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);
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#define APM_NEVENTS 16
|
||||
#define APM_NPMEV 13
|
||||
#define APM_UNKNOWN 0xff
|
||||
|
||||
/* static data */
|
||||
struct apm_softc {
|
||||
|
Loading…
Reference in New Issue
Block a user