debuggers.hg

view xenolinux-2.4.21-sparse/include/asm-xeno/fixmap.h @ 649:2302a65a8f7a

bitkeeper revision 1.342 (3f1153a1RLTmwr7Jo9U1gUChA4e0Jw)

cleanup
author iap10@labyrinth.cl.cam.ac.uk
date Sun Jul 13 12:42:09 2003 +0000 (2003-07-13)
parents 6879a4610638
children 1e118e51c91f
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>
21 /*
22 * Here we define all the compile-time 'special' virtual
23 * addresses. The point is to have a constant address at
24 * compile time, but to set the physical address only
25 * in the boot process. We allocate these special addresses
26 * from the end of virtual memory (0xfffff000) backwards.
27 * Also this lets us do fail-safe vmalloc(), we
28 * can guarantee that these special addresses and
29 * vmalloc()-ed addresses never overlap.
30 *
31 * these 'compile-time allocated' memory buffers are
32 * fixed-size 4k pages. (or larger if used with an increment
33 * highger than 1) use fixmap_set(idx,phys) to associate
34 * physical memory with fixmap indices.
35 *
36 * TLB entries of such buffers will not be flushed across
37 * task switches.
38 */
40 enum fixed_addresses {
41 #ifdef CONFIG_HIGHMEM_XXX
42 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
43 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
44 #endif
45 FIX_BLKRING_BASE,
46 FIX_NETRING0_BASE,
47 FIX_NETRING1_BASE,
48 FIX_NETRING2_BASE,
49 FIX_NETRING3_BASE,
50 #define NR_FIX_BTMAPS 8 /* 32KB For the Dom0 VGA Console */
51 FIX_BTMAP_END,
52 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
53 /* our bt_ioremap is permenant unlike other architectures */
54 __end_of_permanent_fixed_addresses,
55 __end_of_fixed_addresses = __end_of_permanent_fixed_addresses
56 };
58 extern void __set_fixmap (enum fixed_addresses idx,
59 unsigned long phys, pgprot_t flags);
61 #define set_fixmap(idx, phys) \
62 __set_fixmap(idx, phys, PAGE_KERNEL)
63 /*
64 * Some hardware wants to get fixmapped without caching.
65 */
66 #define set_fixmap_nocache(idx, phys) \
67 __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
68 /*
69 * used by vmalloc.c.
70 *
71 * Leave one empty page between vmalloc'ed areas and
72 * the start of the fixmap, and leave one page empty
73 * at the top of mem..
74 */
75 #define FIXADDR_TOP (HYPERVISOR_VIRT_START - 2*PAGE_SIZE)
76 #define __FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
77 #define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
79 #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
81 /*
82 * 'index to address' translation. If anyone tries to use the idx
83 * directly without tranlation, we catch the bug with a NULL-deference
84 * kernel oops. Illegal ranges of incoming indices are caught too.
85 */
86 static inline unsigned long fix_to_virt(unsigned int idx)
87 {
88 return __fix_to_virt(idx);
89 }
91 #endif