Changeset a9ac978 in mainline for kernel/arch/sparc64/src/mm/page.c
- Timestamp:
- 2006-09-27T20:11:34Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 00b38a3
- Parents:
- 86b31ba9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/page.c
r86b31ba9 ra9ac978 41 41 #include <debug.h> 42 42 #include <align.h> 43 #include <config.h> 43 44 45 #ifdef CONFIG_SMP 46 /** Entries locked in DTLB of BSP. 47 * 48 * Application processors need to have the same locked entries 49 * in their DTLBs as the bootstrap processor. 50 */ 51 static struct { 52 uintptr_t virt_page; 53 uintptr_t phys_page; 54 int pagesize_code; 55 } bsp_locked_dtlb_entry[DTLB_ENTRY_COUNT]; 56 57 /** Number of entries in bsp_locked_dtlb_entry array. */ 58 static count_t bsp_locked_dtlb_entries = 0; 59 #endif /* CONFIG_SMP */ 60 61 /** Perform sparc64 specific initialization of paging. */ 44 62 void page_arch_init(void) 45 63 { 46 page_mapping_operations = &ht_mapping_operations; 64 if (config.cpu_active == 1) { 65 page_mapping_operations = &ht_mapping_operations; 66 } else { 67 68 #ifdef CONFIG_SMP 69 int i; 70 71 /* 72 * Copy locked DTLB entries from the BSP. 73 */ 74 for (i = 0; i < bsp_locked_dtlb_entries; i++) { 75 dtlb_insert_mapping(bsp_locked_dtlb_entry[i].virt_page, 76 bsp_locked_dtlb_entry[i].phys_page, bsp_locked_dtlb_entry[i].pagesize_code, 77 true, false); 78 } 79 #endif 80 81 } 47 82 } 48 83 … … 68 103 int i; 69 104 105 ASSERT(config.cpu_active == 1); 106 70 107 struct { 71 int pagesize ;108 int pagesize_code; 72 109 size_t increment; 73 110 count_t count; … … 102 139 last_frame = ALIGN_UP(virtaddr + size, 1<<(order + FRAME_WIDTH)); 103 140 104 for (i = 0; i < sizemap[order].count; i++) 141 for (i = 0; i < sizemap[order].count; i++) { 142 /* 143 * First, insert the mapping into DTLB. 144 */ 105 145 dtlb_insert_mapping(virtaddr + i*sizemap[order].increment, 106 146 physaddr + i*sizemap[order].increment, 107 sizemap[order].pagesize, true, false); 147 sizemap[order].pagesize_code, true, false); 148 149 #ifdef CONFIG_SMP 150 /* 151 * Second, save the information about the mapping for APs. 152 */ 153 bsp_locked_dtlb_entry[bsp_locked_dtlb_entries].virt_page = virtaddr + i*sizemap[order].increment; 154 bsp_locked_dtlb_entry[bsp_locked_dtlb_entries].phys_page = physaddr + i*sizemap[order].increment; 155 bsp_locked_dtlb_entry[bsp_locked_dtlb_entries].pagesize_code = sizemap[order].pagesize_code; 156 bsp_locked_dtlb_entries++; 157 #endif 158 } 108 159 109 160 return virtaddr;
Note:
See TracChangeset
for help on using the changeset viewer.