diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-18 12:34:28 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-18 12:34:28 -0400 |
| commit | 5bc705e9fe774be9bb87584644c1f6752ee5ea7e (patch) | |
| tree | 5bcab227cc2008df6cfb17533be0a69ffd21e981 /arch/sparc/mm/io-unit.c | |
| parent | 605a494e4df0b2dabdebcdfee99536b0f6a22adc (diff) | |
| parent | 405849610fd96b4f34cd1875c4c033228fea6c0f (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[MATH-EMU]: Fix underflow exception reporting.
[SPARC64]: Create a HWCAP_SPARC_N2 and report it to userspace on Niagara-2.
[SPARC64]: SMP trampoline needs to avoid %tick_cmpr on sun4v too.
[SPARC64]: Do not touch %tick_cmpr on sun4v cpus.
[SPARC64]: Niagara-2 optimized copies.
[SPARC64]: Allow userspace to get at the machine description.
[SPARC32]: Remove superfluous 'kernel_end' alignment on sun4c.
[SPARC32]: Fix bogus ramdisk image location check.
[SPARC32]: Remove iommu from struct sbus_bus and use archdata like sparc64.
Diffstat (limited to 'arch/sparc/mm/io-unit.c')
| -rw-r--r-- | arch/sparc/mm/io-unit.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index 4ccda77d08d6..7c89893b1fe8 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c | |||
| @@ -66,7 +66,7 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus) | |||
| 66 | } | 66 | } |
| 67 | if(!xpt) panic("Cannot map External Page Table."); | 67 | if(!xpt) panic("Cannot map External Page Table."); |
| 68 | 68 | ||
| 69 | sbus->iommu = (struct iommu_struct *)iounit; | 69 | sbus->ofdev.dev.archdata.iommu = iounit; |
| 70 | iounit->page_table = xpt; | 70 | iounit->page_table = xpt; |
| 71 | spin_lock_init(&iounit->lock); | 71 | spin_lock_init(&iounit->lock); |
| 72 | 72 | ||
| @@ -127,7 +127,7 @@ nexti: scan = find_next_zero_bit(iounit->bmap, limit, scan); | |||
| 127 | static __u32 iounit_get_scsi_one(char *vaddr, unsigned long len, struct sbus_bus *sbus) | 127 | static __u32 iounit_get_scsi_one(char *vaddr, unsigned long len, struct sbus_bus *sbus) |
| 128 | { | 128 | { |
| 129 | unsigned long ret, flags; | 129 | unsigned long ret, flags; |
| 130 | struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu; | 130 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; |
| 131 | 131 | ||
| 132 | spin_lock_irqsave(&iounit->lock, flags); | 132 | spin_lock_irqsave(&iounit->lock, flags); |
| 133 | ret = iounit_get_area(iounit, (unsigned long)vaddr, len); | 133 | ret = iounit_get_area(iounit, (unsigned long)vaddr, len); |
| @@ -138,7 +138,7 @@ static __u32 iounit_get_scsi_one(char *vaddr, unsigned long len, struct sbus_bus | |||
| 138 | static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus *sbus) | 138 | static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus *sbus) |
| 139 | { | 139 | { |
| 140 | unsigned long flags; | 140 | unsigned long flags; |
| 141 | struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu; | 141 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; |
| 142 | 142 | ||
| 143 | /* FIXME: Cache some resolved pages - often several sg entries are to the same page */ | 143 | /* FIXME: Cache some resolved pages - often several sg entries are to the same page */ |
| 144 | spin_lock_irqsave(&iounit->lock, flags); | 144 | spin_lock_irqsave(&iounit->lock, flags); |
| @@ -153,7 +153,7 @@ static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus | |||
| 153 | static void iounit_release_scsi_one(__u32 vaddr, unsigned long len, struct sbus_bus *sbus) | 153 | static void iounit_release_scsi_one(__u32 vaddr, unsigned long len, struct sbus_bus *sbus) |
| 154 | { | 154 | { |
| 155 | unsigned long flags; | 155 | unsigned long flags; |
| 156 | struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu; | 156 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; |
| 157 | 157 | ||
| 158 | spin_lock_irqsave(&iounit->lock, flags); | 158 | spin_lock_irqsave(&iounit->lock, flags); |
| 159 | len = ((vaddr & ~PAGE_MASK) + len + (PAGE_SIZE-1)) >> PAGE_SHIFT; | 159 | len = ((vaddr & ~PAGE_MASK) + len + (PAGE_SIZE-1)) >> PAGE_SHIFT; |
| @@ -168,7 +168,7 @@ static void iounit_release_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_ | |||
| 168 | { | 168 | { |
| 169 | unsigned long flags; | 169 | unsigned long flags; |
| 170 | unsigned long vaddr, len; | 170 | unsigned long vaddr, len; |
| 171 | struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu; | 171 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; |
| 172 | 172 | ||
| 173 | spin_lock_irqsave(&iounit->lock, flags); | 173 | spin_lock_irqsave(&iounit->lock, flags); |
| 174 | while (sz != 0) { | 174 | while (sz != 0) { |
| @@ -211,7 +211,7 @@ static int iounit_map_dma_area(dma_addr_t *pba, unsigned long va, __u32 addr, in | |||
| 211 | i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT); | 211 | i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT); |
| 212 | 212 | ||
| 213 | for_each_sbus(sbus) { | 213 | for_each_sbus(sbus) { |
| 214 | struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu; | 214 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; |
| 215 | 215 | ||
| 216 | iopte = (iopte_t *)(iounit->page_table + i); | 216 | iopte = (iopte_t *)(iounit->page_table + i); |
| 217 | *iopte = MKIOPTE(__pa(page)); | 217 | *iopte = MKIOPTE(__pa(page)); |
| @@ -235,7 +235,7 @@ static void iounit_unmap_dma_area(unsigned long addr, int len) | |||
| 235 | static struct page *iounit_translate_dvma(unsigned long addr) | 235 | static struct page *iounit_translate_dvma(unsigned long addr) |
| 236 | { | 236 | { |
| 237 | struct sbus_bus *sbus = sbus_root; /* They are all the same */ | 237 | struct sbus_bus *sbus = sbus_root; /* They are all the same */ |
| 238 | struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu; | 238 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; |
| 239 | int i; | 239 | int i; |
| 240 | iopte_t *iopte; | 240 | iopte_t *iopte; |
| 241 | 241 | ||
| @@ -279,7 +279,7 @@ __u32 iounit_map_dma_init(struct sbus_bus *sbus, int size) | |||
| 279 | unsigned long rotor, scan, limit; | 279 | unsigned long rotor, scan, limit; |
| 280 | unsigned long flags; | 280 | unsigned long flags; |
| 281 | __u32 ret; | 281 | __u32 ret; |
| 282 | struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu; | 282 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; |
| 283 | 283 | ||
| 284 | npages = (size + (PAGE_SIZE-1)) >> PAGE_SHIFT; | 284 | npages = (size + (PAGE_SIZE-1)) >> PAGE_SHIFT; |
| 285 | i = 0x0213; | 285 | i = 0x0213; |
| @@ -315,7 +315,7 @@ nexti: scan = find_next_zero_bit(iounit->bmap, limit, scan); | |||
| 315 | __u32 iounit_map_dma_page(__u32 vaddr, void *addr, struct sbus_bus *sbus) | 315 | __u32 iounit_map_dma_page(__u32 vaddr, void *addr, struct sbus_bus *sbus) |
| 316 | { | 316 | { |
| 317 | int scan = (vaddr - IOUNIT_DMA_BASE) >> PAGE_SHIFT; | 317 | int scan = (vaddr - IOUNIT_DMA_BASE) >> PAGE_SHIFT; |
| 318 | struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu; | 318 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; |
| 319 | 319 | ||
| 320 | iounit->page_table[scan] = MKIOPTE(__pa(((unsigned long)addr) & PAGE_MASK)); | 320 | iounit->page_table[scan] = MKIOPTE(__pa(((unsigned long)addr) & PAGE_MASK)); |
| 321 | return vaddr + (((unsigned long)addr) & ~PAGE_MASK); | 321 | return vaddr + (((unsigned long)addr) & ~PAGE_MASK); |
