David S. Miller | af1ee56 | 2008-09-12 00:19:21 -0700 | [diff] [blame] | 1 | #ifndef _SPARC64_MM_INIT_H |
| 2 | #define _SPARC64_MM_INIT_H |
| 3 | |
David S. Miller | bb7b435 | 2013-09-18 15:39:06 -0700 | [diff] [blame] | 4 | #include <asm/page.h> |
| 5 | |
David S. Miller | af1ee56 | 2008-09-12 00:19:21 -0700 | [diff] [blame] | 6 | /* Most of the symbols in this file are defined in init.c and |
| 7 | * marked non-static so that assembler code can get at them. |
| 8 | */ |
| 9 | |
David S. Miller | bb7b435 | 2013-09-18 15:39:06 -0700 | [diff] [blame] | 10 | #define MAX_PHYS_ADDRESS (1UL << MAX_PHYS_ADDRESS_BITS) |
David S. Miller | d8ed1d4 | 2009-08-25 16:47:46 -0700 | [diff] [blame] | 11 | #define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL) |
David S. Miller | af1ee56 | 2008-09-12 00:19:21 -0700 | [diff] [blame] | 12 | #define KPTE_BITMAP_BYTES \ |
David S. Miller | 4f93d21 | 2012-09-06 18:13:58 -0700 | [diff] [blame] | 13 | ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 4) |
David S. Miller | d8ed1d4 | 2009-08-25 16:47:46 -0700 | [diff] [blame] | 14 | #define VALID_ADDR_BITMAP_CHUNK_SZ (4UL * 1024UL * 1024UL) |
| 15 | #define VALID_ADDR_BITMAP_BYTES \ |
| 16 | ((MAX_PHYS_ADDRESS / VALID_ADDR_BITMAP_CHUNK_SZ) / 8) |
David S. Miller | af1ee56 | 2008-09-12 00:19:21 -0700 | [diff] [blame] | 17 | |
David S. Miller | 4f93d21 | 2012-09-06 18:13:58 -0700 | [diff] [blame] | 18 | extern unsigned long kern_linear_pte_xor[4]; |
David S. Miller | af1ee56 | 2008-09-12 00:19:21 -0700 | [diff] [blame] | 19 | extern unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)]; |
| 20 | extern unsigned int sparc64_highest_unlocked_tlb_ent; |
| 21 | extern unsigned long sparc64_kern_pri_context; |
| 22 | extern unsigned long sparc64_kern_pri_nuc_bits; |
| 23 | extern unsigned long sparc64_kern_sec_context; |
| 24 | extern void mmu_info(struct seq_file *m); |
| 25 | |
| 26 | struct linux_prom_translation { |
| 27 | unsigned long virt; |
| 28 | unsigned long size; |
| 29 | unsigned long data; |
| 30 | }; |
| 31 | |
| 32 | /* Exported for kernel TLB miss handling in ktlb.S */ |
| 33 | extern struct linux_prom_translation prom_trans[512]; |
| 34 | extern unsigned int prom_trans_ents; |
| 35 | |
| 36 | /* Exported for SMP bootup purposes. */ |
| 37 | extern unsigned long kern_locked_tte_data; |
| 38 | |
| 39 | extern void prom_world(int enter); |
| 40 | |
David S. Miller | af1ee56 | 2008-09-12 00:19:21 -0700 | [diff] [blame] | 41 | #ifdef CONFIG_SPARSEMEM_VMEMMAP |
| 42 | #define VMEMMAP_CHUNK_SHIFT 22 |
| 43 | #define VMEMMAP_CHUNK (1UL << VMEMMAP_CHUNK_SHIFT) |
| 44 | #define VMEMMAP_CHUNK_MASK ~(VMEMMAP_CHUNK - 1UL) |
| 45 | #define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK) |
| 46 | |
| 47 | #define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \ |
David S. Miller | bffbc94 | 2009-11-23 16:38:56 -0800 | [diff] [blame] | 48 | sizeof(struct page)) >> VMEMMAP_CHUNK_SHIFT) |
David S. Miller | af1ee56 | 2008-09-12 00:19:21 -0700 | [diff] [blame] | 49 | extern unsigned long vmemmap_table[VMEMMAP_SIZE]; |
| 50 | #endif |
| 51 | |
| 52 | #endif /* _SPARC64_MM_INIT_H */ |