Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2012 Advanced Micro Devices, Inc.
0004  * Author: Joerg Roedel <jroedel@suse.de>
0005  *
0006  * This header file contains stuff that is shared between different interrupt
0007  * remapping drivers but with no need to be visible outside of the IOMMU layer.
0008  */
0009 
0010 #ifndef __IRQ_REMAPPING_H
0011 #define __IRQ_REMAPPING_H
0012 
0013 #ifdef CONFIG_IRQ_REMAP
0014 
0015 struct irq_data;
0016 struct msi_msg;
0017 struct irq_domain;
0018 struct irq_alloc_info;
0019 
0020 extern int irq_remap_broken;
0021 extern int disable_sourceid_checking;
0022 extern int no_x2apic_optout;
0023 extern int irq_remapping_enabled;
0024 
0025 extern int disable_irq_post;
0026 
0027 struct irq_remap_ops {
0028     /* The supported capabilities */
0029     int capability;
0030 
0031     /* Initializes hardware and makes it ready for remapping interrupts */
0032     int  (*prepare)(void);
0033 
0034     /* Enables the remapping hardware */
0035     int  (*enable)(void);
0036 
0037     /* Disables the remapping hardware */
0038     void (*disable)(void);
0039 
0040     /* Reenables the remapping hardware */
0041     int  (*reenable)(int);
0042 
0043     /* Enable fault handling */
0044     int  (*enable_faulting)(void);
0045 };
0046 
0047 extern struct irq_remap_ops intel_irq_remap_ops;
0048 extern struct irq_remap_ops amd_iommu_irq_ops;
0049 extern struct irq_remap_ops hyperv_irq_remap_ops;
0050 
0051 #else  /* CONFIG_IRQ_REMAP */
0052 
0053 #define irq_remapping_enabled 0
0054 #define irq_remap_broken      0
0055 #define disable_irq_post      1
0056 
0057 #endif /* CONFIG_IRQ_REMAP */
0058 
0059 #endif /* __IRQ_REMAPPING_H */