• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/arch/sparc/mm/

Lines Matching defs:iounit

41 	struct iounit_struct *iounit;
45 iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
46 if (!iounit) {
47 prom_printf("SUN4D: Cannot alloc iounit, halting.\n");
51 iounit->limit[0] = IOUNIT_BMAP1_START;
52 iounit->limit[1] = IOUNIT_BMAP2_START;
53 iounit->limit[2] = IOUNIT_BMAPM_START;
54 iounit->limit[3] = IOUNIT_BMAPM_END;
55 iounit->rotor[1] = IOUNIT_BMAP2_START;
56 iounit->rotor[2] = IOUNIT_BMAPM_START;
69 sbus->iommu = (struct iommu_struct *)iounit;
70 iounit->page_table = xpt;
71 spin_lock_init(&iounit->lock);
73 for (xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t);
78 /* One has to hold iounit->lock to call this */
79 static unsigned long iounit_get_area(struct iounit_struct *iounit, unsigned long vaddr, int size)
97 rotor = iounit->rotor[j - 1];
98 limit = iounit->limit[j];
100 nexti: scan = find_next_zero_bit(iounit->bmap, limit, scan);
104 scan = iounit->limit[j - 1];
113 if (test_bit(scan++, iounit->bmap))
115 iounit->rotor[j - 1] = (scan < limit) ? scan : iounit->limit[j - 1];
120 set_bit(scan, iounit->bmap);
121 iounit->page_table[scan] = iopte;
130 struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
132 spin_lock_irqsave(&iounit->lock, flags);
133 ret = iounit_get_area(iounit, (unsigned long)vaddr, len);
134 spin_unlock_irqrestore(&iounit->lock, flags);
141 struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
143 spin_lock_irqsave(&iounit->lock, flags);
146 sg[sz].dvma_address = iounit_get_area(iounit, (unsigned long)page_address(sg[sz].page) + sg[sz].offset, sg[sz].length);
149 spin_unlock_irqrestore(&iounit->lock, flags);
155 struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
157 spin_lock_irqsave(&iounit->lock, flags);
162 clear_bit(vaddr, iounit->bmap);
163 spin_unlock_irqrestore(&iounit->lock, flags);
170 struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
172 spin_lock_irqsave(&iounit->lock, flags);
179 clear_bit(vaddr, iounit->bmap);
181 spin_unlock_irqrestore(&iounit->lock, flags);
213 struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
215 iopte = (iopte_t *)(iounit->page_table + i);
235 struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
240 iopte = (iopte_t *)(iounit->page_table + i);
277 struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
281 spin_lock_irqsave(&iounit->lock, flags);
283 rotor = iounit->rotor[j - 1];
284 limit = iounit->limit[j];
286 nexti: scan = find_next_zero_bit(iounit->bmap, limit, scan);
290 scan = iounit->limit[j - 1];
299 if (test_bit(scan++, iounit->bmap))
301 iounit->rotor[j - 1] = (scan < limit) ? scan : iounit->limit[j - 1];
305 set_bit(scan, iounit->bmap);
306 spin_unlock_irqrestore(&iounit->lock, flags);
313 struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
315 iounit->page_table[scan] = MKIOPTE(__pa(((unsigned long)addr) & PAGE_MASK));