ia64/xen-unstable

view linux-2.4-xen-sparse/include/asm-xen/fixmap.h @ 6538:84ee014ebd41

Merge xen-vtx-unstable.hg
author adsharma@los-vmm.sc.intel.com
date Wed Aug 17 12:34:38 2005 -0800 (2005-08-17)
parents 23979fb12c49 f294acb25858
children 99914b54f7bf
line source
1 /*
2 * fixmap.h: compile-time virtual memory allocation
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1998 Ingo Molnar
9 *
10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
11 */
13 #ifndef _ASM_FIXMAP_H
14 #define _ASM_FIXMAP_H
16 #include <linux/config.h>
17 #include <linux/kernel.h>
18 #include <asm/apicdef.h>
19 #include <asm/page.h>
20 #include <asm-xen/gnttab.h>
21 #ifdef CONFIG_HIGHMEM
22 #include <linux/threads.h>
23 #include <asm/kmap_types.h>
24 #endif
26 /*
27 * Here we define all the compile-time 'special' virtual
28 * addresses. The point is to have a constant address at
29 * compile time, but to set the physical address only
30 * in the boot process. We allocate these special addresses
31 * from the end of virtual memory (0xfffff000) backwards.
32 * Also this lets us do fail-safe vmalloc(), we
33 * can guarantee that these special addresses and
34 * vmalloc()-ed addresses never overlap.
35 *
36 * these 'compile-time allocated' memory buffers are
37 * fixed-size 4k pages. (or larger if used with an increment
38 * highger than 1) use fixmap_set(idx,phys) to associate
39 * physical memory with fixmap indices.
40 *
41 * TLB entries of such buffers will not be flushed across
42 * task switches.
43 */
45 enum fixed_addresses {
46 #ifdef CONFIG_HIGHMEM
47 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
48 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
49 #endif
50 FIX_BLKRING_BASE,
51 FIX_NETRING0_BASE,
52 FIX_NETRING1_BASE,
53 FIX_NETRING2_BASE,
54 FIX_NETRING3_BASE,
55 FIX_SHARED_INFO,
56 FIX_GNTTAB_BEGIN,
57 FIX_GNTTAB_END = FIX_GNTTAB_BEGIN + NR_GRANT_FRAMES - 1,
58 #ifdef CONFIG_VGA_CONSOLE
59 #define NR_FIX_BTMAPS 32 /* 128KB For the Dom0 VGA Console A0000-C0000 */
60 #else
61 #define NR_FIX_BTMAPS 1 /* in case anyone wants it in future... */
62 #endif
63 FIX_BTMAP_END,
64 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
65 /* our bt_ioremap is permanent, unlike other architectures */
67 __end_of_permanent_fixed_addresses,
68 __end_of_fixed_addresses = __end_of_permanent_fixed_addresses
69 };
71 extern void __set_fixmap (enum fixed_addresses idx,
72 unsigned long phys, pgprot_t flags);
74 #define set_fixmap(idx, phys) \
75 __set_fixmap(idx, phys, PAGE_KERNEL)
76 /*
77 * Some hardware wants to get fixmapped without caching.
78 */
79 #define set_fixmap_nocache(idx, phys) \
80 __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
82 extern void clear_fixmap(enum fixed_addresses idx);
84 /*
85 * used by vmalloc.c.
86 *
87 * Leave one empty page between vmalloc'ed areas and
88 * the start of the fixmap, and leave one page empty
89 * at the top of mem..
90 */
91 #define FIXADDR_TOP (HYPERVISOR_VIRT_START - 2*PAGE_SIZE)
92 #define __FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
93 #define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
95 #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
97 /*
98 * 'index to address' translation. If anyone tries to use the idx
99 * directly without tranlation, we catch the bug with a NULL-deference
100 * kernel oops. Illegal ranges of incoming indices are caught too.
101 */
102 static inline unsigned long fix_to_virt(unsigned int idx)
103 {
104 return __fix_to_virt(idx);
105 }
107 #endif