aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-12-02 18:28:53 +0100
committerJoerg Roedel <joerg.roedel@amd.com>2009-01-03 14:11:53 +0100
commita2acfb75792511a35586db80a38b8e4701a97730 (patch)
treee031a8dc61aa93fe3f43f86647c30f151bfa9f55
parent86db2e5d47bfa61a151d6ac83263f4bde4d52290 (diff)
AMD IOMMU: add domain id free function
Impact: add code to release a domain id Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
-rw-r--r--arch/x86/kernel/amd_iommu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 8a0fd3d0997..0922d5fe633 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -571,6 +571,18 @@ static u16 domain_id_alloc(void)
return id;
}
+#ifdef CONFIG_IOMMU_API
+static void domain_id_free(int id)
+{
+ unsigned long flags;
+
+ write_lock_irqsave(&amd_iommu_devtable_lock, flags);
+ if (id > 0 && id < MAX_DOMAIN_ID)
+ __clear_bit(id, amd_iommu_pd_alloc_bitmap);
+ write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
+}
+#endif
+
/*
* Used to reserve address ranges in the aperture (e.g. for exclusion
* ranges.