qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 1/3] Add rtc reset function.
Date: Mon, 08 Jun 2009 16:05:35 +0200	[thread overview]
Message-ID: <4A2D1AAF.4090406@siemens.com> (raw)
In-Reply-To: <1244465766-6349-1-git-send-email-gleb@redhat.com>

Gleb Natapov wrote:
> On reset:
> Periodic Interrupt Enable (PIE) bit is cleared to zero
> Alarm Interrupt Enable (AIE) bit is cleared to zero
> Update ended Interrupt Flag (UF) bit is cleared to zero
> Interrupt Request status Flag (IRQF) bit is cleared to zero
> Periodic Interrupt Flag (PF) bit is cleared to zero
> Alarm Interrupt Flag (AF) bit is cleared to zero
> Square Wave output Enable (SQWE) zero
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
>  hw/mc146818rtc.c |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
> index 888b85a..98a2273 100644
> --- a/hw/mc146818rtc.c
> +++ b/hw/mc146818rtc.c
> @@ -568,6 +568,22 @@ static int rtc_load_td(QEMUFile *f, void *opaque, int version_id)
>  }
>  #endif
>  
> +static void rtc_reset(void *opaque)
> +{
> +    RTCState *s = opaque;
> +
> +    /* clear PIE,AIE,SQWE on reset */
> +    s->cmos_data[RTC_REG_B] &= ~((1<<6) | (1<<5) | (1<<3));
> +
> +    /* clear UF,IRQF,PF,AF on reset */
> +    s->cmos_data[RTC_REG_C] &= ~((1<<4) | (1<<7) | (1<<6) | (1<<5));

Didn't check what the rest of this file does, but maybe it's a chance to
give those bits names, ie. #define something.

> +
> +#ifdef TARGET_I386
> +    if (rtc_td_hack)
> +	    s->irq_coalesced = 0;
> +#endif
> +}
> +
>  RTCState *rtc_init_sqw(int base, qemu_irq irq, qemu_irq sqw_irq, int base_year)
>  {
>      RTCState *s;
> @@ -606,6 +622,8 @@ RTCState *rtc_init_sqw(int base, qemu_irq irq, qemu_irq sqw_irq, int base_year)
>      if (rtc_td_hack)
>          register_savevm("mc146818rtc-td", base, 1, rtc_save_td, rtc_load_td, s);
>  #endif
> +    qemu_register_reset(rtc_reset, 0, s);
> +
>      return s;
>  }
>  
> @@ -721,5 +739,6 @@ RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq,
>      if (rtc_td_hack)
>          register_savevm("mc146818rtc-td", base, 1, rtc_save_td, rtc_load_td, s);
>  #endif
> +    qemu_register_reset(rtc_reset, 0, s);
>      return s;
>  }

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

  parent reply	other threads:[~2009-06-08 14:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08 12:56 [Qemu-devel] [PATCH 1/3] Add rtc reset function Gleb Natapov
2009-06-08 12:56 ` [Qemu-devel] [PATCH 2/3] Add pci_bus_reset() function Gleb Natapov
2009-06-08 14:35   ` Avi Kivity
2009-06-08 14:37     ` Gleb Natapov
2009-06-08 14:42       ` Yaniv Kamay
2009-06-08 21:42       ` Dor Laor
2009-06-09  5:31         ` Gleb Natapov
2009-06-09 15:07           ` Blue Swirl
2009-06-09 15:24             ` Gleb Natapov
2009-06-09 15:53             ` Gleb Natapov
2009-06-09 16:07               ` Blue Swirl
2009-06-08 12:56 ` [Qemu-devel] [PATCH 3/3] Call piix3_reset() on system reset Gleb Natapov
2009-06-08 14:05 ` Jan Kiszka [this message]
2009-06-08 14:13   ` [Qemu-devel] Re: [PATCH 1/3] Add rtc reset function Gleb Natapov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A2D1AAF.4090406@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=gleb@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).