diff mbox

ESP : Fix status register update

Message ID 20110127190648.245680@gmx.com
State New
Headers show

Commit Message

Olivier DANET Jan. 27, 2011, 7:06 p.m. UTC
The Count to zero flag (STAT_TC) must not be cleared after an Interrupt Status
register read.

Signed-off-by: Olivier Danet <odanet@caramail.com>
---
 hw/esp.c     2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Blue Swirl Jan. 28, 2011, 9:09 p.m. UTC | #1
On Thu, Jan 27, 2011 at 7:06 PM, Olivier DANET <odanet@caramail.com> wrote:
>
> The Count to zero flag (STAT_TC) must not be cleared after an Interrupt Status
> register read.

This is not what the patch is supposed to do, STAT_TC is already not
cleared. I think you are trying to save Phase bits (2 to 0).

>
> Signed-off-by: Olivier Danet <odanet@caramail.com>
> ---
>  hw/esp.c     2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/esp.c b/hw/esp.c
> index fa9d2a2..90bfdc6 100644
> --- a/hw/esp.c
> +++ b/hw/esp.c
> @@ -525,9 +525,9 @@ static uint32_t esp_mem_readb(void *opaque, target_phys_addr_t addr)
>             except TC */
>          old_val = s->rregs[ESP_RINTR];
>          s->rregs[ESP_RINTR] = 0;
> -        s->rregs[ESP_RSTAT] &= ~STAT_TC;
>          s->rregs[ESP_RSEQ] = SEQ_CD;
>          esp_lower_irq(s);
> +        s->rregs[ESP_RSTAT] &= STAT_TC  STAT_MI;

This seems to miss something, like ~( | ). Why move the line?
diff mbox

Patch

diff --git a/hw/esp.c b/hw/esp.c
index fa9d2a2..90bfdc6 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -525,9 +525,9 @@  static uint32_t esp_mem_readb(void *opaque, target_phys_addr_t addr)
            except TC */
         old_val = s->rregs[ESP_RINTR];
         s->rregs[ESP_RINTR] = 0;
-        s->rregs[ESP_RSTAT] &= ~STAT_TC;
         s->rregs[ESP_RSEQ] = SEQ_CD;
         esp_lower_irq(s);
+        s->rregs[ESP_RSTAT] &= STAT_TC  STAT_MI;
 
         return old_val;
     default: