25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: diskimage.c,v 1.91 2005/05/27 07:29:24 debug Exp $ |
* $Id: diskimage.c,v 1.95 2005/08/10 22:25:50 debug Exp $ |
29 |
* |
* |
30 |
* Disk image support. |
* Disk image support. |
31 |
* |
* |
409 |
static int diskimage__internal_access(struct diskimage *d, int writeflag, |
static int diskimage__internal_access(struct diskimage *d, int writeflag, |
410 |
off_t offset, unsigned char *buf, size_t len) |
off_t offset, unsigned char *buf, size_t len) |
411 |
{ |
{ |
412 |
size_t lendone; |
ssize_t lendone; |
413 |
int res; |
int res; |
414 |
|
|
415 |
if (buf == NULL) { |
if (buf == NULL) { |
919 |
xferp->data_in, size); |
xferp->data_in, size); |
920 |
|
|
921 |
if (d->is_a_tape && d->f != NULL) |
if (d->is_a_tape && d->f != NULL) |
922 |
d->tape_offset = ftell(d->f); |
d->tape_offset = ftello(d->f); |
923 |
|
|
924 |
/* TODO: other errors? */ |
/* TODO: other errors? */ |
925 |
break; |
break; |
1006 |
if (xferp->cmd_len != 6) |
if (xferp->cmd_len != 6) |
1007 |
debug(" (weird len=%i)", xferp->cmd_len); |
debug(" (weird len=%i)", xferp->cmd_len); |
1008 |
|
|
1009 |
for (i=0; i<xferp->cmd_len ; i++) |
for (i=0; i<xferp->cmd_len; i++) |
1010 |
debug(" %02x", xferp->cmd[i]); |
debug(" %02x", xferp->cmd[i]); |
1011 |
|
|
1012 |
/* TODO: actualy care about cmd[] */ |
/* TODO: actualy care about cmd[] */ |
1303 |
&xferp->data_in, retlen, 1); |
&xferp->data_in, retlen, 1); |
1304 |
|
|
1305 |
diskimage__return_default_status_and_message(xferp); |
diskimage__return_default_status_and_message(xferp); |
1306 |
|
|
1307 |
break; |
break; |
1308 |
|
|
1309 |
default: |
default: |
1475 |
/* Special cases: some machines usually have FLOPPY/IDE, not SCSI: */ |
/* Special cases: some machines usually have FLOPPY/IDE, not SCSI: */ |
1476 |
if (machine->arch == ARCH_X86 || |
if (machine->arch == ARCH_X86 || |
1477 |
machine->machine_type == MACHINE_COBALT || |
machine->machine_type == MACHINE_COBALT || |
1478 |
|
machine->machine_type == MACHINE_EVBMIPS || |
1479 |
machine->machine_type == MACHINE_HPCMIPS || |
machine->machine_type == MACHINE_HPCMIPS || |
1480 |
machine->machine_type == MACHINE_PS2) |
machine->machine_type == MACHINE_PS2) |
1481 |
d->type = DISKIMAGE_IDE; |
d->type = DISKIMAGE_IDE; |