diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-05-29 15:10:27 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-29 15:10:27 -0700 |
commit | 907e6a81f3c0e36d6c5aa252b9f513664b643b4c (patch) | |
tree | 9aaa2fe9943da2c070fe02fb8726c7d7a73c9f21 /com32/mboot | |
parent | dd71e58827f55c797bfc58ec5ce15061165d5ff9 (diff) | |
download | syslinux-907e6a81f3c0e36d6c5aa252b9f513664b643b4c.tar.gz |
Run Nindent on com32/mboot/apm.c
Automatically reformat com32/mboot/apm.c using Nindent.
Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/mboot')
-rw-r--r-- | com32/mboot/apm.c | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/com32/mboot/apm.c b/com32/mboot/apm.c index 2cfb7de0..3f48af7c 100644 --- a/com32/mboot/apm.c +++ b/com32/mboot/apm.c @@ -21,7 +21,6 @@ * * ----------------------------------------------------------------------- */ - /* * apm.c * @@ -33,55 +32,55 @@ void mboot_apm(void) { - static struct apm_info apm; - com32sys_t ireg, oreg; - - memset(&ireg, 0, sizeof ireg); - - ireg.eax.w[0] = 0x5300; - __intcall(0x15, &ireg, &oreg); - - if (oreg.eflags.l & EFLAGS_CF) - return; /* No APM BIOS */ + static struct apm_info apm; + com32sys_t ireg, oreg; - if (oreg.ebx.w[0] != 0x504d) - return; /* No "PM" signature */ + memset(&ireg, 0, sizeof ireg); - if (!(oreg.ecx.w[0] & 0x02)) - return; /* 32 bits not supported */ + ireg.eax.w[0] = 0x5300; + __intcall(0x15, &ireg, &oreg); - /* Disconnect first, just in case */ - ireg.eax.b[0] = 0x04; - __intcall(0x15, &ireg, &oreg); + if (oreg.eflags.l & EFLAGS_CF) + return; /* No APM BIOS */ - /* 32-bit connect */ - ireg.eax.b[0] = 0x03; - __intcall(0x15, &ireg, &oreg); + if (oreg.ebx.w[0] != 0x504d) + return; /* No "PM" signature */ - apm.cseg = oreg.eax.w[0]; - apm.offset = oreg.ebx.l; - apm.cseg_16 = oreg.ecx.w[0]; - apm.dseg_16 = oreg.edx.w[0]; - apm.cseg_len = oreg.esi.w[0]; - apm.cseg_16_len = oreg.esi.w[1]; - apm.dseg_16_len = oreg.edi.w[0]; + if (!(oreg.ecx.w[0] & 0x02)) + return; /* 32 bits not supported */ - /* Redo the installation check as the 32-bit connect; - some BIOSes return different flags this way... */ - - ireg.eax.b[0] = 0x00; - __intcall(0x15, &ireg, &oreg); - - if ((oreg.eflags.l & EFLAGS_CF) || (oreg.ebx.w[0] != 0x504d)) { - /* Failure with 32-bit connect, try to disconect and ignore */ + /* Disconnect first, just in case */ ireg.eax.b[0] = 0x04; - __intcall(0x15, &ireg, NULL); - return; - } - - apm.version = oreg.eax.w[0]; - - mbinfo.apm_table = map_data(&apm, sizeof apm, 4, false); - if (mbinfo.apm_table) - mbinfo.flags |= MB_INFO_APM_TABLE; + __intcall(0x15, &ireg, &oreg); + + /* 32-bit connect */ + ireg.eax.b[0] = 0x03; + __intcall(0x15, &ireg, &oreg); + + apm.cseg = oreg.eax.w[0]; + apm.offset = oreg.ebx.l; + apm.cseg_16 = oreg.ecx.w[0]; + apm.dseg_16 = oreg.edx.w[0]; + apm.cseg_len = oreg.esi.w[0]; + apm.cseg_16_len = oreg.esi.w[1]; + apm.dseg_16_len = oreg.edi.w[0]; + + /* Redo the installation check as the 32-bit connect; + some BIOSes return different flags this way... */ + + ireg.eax.b[0] = 0x00; + __intcall(0x15, &ireg, &oreg); + + if ((oreg.eflags.l & EFLAGS_CF) || (oreg.ebx.w[0] != 0x504d)) { + /* Failure with 32-bit connect, try to disconect and ignore */ + ireg.eax.b[0] = 0x04; + __intcall(0x15, &ireg, NULL); + return; + } + + apm.version = oreg.eax.w[0]; + + mbinfo.apm_table = map_data(&apm, sizeof apm, 4, false); + if (mbinfo.apm_table) + mbinfo.flags |= MB_INFO_APM_TABLE; } |