On 19/10/25 23:03, Bernhard Beschow wrote:
Makes the APIC API more type-safe by resolving quite a few APIC_COMMON
downcasts.

Nice!

Like PICCommonState, the APICCommonState is now a public typedef while staying
an abstract datatype.

Signed-off-by: Bernhard Beschow <[email protected]>
---
  include/hw/i386/apic.h           | 33 +++++------
  include/hw/i386/apic_internal.h  |  7 +--
  target/i386/cpu.h                |  4 +-
  target/i386/kvm/kvm_i386.h       |  2 +-
  target/i386/whpx/whpx-internal.h |  2 +-
  hw/i386/kvm/apic.c               |  3 +-
  hw/i386/vapic.c                  |  2 +-
  hw/i386/x86-cpu.c                |  2 +-
  hw/intc/apic.c                   | 97 +++++++++++++-------------------
  hw/intc/apic_common.c            | 56 +++++++-----------
  target/i386/cpu-apic.c           | 18 +++---
  target/i386/cpu-dump.c           |  2 +-
  target/i386/cpu.c                |  2 +-
  target/i386/kvm/kvm.c            |  2 +-
  target/i386/whpx/whpx-apic.c     |  3 +-
  15 files changed, 95 insertions(+), 140 deletions(-)


-int apic_get_highest_priority_irr(DeviceState *dev)
+int apic_get_highest_priority_irr(APICCommonState *s)
  {
-    APICCommonState *s;
-
-    if (!dev) {
+    if (!s) {
          /* no interrupts */

Pre-existing dubious check.

          return -1;
      }
-    s = APIC_COMMON(dev);
      return get_highest_priority_int(s->irr);
  }

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to