ia64/xen-unstable

view linux-2.4.29-xen-sparse/include/asm-xen/fixmap.h @ 3887:4385894c52ae

bitkeeper revision 1.1230.2.4 (421a95cepOZORm0EbZfqBeZ6PZ8MwA)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno/users/cl349/BK/xen-unstable.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
author iap10@freefall.cl.cam.ac.uk
date Tue Feb 22 02:15:42 2005 +0000 (2005-02-22)
parents 0a4b76b6b5a0
children 09e69c727ad2 eb31fbbaa355 7fc6eac6da3a
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 #ifdef CONFIG_HIGHMEM
21 #include <linux/threads.h>
22 #include <asm/kmap_types.h>
23 #endif
25 /*
26 * Here we define all the compile-time 'special' virtual
27 * addresses. The point is to have a constant address at
28 * compile time, but to set the physical address only
29 * in the boot process. We allocate these special addresses
30 * from the end of virtual memory (0xfffff000) backwards.
31 * Also this lets us do fail-safe vmalloc(), we
32 * can guarantee that these special addresses and
33 * vmalloc()-ed addresses never overlap.
34 *
35 * these 'compile-time allocated' memory buffers are
36 * fixed-size 4k pages. (or larger if used with an increment
37 * highger than 1) use fixmap_set(idx,phys) to associate
38 * physical memory with fixmap indices.
39 *
40 * TLB entries of such buffers will not be flushed across
41 * task switches.
42 */
44 enum fixed_addresses {
45 #ifdef CONFIG_HIGHMEM
46 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
47 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
48 #endif
49 FIX_BLKRING_BASE,
50 FIX_NETRING0_BASE,
51 FIX_NETRING1_BASE,
52 FIX_NETRING2_BASE,
53 FIX_NETRING3_BASE,
54 FIX_SHARED_INFO,
55 FIX_GNTTAB,
56 #ifdef CONFIG_VGA_CONSOLE
57 #define NR_FIX_BTMAPS 32 /* 128KB For the Dom0 VGA Console A0000-C0000 */
58 #else
59 #define NR_FIX_BTMAPS 1 /* in case anyone wants it in future... */
60 #endif
61 FIX_BTMAP_END,
62 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
63 /* our bt_ioremap is permanent, unlike other architectures */
65 __end_of_permanent_fixed_addresses,
66 __end_of_fixed_addresses = __end_of_permanent_fixed_addresses
67 };
69 extern void __set_fixmap (enum fixed_addresses idx,
70 unsigned long phys, pgprot_t flags);
72 #define set_fixmap(idx, phys) \
73 __set_fixmap(idx, phys, PAGE_KERNEL)
74 /*
75 * Some hardware wants to get fixmapped without caching.
76 */
77 #define set_fixmap_nocache(idx, phys) \
78 __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
80 extern void clear_fixmap(enum fixed_addresses idx);
82 /*
83 * used by vmalloc.c.
84 *
85 * Leave one empty page between vmalloc'ed areas and
86 * the start of the fixmap, and leave one page empty
87 * at the top of mem..
88 */
89 #define FIXADDR_TOP (HYPERVISOR_VIRT_START - 2*PAGE_SIZE)
90 #define __FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
91 #define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
93 #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
95 /*
96 * 'index to address' translation. If anyone tries to use the idx
97 * directly without tranlation, we catch the bug with a NULL-deference
98 * kernel oops. Illegal ranges of incoming indices are caught too.
99 */
100 static inline unsigned long fix_to_virt(unsigned int idx)
101 {
102 return __fix_to_virt(idx);
103 }
105 #endif