xref: /openbmc/linux/arch/mips/include/asm/fixmap.h (revision 12b9ac6d)
1384740dcSRalf Baechle /*
2384740dcSRalf Baechle  * fixmap.h: compile-time virtual memory allocation
3384740dcSRalf Baechle  *
4384740dcSRalf Baechle  * This file is subject to the terms and conditions of the GNU General Public
5384740dcSRalf Baechle  * License.  See the file "COPYING" in the main directory of this archive
6384740dcSRalf Baechle  * for more details.
7384740dcSRalf Baechle  *
8384740dcSRalf Baechle  * Copyright (C) 1998 Ingo Molnar
9384740dcSRalf Baechle  *
10384740dcSRalf Baechle  * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
11384740dcSRalf Baechle  */
12384740dcSRalf Baechle 
13384740dcSRalf Baechle #ifndef _ASM_FIXMAP_H
14384740dcSRalf Baechle #define _ASM_FIXMAP_H
15384740dcSRalf Baechle 
16384740dcSRalf Baechle #include <asm/page.h>
17565b60deSKevin Cernekee #include <spaces.h>
18384740dcSRalf Baechle #ifdef CONFIG_HIGHMEM
19384740dcSRalf Baechle #include <linux/threads.h>
20a4c33e83SThomas Gleixner #include <asm/kmap_size.h>
21384740dcSRalf Baechle #endif
22384740dcSRalf Baechle 
23384740dcSRalf Baechle /*
24384740dcSRalf Baechle  * Here we define all the compile-time 'special' virtual
25384740dcSRalf Baechle  * addresses. The point is to have a constant address at
26384740dcSRalf Baechle  * compile time, but to set the physical address only
27384740dcSRalf Baechle  * in the boot process. We allocate these special  addresses
28384740dcSRalf Baechle  * from the end of virtual memory (0xfffff000) backwards.
29384740dcSRalf Baechle  * Also this lets us do fail-safe vmalloc(), we
30384740dcSRalf Baechle  * can guarantee that these special addresses and
31384740dcSRalf Baechle  * vmalloc()-ed addresses never overlap.
32384740dcSRalf Baechle  *
33384740dcSRalf Baechle  * these 'compile-time allocated' memory buffers are
34384740dcSRalf Baechle  * fixed-size 4k pages. (or larger if used with an increment
35384740dcSRalf Baechle  * highger than 1) use fixmap_set(idx,phys) to associate
36384740dcSRalf Baechle  * physical memory with fixmap indices.
37384740dcSRalf Baechle  *
38384740dcSRalf Baechle  * TLB entries of such buffers will not be flushed across
39384740dcSRalf Baechle  * task switches.
40384740dcSRalf Baechle  */
41384740dcSRalf Baechle 
42384740dcSRalf Baechle /*
43384740dcSRalf Baechle  * on UP currently we will have no trace of the fixmap mechanizm,
44384740dcSRalf Baechle  * no page table allocations, etc. This might change in the
45384740dcSRalf Baechle  * future, say framebuffers for the console driver(s) could be
46384740dcSRalf Baechle  * fix-mapped?
47384740dcSRalf Baechle  */
48384740dcSRalf Baechle enum fixed_addresses {
49384740dcSRalf Baechle #define FIX_N_COLOURS 8
50384740dcSRalf Baechle 	FIX_CMAP_BEGIN,
510f334a3eSKevin Cernekee 	FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * 2),
52384740dcSRalf Baechle #ifdef CONFIG_HIGHMEM
53384740dcSRalf Baechle 	/* reserved pte's for temporary kernel mappings */
54384740dcSRalf Baechle 	FIX_KMAP_BEGIN = FIX_CMAP_END + 1,
55a4c33e83SThomas Gleixner 	FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,
56384740dcSRalf Baechle #endif
57384740dcSRalf Baechle 	__end_of_fixed_addresses
58384740dcSRalf Baechle };
59384740dcSRalf Baechle 
60384740dcSRalf Baechle /*
61384740dcSRalf Baechle  * used by vmalloc.c.
62384740dcSRalf Baechle  *
63384740dcSRalf Baechle  * Leave one empty page between vmalloc'ed areas and
64384740dcSRalf Baechle  * the start of the fixmap, and leave one page empty
65384740dcSRalf Baechle  * at the top of mem..
66384740dcSRalf Baechle  */
67384740dcSRalf Baechle #define FIXADDR_SIZE	(__end_of_fixed_addresses << PAGE_SHIFT)
68384740dcSRalf Baechle #define FIXADDR_START	(FIXADDR_TOP - FIXADDR_SIZE)
69384740dcSRalf Baechle 
7019fd9629SMark Salter #include <asm-generic/fixmap.h>
71384740dcSRalf Baechle 
72384740dcSRalf Baechle /*
73*12b9ac6dSMike Rapoport (IBM)  * Called from pagetable_init()
74384740dcSRalf Baechle  */
75384740dcSRalf Baechle extern void fixrange_init(unsigned long start, unsigned long end,
76384740dcSRalf Baechle 	pgd_t *pgd_base);
77384740dcSRalf Baechle 
78384740dcSRalf Baechle 
79384740dcSRalf Baechle #endif
80