1 /* ----------------------------------------------------------------------- *
3 * Copyright 2009 Pierre-Alexandre Meyer
5 * Some parts borrowed from chain.c32:
7 * Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
8 * Copyright 2009 Intel Corporation; author: H. Peter Anvin
10 * This file is part of Syslinux, and is made available under
11 * the terms of the GNU General Public License version 2.
13 * ----------------------------------------------------------------------- */
18 #include <disk/geom.h>
20 #define MAX_NB_RETRIES 6
23 * int13_retry - int13h with error handling
24 * @inreg: int13h function parameters
25 * @outreg: output registers
27 * Call int 13h, but with retry on failure. Especially floppies need this.
29 int int13_retry(const com32sys_t
* inreg
, com32sys_t
* outreg
)
31 int retry
= MAX_NB_RETRIES
; /* Number of retries */
38 __intcall(0x13, inreg
, outreg
);
39 if (!(outreg
->eflags
.l
& EFLAGS_CF
))
40 return 0; /* CF=0 => OK */
43 /* If we get here: error */