Skip to content

Commit

Permalink
[x86 setup] APM: BX should be zero when disconnecting
Browse files Browse the repository at this point in the history
For APM calls, BX contains the device index, which is zero for
the system BIOS.  Disconnect requres BX = 0.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
H. Peter Anvin committed Jul 25, 2007
1 parent 1514ab0 commit 1a13286
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/i386/boot/apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ int query_apm_bios(void)

/* Disconnect first, just in case */
ax = 0x5304;
bx = 0;
asm volatile("pushl %%ebp ; int $0x15 ; popl %%ebp"
: "+a" (ax)
: : "ebx", "ecx", "edx", "esi", "edi");
: "+a" (ax), "+b" (bx)
: : "ecx", "edx", "esi", "edi");

/* Paranoia */
ebx = esi = 0;
Expand Down

0 comments on commit 1a13286

Please sign in to comment.