ia64/xen-unstable

changeset 13399:f328425d553e

[LINUX] swiotlb: eliminate KM_SWIOTLB and thus the need for a Xen-specific kmap_types.h.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Fri Jan 12 10:31:16 2007 +0000 (2007-01-12)
parents 648e58e31c26
children 204c2724f800
files linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/kmap_types.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c	Fri Jan 12 10:28:54 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c	Fri Jan 12 10:31:16 2007 +0000
     1.3 @@ -238,9 +238,12 @@ static void
     1.4  		char *dev, *host, *kmp;
     1.5  		len = size;
     1.6  		while (len != 0) {
     1.7 +			unsigned long flags;
     1.8 +
     1.9  			if (((bytes = len) + buffer.offset) > PAGE_SIZE)
    1.10  				bytes = PAGE_SIZE - buffer.offset;
    1.11 -			kmp  = kmap_atomic(buffer.page, KM_SWIOTLB);
    1.12 +			local_irq_save(flags); /* protects KM_BOUNCE_READ */
    1.13 +			kmp  = kmap_atomic(buffer.page, KM_BOUNCE_READ);
    1.14  			dev  = dma_addr + size - len;
    1.15  			host = kmp + buffer.offset;
    1.16  			if (dir == DMA_FROM_DEVICE) {
    1.17 @@ -248,7 +251,8 @@ static void
    1.18  					/* inaccessible */;
    1.19  			} else
    1.20  				memcpy(dev, host, bytes);
    1.21 -			kunmap_atomic(kmp, KM_SWIOTLB);
    1.22 +			kunmap_atomic(kmp, KM_BOUNCE_READ);
    1.23 +			local_irq_restore(flags);
    1.24  			len -= bytes;
    1.25  			buffer.page++;
    1.26  			buffer.offset = 0;
     2.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/kmap_types.h	Fri Jan 12 10:28:54 2007 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,32 +0,0 @@
     2.4 -#ifndef _ASM_KMAP_TYPES_H
     2.5 -#define _ASM_KMAP_TYPES_H
     2.6 -
     2.7 -#include <linux/config.h>
     2.8 -
     2.9 -#ifdef CONFIG_DEBUG_HIGHMEM
    2.10 -# define D(n) __KM_FENCE_##n ,
    2.11 -#else
    2.12 -# define D(n)
    2.13 -#endif
    2.14 -
    2.15 -enum km_type {
    2.16 -D(0)	KM_BOUNCE_READ,
    2.17 -D(1)	KM_SKB_SUNRPC_DATA,
    2.18 -D(2)	KM_SKB_DATA_SOFTIRQ,
    2.19 -D(3)	KM_USER0,
    2.20 -D(4)	KM_USER1,
    2.21 -D(5)	KM_BIO_SRC_IRQ,
    2.22 -D(6)	KM_BIO_DST_IRQ,
    2.23 -D(7)	KM_PTE0,
    2.24 -D(8)	KM_PTE1,
    2.25 -D(9)	KM_IRQ0,
    2.26 -D(10)	KM_IRQ1,
    2.27 -D(11)	KM_SOFTIRQ0,
    2.28 -D(12)	KM_SOFTIRQ1,
    2.29 -D(13)	KM_SWIOTLB,
    2.30 -D(14)	KM_TYPE_NR
    2.31 -};
    2.32 -
    2.33 -#undef D
    2.34 -
    2.35 -#endif