aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-11-24 04:41:57 -0500
committerJoerg Roedel <joerg.roedel@amd.com>2011-12-12 09:34:42 -0500
commit2d5503b624736abfe0e0bad281f9b8d8a705b930 (patch)
tree6ed415d39c6ac928dbb2997bb86f612b9b87b766 /include
parented96f228ba9725edf69385bffdc19ee5bb0ec641 (diff)
iommu/amd: Add routines to bind/unbind a pasid
This patch adds routines to bind a specific process address-space to a given PASID. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/amd-iommu.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h
index e8c7a2ec86b3..23e21e15dfab 100644
--- a/include/linux/amd-iommu.h
+++ b/include/linux/amd-iommu.h
@@ -24,9 +24,13 @@
24 24
25#ifdef CONFIG_AMD_IOMMU 25#ifdef CONFIG_AMD_IOMMU
26 26
27struct task_struct;
27struct pci_dev; 28struct pci_dev;
28 29
29extern int amd_iommu_detect(void); 30extern int amd_iommu_detect(void);
31extern int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid,
32 struct task_struct *task);
33extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid);
30 34
31 35
32/** 36/**
@@ -65,6 +69,28 @@ extern int amd_iommu_init_device(struct pci_dev *pdev, int pasids);
65 */ 69 */
66extern void amd_iommu_free_device(struct pci_dev *pdev); 70extern void amd_iommu_free_device(struct pci_dev *pdev);
67 71
72/**
73 * amd_iommu_bind_pasid() - Bind a given task to a PASID on a device
74 * @pdev: The PCI device to bind the task to
75 * @pasid: The PASID on the device the task should be bound to
76 * @task: the task to bind
77 *
78 * The function returns 0 on success or a negative value on error.
79 */
80extern int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid,
81 struct task_struct *task);
82
83/**
84 * amd_iommu_unbind_pasid() - Unbind a PASID from its task on
85 * a device
86 * @pdev: The device of the PASID
87 * @pasid: The PASID to unbind
88 *
89 * When this function returns the device is no longer using the PASID
90 * and the PASID is no longer bound to its task.
91 */
92extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid);
93
68#else 94#else
69 95
70static inline int amd_iommu_detect(void) { return -ENODEV; } 96static inline int amd_iommu_detect(void) { return -ENODEV; }