ia64/xen-unstable

changeset 210:358956197b21

bitkeeper revision 1.71 (3e53dbfc_URK_oQbGAQZ3O3Qfr6z-Q)

missing file for Keir's virtual block device checkin
author iap10@labyrinth.cl.cam.ac.uk
date Wed Feb 19 19:33:16 2003 +0000 (2003-02-19)
parents 9d5263d6451f
children 35546c6bf1bd
files .rootkeys xenolinux-2.4.16-sparse/include/asm-xeno/fixmap.h
line diff
     1.1 --- a/.rootkeys	Wed Feb 19 18:39:38 2003 +0000
     1.2 +++ b/.rootkeys	Wed Feb 19 19:33:16 2003 +0000
     1.3 @@ -348,6 +348,7 @@ 3ddb79b80Z4ZUIqbD1Xu_t4OCuEHeQ xenolinux
     1.4  3ddb79bac26NkKcPIEsfxETc5Snyag xenolinux-2.4.16-sparse/include/asm-xeno/elf.h
     1.5  3ddb79ba722pCJ_g_xI8ebsE31IK-Q xenolinux-2.4.16-sparse/include/asm-xeno/errno.h
     1.6  3ddb79b8vIpUpgaSNEneFkg5hYSvNg xenolinux-2.4.16-sparse/include/asm-xeno/fcntl.h
     1.7 +3e53dbfb9mmyM-y5NuBBTDJvQkDzjA xenolinux-2.4.16-sparse/include/asm-xeno/fixmap.h
     1.8  3ddb79b8780YvqvK1g5KPIWzQ6P15w xenolinux-2.4.16-sparse/include/asm-xeno/floppy.h
     1.9  3ddb79bas-nFywnmilbUeT34PEAA0g xenolinux-2.4.16-sparse/include/asm-xeno/hardirq.h
    1.10  3ddb79batzR40ZFY9dvgs5f1aM9I6g xenolinux-2.4.16-sparse/include/asm-xeno/hdreg.h
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xenolinux-2.4.16-sparse/include/asm-xeno/fixmap.h	Wed Feb 19 19:33:16 2003 +0000
     2.3 @@ -0,0 +1,91 @@
     2.4 +/*
     2.5 + * fixmap.h: compile-time virtual memory allocation
     2.6 + *
     2.7 + * This file is subject to the terms and conditions of the GNU General Public
     2.8 + * License.  See the file "COPYING" in the main directory of this archive
     2.9 + * for more details.
    2.10 + *
    2.11 + * Copyright (C) 1998 Ingo Molnar
    2.12 + *
    2.13 + * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
    2.14 + */
    2.15 +
    2.16 +#ifndef _ASM_FIXMAP_H
    2.17 +#define _ASM_FIXMAP_H
    2.18 +
    2.19 +#include <linux/config.h>
    2.20 +#include <linux/kernel.h>
    2.21 +#include <asm/apicdef.h>
    2.22 +#include <asm/page.h>
    2.23 +
    2.24 +/*
    2.25 + * Here we define all the compile-time 'special' virtual
    2.26 + * addresses. The point is to have a constant address at
    2.27 + * compile time, but to set the physical address only
    2.28 + * in the boot process. We allocate these special  addresses
    2.29 + * from the end of virtual memory (0xfffff000) backwards.
    2.30 + * Also this lets us do fail-safe vmalloc(), we
    2.31 + * can guarantee that these special addresses and
    2.32 + * vmalloc()-ed addresses never overlap.
    2.33 + *
    2.34 + * these 'compile-time allocated' memory buffers are
    2.35 + * fixed-size 4k pages. (or larger if used with an increment
    2.36 + * highger than 1) use fixmap_set(idx,phys) to associate
    2.37 + * physical memory with fixmap indices.
    2.38 + *
    2.39 + * TLB entries of such buffers will not be flushed across
    2.40 + * task switches.
    2.41 + */
    2.42 +enum fixed_addresses {
    2.43 +    FIX_BLKRING_BASE,
    2.44 +    __end_of_fixed_addresses
    2.45 +};
    2.46 +
    2.47 +extern void __set_fixmap (enum fixed_addresses idx,
    2.48 +					unsigned long phys, pgprot_t flags);
    2.49 +
    2.50 +#define set_fixmap(idx, phys) \
    2.51 +		__set_fixmap(idx, phys, PAGE_KERNEL)
    2.52 +/*
    2.53 + * Some hardware wants to get fixmapped without caching.
    2.54 + */
    2.55 +#define set_fixmap_nocache(idx, phys) \
    2.56 +		__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
    2.57 +/*
    2.58 + * used by vmalloc.c.
    2.59 + *
    2.60 + * Leave one empty page between vmalloc'ed areas and
    2.61 + * the start of the fixmap, and leave one page empty
    2.62 + * at the top of mem..
    2.63 + */
    2.64 +#define FIXADDR_TOP	(HYPERVISOR_VIRT_START - 2*PAGE_SIZE)
    2.65 +#define __FIXADDR_SIZE	(__end_of_fixed_addresses << PAGE_SHIFT)
    2.66 +#define FIXADDR_START	(FIXADDR_TOP - __FIXADDR_SIZE)
    2.67 +
    2.68 +#define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT))
    2.69 +
    2.70 +extern void __this_fixmap_does_not_exist(void);
    2.71 +
    2.72 +/*
    2.73 + * 'index to address' translation. If anyone tries to use the idx
    2.74 + * directly without tranlation, we catch the bug with a NULL-deference
    2.75 + * kernel oops. Illegal ranges of incoming indices are caught too.
    2.76 + */
    2.77 +static inline unsigned long fix_to_virt(const unsigned int idx)
    2.78 +{
    2.79 +	/*
    2.80 +	 * this branch gets completely eliminated after inlining,
    2.81 +	 * except when someone tries to use fixaddr indices in an
    2.82 +	 * illegal way. (such as mixing up address types or using
    2.83 +	 * out-of-range indices).
    2.84 +	 *
    2.85 +	 * If it doesn't get removed, the linker will complain
    2.86 +	 * loudly with a reasonably clear error message..
    2.87 +	 */
    2.88 +	if (idx >= __end_of_fixed_addresses)
    2.89 +		__this_fixmap_does_not_exist();
    2.90 +
    2.91 +        return __fix_to_virt(idx);
    2.92 +}
    2.93 +
    2.94 +#endif