qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] unsubscribe
@ 2017-11-14  7:12 li.shanlue
  0 siblings, 0 replies; 4+ messages in thread
From: li.shanlue @ 2017-11-14  7:12 UTC (permalink / raw)
  To: qemu-devel

unsubscribe

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [Qemu-devel] unsubscribe
@ 2008-09-11  4:18 Simson Garfinkel
  0 siblings, 0 replies; 4+ messages in thread
From: Simson Garfinkel @ 2008-09-11  4:18 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 11 bytes --]

unsubscribe

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2413 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [Qemu-devel] unsubscribe
@ 2008-04-20 12:51 coolman coolx
  0 siblings, 0 replies; 4+ messages in thread
From: coolman coolx @ 2008-04-20 12:51 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3870 bytes --]

On Thu, Apr 17, 2008 at 12:07 AM, Andrzej Zaborowski <balrogg@gmail.com>
wrote:

> Revision: 4216
>          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4216
> Author:   balrog
> Date:     2008-04-16 23:07:32 +0000 (Wed, 16 Apr 2008)
>
> Log Message:
> -----------
> Use qemu time/date functions for the Menelaus RTC.
>
> Modified Paths:
> --------------
>    trunk/hw/twl92230.c
>
> Modified: trunk/hw/twl92230.c
> ===================================================================
> --- trunk/hw/twl92230.c 2008-04-14 21:57:44 UTC (rev 4215)
> +++ trunk/hw/twl92230.c 2008-04-16 23:07:32 UTC (rev 4216)
> @@ -59,9 +59,9 @@
>         struct tm tm;
>         struct tm new;
>         struct tm alm;
> -        time_t sec;
> -        time_t alm_sec;
> -        time_t next_comp;
> +        int sec_offset;
> +        int alm_sec;
> +        int next_comp;
>         struct tm *(*gettime)(const time_t *timep, struct tm *result);
>     } rtc;
>     qemu_irq handler[3];
> @@ -91,20 +91,21 @@
>
>  static void menelaus_rtc_update(struct menelaus_s *s)
>  {
> -    s->rtc.gettime(&s->rtc.sec, &s->rtc.tm);
> +    qemu_get_timedate(&s->rtc.tm, s->rtc.sec_offset);
>  }
>
>  static void menelaus_alm_update(struct menelaus_s *s)
>  {
>     if ((s->rtc.ctrl & 3) == 3)
> -        s->rtc.alm_sec = mktime(&s->rtc.alm);
> +        s->rtc.alm_sec = qemu_timedate_diff(&s->rtc.alm) -
> s->rtc.sec_offset;
>  }
>
>  static void menelaus_rtc_hz(void *opaque)
>  {
>     struct menelaus_s *s = (struct menelaus_s *) opaque;
>
> -    s->rtc.sec ++;
> +    s->rtc.next_comp --;
> +    s->rtc.alm_sec --;
>     s->rtc.next += 1000;
>     qemu_mod_timer(s->rtc.hz, s->rtc.next);
>     if ((s->rtc.ctrl >> 3) & 3) {                              /* EVERY */
> @@ -118,13 +119,13 @@
>     } else
>         s->status |= 1 << 8;                                   /* RTCTMR
> */
>     if ((s->rtc.ctrl >> 1) & 1) {                              /*
> RTC_AL_EN */
> -        if (s->rtc.sec == s->rtc.alm_sec)
> +        if (s->rtc.alm_sec == 0)
>             s->status |= 1 << 9;                               /* RTCALM
> */
>         /* TODO: wake-up */
>     }
> -    if (s->rtc.next_comp >= s->rtc.sec) {
> +    if (s->rtc.next_comp <= 0) {
>         s->rtc.next -= muldiv64((int16_t) s->rtc.comp, 1000, 0x8000);
> -        s->rtc.next_comp = s->rtc.sec + 3600;
> +        s->rtc.next_comp = 3600;
>     }
>     menelaus_update(s);
>  }
> @@ -132,7 +133,6 @@
>  void menelaus_reset(i2c_slave *i2c)
>  {
>     struct menelaus_s *s = (struct menelaus_s *) i2c;
> -    time_t ti;
>     s->reg = 0x00;
>
>     s->vcore[0] = 0x0c;        /* XXX: X-loader needs 0x8c? check!  */
> @@ -169,14 +169,14 @@
>     s->mmc_ctrl[2] = 0x00;
>     s->mmc_debounce = 0x05;
>
> -    time(&ti);
>     if (s->rtc.ctrl & 1)
>         menelaus_rtc_stop(s);
>     s->rtc.ctrl = 0x00;
>     s->rtc.comp = 0x0000;
>     s->rtc.next = 1000;
> -    s->rtc.sec = ti;
> -    s->rtc.next_comp = s->rtc.sec + 1800;
> +    s->rtc.sec_offset = 0;
> +    s->rtc.next_comp = 1800;
> +    s->rtc.alm_sec = 1800;
>     s->rtc.alm.tm_sec = 0x00;
>     s->rtc.alm.tm_min = 0x00;
>     s->rtc.alm.tm_hour = 0x00;
> @@ -627,7 +627,7 @@
>             s->status |= 1 << 10;                              /* RTCERR
> */
>             menelaus_update(s);
>         }
> -        s->rtc.sec += difftime(mktime(&tm), mktime(&s->rtc.tm));
> +        s->rtc.sec_offset = qemu_timedate_diff(&tm);
>         break;
>     case MENELAUS_RTC_SEC:
>         s->rtc.tm.tm_sec = from_bcd(value & 0x7f);
> @@ -888,9 +888,6 @@
>     s->i2c.recv = menelaus_rx;
>     s->i2c.send = menelaus_tx;
>
> -    /* TODO: use the qemu gettime functions */
> -    s->rtc.gettime = localtime_r;
> -
>     s->irq = irq;
>     s->rtc.hz = qemu_new_timer(rt_clock, menelaus_rtc_hz, s);
>     s->in = qemu_allocate_irqs(menelaus_gpio_set, s, 3);
>
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 6428 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-14  7:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201710161748437225462@zte.com.cn>
2017-11-06  9:08 ` [Qemu-devel] unsubscribe li.shanlue
2017-11-14  7:12 li.shanlue
  -- strict thread matches above, loose matches on Subject: below --
2008-09-11  4:18 Simson Garfinkel
2008-04-20 12:51 coolman coolx

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).