diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-07-11 11:14:23 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-11 12:01:11 -0400 |
commit | 8ea80d783efd0c50577ec8d69757ae54c408eacd (patch) | |
tree | 5f4c577435f600a2ed03280de0849713cc27e64f | |
parent | 431b2a2015337533f1a9e39a840266a8a2c93144 (diff) |
x86, AMD IOMMU: replace HIGH_U32 macro with upper_32_bits function
Removes a driver specific macro and replaces it with a generic function already
available in Linux.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: iommu@lists.linux-foundation.org
Cc: bhavna.sarathy@amd.com
Cc: robert.richter@amd.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 4 | ||||
-rw-r--r-- | include/asm-x86/amd_iommu_types.h | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 4bae96ca7c11..9098f047c1a9 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -109,7 +109,7 @@ static int iommu_completion_wait(struct amd_iommu *iommu) | |||
109 | 109 | ||
110 | memset(&cmd, 0, sizeof(cmd)); | 110 | memset(&cmd, 0, sizeof(cmd)); |
111 | cmd.data[0] = LOW_U32(ready_phys) | CMD_COMPL_WAIT_STORE_MASK; | 111 | cmd.data[0] = LOW_U32(ready_phys) | CMD_COMPL_WAIT_STORE_MASK; |
112 | cmd.data[1] = HIGH_U32(ready_phys); | 112 | cmd.data[1] = upper_32_bits(ready_phys); |
113 | cmd.data[2] = 1; /* value written to 'ready' */ | 113 | cmd.data[2] = 1; /* value written to 'ready' */ |
114 | CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT); | 114 | CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT); |
115 | 115 | ||
@@ -157,7 +157,7 @@ static int iommu_queue_inv_iommu_pages(struct amd_iommu *iommu, | |||
157 | CMD_SET_TYPE(&cmd, CMD_INV_IOMMU_PAGES); | 157 | CMD_SET_TYPE(&cmd, CMD_INV_IOMMU_PAGES); |
158 | cmd.data[1] |= domid; | 158 | cmd.data[1] |= domid; |
159 | cmd.data[2] = LOW_U32(address); | 159 | cmd.data[2] = LOW_U32(address); |
160 | cmd.data[3] = HIGH_U32(address); | 160 | cmd.data[3] = upper_32_bits(address); |
161 | if (s) /* size bit - we flush more than one 4kb page */ | 161 | if (s) /* size bit - we flush more than one 4kb page */ |
162 | cmd.data[2] |= CMD_INV_IOMMU_PAGES_SIZE_MASK; | 162 | cmd.data[2] |= CMD_INV_IOMMU_PAGES_SIZE_MASK; |
163 | if (pde) /* PDE bit - we wan't flush everything not only the PTEs */ | 163 | if (pde) /* PDE bit - we wan't flush everything not only the PTEs */ |
diff --git a/include/asm-x86/amd_iommu_types.h b/include/asm-x86/amd_iommu_types.h index 945fd498a3ad..14aaffe38fe5 100644 --- a/include/asm-x86/amd_iommu_types.h +++ b/include/asm-x86/amd_iommu_types.h | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | /* helper macros */ | 34 | /* helper macros */ |
35 | #define LOW_U32(x) ((x) & ((1ULL << 32)-1)) | 35 | #define LOW_U32(x) ((x) & ((1ULL << 32)-1)) |
36 | #define HIGH_U32(x) (LOW_U32((x) >> 32)) | ||
37 | 36 | ||
38 | /* Length of the MMIO region for the AMD IOMMU */ | 37 | /* Length of the MMIO region for the AMD IOMMU */ |
39 | #define MMIO_REGION_LENGTH 0x4000 | 38 | #define MMIO_REGION_LENGTH 0x4000 |