• Andre Przywara's avatar
    arm/arm64: KVM: add vgic.h header file · 83215812
    Andre Przywara authored
    vgic.c is currently a mixture of generic vGIC emulation code and
    functions specific to emulating a GICv2. To ease the addition of
    GICv3 later, we create new header file vgic.h, which holds constants
    and prototypes of commonly used functions.
    Rename some identifiers to avoid name space clutter.
    I removed the long-standing comment about using the kvm_io_bus API
    to tackle the GIC register ranges, as it wouldn't be a win for us
    anymore.
    Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
    Acked-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
    
    -------
    As the diff isn't always obvious here (and to aid eventual rebases),
    here is a list of high-level changes done to the code:
    * moved definitions and prototypes from vgic.c to vgic.h:
      - VGIC_ADDR_UNDEF
      - ACCESS_{READ,WRITE}_*
      - vgic_init()
      - vgic_update_state()
      - vgic_kick_vcpus()
      - vgic_get_vmcr()
      - vgic_set_vmcr()
      - struct mmio_range {} (renamed to struct kvm_mmio_range)
    * removed static keyword and exported prototype in vgic.h:
      - vgic_bitmap_get_reg()
      - vgic_bitmap_set_irq_val()
      - vgic_bitmap_get_shared_map()
      - vgic_bytemap_get_reg()
      - vgic_dist_irq_set_pending()
      - vgic_dist_irq_clear_pending()
      - vgic_cpu_irq_clear()
      - vgic_reg_access()
      - handle_mmio_raz_wi()
      - vgic_handle_enable_reg()
      - vgic_handle_set_pending_reg()
      - vgic_handle_clear_pending_reg()
      - vgic_handle_cfg_reg()
      - vgic_unqueue_irqs()
      - find_matching_range() (renamed to vgic_find_range)
      - vgic_handle_mmio_range()
      - vgic_update_state()
      - vgic_get_vmcr()
      - vgic_set_vmcr()
      - vgic_queue_irq()
      - vgic_kick_vcpus()
      - vgic_init()
      - vgic_v2_init_emulation()
      - vgic_has_attr_regs()
      - vgic_set_common_attr()
      - vgic_get_common_attr()
      - vgic_destroy()
      - vgic_create()
    * moved functions to vgic.h (static inline):
      - mmio_data_read()
      - mmio_data_write()
      - is_in_range()
    Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
    83215812
vgic.c 65.1 KB