Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * fixmap.h: compile-time virtual memory allocation
0003  *
0004  * This file is subject to the terms and conditions of the GNU General Public
0005  * License.  See the file "COPYING" in the main directory of this archive
0006  * for more details.
0007  *
0008  * Copyright (C) 1998 Ingo Molnar
0009  *
0010  * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
0011  */
0012 
0013 #ifndef _ASM_FIXMAP_H
0014 #define _ASM_FIXMAP_H
0015 
0016 #include <asm/page.h>
0017 #include <spaces.h>
0018 #ifdef CONFIG_HIGHMEM
0019 #include <linux/threads.h>
0020 #include <asm/kmap_size.h>
0021 #endif
0022 
0023 /*
0024  * Here we define all the compile-time 'special' virtual
0025  * addresses. The point is to have a constant address at
0026  * compile time, but to set the physical address only
0027  * in the boot process. We allocate these special  addresses
0028  * from the end of virtual memory (0xfffff000) backwards.
0029  * Also this lets us do fail-safe vmalloc(), we
0030  * can guarantee that these special addresses and
0031  * vmalloc()-ed addresses never overlap.
0032  *
0033  * these 'compile-time allocated' memory buffers are
0034  * fixed-size 4k pages. (or larger if used with an increment
0035  * highger than 1) use fixmap_set(idx,phys) to associate
0036  * physical memory with fixmap indices.
0037  *
0038  * TLB entries of such buffers will not be flushed across
0039  * task switches.
0040  */
0041 
0042 /*
0043  * on UP currently we will have no trace of the fixmap mechanizm,
0044  * no page table allocations, etc. This might change in the
0045  * future, say framebuffers for the console driver(s) could be
0046  * fix-mapped?
0047  */
0048 enum fixed_addresses {
0049 #define FIX_N_COLOURS 8
0050     FIX_CMAP_BEGIN,
0051     FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * 2),
0052 #ifdef CONFIG_HIGHMEM
0053     /* reserved pte's for temporary kernel mappings */
0054     FIX_KMAP_BEGIN = FIX_CMAP_END + 1,
0055     FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,
0056 #endif
0057     __end_of_fixed_addresses
0058 };
0059 
0060 /*
0061  * used by vmalloc.c.
0062  *
0063  * Leave one empty page between vmalloc'ed areas and
0064  * the start of the fixmap, and leave one page empty
0065  * at the top of mem..
0066  */
0067 #define FIXADDR_SIZE    (__end_of_fixed_addresses << PAGE_SHIFT)
0068 #define FIXADDR_START   (FIXADDR_TOP - FIXADDR_SIZE)
0069 
0070 #include <asm-generic/fixmap.h>
0071 
0072 /*
0073  * Called from pgtable_init()
0074  */
0075 extern void fixrange_init(unsigned long start, unsigned long end,
0076     pgd_t *pgd_base);
0077 
0078 
0079 #endif