Blame view

arch/x86/include/asm/irq_remapping.h 1.24 KB
5e1b00758   H. Peter Anvin   x86: canonicalize...
1
2
  #ifndef _ASM_X86_IRQ_REMAPPING_H
  #define _ASM_X86_IRQ_REMAPPING_H
89027d35a   Suresh Siddha   x64, x2apic/intr-...
3

fc1edaf9e   Suresh Siddha   x86: x2apic, IR: ...
4
  #define IRTE_DEST(dest) ((x2apic_mode) ? dest : dest << 8)
89027d35a   Suresh Siddha   x64, x2apic/intr-...
5

d3f138106   Suresh Siddha   iommu: Rename the...
6
  #ifdef CONFIG_IRQ_REMAP
c39d77ffa   Suresh Siddha   x86, ioapic: Defi...
7
  static void irq_remap_modify_chip_defaults(struct irq_chip *chip);
62a92f4c6   Suresh Siddha   x86, intr-remap: ...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  static inline void prepare_irte(struct irte *irte, int vector,
  			        unsigned int dest)
  {
  	memset(irte, 0, sizeof(*irte));
  
  	irte->present = 1;
  	irte->dst_mode = apic->irq_dest_mode;
  	/*
  	 * Trigger mode in the IRTE will always be edge, and for IO-APIC, the
  	 * actual level or edge trigger will be setup in the IO-APIC
  	 * RTE. This will help simplify level triggered irq migration.
  	 * For more details, see the comments (in io_apic.c) explainig IO-APIC
  	 * irq migration in the presence of interrupt-remapping.
  	*/
  	irte->trigger_mode = 0;
  	irte->dlvry_mode = apic->irq_delivery_mode;
  	irte->vector = vector;
  	irte->dest_id = IRTE_DEST(dest);
  	irte->redir_hint = 1;
  }
1a0730d66   Thomas Gleixner   x86: Speed up the...
28
29
30
31
  static inline bool irq_remapped(struct irq_cfg *cfg)
  {
  	return cfg->irq_2_iommu.iommu != NULL;
  }
62a92f4c6   Suresh Siddha   x86, intr-remap: ...
32
33
34
35
  #else
  static void prepare_irte(struct irte *irte, int vector, unsigned int dest)
  {
  }
1a0730d66   Thomas Gleixner   x86: Speed up the...
36
37
38
39
  static inline bool irq_remapped(struct irq_cfg *cfg)
  {
  	return false;
  }
c39d77ffa   Suresh Siddha   x86, ioapic: Defi...
40
41
42
  static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip)
  {
  }
62a92f4c6   Suresh Siddha   x86, intr-remap: ...
43
  #endif
5e1b00758   H. Peter Anvin   x86: canonicalize...
44
  #endif	/* _ASM_X86_IRQ_REMAPPING_H */