Skip to content

Commit

Permalink
AMD IOMMU: add domain id free function
Browse files Browse the repository at this point in the history
Impact: add code to release a domain id

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Joerg Roedel committed Jan 3, 2009
1 parent 86db2e5 commit a2acfb7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a2acfb7

Please sign in to comment.