Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_X86_AGP_H
0003 #define _ASM_X86_AGP_H
0004 
0005 #include <linux/pgtable.h>
0006 #include <asm/cacheflush.h>
0007 
0008 /*
0009  * Functions to keep the agpgart mappings coherent with the MMU. The
0010  * GART gives the CPU a physical alias of pages in memory. The alias
0011  * region is mapped uncacheable. Make sure there are no conflicting
0012  * mappings with different cacheability attributes for the same
0013  * page. This avoids data corruption on some CPUs.
0014  */
0015 
0016 #define map_page_into_agp(page) set_pages_uc(page, 1)
0017 #define unmap_page_from_agp(page) set_pages_wb(page, 1)
0018 
0019 /*
0020  * Could use CLFLUSH here if the cpu supports it. But then it would
0021  * need to be called for each cacheline of the whole page so it may
0022  * not be worth it. Would need a page for it.
0023  */
0024 #define flush_agp_cache() wbinvd()
0025 
0026 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
0027 #define alloc_gatt_pages(order)     \
0028     ((char *)__get_free_pages(GFP_KERNEL, (order)))
0029 #define free_gatt_pages(table, order)   \
0030     free_pages((unsigned long)(table), (order))
0031 
0032 #endif /* _ASM_X86_AGP_H */