blob: 0661aa606decec7480e4042aed430f8729af5bd5 [file] [log] [blame]
David S. Milleraf1ee562008-09-12 00:19:21 -07001#ifndef _SPARC64_MM_INIT_H
2#define _SPARC64_MM_INIT_H
3
4/* Most of the symbols in this file are defined in init.c and
5 * marked non-static so that assembler code can get at them.
6 */
7
David S. Millerd8ed1d42009-08-25 16:47:46 -07008#define MAX_PHYS_ADDRESS (1UL << 41UL)
9#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL)
David S. Milleraf1ee562008-09-12 00:19:21 -070010#define KPTE_BITMAP_BYTES \
David S. Miller4f93d212012-09-06 18:13:58 -070011 ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 4)
David S. Millerd8ed1d42009-08-25 16:47:46 -070012#define VALID_ADDR_BITMAP_CHUNK_SZ (4UL * 1024UL * 1024UL)
13#define VALID_ADDR_BITMAP_BYTES \
14 ((MAX_PHYS_ADDRESS / VALID_ADDR_BITMAP_CHUNK_SZ) / 8)
David S. Milleraf1ee562008-09-12 00:19:21 -070015
David S. Miller4f93d212012-09-06 18:13:58 -070016extern unsigned long kern_linear_pte_xor[4];
David S. Milleraf1ee562008-09-12 00:19:21 -070017extern unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)];
18extern unsigned int sparc64_highest_unlocked_tlb_ent;
19extern unsigned long sparc64_kern_pri_context;
20extern unsigned long sparc64_kern_pri_nuc_bits;
21extern unsigned long sparc64_kern_sec_context;
22extern void mmu_info(struct seq_file *m);
23
24struct linux_prom_translation {
25 unsigned long virt;
26 unsigned long size;
27 unsigned long data;
28};
29
30/* Exported for kernel TLB miss handling in ktlb.S */
31extern struct linux_prom_translation prom_trans[512];
32extern unsigned int prom_trans_ents;
33
34/* Exported for SMP bootup purposes. */
35extern unsigned long kern_locked_tte_data;
36
37extern void prom_world(int enter);
38
David S. Milleraf1ee562008-09-12 00:19:21 -070039#ifdef CONFIG_SPARSEMEM_VMEMMAP
40#define VMEMMAP_CHUNK_SHIFT 22
41#define VMEMMAP_CHUNK (1UL << VMEMMAP_CHUNK_SHIFT)
42#define VMEMMAP_CHUNK_MASK ~(VMEMMAP_CHUNK - 1UL)
43#define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK)
44
45#define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \
David S. Millerbffbc942009-11-23 16:38:56 -080046 sizeof(struct page)) >> VMEMMAP_CHUNK_SHIFT)
David S. Milleraf1ee562008-09-12 00:19:21 -070047extern unsigned long vmemmap_table[VMEMMAP_SIZE];
48#endif
49
50#endif /* _SPARC64_MM_INIT_H */