Changeset a9ac978 in mainline for kernel/arch/sparc64/src/mm
- 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
- Location:
- kernel/arch/sparc64/src/mm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/as.c
r86b31ba9 ra9ac978 38 38 #include <genarch/mm/asid_fifo.h> 39 39 #include <debug.h> 40 #include <config.h> 40 41 41 42 #ifdef CONFIG_TSB … … 52 53 void as_arch_init(void) 53 54 { 54 as_operations = &as_ht_operations; 55 asid_fifo_init(); 55 if (config.cpu_active == 1) { 56 as_operations = &as_ht_operations; 57 asid_fifo_init(); 58 } 56 59 } 57 60 -
kernel/arch/sparc64/src/mm/frame.c
r86b31ba9 ra9ac978 54 54 pfn_t confdata; 55 55 56 for (i = 0; i < bootinfo.memmap.count; i++) { 57 uintptr_t start = bootinfo.memmap.zones[i].start; 58 size_t size = bootinfo.memmap.zones[i].size; 56 if (config.cpu_active == 1) { 57 for (i = 0; i < bootinfo.memmap.count; i++) { 58 uintptr_t start = bootinfo.memmap.zones[i].start; 59 size_t size = bootinfo.memmap.zones[i].size; 59 60 60 /*61 * The memmap is created by HelenOS boot loader.62 * It already contains no holes.63 */61 /* 62 * The memmap is created by HelenOS boot loader. 63 * It already contains no holes. 64 */ 64 65 65 confdata = ADDR2PFN(start);66 if (confdata == 0)67 confdata = 2;68 zone_create(ADDR2PFN(start), SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)), confdata, 0);66 confdata = ADDR2PFN(start); 67 if (confdata == 0) 68 confdata = 2; 69 zone_create(ADDR2PFN(start), SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)), confdata, 0); 69 70 70 last_frame = max(last_frame, start + ALIGN_UP(size, FRAME_SIZE)); 71 last_frame = max(last_frame, start + ALIGN_UP(size, FRAME_SIZE)); 72 } 71 73 } 72 74 -
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.