qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 9491e9: i6300esb: remove muldiv64()


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 9491e9: i6300esb: remove muldiv64()
Date: Fri, 25 Sep 2015 11:30:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 9491e9bc019a365dfa9780f462984a0d052f4c0d
      
https://github.com/qemu/qemu/commit/9491e9bc019a365dfa9780f462984a0d052f4c0d
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M hw/watchdog/wdt_i6300esb.c

  Log Message:
  -----------
  i6300esb: remove muldiv64()

Originally, timers were ticks based, and it made sense to
add ticks to current time to know when to trigger an alarm.

But since commit:

7447545 change all other clock references to use nanosecond resolution accessors

All timers use nanoseconds and we need to convert ticks to nanoseconds, by
doing something like:

    y = muldiv64(x, get_ticks_per_sec(), PCI_FREQUENCY)

where x is the number of device ticks and y the number of system ticks.

y is used as nanoseconds in timer functions,
it works because 1 tick is 1 nanosecond.
(get_ticks_per_sec() is 10^9)

But as PCI frequency is 33 MHz, we can also do:

    y = x * 30; /* 33 MHz PCI period is 30 ns */

Which is much more simple.

This implies a 33.333333 MHz PCI frequency,
but this is correct.

Signed-off-by: Laurent Vivier <address@hidden>


  Commit: 37b9ab92f7f8295c61daa4a8893eb8fb1add63e2
      
https://github.com/qemu/qemu/commit/37b9ab92f7f8295c61daa4a8893eb8fb1add63e2
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M hw/net/rtl8139.c
    M tests/rtl8139-test.c

  Log Message:
  -----------
  rtl8139: remove muldiv64()

Originally, timers were ticks based, and it made sense to
add ticks to current time to know when to trigger an alarm.

But since commit:

7447545 change all other clock references to use nanosecond resolution accessors

All timers use nanoseconds and we need to convert ticks to nanoseconds, by
doing something like:

    y = muldiv64(x, get_ticks_per_sec(), PCI_FREQUENCY)

where x is the number of device ticks and y the number of system ticks.

y is used as nanoseconds in timer functions,
it works because 1 tick is 1 nanosecond.
(get_ticks_per_sec() is 10^9)

But as PCI frequency is 33 MHz, we can also do:

    y = x * 30; /* 33 MHz PCI period is 30 ns */

Which is much more simple.

This implies a 33.333333 MHz PCI frequency,
but this is correct.

Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>


  Commit: c6acbe861f1ed4203f4864baf756686064ba561f
      
https://github.com/qemu/qemu/commit/c6acbe861f1ed4203f4864baf756686064ba561f
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M hw/net/pcnet.c

  Log Message:
  -----------
  pcnet: remove muldiv64()

Originally, timers were ticks based, and it made sense to
add ticks to current time to know when to trigger an alarm.

But since commit:

7447545 change all other clock references to use nanosecond resolution accessors

All timers use nanoseconds and we need to convert ticks to nanoseconds, by
doing something like:

    y = muldiv64(x, get_ticks_per_sec(), PCI_FREQUENCY)

where x is the number of device ticks and y the number of system ticks.

y is used as nanoseconds in timer functions,
it works because 1 tick is 1 nanosecond.
(get_ticks_per_sec() is 10^9)

But as PCI frequency is 33 MHz, we can also do:

    y = x * 30; /* 33 MHz PCI period is 30 ns */

Which is much more simple.

This implies a 33.333333 MHz PCI frequency,
but this is correct.

Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>


  Commit: 683dca6bd5057a87d9376475b0c7e30d56d8e532
      
https://github.com/qemu/qemu/commit/683dca6bd5057a87d9376475b0c7e30d56d8e532
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M hw/mips/cputimer.c

  Log Message:
  -----------
  mips: remove muldiv64()

Originally, timers were ticks based, and it made sense to
add ticks to current time to know when to trigger an alarm.

But since commit:

7447545 change all other clock references to use nanosecond resolution accessors

All timers use nanoseconds and we need to convert ticks to nanoseconds, by
doing something like:

    y = muldiv64(x, get_ticks_per_sec(), TIMER_FREQ)

where x is the number of device ticks and y the number of system ticks.

y is used as nanoseconds in timer functions,
it works because 1 tick is 1 nanosecond.
(get_ticks_per_sec() is 10^9)

But as MIPS timer frequency is 100 MHz, we can also do:

    y = x * 10; /* 100 MHz period is 10 ns */

Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Leon Alrae <address@hidden>


  Commit: ccaf1749239aa33c5a5b755972232ffe1c0cf946
      
https://github.com/qemu/qemu/commit/ccaf1749239aa33c5a5b755972232ffe1c0cf946
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M hw/openrisc/cputimer.c

  Log Message:
  -----------
  openrisc: remove muldiv64()

Originally, timers were ticks based, and it made sense to
add ticks to current time to know when to trigger an alarm.

But since commit:

7447545 change all other clock references to use nanosecond resolution accessors

All timers use nanoseconds and we need to convert ticks to nanoseconds, by
doing something like:

    y = muldiv64(x, get_ticks_per_sec(), TIMER_FREQ)

where x is the number of device ticks and y the number of system ticks.

y is used as nanoseconds in timer functions,
it works because 1 tick is 1 nanosecond.
(get_ticks_per_sec() is 10^9)

But as openrisc timer frequency is 20 MHz, we can also do:

    y = x * 50; /* 20 MHz period is 50 ns */

Signed-off-by: Laurent Vivier <address@hidden>


  Commit: 352c98e502893dee405d0bd8301264fca3b79179
      
https://github.com/qemu/qemu/commit/352c98e502893dee405d0bd8301264fca3b79179
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M target-arm/helper.c

  Log Message:
  -----------
  arm: clarify the use of muldiv64()

muldiv64() is used to convert microseconds into CPU ticks.

But it is not clear and not commented. This patch uses macro
to clearly identify what is used: time, CPU frequency and ticks.
For an elapsed time and a given frequency, we compute how many ticks
 we have.

Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
Acked-by: Peter Maydell <address@hidden>


  Commit: 0a4f9240f5b8b1bfe2d5c5c2748545bc23771bb4
      
https://github.com/qemu/qemu/commit/0a4f9240f5b8b1bfe2d5c5c2748545bc23771bb4
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M hw/timer/hpet.c
    M include/hw/timer/hpet.h

  Log Message:
  -----------
  hpet: remove muldiv64()

hpet defines a clock period in femtoseconds but
then converts it to nanoseconds to use the internal
timers.

We can define the period in nanoseconds and use it
directly, this allows to remove muldiv64().

We only need to convert the period to femtoseconds
to put it in internal hpet capability register.

Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: fdfea124f9e12232f99d9f235267ca1eeeb23469
      
https://github.com/qemu/qemu/commit/fdfea124f9e12232f99d9f235267ca1eeeb23469
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M hw/bt/hci.c

  Log Message:
  -----------
  bt: remove muldiv64()

Originally, timers were ticks based, and it made sense to
add ticks to current time to know when to trigger an alarm.

But since commit:

7447545 change all other clock references to use nanosecond resolution accessors

All timers use nanoseconds and we need to convert ticks to nanoseconds.

As get_ticks_per_sec() is 10^9,

    a = muldiv64(b, get_ticks_per_sec(), 100);
    y = muldiv64(x, get_ticks_per_sec(), 1000000);

can be converted to

    a = b * 10000000;
    y = x * 1000;

Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: ab60b7485cece312ad9c21327ee678f0f9898fb5
      
https://github.com/qemu/qemu/commit/ab60b7485cece312ad9c21327ee678f0f9898fb5
  Author: Laurent Vivier <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M net/dump.c

  Log Message:
  -----------
  net: remove muldiv64()

muldiv64() is used to convert nanoseconds to microseconds.

    x = muldiv64(qemu_clock_get_ns(..), 1000000, get_ticks_per_sec());

As  get_ticks_per_sec() is 10^9, it can be replaced by:

    x = qemu_clock_get_us(..);

Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>


  Commit: 690b286fefa806f130dfc1931b5ba0b4dd2fb415
      
https://github.com/qemu/qemu/commit/690b286fefa806f130dfc1931b5ba0b4dd2fb415
  Author: Peter Maydell <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M hw/bt/hci.c
    M hw/mips/cputimer.c
    M hw/net/pcnet.c
    M hw/net/rtl8139.c
    M hw/openrisc/cputimer.c
    M hw/timer/hpet.c
    M hw/watchdog/wdt_i6300esb.c
    M include/hw/timer/hpet.h
    M net/dump.c
    M target-arm/helper.c
    M tests/rtl8139-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/vivier-misc/tags/pull-muldiv64-20150925' into staging

Remove muldiv64() by using period instead of frequency

# gpg: Signature made Fri 25 Sep 2015 14:54:37 BST using RSA key ID 3F2FBE3C
# gpg: Good signature from "Laurent Vivier <address@hidden>"
# gpg:                 aka "Laurent Vivier <address@hidden>"
# gpg:                 aka "Laurent Vivier (Red Hat) <address@hidden>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier-misc/tags/pull-muldiv64-20150925:
  net: remove muldiv64()
  bt: remove muldiv64()
  hpet: remove muldiv64()
  arm: clarify the use of muldiv64()
  openrisc: remove muldiv64()
  mips: remove muldiv64()
  pcnet: remove muldiv64()
  rtl8139: remove muldiv64()
  i6300esb: remove muldiv64()

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/cdf98182420e...690b286fefa8

reply via email to

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