]> err.no Git - linux-2.6/commitdiff
[IA64] SN2 needs platform specific irq_to_vector() function.
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Mon, 13 Aug 2007 17:31:26 +0000 (10:31 -0700)
committerTony Luck <tony.luck@intel.com>
Mon, 13 Aug 2007 17:31:26 +0000 (10:31 -0700)
Add base support for implementing platform_irq_to_vector(), and
then use it on SN2.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: John Keller <jpk@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/kernel/irq.c
arch/ia64/sn/kernel/irq.c
include/asm-ia64/hw_irq.h
include/asm-ia64/machvec.h
include/asm-ia64/machvec_init.h
include/asm-ia64/machvec_sn2.h

index cc3ee4ef37afb1bbfed332481f8b9e787b91ae38..44be1c952b7ca2cc6761f65c112a7f737c1f0b7f 100644 (file)
@@ -33,6 +33,11 @@ void ack_bad_irq(unsigned int irq)
 }
 
 #ifdef CONFIG_IA64_GENERIC
+ia64_vector __ia64_irq_to_vector(int irq)
+{
+       return irq_cfg[irq].vector;
+}
+
 unsigned int __ia64_local_vector_to_irq (ia64_vector vec)
 {
        return __get_cpu_var(vector_irq)[vec];
index 7f6d2360a2620f66f96487c4b37898f9a2dac13e..bfa43e4c7ef7546713241d7d62acbf4f02afefba 100644 (file)
@@ -256,6 +256,13 @@ struct irq_chip irq_type_sn = {
        .set_affinity   = sn_set_affinity_irq
 };
 
+ia64_vector sn_irq_to_vector(int irq)
+{
+       if (irq >= IA64_NUM_VECTORS)
+               return 0;
+       return (ia64_vector)irq;
+}
+
 unsigned int sn_local_vector_to_irq(u8 vector)
 {
        return (CPU_VECTOR_TO_IRQ(smp_processor_id(), vector));
index efa1b8f7251d9f12eeab86432eae8aac919b6646..bba5baa3c7fc97ca9fcfd9f63d26d118c8c24a98 100644 (file)
@@ -124,6 +124,11 @@ static inline void ia64_resend_irq(unsigned int vector)
 extern irq_desc_t irq_desc[NR_IRQS];
 
 #ifndef CONFIG_IA64_GENERIC
+static inline ia64_vector __ia64_irq_to_vector(int irq)
+{
+       return irq_cfg[irq].vector;
+}
+
 static inline unsigned int
 __ia64_local_vector_to_irq (ia64_vector vec)
 {
@@ -145,7 +150,7 @@ __ia64_local_vector_to_irq (ia64_vector vec)
 static inline ia64_vector
 irq_to_vector (int irq)
 {
-       return irq_cfg[irq].vector;
+       return platform_irq_to_vector(irq);
 }
 
 /*
index 5cf8bf1e805e6931ee51ea50f24c82fa336b7cda..c201a2020aa49e1a8a30deff30892b143e3dc157 100644 (file)
@@ -30,6 +30,7 @@ typedef void ia64_mv_send_ipi_t (int, int, int, int);
 typedef void ia64_mv_timer_interrupt_t (int, void *);
 typedef void ia64_mv_global_tlb_purge_t (struct mm_struct *, unsigned long, unsigned long, unsigned long);
 typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *);
+typedef u8 ia64_mv_irq_to_vector (int);
 typedef unsigned int ia64_mv_local_vector_to_irq (u8);
 typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *);
 typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val,
@@ -145,6 +146,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
 #  define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device
 #  define platform_dma_mapping_error           ia64_mv.dma_mapping_error
 #  define platform_dma_supported       ia64_mv.dma_supported
+#  define platform_irq_to_vector       ia64_mv.irq_to_vector
 #  define platform_local_vector_to_irq ia64_mv.local_vector_to_irq
 #  define platform_pci_get_legacy_mem  ia64_mv.pci_get_legacy_mem
 #  define platform_pci_legacy_read     ia64_mv.pci_legacy_read
@@ -198,6 +200,7 @@ struct ia64_machine_vector {
        ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device;
        ia64_mv_dma_mapping_error *dma_mapping_error;
        ia64_mv_dma_supported *dma_supported;
+       ia64_mv_irq_to_vector *irq_to_vector;
        ia64_mv_local_vector_to_irq *local_vector_to_irq;
        ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem;
        ia64_mv_pci_legacy_read_t *pci_legacy_read;
@@ -247,6 +250,7 @@ struct ia64_machine_vector {
        platform_dma_sync_sg_for_device,        \
        platform_dma_mapping_error,                     \
        platform_dma_supported,                 \
+       platform_irq_to_vector,                 \
        platform_local_vector_to_irq,           \
        platform_pci_get_legacy_mem,            \
        platform_pci_legacy_read,               \
@@ -366,6 +370,9 @@ extern ia64_mv_dma_supported                swiotlb_dma_supported;
 #ifndef platform_dma_supported
 # define  platform_dma_supported       swiotlb_dma_supported
 #endif
+#ifndef platform_irq_to_vector
+# define platform_irq_to_vector                __ia64_irq_to_vector
+#endif
 #ifndef platform_local_vector_to_irq
 # define platform_local_vector_to_irq  __ia64_local_vector_to_irq
 #endif
index 2d36f6840f0bffb5d7719df6b01e66aad1606dc3..7f21249fba3fd2193b811c156484f1e2b95a1120 100644 (file)
@@ -2,6 +2,7 @@
 
 extern ia64_mv_send_ipi_t ia64_send_ipi;
 extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge;
+extern ia64_mv_irq_to_vector __ia64_irq_to_vector;
 extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq;
 extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem;
 extern ia64_mv_pci_legacy_read_t ia64_pci_legacy_read;
index eaa2fce0fecde4e836def5815e13b619cb5db9ee..61439a7f5b08a76263983695d23ec7562bbea96e 100644 (file)
@@ -35,6 +35,7 @@ extern ia64_mv_send_ipi_t sn2_send_IPI;
 extern ia64_mv_timer_interrupt_t sn_timer_interrupt;
 extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge;
 extern ia64_mv_tlb_migrate_finish_t    sn_tlb_migrate_finish;
+extern ia64_mv_irq_to_vector sn_irq_to_vector;
 extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq;
 extern ia64_mv_pci_get_legacy_mem_t sn_pci_get_legacy_mem;
 extern ia64_mv_pci_legacy_read_t sn_pci_legacy_read;
@@ -104,6 +105,7 @@ extern ia64_mv_pci_fixup_bus_t              sn_pci_fixup_bus;
 #define platform_readw_relaxed         __sn_readw_relaxed
 #define platform_readl_relaxed         __sn_readl_relaxed
 #define platform_readq_relaxed         __sn_readq_relaxed
+#define platform_irq_to_vector         sn_irq_to_vector
 #define platform_local_vector_to_irq   sn_local_vector_to_irq
 #define platform_pci_get_legacy_mem    sn_pci_get_legacy_mem
 #define platform_pci_legacy_read       sn_pci_legacy_read