[syslinux:master] memdisk/dskprobe: Reorder operations to compact the debug output
syslinux-bot for Gene Cumm
gene.cumm at gmail.com
Fri Apr 1 15:54:38 PDT 2011
Commit-ID: 61702e11e5d3bc4de3b9df1c290f47c252af4605
Gitweb: http://syslinux.zytor.com/commit/61702e11e5d3bc4de3b9df1c290f47c252af4605
Author: Gene Cumm <gene.cumm at gmail.com>
AuthorDate: Wed, 26 Jan 2011 21:47:48 -0500
Committer: Gene Cumm <gene.cumm at gmail.com>
CommitDate: Wed, 26 Jan 2011 21:47:48 -0500
memdisk/dskprobe: Reorder operations to compact the debug output
By listing current regs, evaluate present, then display present last, it
allows it to conveniently use only 1 output line.
---
memdisk/dskprobe.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/memdisk/dskprobe.c b/memdisk/dskprobe.c
index 52ea5ef..afceb19 100644
--- a/memdisk/dskprobe.c
+++ b/memdisk/dskprobe.c
@@ -76,7 +76,7 @@ static int probe_int13h_01h(uint8_t drive)
memset(®s, 0, sizeof regs);
probe_any(0x01, drive, ®s);
status = (regs.eflags.l & 1) * 256 + regs.eax.b[1];
- dskprobe_printf(" AH01: CF%d AH%02x\n", regs.eflags.l & 1, regs.eax.b[1]);
+ dskprobe_printf(" AH01: CF%d AH%02x", regs.eflags.l & 1, regs.eax.b[1]);
return status;
}
@@ -89,10 +89,11 @@ static int probe_int13h_08h(uint8_t drive, com32sys_t * regs)
memset(regs, 0, sizeof *regs);
probe_any(0x08, drive, regs);
- present = !(regs->eflags.l & 1) && !regs->eax.b[1];
- dskprobe_printf(" AH08: P%d CF%d AH%02x AL%02x BL%02x DL%02x\n", present,
+ dskprobe_printf(" AH08: CF%d AH%02x AL%02x BL%02x DL%02x",
regs->eflags.l & 1, regs->eax.b[1], regs->eax.b[0],
regs->ebx.b[0], regs->edx.b[0]);
+ present = !(regs->eflags.l & 1) && !regs->eax.b[1];
+ dskprobe_printf(" P%d\n", present);
return present;
}
@@ -102,14 +103,17 @@ static int probe_int13h_08h(uint8_t drive, com32sys_t * regs)
static int probe_int13h_15h(uint8_t drive, com32sys_t * regs)
{
int present;
+ int status;
memset(regs, 0, sizeof *regs);
probe_any(0x15, drive, regs);
- present = !(regs->eflags.l & 1) && regs->eax.b[1]
- && !(probe_int13h_01h_fail(probe_int13h_01h(drive)));
- dskprobe_printf(" AH15: P%d CF%d AH%02x AL%02x CX%04x DX%04x\n", present,
+ dskprobe_printf(" AH15: CF%d AH%02x AL%02x CX%04x DX%04x",
regs->eflags.l & 1, regs->eax.b[1], regs->eax.b[0],
regs->ecx.w[0], regs->edx.w[0]);
+ present = !(regs->eflags.l & 1) && regs->eax.b[1];
+ status = probe_int13h_01h(drive);
+ present = present && !(probe_int13h_01h_fail(status));
+ dskprobe_printf(" P%d\n", present);
return present;
}
@@ -123,10 +127,11 @@ static int probe_int13h_41h(uint8_t drive, com32sys_t * regs)
memset(regs, 0, sizeof *regs);
regs->ebx.w[0] = 0x55AA; /* BX == 0x55AA */
probe_any(0x41, drive, regs);
- present = !(regs->eflags.l & 1) && (regs->ebx.w[0] == 0xAA55);
- dskprobe_printf(" AH41: P%d CF%d BX%04x AH%02x DH%02x\n", present,
+ dskprobe_printf(" AH41: CF%d BX%04x AH%02x DH%02x",
regs->eflags.l & 1, regs->ebx.w[0], regs->eax.b[1],
regs->edx.b[1]);
+ present = !(regs->eflags.l & 1) && (regs->ebx.w[0] == 0xAA55);
+ dskprobe_printf(" P%d\n", present);
return present;
}
More information about the Syslinux-commits
mailing list