qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Ignore IDE command if issued while IDE is busy.


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Ignore IDE command if issued while IDE is busy.
Date: Thu, 21 Aug 2008 14:46:49 -0500
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

Gleb Natapov wrote:
@@ -2511,6 +2524,11 @@ static uint32_t ide_data_readw(void *opaque, uint32_t 
addr)
     IDEState *s = ((IDEState *)opaque)->cur_drive;
     uint8_t *p;
     int ret;
+
+    /* PIO data access allowed only when DRQ bit is set */
+    if (!(s->status & DRQ_STAT))
+        return;

Returns a uint32_t but you just do return;

     p = s->data_ptr;
     ret = cpu_to_le16(*(uint16_t *)p);
     p += 2;
@@ -2525,6 +2543,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, 
uint32_t val)
     IDEState *s = ((IDEState *)opaque)->cur_drive;
     uint8_t *p;
+ /* PIO data access allowed only when DRQ bit is set */
+    if (!(s->status & DRQ_STAT))
+        return;
+
     p = s->data_ptr;
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
@@ -2539,6 +2561,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t 
addr)
     uint8_t *p;
     int ret;
+ /* PIO data access allowed only when DRQ bit is set */
+    if (!(s->status & DRQ_STAT))
+        return;

This function returns a uint32_t but you just have a return; here.

Regards,

Anthony Liguori


     p = s->data_ptr;
     ret = cpu_to_le32(*(uint32_t *)p);
     p += 4;








reply via email to

[Prev in Thread] Current Thread [Next in Thread]