void *dxt_dma_contig_alloc(unsigned int size)
{
struct page *page;
void *addr = (void *)__get_free_pages( GFP_DMA, get_order(size));
for (page = virt_to_page(addr); page <= virt_to_page(addr + size - 1); page++)
//SetPageReserved(page);
return addr;
}
void dxt_dma_contig_free(void *addr, unsigned int size)
{
struct page *page;
for (page = virt_to_page(addr); page <= virt_to_page(addr + size - 1); page++)
//ClearPageReserved(page);
free_pages((unsigned long)addr, get_order(size));
}
1. 在PC上可以分配8M
2. __get_free_pages( GFP_DMA | GFP_KERNEL, )有问题
3. 不能SetPageReserved()
阅读(2699) | 评论(0) | 转发(0) |