ia64/xen-unstable

changeset 12699:2c5bed93ffbc

linux/x86-64: missing agp.h

This causes data corruption and/or crashes when AGP is actually used.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Thu Nov 30 17:21:52 2006 +0000 (2006-11-30)
parents 27a5a62552c0
children a2c26a896725
files linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/agp.h
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/agp.h	Thu Nov 30 17:21:52 2006 +0000
     1.3 @@ -0,0 +1,35 @@
     1.4 +#ifndef AGP_H
     1.5 +#define AGP_H 1
     1.6 +
     1.7 +#include <asm/cacheflush.h>
     1.8 +#include <asm/system.h>
     1.9 +
    1.10 +/*
    1.11 + * Functions to keep the agpgart mappings coherent.
    1.12 + * The GART gives the CPU a physical alias of memory. The alias is
    1.13 + * mapped uncacheable. Make sure there are no conflicting mappings
    1.14 + * with different cachability attributes for the same page.
    1.15 + */
    1.16 +
    1.17 +int map_page_into_agp(struct page *page);
    1.18 +int unmap_page_from_agp(struct page *page);
    1.19 +#define flush_agp_mappings() global_flush_tlb()
    1.20 +
    1.21 +/* Could use CLFLUSH here if the cpu supports it. But then it would
    1.22 +   need to be called for each cacheline of the whole page so it may not be
    1.23 +   worth it. Would need a page for it. */
    1.24 +#define flush_agp_cache() wbinvd()
    1.25 +
    1.26 +/* Convert a physical address to an address suitable for the GART. */
    1.27 +#define phys_to_gart(x) phys_to_machine(x)
    1.28 +#define gart_to_phys(x) machine_to_phys(x)
    1.29 +
    1.30 +/* GATT allocation. Returns/accepts GATT kernel virtual address. */
    1.31 +#define alloc_gatt_pages(order)	({                                          \
    1.32 +	char *_t; dma_addr_t _d;                                            \
    1.33 +	_t = dma_alloc_coherent(NULL,PAGE_SIZE<<(order),&_d,GFP_KERNEL);    \
    1.34 +	_t; })
    1.35 +#define free_gatt_pages(table, order)	\
    1.36 +	dma_free_coherent(NULL,PAGE_SIZE<<(order),(table),virt_to_bus(table))
    1.37 +
    1.38 +#endif