Mailing List Archive

[Xen-merge] [PATCH 01/23] agp subarch headers
--- linux-2.6.12-xen0-arch.orig/include/asm-i386/agp.h
+++ linux-2.6.12-xen0-arch/include/asm-i386/agp.h
@@ -3,6 +3,8 @@

#include <asm/pgtable.h>
#include <asm/cacheflush.h>
+#include <asm/system.h>
+#include <mach_agp.h>

/*
* Functions to keep the agpgart mappings coherent with the MMU.
@@ -19,16 +21,10 @@ int unmap_page_from_agp(struct page *pag
/* 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")
+#define flush_agp_cache() wbinvd()

/* 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))
+#define phys_to_gart(x) phys_to_machine(x)
+#define gart_to_phys(x) machine_to_phys(x)

#endif
--- /dev/null
+++ linux-2.6.12-xen0-arch/include/asm-i386/mach-default/mach_agp.h
@@ -0,0 +1,10 @@
+#ifndef __ASM_MACH_AGP_H
+#define __ASM_MACH_AGP_H
+
+/* 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
--- linux-2.6.12-xen0/include/asm-i386/mach-xen/mach_agp.h 1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.12-xen0-arch/include/asm-i386/mach-xen/mach_agp.h 2005-07-29 15:28:55.000000000 -0700
@@ -0,0 +1,12 @@
+#ifndef __ASM_MACH_AGP_H
+#define __ASM_MACH_AGP_H
+
+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
+#define alloc_gatt_pages(order) ({ \
+ char *_t; dma_addr_t _d; \
+ _t = dma_alloc_coherent(NULL,PAGE_SIZE<<(order),&_d,GFP_KERNEL); \
+ _t; })
+#define free_gatt_pages(table, order) \
+ dma_free_coherent(NULL,PAGE_SIZE<<(order),(table),virt_to_bus(table))
+
+#endif

--


_______________________________________________
Xen-merge mailing list
Xen-merge@lists.xensource.com
http://lists.xensource.com/xen-merge