CD-ROM detection fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@520 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
2ddbbd10de
commit
6b136f9e8f
15
hw/ide.c
15
hw/ide.c
|
@ -40,14 +40,14 @@
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
#define NO_THUNK_TYPE_SIZE
|
||||||
|
#include "thunk.h"
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "exec-all.h"
|
#include "exec-all.h"
|
||||||
|
|
||||||
#include "vl.h"
|
#include "vl.h"
|
||||||
|
|
||||||
#define NO_THUNK_TYPE_SIZE
|
|
||||||
#include "thunk.h"
|
|
||||||
|
|
||||||
/* debug IDE devices */
|
/* debug IDE devices */
|
||||||
//#define DEBUG_IDE
|
//#define DEBUG_IDE
|
||||||
//#define DEBUG_IDE_ATAPI
|
//#define DEBUG_IDE_ATAPI
|
||||||
|
@ -1128,6 +1128,8 @@ static void ide_ioport_write(CPUX86State *env, uint32_t addr, uint32_t val)
|
||||||
break;
|
break;
|
||||||
case WIN_READ:
|
case WIN_READ:
|
||||||
case WIN_READ_ONCE:
|
case WIN_READ_ONCE:
|
||||||
|
if (!s->bs)
|
||||||
|
goto abort_cmd;
|
||||||
s->req_nb_sectors = 1;
|
s->req_nb_sectors = 1;
|
||||||
ide_sector_read(s);
|
ide_sector_read(s);
|
||||||
break;
|
break;
|
||||||
|
@ -1174,7 +1176,7 @@ static void ide_ioport_write(CPUX86State *env, uint32_t addr, uint32_t val)
|
||||||
if (!s->is_cdrom)
|
if (!s->is_cdrom)
|
||||||
goto abort_cmd;
|
goto abort_cmd;
|
||||||
ide_set_signature(s);
|
ide_set_signature(s);
|
||||||
s->status = READY_STAT;
|
s->status = 0x00; /* NOTE: READY is _not_ set */
|
||||||
s->error = 0x01;
|
s->error = 0x01;
|
||||||
break;
|
break;
|
||||||
case WIN_PACKETCMD:
|
case WIN_PACKETCMD:
|
||||||
|
@ -1271,7 +1273,10 @@ static void ide_cmd_write(CPUX86State *env, uint32_t addr, uint32_t val)
|
||||||
/* high to low */
|
/* high to low */
|
||||||
for(i = 0;i < 2; i++) {
|
for(i = 0;i < 2; i++) {
|
||||||
s = &ide_if[i];
|
s = &ide_if[i];
|
||||||
s->status = READY_STAT;
|
if (s->is_cdrom)
|
||||||
|
s->status = 0x00; /* NOTE: READY is _not_ set */
|
||||||
|
else
|
||||||
|
s->status = READY_STAT;
|
||||||
ide_set_signature(s);
|
ide_set_signature(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue