2 /* dvma support routines */
4 #include <linux/kernel.h>
7 #include <asm/pgtable.h>
8 #include <asm/sun3mmu.h>
11 unsigned long dvma_next_free
= DVMA_START
;
13 /* get needed number of free dma pages, or panic if not enough */
15 void *sun3_dvma_malloc(int len
)
19 /* if the next free pages have been accessed, skip them */
20 while((dvma_next_free
< DVMA_END
) &&
21 (sun3_get_pte(dvma_next_free
) & SUN3_PAGE_ACCESSED
))
22 dvma_next_free
+= SUN3_PTE_SIZE
;
24 if((dvma_next_free
+ len
) > DVMA_END
)
25 panic("sun3_dvma_malloc: out of dvma pages");
27 vaddr
= dvma_next_free
;
28 dvma_next_free
= PAGE_ALIGN(dvma_next_free
+ len
);