ia64/xen-unstable

changeset 18656:d8a156bdef14

Add a new file xen/include/xen/hvm/irq.h to share common definitions.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Oct 20 15:11:41 2008 +0100 (2008-10-20)
parents 314df03b7d61
children e57ca7937ae8
files xen/include/asm-x86/hvm/irq.h xen/include/xen/hvm/irq.h
line diff
     1.1 --- a/xen/include/asm-x86/hvm/irq.h	Mon Oct 20 15:11:19 2008 +0100
     1.2 +++ b/xen/include/asm-x86/hvm/irq.h	Mon Oct 20 15:11:41 2008 +0100
     1.3 @@ -22,62 +22,11 @@
     1.4  #ifndef __ASM_X86_HVM_IRQ_H__
     1.5  #define __ASM_X86_HVM_IRQ_H__
     1.6  
     1.7 -#include <xen/types.h>
     1.8 -#include <xen/spinlock.h>
     1.9 -#include <asm/irq.h>
    1.10  #include <asm/pirq.h>
    1.11 +#include <xen/hvm/irq.h>
    1.12  #include <asm/hvm/hvm.h>
    1.13  #include <asm/hvm/vpic.h>
    1.14  #include <asm/hvm/vioapic.h>
    1.15 -#include <public/hvm/save.h>
    1.16 -
    1.17 -struct dev_intx_gsi_link {
    1.18 -    struct list_head list;
    1.19 -    uint8_t device;
    1.20 -    uint8_t intx;
    1.21 -    uint8_t gsi;
    1.22 -    uint8_t link;
    1.23 -};
    1.24 -
    1.25 -#define _HVM_IRQ_DPCI_MSI  0x1
    1.26 -
    1.27 -struct hvm_gmsi_info {
    1.28 -    uint32_t gvec;
    1.29 -    uint32_t gflags;
    1.30 -};
    1.31 -
    1.32 -struct hvm_mirq_dpci_mapping {
    1.33 -    uint32_t flags;
    1.34 -    int pending;
    1.35 -    struct list_head digl_list;
    1.36 -    struct domain *dom;
    1.37 -    struct hvm_gmsi_info gmsi;
    1.38 -};
    1.39 -
    1.40 -struct hvm_girq_dpci_mapping {
    1.41 -    uint8_t valid;
    1.42 -    uint8_t device;
    1.43 -    uint8_t intx;
    1.44 -    uint8_t machine_gsi;
    1.45 -};
    1.46 -
    1.47 -#define NR_ISAIRQS  16
    1.48 -#define NR_LINK     4
    1.49 -/* Protected by domain's event_lock */
    1.50 -struct hvm_irq_dpci {
    1.51 -    /* Machine IRQ to guest device/intx mapping. */
    1.52 -    DECLARE_BITMAP(mapping, NR_PIRQS);
    1.53 -    struct hvm_mirq_dpci_mapping mirq[NR_IRQS];
    1.54 -    /* Guest IRQ to guest device/intx mapping. */
    1.55 -    struct hvm_girq_dpci_mapping girq[NR_IRQS];
    1.56 -    uint8_t msi_gvec_pirq[NR_VECTORS];
    1.57 -    DECLARE_BITMAP(dirq_mask, NR_IRQS);
    1.58 -    /* Record of mapped ISA IRQs */
    1.59 -    DECLARE_BITMAP(isairq_map, NR_ISAIRQS);
    1.60 -    /* Record of mapped Links */
    1.61 -    uint8_t link_cnt[NR_LINK];
    1.62 -    struct timer hvm_timer[NR_IRQS];
    1.63 -};
    1.64  
    1.65  struct hvm_irq {
    1.66      /*
    1.67 @@ -149,27 +98,8 @@ struct hvm_irq {
    1.68  
    1.69  #define hvm_isa_irq_to_gsi(isa_irq) ((isa_irq) ? : 2)
    1.70  
    1.71 -/* Modify state of a PCI INTx wire. */
    1.72 -void hvm_pci_intx_assert(
    1.73 -    struct domain *d, unsigned int device, unsigned int intx);
    1.74 -void hvm_pci_intx_deassert(
    1.75 -    struct domain *d, unsigned int device, unsigned int intx);
    1.76 -
    1.77 -/* Modify state of an ISA device's IRQ wire. */
    1.78 -void hvm_isa_irq_assert(
    1.79 -    struct domain *d, unsigned int isa_irq);
    1.80 -void hvm_isa_irq_deassert(
    1.81 -    struct domain *d, unsigned int isa_irq);
    1.82 -
    1.83 -void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq);
    1.84 -
    1.85 -void hvm_maybe_deassert_evtchn_irq(void);
    1.86 -void hvm_assert_evtchn_irq(struct vcpu *v);
    1.87 -void hvm_set_callback_via(struct domain *d, uint64_t via);
    1.88 -
    1.89  /* Check/Acknowledge next pending interrupt. */
    1.90  struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v);
    1.91  struct hvm_intack hvm_vcpu_ack_pending_irq(struct vcpu *v,
    1.92                                             struct hvm_intack intack);
    1.93 -
    1.94  #endif /* __ASM_X86_HVM_IRQ_H__ */
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xen/include/xen/hvm/irq.h	Mon Oct 20 15:11:41 2008 +0100
     2.3 @@ -0,0 +1,98 @@
     2.4 +/******************************************************************************
     2.5 + * irq.h
     2.6 + * 
     2.7 + * Interrupt distribution and delivery logic.
     2.8 + * 
     2.9 + * Copyright (c) 2006, K A Fraser, XenSource Inc.
    2.10 + *
    2.11 + * This program is free software; you can redistribute it and/or modify it
    2.12 + * under the terms and conditions of the GNU General Public License,
    2.13 + * version 2, as published by the Free Software Foundation.
    2.14 + *
    2.15 + * This program is distributed in the hope it will be useful, but WITHOUT
    2.16 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.17 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    2.18 + * more details.
    2.19 + *
    2.20 + * You should have received a copy of the GNU General Public License along with
    2.21 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    2.22 + * Place - Suite 330, Boston, MA 02111-1307 USA.
    2.23 + */
    2.24 +
    2.25 +#ifndef __XEN_HVM_IRQ_H__
    2.26 +#define __XEN_HVM_IRQ_H__
    2.27 +
    2.28 +#include <xen/types.h>
    2.29 +#include <xen/spinlock.h>
    2.30 +#include <asm/irq.h>
    2.31 +#include <public/hvm/save.h>
    2.32 +
    2.33 +struct dev_intx_gsi_link {
    2.34 +    struct list_head list;
    2.35 +    uint8_t device;
    2.36 +    uint8_t intx;
    2.37 +    uint8_t gsi;
    2.38 +    uint8_t link;
    2.39 +};
    2.40 +
    2.41 +#define _HVM_IRQ_DPCI_MSI  0x1
    2.42 +
    2.43 +struct hvm_gmsi_info {
    2.44 +    uint32_t gvec;
    2.45 +    uint32_t gflags;
    2.46 +};
    2.47 +
    2.48 +struct hvm_mirq_dpci_mapping {
    2.49 +    uint32_t flags;
    2.50 +    int pending;
    2.51 +    struct list_head digl_list;
    2.52 +    struct domain *dom;
    2.53 +    struct hvm_gmsi_info gmsi;
    2.54 +};
    2.55 +
    2.56 +struct hvm_girq_dpci_mapping {
    2.57 +    uint8_t valid;
    2.58 +    uint8_t device;
    2.59 +    uint8_t intx;
    2.60 +    uint8_t machine_gsi;
    2.61 +};
    2.62 +
    2.63 +#define NR_ISAIRQS  16
    2.64 +#define NR_LINK     4
    2.65 +
    2.66 +/* Protected by domain's event_lock */
    2.67 +struct hvm_irq_dpci {
    2.68 +    /* Machine IRQ to guest device/intx mapping. */
    2.69 +    DECLARE_BITMAP(mapping, NR_PIRQS);
    2.70 +    struct hvm_mirq_dpci_mapping mirq[NR_IRQS];
    2.71 +    /* Guest IRQ to guest device/intx mapping. */
    2.72 +    struct hvm_girq_dpci_mapping girq[NR_IRQS];
    2.73 +    uint8_t msi_gvec_pirq[NR_VECTORS];
    2.74 +    DECLARE_BITMAP(dirq_mask, NR_IRQS);
    2.75 +    /* Record of mapped ISA IRQs */
    2.76 +    DECLARE_BITMAP(isairq_map, NR_ISAIRQS);
    2.77 +    /* Record of mapped Links */
    2.78 +    uint8_t link_cnt[NR_LINK];
    2.79 +    struct timer hvm_timer[NR_IRQS];
    2.80 +};
    2.81 +
    2.82 +/* Modify state of a PCI INTx wire. */
    2.83 +void hvm_pci_intx_assert(
    2.84 +    struct domain *d, unsigned int device, unsigned int intx);
    2.85 +void hvm_pci_intx_deassert(
    2.86 +    struct domain *d, unsigned int device, unsigned int intx);
    2.87 +
    2.88 +/* Modify state of an ISA device's IRQ wire. */
    2.89 +void hvm_isa_irq_assert(
    2.90 +    struct domain *d, unsigned int isa_irq);
    2.91 +void hvm_isa_irq_deassert(
    2.92 +    struct domain *d, unsigned int isa_irq);
    2.93 +
    2.94 +void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq);
    2.95 +
    2.96 +void hvm_maybe_deassert_evtchn_irq(void);
    2.97 +void hvm_assert_evtchn_irq(struct vcpu *v);
    2.98 +void hvm_set_callback_via(struct domain *d, uint64_t via);
    2.99 +
   2.100 +
   2.101 +#endif /* __XEN_HVM_IRQ_H__ */