From 2aaf0ec7ff239523ce2c8d913b120202c219af3e Mon Sep 17 00:00:00 2001 From: Bernhard Beschow Date: Mon, 9 Jan 2023 18:23:22 +0100 Subject: hw/intc/i8259: Make using the isa_pic singleton more type-safe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This even spares some casts in hot code paths along the way. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230109172347.1830-10-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/intc/i8259.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/hw/intc') diff --git a/include/hw/intc/i8259.h b/include/hw/intc/i8259.h index e2b1e8c..a0e34dd 100644 --- a/include/hw/intc/i8259.h +++ b/include/hw/intc/i8259.h @@ -3,10 +3,10 @@ /* i8259.c */ -extern DeviceState *isa_pic; +extern PICCommonState *isa_pic; qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq); qemu_irq *kvm_i8259_init(ISABus *bus); -int pic_get_output(DeviceState *d); -int pic_read_irq(DeviceState *d); +int pic_get_output(PICCommonState *s); +int pic_read_irq(PICCommonState *s); #endif -- cgit v1.1 From 2b85e0cda4b066010efda63a2d2359872ba07a04 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 10 Jan 2023 10:53:48 +0100 Subject: hw/intc: Extract the IRQ counting functions into a separate file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These IRQ counting functions will soon be required in binaries that do not include the APIC code, too, so let's extract them into a separate file that can be linked independently of the APIC code. While we're at it, change the apic_* prefix into kvm_* since the functions are used from the i8259 PIC (i.e. not the APIC), too. Reviewed-by: Bernhard Beschow Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20230110095351.611724-2-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/intc/kvm_irqcount.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 include/hw/intc/kvm_irqcount.h (limited to 'include/hw/intc') diff --git a/include/hw/intc/kvm_irqcount.h b/include/hw/intc/kvm_irqcount.h new file mode 100644 index 0000000..0ed5999 --- /dev/null +++ b/include/hw/intc/kvm_irqcount.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#ifndef KVM_IRQCOUNT_H +#define KVM_IRQCOUNT_H + +void kvm_report_irq_delivered(int delivered); +void kvm_reset_irq_delivered(void); +int kvm_get_irq_delivered(void); + +#endif -- cgit v1.1