mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 23:53:55 +08:00
07eee78ea8
When Linux is running on the Xen virtual machine monitor, physical addresses are virtualised and cannot be directly referenced by the AGP GART. This patch fixes the GART driver for Xen by adding a layer of abstraction between physical addresses and 'GART addresses'. Architecture-specific functions are also defined for allocating and freeing the GATT. Xen requires this to ensure that table really is contiguous from the point of view of the GART. These extra interface functions are defined as 'no-ops' for all existing architectures that use the GART driver. Signed-off-by: Keir Fraser <keir@xensource.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Jones <davej@redhat.com>
33 lines
1.0 KiB
C
33 lines
1.0 KiB
C
#ifndef AGP_H
|
|
#define AGP_H 1
|
|
|
|
#include <asm/cacheflush.h>
|
|
|
|
/*
|
|
* Functions to keep the agpgart mappings coherent.
|
|
* The GART gives the CPU a physical alias of memory. The alias is
|
|
* mapped uncacheable. Make sure there are no conflicting mappings
|
|
* with different cachability attributes for the same page.
|
|
*/
|
|
|
|
int map_page_into_agp(struct page *page);
|
|
int unmap_page_from_agp(struct page *page);
|
|
#define flush_agp_mappings() global_flush_tlb()
|
|
|
|
/* Could use CLFLUSH here if the cpu supports it. But then it would
|
|
need to be called for each cacheline of the whole page so it may not be
|
|
worth it. Would need a page for it. */
|
|
#define flush_agp_cache() asm volatile("wbinvd":::"memory")
|
|
|
|
/* Convert a physical address to an address suitable for the GART. */
|
|
#define phys_to_gart(x) (x)
|
|
#define gart_to_phys(x) (x)
|
|
|
|
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
|
|
#define alloc_gatt_pages(order) \
|
|
((char *)__get_free_pages(GFP_KERNEL, (order)))
|
|
#define free_gatt_pages(table, order) \
|
|
free_pages((unsigned long)(table), (order))
|
|
|
|
#endif
|