summaryrefslogtreecommitdiff
path: root/include/linux/amd-iommu.h
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-11-24 13:41:57 +0400
committerJoerg Roedel <joerg.roedel@amd.com>2011-12-12 18:34:42 +0400
commit2d5503b624736abfe0e0bad281f9b8d8a705b930 (patch)
tree6ed415d39c6ac928dbb2997bb86f612b9b87b766 /include/linux/amd-iommu.h
parented96f228ba9725edf69385bffdc19ee5bb0ec641 (diff)
downloadlinux-2d5503b624736abfe0e0bad281f9b8d8a705b930.tar.xz
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/linux/amd-iommu.h')
-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 @@
#ifdef CONFIG_AMD_IOMMU
+struct task_struct;
struct pci_dev;
extern int amd_iommu_detect(void);
+extern int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid,
+ struct task_struct *task);
+extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid);
/**
@@ -65,6 +69,28 @@ extern int amd_iommu_init_device(struct pci_dev *pdev, int pasids);
*/
extern void amd_iommu_free_device(struct pci_dev *pdev);
+/**
+ * amd_iommu_bind_pasid() - Bind a given task to a PASID on a device
+ * @pdev: The PCI device to bind the task to
+ * @pasid: The PASID on the device the task should be bound to
+ * @task: the task to bind
+ *
+ * The function returns 0 on success or a negative value on error.
+ */
+extern int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid,
+ struct task_struct *task);
+
+/**
+ * amd_iommu_unbind_pasid() - Unbind a PASID from its task on
+ * a device
+ * @pdev: The device of the PASID
+ * @pasid: The PASID to unbind
+ *
+ * When this function returns the device is no longer using the PASID
+ * and the PASID is no longer bound to its task.
+ */
+extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid);
+
#else
static inline int amd_iommu_detect(void) { return -ENODEV; }