1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 28ede0bdbSAl Viro #ifndef __UM_FIXMAP_H 38ede0bdbSAl Viro #define __UM_FIXMAP_H 48ede0bdbSAl Viro 58ede0bdbSAl Viro #include <asm/processor.h> 68ede0bdbSAl Viro #include <asm/archparam.h> 78ede0bdbSAl Viro #include <asm/page.h> 8fe1cd987SAl Viro #include <linux/threads.h> 98ede0bdbSAl Viro 108ede0bdbSAl Viro /* 118ede0bdbSAl Viro * Here we define all the compile-time 'special' virtual 128ede0bdbSAl Viro * addresses. The point is to have a constant address at 138ede0bdbSAl Viro * compile time, but to set the physical address only 148ede0bdbSAl Viro * in the boot process. We allocate these special addresses 158ede0bdbSAl Viro * from the end of virtual memory (0xfffff000) backwards. 168ede0bdbSAl Viro * Also this lets us do fail-safe vmalloc(), we 178ede0bdbSAl Viro * can guarantee that these special addresses and 188ede0bdbSAl Viro * vmalloc()-ed addresses never overlap. 198ede0bdbSAl Viro * 208ede0bdbSAl Viro * these 'compile-time allocated' memory buffers are 218ede0bdbSAl Viro * fixed-size 4k pages. (or larger if used with an increment 228ede0bdbSAl Viro * highger than 1) use fixmap_set(idx,phys) to associate 238ede0bdbSAl Viro * physical memory with fixmap indices. 248ede0bdbSAl Viro * 258ede0bdbSAl Viro * TLB entries of such buffers will not be flushed across 268ede0bdbSAl Viro * task switches. 278ede0bdbSAl Viro */ 288ede0bdbSAl Viro 298ede0bdbSAl Viro /* 308ede0bdbSAl Viro * on UP currently we will have no trace of the fixmap mechanizm, 318ede0bdbSAl Viro * no page table allocations, etc. This might change in the 328ede0bdbSAl Viro * future, say framebuffers for the console driver(s) could be 338ede0bdbSAl Viro * fix-mapped? 348ede0bdbSAl Viro */ 358ede0bdbSAl Viro enum fixed_addresses { 368ede0bdbSAl Viro __end_of_fixed_addresses 378ede0bdbSAl Viro }; 388ede0bdbSAl Viro 398ede0bdbSAl Viro extern void __set_fixmap (enum fixed_addresses idx, 408ede0bdbSAl Viro unsigned long phys, pgprot_t flags); 418ede0bdbSAl Viro 428ede0bdbSAl Viro /* 438ede0bdbSAl Viro * used by vmalloc.c. 448ede0bdbSAl Viro * 458ede0bdbSAl Viro * Leave one empty page between vmalloc'ed areas and 468ede0bdbSAl Viro * the start of the fixmap, and leave one page empty 478ede0bdbSAl Viro * at the top of mem.. 488ede0bdbSAl Viro */ 498ede0bdbSAl Viro 508ede0bdbSAl Viro #define FIXADDR_TOP (TASK_SIZE - 2 * PAGE_SIZE) 518ede0bdbSAl Viro #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 528ede0bdbSAl Viro #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 538ede0bdbSAl Viro 54a6ce7114SMark Salter #include <asm-generic/fixmap.h> 558ede0bdbSAl Viro 568ede0bdbSAl Viro #endif 57