ia64/xen-unstable

changeset 3863:b0a8660dc6fd

bitkeeper revision 1.1159.258.5 (4215f09cU1Zrw85yrXJiQPM7LeMJtw)

nettel.patch, drm.patch, agpgart.patch:
mvdir
author kaf24@scramble.cl.cam.ac.uk
date Fri Feb 18 13:41:48 2005 +0000 (2005-02-18)
parents 58be428f51a8
children 73c3313f21d3
files .rootkeys patches/linux-2.6.10/agpgart.patch patches/linux-2.6.10/drm.patch patches/linux-2.6.10/nettel.patch patches/linux-2.6.9/agpgart.patch patches/linux-2.6.9/drm.patch patches/linux-2.6.9/nettel.patch
line diff
     1.1 --- a/.rootkeys	Sat Feb 12 13:45:18 2005 +0000
     1.2 +++ b/.rootkeys	Fri Feb 18 13:41:48 2005 +0000
     1.3 @@ -291,9 +291,9 @@ 413cb3b5rIKB3TbyhK3pbNyVkYysqA netbsd-2.
     1.4  413cb3b5eKxnzoodEqaWn2wrPnHWnA netbsd-2.0-xen-sparse/sys/arch/xen/xen/xencons.c
     1.5  413cb3b5F56TvQWAmO5TsuzhtzLFPQ netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c
     1.6  413cb3b53nyOv1OIeDSsCXhBFDXvJA netbsd-2.0-xen-sparse/sys/nfs/files.nfs
     1.7 -413aa1d0oNP8HXLvfPuMe6cSroUfSA patches/linux-2.6.9/agpgart.patch
     1.8 -413aa1d0ewvSv-ohnNnQQNGsbPTTNA patches/linux-2.6.9/drm.patch
     1.9 -418abc69J3F638vPO9MYoDGeYilxoQ patches/linux-2.6.9/nettel.patch
    1.10 +413aa1d0oNP8HXLvfPuMe6cSroUfSA patches/linux-2.6.10/agpgart.patch
    1.11 +413aa1d0ewvSv-ohnNnQQNGsbPTTNA patches/linux-2.6.10/drm.patch
    1.12 +418abc69J3F638vPO9MYoDGeYilxoQ patches/linux-2.6.10/nettel.patch
    1.13  3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Makefile
    1.14  40e1b09db5mN69Ijj0X_Eol-S7dXiw tools/Rules.mk
    1.15  4124b307nRyK3dhn1hAsvrY76NuV3g tools/check/Makefile
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/linux-2.6.10/agpgart.patch	Fri Feb 18 13:41:48 2005 +0000
     2.3 @@ -0,0 +1,371 @@
     2.4 +diff -ur linux-2.6.9/drivers/char/agp/ali-agp.c linux-2.6.9-new/drivers/char/agp/ali-agp.c
     2.5 +--- linux-2.6.9/drivers/char/agp/ali-agp.c	2004-10-18 22:54:38.000000000 +0100
     2.6 ++++ linux-2.6.9-new/drivers/char/agp/ali-agp.c	2004-11-28 19:32:03.000000000 +0000
     2.7 +@@ -150,7 +150,7 @@
     2.8 + 	pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
     2.9 + 	pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
    2.10 + 			(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
    2.11 +-			  virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN ));
    2.12 ++			  virt_to_bus(addr)) | ALI_CACHE_FLUSH_EN ));
    2.13 + 	return addr;
    2.14 + }
    2.15 + 
    2.16 +@@ -174,7 +174,7 @@
    2.17 + 	pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
    2.18 + 	pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
    2.19 + 			(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
    2.20 +-			  virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN));
    2.21 ++			  virt_to_bus(addr)) | ALI_CACHE_FLUSH_EN));
    2.22 + 	agp_generic_destroy_page(addr);
    2.23 + }
    2.24 + 
    2.25 +diff -ur linux-2.6.9/drivers/char/agp/amd-k7-agp.c linux-2.6.9-new/drivers/char/agp/amd-k7-agp.c
    2.26 +--- linux-2.6.9/drivers/char/agp/amd-k7-agp.c	2004-10-18 22:55:36.000000000 +0100
    2.27 ++++ linux-2.6.9-new/drivers/char/agp/amd-k7-agp.c	2004-11-28 19:36:39.000000000 +0000
    2.28 +@@ -43,7 +43,7 @@
    2.29 + 
    2.30 + 	SetPageReserved(virt_to_page(page_map->real));
    2.31 + 	global_cache_flush();
    2.32 +-	page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
    2.33 ++	page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real),
    2.34 + 					    PAGE_SIZE);
    2.35 + 	if (page_map->remapped == NULL) {
    2.36 + 		ClearPageReserved(virt_to_page(page_map->real));
    2.37 +@@ -152,7 +152,7 @@
    2.38 + 
    2.39 + 	agp_bridge->gatt_table_real = (u32 *)page_dir.real;
    2.40 + 	agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
    2.41 +-	agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
    2.42 ++	agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real);
    2.43 + 
    2.44 + 	/* Get the address for the gart region.
    2.45 + 	 * This is a bus address even on the alpha, b/c its
    2.46 +@@ -165,7 +165,7 @@
    2.47 + 
    2.48 + 	/* Calculate the agp offset */
    2.49 + 	for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
    2.50 +-		writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1,
    2.51 ++		writel(virt_to_bus(amd_irongate_private.gatt_pages[i]->real) | 1,
    2.52 + 			page_dir.remapped+GET_PAGE_DIR_OFF(addr));
    2.53 + 	}
    2.54 + 
    2.55 +diff -ur linux-2.6.9/drivers/char/agp/amd64-agp.c linux-2.6.9-new/drivers/char/agp/amd64-agp.c
    2.56 +--- linux-2.6.9/drivers/char/agp/amd64-agp.c	2004-10-18 22:54:38.000000000 +0100
    2.57 ++++ linux-2.6.9-new/drivers/char/agp/amd64-agp.c	2004-11-28 19:32:03.000000000 +0000
    2.58 +@@ -212,7 +212,7 @@
    2.59 + 
    2.60 + static int amd_8151_configure(void)
    2.61 + {
    2.62 +-	unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real);
    2.63 ++	unsigned long gatt_bus = virt_to_bus(agp_bridge->gatt_table_real);
    2.64 + 
    2.65 + 	/* Configure AGP regs in each x86-64 host bridge. */
    2.66 + 	for_each_nb() {
    2.67 +@@ -521,7 +521,7 @@
    2.68 + {
    2.69 + 	struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
    2.70 + 
    2.71 +-	release_mem_region(virt_to_phys(bridge->gatt_table_real),
    2.72 ++	release_mem_region(virt_to_bus(bridge->gatt_table_real),
    2.73 + 			   amd64_aperture_sizes[bridge->aperture_size_idx].size);
    2.74 + 	agp_remove_bridge(bridge);
    2.75 + 	agp_put_bridge(bridge);
    2.76 +diff -ur linux-2.6.9/drivers/char/agp/ati-agp.c linux-2.6.9-new/drivers/char/agp/ati-agp.c
    2.77 +--- linux-2.6.9/drivers/char/agp/ati-agp.c	2004-10-18 22:54:40.000000000 +0100
    2.78 ++++ linux-2.6.9-new/drivers/char/agp/ati-agp.c	2004-11-28 19:32:03.000000000 +0000
    2.79 +@@ -64,7 +64,7 @@
    2.80 + 
    2.81 + 	/* CACHE_FLUSH(); */
    2.82 + 	global_cache_flush();
    2.83 +-	page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
    2.84 ++	page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real),
    2.85 + 					    PAGE_SIZE);
    2.86 + 	if (page_map->remapped == NULL || err) {
    2.87 + 		ClearPageReserved(virt_to_page(page_map->real));
    2.88 +diff -ur linux-2.6.9/drivers/char/agp/backend.c linux-2.6.9-new/drivers/char/agp/backend.c
    2.89 +--- linux-2.6.9/drivers/char/agp/backend.c	2004-10-18 22:54:39.000000000 +0100
    2.90 ++++ linux-2.6.9-new/drivers/char/agp/backend.c	2004-11-28 19:32:03.000000000 +0000
    2.91 +@@ -142,7 +142,7 @@
    2.92 + 			return -ENOMEM;
    2.93 + 		}
    2.94 + 
    2.95 +-		bridge->scratch_page_real = virt_to_phys(addr);
    2.96 ++		bridge->scratch_page_real = virt_to_bus(addr);
    2.97 + 		bridge->scratch_page =
    2.98 + 		    bridge->driver->mask_memory(bridge->scratch_page_real, 0);
    2.99 + 	}
   2.100 +@@ -186,7 +186,7 @@
   2.101 + err_out:
   2.102 + 	if (bridge->driver->needs_scratch_page)
   2.103 + 		bridge->driver->agp_destroy_page(
   2.104 +-				phys_to_virt(bridge->scratch_page_real));
   2.105 ++				bus_to_virt(bridge->scratch_page_real));
   2.106 + 	if (got_gatt)
   2.107 + 		bridge->driver->free_gatt_table();
   2.108 + 	if (got_keylist) {
   2.109 +@@ -211,7 +211,7 @@
   2.110 + 	if (bridge->driver->agp_destroy_page &&
   2.111 + 	    bridge->driver->needs_scratch_page)
   2.112 + 		bridge->driver->agp_destroy_page(
   2.113 +-				phys_to_virt(bridge->scratch_page_real));
   2.114 ++				bus_to_virt(bridge->scratch_page_real));
   2.115 + }
   2.116 + 
   2.117 + static const drm_agp_t drm_agp = {
   2.118 +diff -ur linux-2.6.9/drivers/char/agp/efficeon-agp.c linux-2.6.9-new/drivers/char/agp/efficeon-agp.c
   2.119 +--- linux-2.6.9/drivers/char/agp/efficeon-agp.c	2004-10-18 22:53:06.000000000 +0100
   2.120 ++++ linux-2.6.9-new/drivers/char/agp/efficeon-agp.c	2004-11-28 19:38:28.000000000 +0000
   2.121 +@@ -219,7 +219,7 @@
   2.122 + 
   2.123 + 		efficeon_private.l1_table[index] = page;
   2.124 + 
   2.125 +-		value = __pa(page) | pati | present | index;
   2.126 ++		value = virt_to_bus(page) | pati | present | index;
   2.127 + 
   2.128 + 		pci_write_config_dword(agp_bridge->dev,
   2.129 + 			EFFICEON_ATTPAGE, value);
   2.130 +diff -ur linux-2.6.9/drivers/char/agp/generic.c linux-2.6.9-new/drivers/char/agp/generic.c
   2.131 +--- linux-2.6.9/drivers/char/agp/generic.c	2004-10-18 22:53:50.000000000 +0100
   2.132 ++++ linux-2.6.9-new/drivers/char/agp/generic.c	2004-11-28 19:32:03.000000000 +0000
   2.133 +@@ -128,7 +128,7 @@
   2.134 + 	}
   2.135 + 	if (curr->page_count != 0) {
   2.136 + 		for (i = 0; i < curr->page_count; i++) {
   2.137 +-			agp_bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[i]));
   2.138 ++			agp_bridge->driver->agp_destroy_page(bus_to_virt(curr->memory[i]));
   2.139 + 		}
   2.140 + 	}
   2.141 + 	agp_free_key(curr->key);
   2.142 +@@ -182,7 +182,7 @@
   2.143 + 			return NULL;
   2.144 + 		}
   2.145 + 		new->memory[i] =
   2.146 +-			agp_bridge->driver->mask_memory(virt_to_phys(addr), type);
   2.147 ++			agp_bridge->driver->mask_memory(virt_to_bus(addr), type);
   2.148 + 		new->page_count++;
   2.149 + 	}
   2.150 + 
   2.151 +@@ -637,6 +637,7 @@
   2.152 + 	int i;
   2.153 + 	void *temp;
   2.154 + 	struct page *page;
   2.155 ++	dma_addr_t dma;
   2.156 + 
   2.157 + 	/* The generic routines can't handle 2 level gatt's */
   2.158 + 	if (agp_bridge->driver->size_type == LVL2_APER_SIZE)
   2.159 +@@ -675,8 +676,10 @@
   2.160 + 				break;
   2.161 + 			}
   2.162 + 
   2.163 +-			table = (char *) __get_free_pages(GFP_KERNEL,
   2.164 +-							  page_order);
   2.165 ++			table = dma_alloc_coherent(
   2.166 ++					&agp_bridge->dev->dev,
   2.167 ++					PAGE_SIZE << page_order, &dma,
   2.168 ++					GFP_KERNEL);
   2.169 + 
   2.170 + 			if (table == NULL) {
   2.171 + 				i++;
   2.172 +@@ -707,7 +710,9 @@
   2.173 + 		size = ((struct aper_size_info_fixed *) temp)->size;
   2.174 + 		page_order = ((struct aper_size_info_fixed *) temp)->page_order;
   2.175 + 		num_entries = ((struct aper_size_info_fixed *) temp)->num_entries;
   2.176 +-		table = (char *) __get_free_pages(GFP_KERNEL, page_order);
   2.177 ++		table = dma_alloc_coherent(
   2.178 ++				&agp_bridge->dev->dev,
   2.179 ++				PAGE_SIZE << page_order, &dma, GFP_KERNEL);
   2.180 + 	}
   2.181 + 
   2.182 + 	if (table == NULL)
   2.183 +@@ -722,7 +727,7 @@
   2.184 + 	agp_gatt_table = (void *)table;
   2.185 + 
   2.186 + 	agp_bridge->driver->cache_flush();
   2.187 +-	agp_bridge->gatt_table = ioremap_nocache(virt_to_phys(table),
   2.188 ++	agp_bridge->gatt_table = ioremap_nocache(virt_to_bus(table),
   2.189 + 					(PAGE_SIZE * (1 << page_order)));
   2.190 + 	agp_bridge->driver->cache_flush();
   2.191 + 
   2.192 +@@ -730,11 +735,12 @@
   2.193 + 		for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
   2.194 + 			ClearPageReserved(page);
   2.195 + 
   2.196 +-		free_pages((unsigned long) table, page_order);
   2.197 ++		dma_free_coherent(&agp_bridge->dev->dev, PAGE_SIZE<<page_order,
   2.198 ++					table, dma);
   2.199 + 
   2.200 + 		return -ENOMEM;
   2.201 + 	}
   2.202 +-	agp_bridge->gatt_bus_addr = virt_to_phys(agp_bridge->gatt_table_real);
   2.203 ++	agp_bridge->gatt_bus_addr = virt_to_bus(table);
   2.204 + 
   2.205 + 	/* AK: bogus, should encode addresses > 4GB */
   2.206 + 	for (i = 0; i < num_entries; i++)
   2.207 +@@ -786,7 +792,8 @@
   2.208 + 	for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
   2.209 + 		ClearPageReserved(page);
   2.210 + 
   2.211 +-	free_pages((unsigned long) agp_bridge->gatt_table_real, page_order);
   2.212 ++	dma_free_coherent(&agp_bridge->dev->dev, PAGE_SIZE<<page_order,
   2.213 ++		agp_bridge->gatt_table_real, agp_bridge->gatt_bus_addr);
   2.214 + 
   2.215 + 	agp_gatt_table = NULL;
   2.216 + 	agp_bridge->gatt_table = NULL;
   2.217 +diff -ur linux-2.6.9/drivers/char/agp/hp-agp.c linux-2.6.9-new/drivers/char/agp/hp-agp.c
   2.218 +--- linux-2.6.9/drivers/char/agp/hp-agp.c	2004-10-18 22:54:55.000000000 +0100
   2.219 ++++ linux-2.6.9-new/drivers/char/agp/hp-agp.c	2004-11-28 19:32:03.000000000 +0000
   2.220 +@@ -110,7 +110,7 @@
   2.221 + 	hp->gart_size = HP_ZX1_GART_SIZE;
   2.222 + 	hp->gatt_entries = hp->gart_size / hp->io_page_size;
   2.223 + 
   2.224 +-	hp->io_pdir = phys_to_virt(INREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE));
   2.225 ++	hp->io_pdir = bus_to_virt(INREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE));
   2.226 + 	hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];
   2.227 + 
   2.228 + 	if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
   2.229 +@@ -248,7 +248,7 @@
   2.230 + 	agp_bridge->mode = INREG32(hp->lba_regs, hp->lba_cap_offset + PCI_AGP_STATUS);
   2.231 + 
   2.232 + 	if (hp->io_pdir_owner) {
   2.233 +-		OUTREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE, virt_to_phys(hp->io_pdir));
   2.234 ++		OUTREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE, virt_to_bus(hp->io_pdir));
   2.235 + 		OUTREG64(hp->ioc_regs, HP_ZX1_TCNFG, hp->io_tlb_ps);
   2.236 + 		OUTREG64(hp->ioc_regs, HP_ZX1_IMASK, ~(HP_ZX1_IOVA_SIZE - 1));
   2.237 + 		OUTREG64(hp->ioc_regs, HP_ZX1_IBASE, hp->iova_base | 0x1);
   2.238 +diff -ur linux-2.6.9/drivers/char/agp/i460-agp.c linux-2.6.9-new/drivers/char/agp/i460-agp.c
   2.239 +--- linux-2.6.9/drivers/char/agp/i460-agp.c	2004-10-18 22:54:32.000000000 +0100
   2.240 ++++ linux-2.6.9-new/drivers/char/agp/i460-agp.c	2004-11-28 19:32:03.000000000 +0000
   2.241 +@@ -371,7 +371,7 @@
   2.242 + 	}
   2.243 + 	memset(lp->alloced_map, 0, map_size);
   2.244 + 
   2.245 +-	lp->paddr = virt_to_phys(lpage);
   2.246 ++	lp->paddr = virt_to_bus(lpage);
   2.247 + 	lp->refcount = 0;
   2.248 + 	atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
   2.249 + 	return 0;
   2.250 +@@ -382,7 +382,7 @@
   2.251 + 	kfree(lp->alloced_map);
   2.252 + 	lp->alloced_map = NULL;
   2.253 + 
   2.254 +-	free_pages((unsigned long) phys_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT);
   2.255 ++	free_pages((unsigned long) bus_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT);
   2.256 + 	atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
   2.257 + }
   2.258 + 
   2.259 +diff -ur linux-2.6.9/drivers/char/agp/intel-agp.c linux-2.6.9-new/drivers/char/agp/intel-agp.c
   2.260 +--- linux-2.6.9/drivers/char/agp/intel-agp.c	2004-10-18 22:54:08.000000000 +0100
   2.261 ++++ linux-2.6.9-new/drivers/char/agp/intel-agp.c	2004-11-28 19:37:22.000000000 +0000
   2.262 +@@ -285,7 +285,7 @@
   2.263 + 	if (new == NULL)
   2.264 + 		return NULL;
   2.265 + 
   2.266 +-	new->memory[0] = virt_to_phys(addr);
   2.267 ++	new->memory[0] = virt_to_bus(addr);
   2.268 + 	if (pg_count == 4) {
   2.269 + 		/* kludge to get 4 physical pages for ARGB cursor */
   2.270 + 		new->memory[1] = new->memory[0] + PAGE_SIZE;
   2.271 +@@ -328,10 +328,10 @@
   2.272 + 	agp_free_key(curr->key);
   2.273 + 	if(curr->type == AGP_PHYS_MEMORY) {
   2.274 + 		if (curr->page_count == 4)
   2.275 +-			i8xx_destroy_pages(phys_to_virt(curr->memory[0]));
   2.276 ++			i8xx_destroy_pages(bus_to_virt(curr->memory[0]));
   2.277 + 		else
   2.278 + 			agp_bridge->driver->agp_destroy_page(
   2.279 +-				 phys_to_virt(curr->memory[0]));
   2.280 ++				 bus_to_virt(curr->memory[0]));
   2.281 + 		vfree(curr->memory);
   2.282 + 	}
   2.283 + 	kfree(curr);
   2.284 +diff -ur linux-2.6.9/drivers/char/agp/intel-mch-agp.c linux-2.6.9-new/drivers/char/agp/intel-mch-agp.c
   2.285 +--- linux-2.6.9/drivers/char/agp/intel-mch-agp.c	2004-10-18 22:53:13.000000000 +0100
   2.286 ++++ linux-2.6.9-new/drivers/char/agp/intel-mch-agp.c	2004-11-28 19:32:03.000000000 +0000
   2.287 +@@ -51,7 +51,7 @@
   2.288 + 	if (new == NULL)
   2.289 + 		return NULL;
   2.290 + 
   2.291 +-	new->memory[0] = agp_bridge->driver->mask_memory(virt_to_phys(addr), type);
   2.292 ++	new->memory[0] = agp_bridge->driver->mask_memory(virt_to_bus(addr), type);
   2.293 + 	new->page_count = 1;
   2.294 + 	new->num_scratch_pages = 1;
   2.295 + 	new->type = AGP_PHYS_MEMORY;
   2.296 +@@ -63,7 +63,7 @@
   2.297 + {
   2.298 + 	agp_free_key(curr->key);
   2.299 + 	if(curr->type == AGP_PHYS_MEMORY) {
   2.300 +-		agp_bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[0]));
   2.301 ++		agp_bridge->driver->agp_destroy_page(bus_to_virt(curr->memory[0]));
   2.302 + 		vfree(curr->memory);
   2.303 + 	}
   2.304 + 	kfree(curr);
   2.305 +diff -ur linux-2.6.9/drivers/char/agp/sworks-agp.c linux-2.6.9-new/drivers/char/agp/sworks-agp.c
   2.306 +--- linux-2.6.9/drivers/char/agp/sworks-agp.c	2004-10-18 22:53:50.000000000 +0100
   2.307 ++++ linux-2.6.9-new/drivers/char/agp/sworks-agp.c	2004-11-28 19:38:02.000000000 +0000
   2.308 +@@ -51,7 +51,7 @@
   2.309 + 	}
   2.310 + 	SetPageReserved(virt_to_page(page_map->real));
   2.311 + 	global_cache_flush();
   2.312 +-	page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 
   2.313 ++	page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real), 
   2.314 + 					    PAGE_SIZE);
   2.315 + 	if (page_map->remapped == NULL) {
   2.316 + 		ClearPageReserved(virt_to_page(page_map->real));
   2.317 +@@ -162,7 +162,7 @@
   2.318 + 	/* Create a fake scratch directory */
   2.319 + 	for(i = 0; i < 1024; i++) {
   2.320 + 		writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i);
   2.321 +-		writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
   2.322 ++		writel(virt_to_bus(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
   2.323 + 	}
   2.324 + 
   2.325 + 	retval = serverworks_create_gatt_pages(value->num_entries / 1024);
   2.326 +@@ -174,7 +174,7 @@
   2.327 + 
   2.328 + 	agp_bridge->gatt_table_real = (u32 *)page_dir.real;
   2.329 + 	agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
   2.330 +-	agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
   2.331 ++	agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real);
   2.332 + 
   2.333 + 	/* Get the address for the gart region.
   2.334 + 	 * This is a bus address even on the alpha, b/c its
   2.335 +@@ -187,7 +187,7 @@
   2.336 + 	/* Calculate the agp offset */	
   2.337 + 
   2.338 + 	for(i = 0; i < value->num_entries / 1024; i++)
   2.339 +-		writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
   2.340 ++		writel(virt_to_bus(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
   2.341 + 
   2.342 + 	return 0;
   2.343 + }
   2.344 +diff -ur linux-2.6.9/drivers/char/agp/uninorth-agp.c linux-2.6.9-new/drivers/char/agp/uninorth-agp.c
   2.345 +--- linux-2.6.9/drivers/char/agp/uninorth-agp.c	2004-10-18 22:54:29.000000000 +0100
   2.346 ++++ linux-2.6.9-new/drivers/char/agp/uninorth-agp.c	2004-11-28 19:32:03.000000000 +0000
   2.347 +@@ -200,7 +200,7 @@
   2.348 + 
   2.349 + 	agp_bridge->gatt_table_real = (u32 *) table;
   2.350 + 	agp_bridge->gatt_table = (u32 *)table;
   2.351 +-	agp_bridge->gatt_bus_addr = virt_to_phys(table);
   2.352 ++	agp_bridge->gatt_bus_addr = virt_to_bus(table);
   2.353 + 
   2.354 + 	for (i = 0; i < num_entries; i++) {
   2.355 + 		agp_bridge->gatt_table[i] =
   2.356 +diff -ur linux-2.6.9/include/asm-i386/agp.h linux-2.6.9-new/include/asm-i386/agp.h
   2.357 +--- linux-2.6.9/include/asm-i386/agp.h	2004-10-18 22:53:06.000000000 +0100
   2.358 ++++ linux-2.6.9-new/include/asm-i386/agp.h	2004-11-28 19:32:03.000000000 +0000
   2.359 +@@ -3,6 +3,7 @@
   2.360 + 
   2.361 + #include <asm/pgtable.h>
   2.362 + #include <asm/cacheflush.h>
   2.363 ++#include <asm/system.h>
   2.364 + 
   2.365 + /* 
   2.366 +  * Functions to keep the agpgart mappings coherent with the MMU.
   2.367 +@@ -19,6 +20,6 @@
   2.368 + /* Could use CLFLUSH here if the cpu supports it. But then it would
   2.369 +    need to be called for each cacheline of the whole page so it may not be 
   2.370 +    worth it. Would need a page for it. */
   2.371 +-#define flush_agp_cache() asm volatile("wbinvd":::"memory")
   2.372 ++#define flush_agp_cache() wbinvd()
   2.373 + 
   2.374 + #endif
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/linux-2.6.10/drm.patch	Fri Feb 18 13:41:48 2005 +0000
     3.3 @@ -0,0 +1,12 @@
     3.4 +diff -ur linux-2.6.9/drivers/char/drm/ati_pcigart.h linux-2.6.9-new/drivers/char/drm/ati_pcigart.h
     3.5 +--- linux-2.6.9/drivers/char/drm/ati_pcigart.h	2004-10-18 22:55:07.000000000 +0100
     3.6 ++++ linux-2.6.9-new/drivers/char/drm/ati_pcigart.h	2004-11-28 19:42:41.000000000 +0000
     3.7 +@@ -158,7 +158,7 @@
     3.8 + 	ret = 1;
     3.9 + 
    3.10 + #if defined(__i386__) || defined(__x86_64__)
    3.11 +-	asm volatile ( "wbinvd" ::: "memory" );
    3.12 ++	wbinvd();
    3.13 + #else
    3.14 + 	mb();
    3.15 + #endif
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/patches/linux-2.6.10/nettel.patch	Fri Feb 18 13:41:48 2005 +0000
     4.3 @@ -0,0 +1,30 @@
     4.4 +diff -ur linux-2.6.9/drivers/mtd/maps/nettel.c linux-2.6.9-new/drivers/mtd/maps/nettel.c
     4.5 +--- linux-2.6.9/drivers/mtd/maps/nettel.c	2004-10-18 22:53:44.000000000 +0100
     4.6 ++++ linux-2.6.9-new/drivers/mtd/maps/nettel.c	2004-11-28 19:45:35.000000000 +0000
     4.7 +@@ -270,7 +270,7 @@
     4.8 + 	maxsize = AMD_WINDOW_MAXSIZE;
     4.9 + 
    4.10 + 	*amdpar = SC520_PAR(SC520_PAR_BOOTCS, amdaddr, maxsize);
    4.11 +-	__asm__ ("wbinvd");
    4.12 ++	wbinvd();
    4.13 + 
    4.14 + 	nettel_amd_map.phys = amdaddr;
    4.15 + 	nettel_amd_map.virt = (unsigned long)
    4.16 +@@ -382,7 +382,7 @@
    4.17 + 	 */
    4.18 + 	intel1addr = intel0addr + intel0size;
    4.19 + 	*intel1par = SC520_PAR(intel1cs, intel1addr, maxsize);
    4.20 +-	__asm__ ("wbinvd");
    4.21 ++	wbinvd();
    4.22 + 
    4.23 + 	maxsize += intel0size;
    4.24 + 
    4.25 +@@ -408,7 +408,7 @@
    4.26 + 	intel1size = intel_mtd->size - intel0size;
    4.27 + 	if (intel1size > 0) {
    4.28 + 		*intel1par = SC520_PAR(intel1cs, intel1addr, intel1size);
    4.29 +-		__asm__ ("wbinvd");
    4.30 ++		wbinvd();
    4.31 + 	} else {
    4.32 + 		*intel1par = 0;
    4.33 + 	}
     5.1 --- a/patches/linux-2.6.9/agpgart.patch	Sat Feb 12 13:45:18 2005 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,371 +0,0 @@
     5.4 -diff -ur linux-2.6.9/drivers/char/agp/ali-agp.c linux-2.6.9-new/drivers/char/agp/ali-agp.c
     5.5 ---- linux-2.6.9/drivers/char/agp/ali-agp.c	2004-10-18 22:54:38.000000000 +0100
     5.6 -+++ linux-2.6.9-new/drivers/char/agp/ali-agp.c	2004-11-28 19:32:03.000000000 +0000
     5.7 -@@ -150,7 +150,7 @@
     5.8 - 	pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
     5.9 - 	pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
    5.10 - 			(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
    5.11 --			  virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN ));
    5.12 -+			  virt_to_bus(addr)) | ALI_CACHE_FLUSH_EN ));
    5.13 - 	return addr;
    5.14 - }
    5.15 - 
    5.16 -@@ -174,7 +174,7 @@
    5.17 - 	pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
    5.18 - 	pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
    5.19 - 			(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
    5.20 --			  virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN));
    5.21 -+			  virt_to_bus(addr)) | ALI_CACHE_FLUSH_EN));
    5.22 - 	agp_generic_destroy_page(addr);
    5.23 - }
    5.24 - 
    5.25 -diff -ur linux-2.6.9/drivers/char/agp/amd-k7-agp.c linux-2.6.9-new/drivers/char/agp/amd-k7-agp.c
    5.26 ---- linux-2.6.9/drivers/char/agp/amd-k7-agp.c	2004-10-18 22:55:36.000000000 +0100
    5.27 -+++ linux-2.6.9-new/drivers/char/agp/amd-k7-agp.c	2004-11-28 19:36:39.000000000 +0000
    5.28 -@@ -43,7 +43,7 @@
    5.29 - 
    5.30 - 	SetPageReserved(virt_to_page(page_map->real));
    5.31 - 	global_cache_flush();
    5.32 --	page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
    5.33 -+	page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real),
    5.34 - 					    PAGE_SIZE);
    5.35 - 	if (page_map->remapped == NULL) {
    5.36 - 		ClearPageReserved(virt_to_page(page_map->real));
    5.37 -@@ -152,7 +152,7 @@
    5.38 - 
    5.39 - 	agp_bridge->gatt_table_real = (u32 *)page_dir.real;
    5.40 - 	agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
    5.41 --	agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
    5.42 -+	agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real);
    5.43 - 
    5.44 - 	/* Get the address for the gart region.
    5.45 - 	 * This is a bus address even on the alpha, b/c its
    5.46 -@@ -165,7 +165,7 @@
    5.47 - 
    5.48 - 	/* Calculate the agp offset */
    5.49 - 	for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
    5.50 --		writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1,
    5.51 -+		writel(virt_to_bus(amd_irongate_private.gatt_pages[i]->real) | 1,
    5.52 - 			page_dir.remapped+GET_PAGE_DIR_OFF(addr));
    5.53 - 	}
    5.54 - 
    5.55 -diff -ur linux-2.6.9/drivers/char/agp/amd64-agp.c linux-2.6.9-new/drivers/char/agp/amd64-agp.c
    5.56 ---- linux-2.6.9/drivers/char/agp/amd64-agp.c	2004-10-18 22:54:38.000000000 +0100
    5.57 -+++ linux-2.6.9-new/drivers/char/agp/amd64-agp.c	2004-11-28 19:32:03.000000000 +0000
    5.58 -@@ -212,7 +212,7 @@
    5.59 - 
    5.60 - static int amd_8151_configure(void)
    5.61 - {
    5.62 --	unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real);
    5.63 -+	unsigned long gatt_bus = virt_to_bus(agp_bridge->gatt_table_real);
    5.64 - 
    5.65 - 	/* Configure AGP regs in each x86-64 host bridge. */
    5.66 - 	for_each_nb() {
    5.67 -@@ -521,7 +521,7 @@
    5.68 - {
    5.69 - 	struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
    5.70 - 
    5.71 --	release_mem_region(virt_to_phys(bridge->gatt_table_real),
    5.72 -+	release_mem_region(virt_to_bus(bridge->gatt_table_real),
    5.73 - 			   amd64_aperture_sizes[bridge->aperture_size_idx].size);
    5.74 - 	agp_remove_bridge(bridge);
    5.75 - 	agp_put_bridge(bridge);
    5.76 -diff -ur linux-2.6.9/drivers/char/agp/ati-agp.c linux-2.6.9-new/drivers/char/agp/ati-agp.c
    5.77 ---- linux-2.6.9/drivers/char/agp/ati-agp.c	2004-10-18 22:54:40.000000000 +0100
    5.78 -+++ linux-2.6.9-new/drivers/char/agp/ati-agp.c	2004-11-28 19:32:03.000000000 +0000
    5.79 -@@ -64,7 +64,7 @@
    5.80 - 
    5.81 - 	/* CACHE_FLUSH(); */
    5.82 - 	global_cache_flush();
    5.83 --	page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
    5.84 -+	page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real),
    5.85 - 					    PAGE_SIZE);
    5.86 - 	if (page_map->remapped == NULL || err) {
    5.87 - 		ClearPageReserved(virt_to_page(page_map->real));
    5.88 -diff -ur linux-2.6.9/drivers/char/agp/backend.c linux-2.6.9-new/drivers/char/agp/backend.c
    5.89 ---- linux-2.6.9/drivers/char/agp/backend.c	2004-10-18 22:54:39.000000000 +0100
    5.90 -+++ linux-2.6.9-new/drivers/char/agp/backend.c	2004-11-28 19:32:03.000000000 +0000
    5.91 -@@ -142,7 +142,7 @@
    5.92 - 			return -ENOMEM;
    5.93 - 		}
    5.94 - 
    5.95 --		bridge->scratch_page_real = virt_to_phys(addr);
    5.96 -+		bridge->scratch_page_real = virt_to_bus(addr);
    5.97 - 		bridge->scratch_page =
    5.98 - 		    bridge->driver->mask_memory(bridge->scratch_page_real, 0);
    5.99 - 	}
   5.100 -@@ -186,7 +186,7 @@
   5.101 - err_out:
   5.102 - 	if (bridge->driver->needs_scratch_page)
   5.103 - 		bridge->driver->agp_destroy_page(
   5.104 --				phys_to_virt(bridge->scratch_page_real));
   5.105 -+				bus_to_virt(bridge->scratch_page_real));
   5.106 - 	if (got_gatt)
   5.107 - 		bridge->driver->free_gatt_table();
   5.108 - 	if (got_keylist) {
   5.109 -@@ -211,7 +211,7 @@
   5.110 - 	if (bridge->driver->agp_destroy_page &&
   5.111 - 	    bridge->driver->needs_scratch_page)
   5.112 - 		bridge->driver->agp_destroy_page(
   5.113 --				phys_to_virt(bridge->scratch_page_real));
   5.114 -+				bus_to_virt(bridge->scratch_page_real));
   5.115 - }
   5.116 - 
   5.117 - static const drm_agp_t drm_agp = {
   5.118 -diff -ur linux-2.6.9/drivers/char/agp/efficeon-agp.c linux-2.6.9-new/drivers/char/agp/efficeon-agp.c
   5.119 ---- linux-2.6.9/drivers/char/agp/efficeon-agp.c	2004-10-18 22:53:06.000000000 +0100
   5.120 -+++ linux-2.6.9-new/drivers/char/agp/efficeon-agp.c	2004-11-28 19:38:28.000000000 +0000
   5.121 -@@ -219,7 +219,7 @@
   5.122 - 
   5.123 - 		efficeon_private.l1_table[index] = page;
   5.124 - 
   5.125 --		value = __pa(page) | pati | present | index;
   5.126 -+		value = virt_to_bus(page) | pati | present | index;
   5.127 - 
   5.128 - 		pci_write_config_dword(agp_bridge->dev,
   5.129 - 			EFFICEON_ATTPAGE, value);
   5.130 -diff -ur linux-2.6.9/drivers/char/agp/generic.c linux-2.6.9-new/drivers/char/agp/generic.c
   5.131 ---- linux-2.6.9/drivers/char/agp/generic.c	2004-10-18 22:53:50.000000000 +0100
   5.132 -+++ linux-2.6.9-new/drivers/char/agp/generic.c	2004-11-28 19:32:03.000000000 +0000
   5.133 -@@ -128,7 +128,7 @@
   5.134 - 	}
   5.135 - 	if (curr->page_count != 0) {
   5.136 - 		for (i = 0; i < curr->page_count; i++) {
   5.137 --			agp_bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[i]));
   5.138 -+			agp_bridge->driver->agp_destroy_page(bus_to_virt(curr->memory[i]));
   5.139 - 		}
   5.140 - 	}
   5.141 - 	agp_free_key(curr->key);
   5.142 -@@ -182,7 +182,7 @@
   5.143 - 			return NULL;
   5.144 - 		}
   5.145 - 		new->memory[i] =
   5.146 --			agp_bridge->driver->mask_memory(virt_to_phys(addr), type);
   5.147 -+			agp_bridge->driver->mask_memory(virt_to_bus(addr), type);
   5.148 - 		new->page_count++;
   5.149 - 	}
   5.150 - 
   5.151 -@@ -637,6 +637,7 @@
   5.152 - 	int i;
   5.153 - 	void *temp;
   5.154 - 	struct page *page;
   5.155 -+	dma_addr_t dma;
   5.156 - 
   5.157 - 	/* The generic routines can't handle 2 level gatt's */
   5.158 - 	if (agp_bridge->driver->size_type == LVL2_APER_SIZE)
   5.159 -@@ -675,8 +676,10 @@
   5.160 - 				break;
   5.161 - 			}
   5.162 - 
   5.163 --			table = (char *) __get_free_pages(GFP_KERNEL,
   5.164 --							  page_order);
   5.165 -+			table = dma_alloc_coherent(
   5.166 -+					&agp_bridge->dev->dev,
   5.167 -+					PAGE_SIZE << page_order, &dma,
   5.168 -+					GFP_KERNEL);
   5.169 - 
   5.170 - 			if (table == NULL) {
   5.171 - 				i++;
   5.172 -@@ -707,7 +710,9 @@
   5.173 - 		size = ((struct aper_size_info_fixed *) temp)->size;
   5.174 - 		page_order = ((struct aper_size_info_fixed *) temp)->page_order;
   5.175 - 		num_entries = ((struct aper_size_info_fixed *) temp)->num_entries;
   5.176 --		table = (char *) __get_free_pages(GFP_KERNEL, page_order);
   5.177 -+		table = dma_alloc_coherent(
   5.178 -+				&agp_bridge->dev->dev,
   5.179 -+				PAGE_SIZE << page_order, &dma, GFP_KERNEL);
   5.180 - 	}
   5.181 - 
   5.182 - 	if (table == NULL)
   5.183 -@@ -722,7 +727,7 @@
   5.184 - 	agp_gatt_table = (void *)table;
   5.185 - 
   5.186 - 	agp_bridge->driver->cache_flush();
   5.187 --	agp_bridge->gatt_table = ioremap_nocache(virt_to_phys(table),
   5.188 -+	agp_bridge->gatt_table = ioremap_nocache(virt_to_bus(table),
   5.189 - 					(PAGE_SIZE * (1 << page_order)));
   5.190 - 	agp_bridge->driver->cache_flush();
   5.191 - 
   5.192 -@@ -730,11 +735,12 @@
   5.193 - 		for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
   5.194 - 			ClearPageReserved(page);
   5.195 - 
   5.196 --		free_pages((unsigned long) table, page_order);
   5.197 -+		dma_free_coherent(&agp_bridge->dev->dev, PAGE_SIZE<<page_order,
   5.198 -+					table, dma);
   5.199 - 
   5.200 - 		return -ENOMEM;
   5.201 - 	}
   5.202 --	agp_bridge->gatt_bus_addr = virt_to_phys(agp_bridge->gatt_table_real);
   5.203 -+	agp_bridge->gatt_bus_addr = virt_to_bus(table);
   5.204 - 
   5.205 - 	/* AK: bogus, should encode addresses > 4GB */
   5.206 - 	for (i = 0; i < num_entries; i++)
   5.207 -@@ -786,7 +792,8 @@
   5.208 - 	for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
   5.209 - 		ClearPageReserved(page);
   5.210 - 
   5.211 --	free_pages((unsigned long) agp_bridge->gatt_table_real, page_order);
   5.212 -+	dma_free_coherent(&agp_bridge->dev->dev, PAGE_SIZE<<page_order,
   5.213 -+		agp_bridge->gatt_table_real, agp_bridge->gatt_bus_addr);
   5.214 - 
   5.215 - 	agp_gatt_table = NULL;
   5.216 - 	agp_bridge->gatt_table = NULL;
   5.217 -diff -ur linux-2.6.9/drivers/char/agp/hp-agp.c linux-2.6.9-new/drivers/char/agp/hp-agp.c
   5.218 ---- linux-2.6.9/drivers/char/agp/hp-agp.c	2004-10-18 22:54:55.000000000 +0100
   5.219 -+++ linux-2.6.9-new/drivers/char/agp/hp-agp.c	2004-11-28 19:32:03.000000000 +0000
   5.220 -@@ -110,7 +110,7 @@
   5.221 - 	hp->gart_size = HP_ZX1_GART_SIZE;
   5.222 - 	hp->gatt_entries = hp->gart_size / hp->io_page_size;
   5.223 - 
   5.224 --	hp->io_pdir = phys_to_virt(INREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE));
   5.225 -+	hp->io_pdir = bus_to_virt(INREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE));
   5.226 - 	hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];
   5.227 - 
   5.228 - 	if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
   5.229 -@@ -248,7 +248,7 @@
   5.230 - 	agp_bridge->mode = INREG32(hp->lba_regs, hp->lba_cap_offset + PCI_AGP_STATUS);
   5.231 - 
   5.232 - 	if (hp->io_pdir_owner) {
   5.233 --		OUTREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE, virt_to_phys(hp->io_pdir));
   5.234 -+		OUTREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE, virt_to_bus(hp->io_pdir));
   5.235 - 		OUTREG64(hp->ioc_regs, HP_ZX1_TCNFG, hp->io_tlb_ps);
   5.236 - 		OUTREG64(hp->ioc_regs, HP_ZX1_IMASK, ~(HP_ZX1_IOVA_SIZE - 1));
   5.237 - 		OUTREG64(hp->ioc_regs, HP_ZX1_IBASE, hp->iova_base | 0x1);
   5.238 -diff -ur linux-2.6.9/drivers/char/agp/i460-agp.c linux-2.6.9-new/drivers/char/agp/i460-agp.c
   5.239 ---- linux-2.6.9/drivers/char/agp/i460-agp.c	2004-10-18 22:54:32.000000000 +0100
   5.240 -+++ linux-2.6.9-new/drivers/char/agp/i460-agp.c	2004-11-28 19:32:03.000000000 +0000
   5.241 -@@ -371,7 +371,7 @@
   5.242 - 	}
   5.243 - 	memset(lp->alloced_map, 0, map_size);
   5.244 - 
   5.245 --	lp->paddr = virt_to_phys(lpage);
   5.246 -+	lp->paddr = virt_to_bus(lpage);
   5.247 - 	lp->refcount = 0;
   5.248 - 	atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
   5.249 - 	return 0;
   5.250 -@@ -382,7 +382,7 @@
   5.251 - 	kfree(lp->alloced_map);
   5.252 - 	lp->alloced_map = NULL;
   5.253 - 
   5.254 --	free_pages((unsigned long) phys_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT);
   5.255 -+	free_pages((unsigned long) bus_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT);
   5.256 - 	atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
   5.257 - }
   5.258 - 
   5.259 -diff -ur linux-2.6.9/drivers/char/agp/intel-agp.c linux-2.6.9-new/drivers/char/agp/intel-agp.c
   5.260 ---- linux-2.6.9/drivers/char/agp/intel-agp.c	2004-10-18 22:54:08.000000000 +0100
   5.261 -+++ linux-2.6.9-new/drivers/char/agp/intel-agp.c	2004-11-28 19:37:22.000000000 +0000
   5.262 -@@ -285,7 +285,7 @@
   5.263 - 	if (new == NULL)
   5.264 - 		return NULL;
   5.265 - 
   5.266 --	new->memory[0] = virt_to_phys(addr);
   5.267 -+	new->memory[0] = virt_to_bus(addr);
   5.268 - 	if (pg_count == 4) {
   5.269 - 		/* kludge to get 4 physical pages for ARGB cursor */
   5.270 - 		new->memory[1] = new->memory[0] + PAGE_SIZE;
   5.271 -@@ -328,10 +328,10 @@
   5.272 - 	agp_free_key(curr->key);
   5.273 - 	if(curr->type == AGP_PHYS_MEMORY) {
   5.274 - 		if (curr->page_count == 4)
   5.275 --			i8xx_destroy_pages(phys_to_virt(curr->memory[0]));
   5.276 -+			i8xx_destroy_pages(bus_to_virt(curr->memory[0]));
   5.277 - 		else
   5.278 - 			agp_bridge->driver->agp_destroy_page(
   5.279 --				 phys_to_virt(curr->memory[0]));
   5.280 -+				 bus_to_virt(curr->memory[0]));
   5.281 - 		vfree(curr->memory);
   5.282 - 	}
   5.283 - 	kfree(curr);
   5.284 -diff -ur linux-2.6.9/drivers/char/agp/intel-mch-agp.c linux-2.6.9-new/drivers/char/agp/intel-mch-agp.c
   5.285 ---- linux-2.6.9/drivers/char/agp/intel-mch-agp.c	2004-10-18 22:53:13.000000000 +0100
   5.286 -+++ linux-2.6.9-new/drivers/char/agp/intel-mch-agp.c	2004-11-28 19:32:03.000000000 +0000
   5.287 -@@ -51,7 +51,7 @@
   5.288 - 	if (new == NULL)
   5.289 - 		return NULL;
   5.290 - 
   5.291 --	new->memory[0] = agp_bridge->driver->mask_memory(virt_to_phys(addr), type);
   5.292 -+	new->memory[0] = agp_bridge->driver->mask_memory(virt_to_bus(addr), type);
   5.293 - 	new->page_count = 1;
   5.294 - 	new->num_scratch_pages = 1;
   5.295 - 	new->type = AGP_PHYS_MEMORY;
   5.296 -@@ -63,7 +63,7 @@
   5.297 - {
   5.298 - 	agp_free_key(curr->key);
   5.299 - 	if(curr->type == AGP_PHYS_MEMORY) {
   5.300 --		agp_bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[0]));
   5.301 -+		agp_bridge->driver->agp_destroy_page(bus_to_virt(curr->memory[0]));
   5.302 - 		vfree(curr->memory);
   5.303 - 	}
   5.304 - 	kfree(curr);
   5.305 -diff -ur linux-2.6.9/drivers/char/agp/sworks-agp.c linux-2.6.9-new/drivers/char/agp/sworks-agp.c
   5.306 ---- linux-2.6.9/drivers/char/agp/sworks-agp.c	2004-10-18 22:53:50.000000000 +0100
   5.307 -+++ linux-2.6.9-new/drivers/char/agp/sworks-agp.c	2004-11-28 19:38:02.000000000 +0000
   5.308 -@@ -51,7 +51,7 @@
   5.309 - 	}
   5.310 - 	SetPageReserved(virt_to_page(page_map->real));
   5.311 - 	global_cache_flush();
   5.312 --	page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 
   5.313 -+	page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real), 
   5.314 - 					    PAGE_SIZE);
   5.315 - 	if (page_map->remapped == NULL) {
   5.316 - 		ClearPageReserved(virt_to_page(page_map->real));
   5.317 -@@ -162,7 +162,7 @@
   5.318 - 	/* Create a fake scratch directory */
   5.319 - 	for(i = 0; i < 1024; i++) {
   5.320 - 		writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i);
   5.321 --		writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
   5.322 -+		writel(virt_to_bus(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
   5.323 - 	}
   5.324 - 
   5.325 - 	retval = serverworks_create_gatt_pages(value->num_entries / 1024);
   5.326 -@@ -174,7 +174,7 @@
   5.327 - 
   5.328 - 	agp_bridge->gatt_table_real = (u32 *)page_dir.real;
   5.329 - 	agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
   5.330 --	agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
   5.331 -+	agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real);
   5.332 - 
   5.333 - 	/* Get the address for the gart region.
   5.334 - 	 * This is a bus address even on the alpha, b/c its
   5.335 -@@ -187,7 +187,7 @@
   5.336 - 	/* Calculate the agp offset */	
   5.337 - 
   5.338 - 	for(i = 0; i < value->num_entries / 1024; i++)
   5.339 --		writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
   5.340 -+		writel(virt_to_bus(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
   5.341 - 
   5.342 - 	return 0;
   5.343 - }
   5.344 -diff -ur linux-2.6.9/drivers/char/agp/uninorth-agp.c linux-2.6.9-new/drivers/char/agp/uninorth-agp.c
   5.345 ---- linux-2.6.9/drivers/char/agp/uninorth-agp.c	2004-10-18 22:54:29.000000000 +0100
   5.346 -+++ linux-2.6.9-new/drivers/char/agp/uninorth-agp.c	2004-11-28 19:32:03.000000000 +0000
   5.347 -@@ -200,7 +200,7 @@
   5.348 - 
   5.349 - 	agp_bridge->gatt_table_real = (u32 *) table;
   5.350 - 	agp_bridge->gatt_table = (u32 *)table;
   5.351 --	agp_bridge->gatt_bus_addr = virt_to_phys(table);
   5.352 -+	agp_bridge->gatt_bus_addr = virt_to_bus(table);
   5.353 - 
   5.354 - 	for (i = 0; i < num_entries; i++) {
   5.355 - 		agp_bridge->gatt_table[i] =
   5.356 -diff -ur linux-2.6.9/include/asm-i386/agp.h linux-2.6.9-new/include/asm-i386/agp.h
   5.357 ---- linux-2.6.9/include/asm-i386/agp.h	2004-10-18 22:53:06.000000000 +0100
   5.358 -+++ linux-2.6.9-new/include/asm-i386/agp.h	2004-11-28 19:32:03.000000000 +0000
   5.359 -@@ -3,6 +3,7 @@
   5.360 - 
   5.361 - #include <asm/pgtable.h>
   5.362 - #include <asm/cacheflush.h>
   5.363 -+#include <asm/system.h>
   5.364 - 
   5.365 - /* 
   5.366 -  * Functions to keep the agpgart mappings coherent with the MMU.
   5.367 -@@ -19,6 +20,6 @@
   5.368 - /* Could use CLFLUSH here if the cpu supports it. But then it would
   5.369 -    need to be called for each cacheline of the whole page so it may not be 
   5.370 -    worth it. Would need a page for it. */
   5.371 --#define flush_agp_cache() asm volatile("wbinvd":::"memory")
   5.372 -+#define flush_agp_cache() wbinvd()
   5.373 - 
   5.374 - #endif
     6.1 --- a/patches/linux-2.6.9/drm.patch	Sat Feb 12 13:45:18 2005 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,12 +0,0 @@
     6.4 -diff -ur linux-2.6.9/drivers/char/drm/ati_pcigart.h linux-2.6.9-new/drivers/char/drm/ati_pcigart.h
     6.5 ---- linux-2.6.9/drivers/char/drm/ati_pcigart.h	2004-10-18 22:55:07.000000000 +0100
     6.6 -+++ linux-2.6.9-new/drivers/char/drm/ati_pcigart.h	2004-11-28 19:42:41.000000000 +0000
     6.7 -@@ -158,7 +158,7 @@
     6.8 - 	ret = 1;
     6.9 - 
    6.10 - #if defined(__i386__) || defined(__x86_64__)
    6.11 --	asm volatile ( "wbinvd" ::: "memory" );
    6.12 -+	wbinvd();
    6.13 - #else
    6.14 - 	mb();
    6.15 - #endif
     7.1 --- a/patches/linux-2.6.9/nettel.patch	Sat Feb 12 13:45:18 2005 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,30 +0,0 @@
     7.4 -diff -ur linux-2.6.9/drivers/mtd/maps/nettel.c linux-2.6.9-new/drivers/mtd/maps/nettel.c
     7.5 ---- linux-2.6.9/drivers/mtd/maps/nettel.c	2004-10-18 22:53:44.000000000 +0100
     7.6 -+++ linux-2.6.9-new/drivers/mtd/maps/nettel.c	2004-11-28 19:45:35.000000000 +0000
     7.7 -@@ -270,7 +270,7 @@
     7.8 - 	maxsize = AMD_WINDOW_MAXSIZE;
     7.9 - 
    7.10 - 	*amdpar = SC520_PAR(SC520_PAR_BOOTCS, amdaddr, maxsize);
    7.11 --	__asm__ ("wbinvd");
    7.12 -+	wbinvd();
    7.13 - 
    7.14 - 	nettel_amd_map.phys = amdaddr;
    7.15 - 	nettel_amd_map.virt = (unsigned long)
    7.16 -@@ -382,7 +382,7 @@
    7.17 - 	 */
    7.18 - 	intel1addr = intel0addr + intel0size;
    7.19 - 	*intel1par = SC520_PAR(intel1cs, intel1addr, maxsize);
    7.20 --	__asm__ ("wbinvd");
    7.21 -+	wbinvd();
    7.22 - 
    7.23 - 	maxsize += intel0size;
    7.24 - 
    7.25 -@@ -408,7 +408,7 @@
    7.26 - 	intel1size = intel_mtd->size - intel0size;
    7.27 - 	if (intel1size > 0) {
    7.28 - 		*intel1par = SC520_PAR(intel1cs, intel1addr, intel1size);
    7.29 --		__asm__ ("wbinvd");
    7.30 -+		wbinvd();
    7.31 - 	} else {
    7.32 - 		*intel1par = 0;
    7.33 - 	}