qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH qemu] timer/i8254: Fix one shot PIT mode


From: Michael Tokarev
Subject: Re: [PATCH qemu] timer/i8254: Fix one shot PIT mode
Date: Mon, 15 May 2023 19:15:30 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

26.02.2023 04:58, Damien Zammit wrote:
Currently, the one-shot (mode 1) PIT expires far too quickly,
due to the output being set under the wrong logic.
This change fixes the one-shot PIT mode to behave similarly to mode 0.

TESTED: using the one-shot PIT mode to calibrate a local apic timer.

Has this been forgotten, or is it not needed anymore?

Thanks,

/mjt

  hw/timer/i8254_common.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
index 050875b497..9164576ca9 100644
--- a/hw/timer/i8254_common.c
+++ b/hw/timer/i8254_common.c
@@ -52,10 +52,8 @@ int pit_get_out(PITChannelState *s, int64_t current_time)
      switch (s->mode) {
      default:
      case 0:
-        out = (d >= s->count);
-        break;
      case 1:
-        out = (d < s->count);
+        out = (d >= s->count);
          break;
      case 2:
          if ((d % s->count) == 0 && d != 0) {
--
2.39.0







reply via email to

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