aboutsummaryrefslogtreecommitdiffstats
path: root/com32/modules
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2010-06-28 00:59:17 -0400
committerShao Miller <shao.miller@yrdsb.edu.on.ca>2010-07-10 01:00:47 -0400
commit8f0f42100f43a52e957c7c6feec0d2fcb21d0b6e (patch)
tree67466c002e77234571473af4f1a3a7589518cb8c /com32/modules
parente2bba11e4aabeada9e4b8bb184ffadbdf14add3c (diff)
downloadsyslinux-8f0f42100f43a52e957c7c6feec0d2fcb21d0b6e.tar.gz
syslinux-8f0f42100f43a52e957c7c6feec0d2fcb21d0b6e.tar.xz
syslinux-8f0f42100f43a52e957c7c6feec0d2fcb21d0b6e.zip
chain.c32, libcom32: Move int13_retry() as disk_int13_retry()
Moving portions of chain.c32 into libcom32. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Diffstat (limited to 'com32/modules')
-rw-r--r--com32/modules/chain.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index d6005e28..19afa051 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -146,26 +146,6 @@ static inline void error(const char *msg)
}
/*
- * Call int 13h, but with retry on failure. Especially floppies need this.
- */
-static int int13_retry(const com32sys_t * inreg, com32sys_t * outreg)
-{
- int retry = 6; /* Number of retries */
- com32sys_t tmpregs;
-
- if (!outreg)
- outreg = &tmpregs;
-
- while (retry--) {
- __intcall(0x13, inreg, outreg);
- if (!(outreg->eflags.l & EFLAGS_CF))
- return 0; /* CF=0, OK */
- }
-
- return -1; /* Error */
-}
-
-/*
* Query disk parameters and EBIOS availability for a particular disk.
*/
struct diskinfo {
@@ -287,7 +267,7 @@ static void *read_sectors(uint64_t lba, uint8_t count)
inreg.es = SEG(buf);
}
- if (int13_retry(&inreg, NULL))
+ if (disk_int13_retry(&inreg, NULL))
return NULL;
data = malloc(count * SECTOR);
@@ -347,7 +327,7 @@ static int write_sector(unsigned int lba, const void *data)
inreg.es = SEG(buf);
}
- if (int13_retry(&inreg, NULL))
+ if (disk_int13_retry(&inreg, NULL))
return -1;
return 0; /* ok */