Jacob Gorm Hansen wrote:
This is not a very clean or nice patch, but it does the job. Does anyone
know where to send fglrx-patches, once I have a nicer version?
Here is a diff -Naur version, see attached.
Jacob
diff -Naur old/agpgart_be.c new/agpgart_be.c
--- old/agpgart_be.c 2005-02-07 23:32:27.881712680 -0800
+++ new/agpgart_be.c 2005-02-07 23:48:18.705165544 -0800
@@ -138,6 +138,7 @@
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/io.h>
+
#include <asm/page.h>
#include "agp_backend.h"
@@ -1050,7 +1051,7 @@
#ifndef AGPGART_2_2
struct page *page;
#endif /* !AGPGART_2_2 */
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
int err;
#endif
@@ -1159,18 +1160,18 @@
agp_bridge.gatt_table_real = (unsigned long *) table;
CACHE_FLUSH();
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
err = change_page_attr(virt_to_page(table), 1<<page_order,
PAGE_KERNEL_NOCACHE);
if (!err)
#endif
{
- agp_bridge.gatt_table = ioremap_nocache(virt_to_phys(table),
+ agp_bridge.gatt_table = ioremap_nocache(virt_to_bus(table),
(PAGE_SIZE * (1 << page_order)));
}
CACHE_FLUSH();
if (agp_bridge.gatt_table == NULL
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
|| (err)
#endif
)
@@ -1245,7 +1246,7 @@
* from the table.
*/
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
change_page_attr(virt_to_page(agp_bridge.gatt_table_real), 1<<page_order,
PAGE_KERNEL);
#endif
@@ -1402,7 +1403,7 @@
return 0;
}
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
if (change_page_attr(page, 1, PAGE_KERNEL_NOCACHE) < 0) {
__free_page(page);
return 0;
@@ -1443,7 +1444,7 @@
}
page = virt_to_page((unsigned long)pt);
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
change_page_attr(page, 1, PAGE_KERNEL);
#endif
@@ -3176,7 +3177,7 @@
static int amd_create_page_map(amd_page_map *page_map)
{
int i;
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
int err;
#endif
@@ -3196,17 +3197,17 @@
set_bit(PG_reserved, &virt_to_page((unsigned long)page_map->real)->flags);
CACHE_FLUSH();
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
err = change_page_attr(virt_to_page(page_map->real), 1,
PAGE_KERNEL_NOCACHE);
if (!err)
#endif
{
- page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
+ page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real),
PAGE_SIZE);
}
if ( (page_map->remapped == NULL)
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
|| (err)
#endif
)
@@ -3235,7 +3236,7 @@
&mem_map[MAP_NR(page_map->real)].flags);
#else /* !AGPGART_2_2 */
iounmap(page_map->remapped);
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
change_page_attr(virt_to_page(page_map->real), 1, PAGE_KERNEL);
#endif
clear_bit(PG_reserved,
@@ -4404,7 +4405,7 @@
// 2.4.8-ac7 and 2.4.13
unsigned long page_addr;
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
page_addr = agp_generic_alloc_page();
if (page_addr == 0)
return 0;
@@ -4482,7 +4483,7 @@
static void ali_destroy_page(unsigned long addr)
{
void *pt = (void *) addr;
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
/* no more vars needed */
#else
struct page *page;
@@ -4503,7 +4504,7 @@
ALI_CACHE_FLUSH_EN));
}
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
agp_generic_destroy_page(addr);
#else
page = virt_to_page((unsigned long)pt);
@@ -4597,7 +4598,7 @@
static int serverworks_create_page_map(serverworks_page_map *page_map)
{
int i;
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
int err;
#endif
@@ -4618,17 +4619,17 @@
set_bit(PG_reserved, &virt_to_page((unsigned
long)page_map->real)->flags);
CACHE_FLUSH();
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
err = change_page_attr(virt_to_page(page_map->real), 1,
PAGE_KERNEL_NOCACHE);
if (!err)
#endif
{
- page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
+ page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real),
PAGE_SIZE);
}
if ( (page_map->remapped == NULL)
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
|| (err)
#endif
)
@@ -4655,7 +4656,7 @@
clear_bit(PG_reserved,
&mem_map[MAP_NR(page_map->real)].flags);
#else /* !AGPGART_2_2 */
-#if defined(CONFIG_X86) && (PAGE_ATTR_FIX != 0)
+#if (defined(CONFIG_X86) || defined(CONFIG_XEN)) && (PAGE_ATTR_FIX != 0)
change_page_attr(virt_to_page(page_map->real),1,PAGE_KERNEL);
#endif
iounmap(page_map->remapped);
diff -Naur old/firegl_public.c new/firegl_public.c
--- old/firegl_public.c 2005-02-07 23:32:37.832199976 -0800
+++ new/firegl_public.c 2005-02-07 23:49:50.919146888 -0800
@@ -32,13 +32,14 @@
// ============================================================
#include <linux/version.h>
#include <linux/autoconf.h>
+#include <asm/pgtable.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
#define EXPORT_SYMTAB 1
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,71)
-#if !defined(CONFIG_X86_PC)
+#if !defined(CONFIG_X86)
#if !defined(CONFIG_X86_64)
#if !defined(CONFIG_X86_VOYAGER)
#if !defined(CONFIG_X86_NUMAQ)
@@ -46,6 +47,7 @@
#if !defined(CONFIG_X86_BIGSMP)
#if !defined(CONFIG_X86_VISWS)
#if !defined(CONFIG_X86_GENERICARCH)
+#if !defined(CONFIG_XEN)
#error unknown or undefined architecture configured
#endif
#endif
@@ -55,6 +57,7 @@
#endif
#endif
#endif
+#endif
#endif /* LINUX_VERSION_CODE */
// ============================================================
@@ -2554,8 +2557,9 @@
enum __ke_vm_maptype type,
int readonly)
{
+
unsigned int pages;
- __KE_DEBUG3("start=0x%08lx, "
+ __KE_DEBUG("start=0x%08lx, "
"end=0x%08lx, "
"offset=0x%08lx\n",
vma->vm_start,
@@ -2586,13 +2590,13 @@
#endif /* __ia64__ */
vma->vm_flags |= VM_IO; /* not in core dump */
}
- if (remap_page_range(FGL_VMA_API_PASS
+ if (io_remap_page_range(vma,
vma->vm_start,
__ke_vm_offset(vma),
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
{
- __KE_DEBUG("remap_page_range failed\n");
+ __KE_DEBUG("io_remap_page_range failed\n");
return -EAGAIN;
}
vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
@@ -2653,13 +2657,13 @@
{
if (__ke_vm_offset(vma) >= __pa(high_memory))
vma->vm_flags |= VM_IO; /* not in core
dump */
- if (remap_page_range(FGL_VMA_API_PASS
+ if (io_remap_page_range(vma,
vma->vm_start,
__ke_vm_offset(vma),
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
{
- __KE_DEBUG("remap_page_range failed\n");
+ __KE_DEBUG("io_remap_page_range
failed\n");
return -EAGAIN;
}
#ifdef __x86_64__
@@ -2690,13 +2694,13 @@
{
if (__ke_vm_offset(vma) >= __pa(high_memory))
vma->vm_flags |= VM_IO; /* not in core
dump */
- if (remap_page_range(FGL_VMA_API_PASS
+ if (io_remap_page_range(vma,
vma->vm_start,
__ke_vm_offset(vma),
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
{
- __KE_DEBUG("remap_page_range failed\n");
+ __KE_DEBUG("io_remap_page_range
failed\n");
return -EAGAIN;
}
#ifdef __x86_64__
|