Changeset 2057572 in mainline
- Timestamp:
- 2007-03-27T23:40:25Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 399ece9
- Parents:
- 8d37a06
- Files:
-
- 1 deleted
- 38 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/asm.h
r8d37a06 r2057572 34 34 #include "main.h" 35 35 36 #define PAGE_ SIZE 819237 #define PAGE_ WIDTH 1336 #define PAGE_WIDTH 14 37 #define PAGE_SIZE (1 << PAGE_WIDTH) 38 38 39 39 #define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) -
kernel/arch/sparc64/Makefile.inc
r8d37a06 r2057572 84 84 arch/$(ARCH)/src/dummy.s \ 85 85 arch/$(ARCH)/src/mm/as.c \ 86 arch/$(ARCH)/src/mm/cache.c \ 87 arch/$(ARCH)/src/mm/cache_asm.S \ 86 arch/$(ARCH)/src/mm/cache.S \ 88 87 arch/$(ARCH)/src/mm/frame.c \ 89 88 arch/$(ARCH)/src/mm/page.c \ -
kernel/arch/sparc64/include/cpu.h
r8d37a06 r2057572 65 65 generated when the TICK register 66 66 matches this value. */ 67 #ifdef CONFIG_SMP68 int dcache_active;69 dcache_shootdown_msg_t dcache_messages[DCACHE_MSG_QUEUE_LEN];70 count_t dcache_message_count;71 #endif72 67 } cpu_arch_t; 73 68 -
kernel/arch/sparc64/include/mm/as.h
r8d37a06 r2057572 82 82 83 83 #ifdef CONFIG_TSB 84 # include <arch/mm/tsb.h> 85 # define as_invalidate_translation_cache(as, page, cnt) tsb_invalidate(as, page, cnt) 84 #include <arch/mm/tsb.h> 85 #define as_invalidate_translation_cache(as, page, cnt) \ 86 tsb_invalidate((as), (page), (cnt)) 86 87 #else 87 # 88 #define as_invalidate_translation_cache(as, page, cnt) 88 89 #endif 89 90 -
kernel/arch/sparc64/include/mm/cache.h
r8d37a06 r2057572 44 44 dcache_flush_tag(PAGE_COLOR((p)), ADDR2PFN((f))); 45 45 46 /**47 * Enumerations to differentiate among different scopes of D-Cache48 * invalidation.49 */50 typedef enum {51 DCACHE_INVL_INVALID,52 DCACHE_INVL_ALL,53 DCACHE_INVL_COLOR,54 DCACHE_INVL_FRAME55 } dcache_invalidate_type_t;56 57 /**58 * Number of messages that can be queued in the cpu_arch_t structure at a time.59 */60 #define DCACHE_MSG_QUEUE_LEN 1061 62 /** D-cache shootdown message type. */63 typedef struct {64 dcache_invalidate_type_t type;65 int color;66 uintptr_t frame;67 } dcache_shootdown_msg_t;68 69 46 extern void dcache_flush(void); 70 47 extern void dcache_flush_color(int c); 71 48 extern void dcache_flush_tag(int c, pfn_t tag); 72 73 #ifdef CONFIG_SMP74 extern void dcache_shootdown_start(dcache_invalidate_type_t type, int color,75 uintptr_t frame);76 extern void dcache_shootdown_finalize(void);77 extern void dcache_shootdown_ipi_recv(void);78 #else79 #define dcache_shootdown_start(t, c, f)80 #define dcache_shootdown_finalize()81 #define dcache_shootdown_ipi_recv()82 #endif /* CONFIG_SMP */83 49 84 50 #endif -
kernel/arch/sparc64/include/mm/frame.h
r8d37a06 r2057572 36 36 #define KERN_sparc64_FRAME_H_ 37 37 38 #define FRAME_WIDTH 13 /* 8K */ 38 /* 39 * Page size supported by the MMU. 40 * For 8K there is the nasty illegal virtual aliasing problem. 41 * Therefore, the kernel uses 8K only internally on the TLB and TSB levels. 42 */ 43 #define MMU_FRAME_WIDTH 13 /* 8K */ 44 #define MMU_FRAME_SIZE (1 << MMU_FRAME_WIDTH) 45 46 /* 47 * Page size exported to the generic memory management subsystems. 48 * This page size is not directly supported by the MMU, but we can emulate 49 * each 16K page with a pair of adjacent 8K pages. 50 */ 51 #define FRAME_WIDTH 14 /* 16K */ 39 52 #define FRAME_SIZE (1 << FRAME_WIDTH) 40 53 -
kernel/arch/sparc64/include/mm/page.h
r8d37a06 r2057572 38 38 #include <arch/mm/frame.h> 39 39 40 /* 41 * On the TLB and TSB level, we still use 8K pages, which are supported by the 42 * MMU. 43 */ 44 #define MMU_PAGE_WIDTH MMU_FRAME_WIDTH 45 #define MMU_PAGE_SIZE MMU_FRAME_SIZE 46 47 /* 48 * On the page table level, we use 16K pages. 16K pages are not supported by 49 * the MMU but we emulate them with pairs of 8K pages. 50 */ 40 51 #define PAGE_WIDTH FRAME_WIDTH 41 52 #define PAGE_SIZE FRAME_SIZE 42 53 43 #define PAGE_COLOR_BITS 1 /**< 14 - 13; 2^14 == 16K == alias boundary. */ 54 #define MMU_PAGES_PER_PAGE (1 << (PAGE_WIDTH - MMU_PAGE_WIDTH)) 55 56 /* 57 * With 16K pages, there is only one page color. 58 */ 59 #define PAGE_COLOR_BITS 0 /**< 14 - 14; 2^14 == 16K == alias boundary. */ 44 60 45 61 #ifdef KERNEL -
kernel/arch/sparc64/include/mm/tsb.h
r8d37a06 r2057572 113 113 114 114 extern void tsb_invalidate(struct as *as, uintptr_t page, count_t pages); 115 extern void itsb_pte_copy(struct pte *t );116 extern void dtsb_pte_copy(struct pte *t, bool ro);115 extern void itsb_pte_copy(struct pte *t, index_t index); 116 extern void dtsb_pte_copy(struct pte *t, index_t index, bool ro); 117 117 118 118 #endif /* !def __ASM__ */ -
kernel/arch/sparc64/include/stack.h
r8d37a06 r2057572 44 44 * 16-extended-word save area for %i[0-7] and %l[0-7] registers. 45 45 */ 46 #define STACK_WINDOW_SAVE_AREA_SIZE (16 *STACK_ITEM_SIZE)46 #define STACK_WINDOW_SAVE_AREA_SIZE (16 * STACK_ITEM_SIZE) 47 47 48 48 /** -
kernel/arch/sparc64/src/cpu/cpu.c
r8d37a06 r2057572 52 52 CPU->arch.mid = upa_config.mid; 53 53 54 #if (defined(CONFIG_SMP) && defined(CONFIG_VIRT_IDX_DCACHE))55 CPU->arch.dcache_active = 1;56 CPU->arch.dcache_message_count = 0;57 #endif58 59 54 /* 60 55 * Detect processor frequency. -
kernel/arch/sparc64/src/mm/as.c
r8d37a06 r2057572 63 63 #ifdef CONFIG_TSB 64 64 int order = fnzb32(((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * 65 sizeof(tsb_entry_t)) >> FRAME_WIDTH);65 sizeof(tsb_entry_t)) >> MMU_FRAME_WIDTH); 66 66 uintptr_t tsb = (uintptr_t) frame_alloc(order, flags | FRAME_KA); 67 67 … … 72 72 as->arch.dtsb = (tsb_entry_t *) (tsb + ITSB_ENTRY_COUNT * 73 73 sizeof(tsb_entry_t)); 74 memsetb((uintptr_t) as->arch.itsb, (ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT)75 74 memsetb((uintptr_t) as->arch.itsb, 75 (ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * sizeof(tsb_entry_t), 0); 76 76 #endif 77 77 return 0; … … 82 82 #ifdef CONFIG_TSB 83 83 count_t cnt = ((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * 84 sizeof(tsb_entry_t)) >> FRAME_WIDTH;84 sizeof(tsb_entry_t)) >> MMU_FRAME_WIDTH; 85 85 frame_free(KA2PA((uintptr_t) as->arch.itsb)); 86 86 return cnt; … … 140 140 uintptr_t tsb = (uintptr_t) as->arch.itsb; 141 141 142 if (!overlaps(tsb, 8 * PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {142 if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 143 143 /* 144 144 * TSBs were allocated from memory not covered … … 159 159 tsb_base.split = 0; 160 160 161 tsb_base.base = ((uintptr_t) as->arch.itsb) >> PAGE_WIDTH;161 tsb_base.base = ((uintptr_t) as->arch.itsb) >> MMU_PAGE_WIDTH; 162 162 itsb_base_write(tsb_base.value); 163 tsb_base.base = ((uintptr_t) as->arch.dtsb) >> PAGE_WIDTH;163 tsb_base.base = ((uintptr_t) as->arch.dtsb) >> MMU_PAGE_WIDTH; 164 164 dtsb_base_write(tsb_base.value); 165 165 #endif … … 190 190 uintptr_t tsb = (uintptr_t) as->arch.itsb; 191 191 192 if (!overlaps(tsb, 8 * PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {192 if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 193 193 /* 194 194 * TSBs were allocated from memory not covered -
kernel/arch/sparc64/src/mm/page.c
r8d37a06 r2057572 74 74 for (i = 0; i < bsp_locked_dtlb_entries; i++) { 75 75 dtlb_insert_mapping(bsp_locked_dtlb_entry[i].virt_page, 76 77 bsp_locked_dtlb_entry[i].pagesize_code,true,78 76 bsp_locked_dtlb_entry[i].phys_page, 77 bsp_locked_dtlb_entry[i].pagesize_code, true, 78 false); 79 79 } 80 80 #endif … … 108 108 count_t count; 109 109 } sizemap[] = { 110 { PAGESIZE_8K, 0, 1 }, /* 8K */111 { PAGESIZE_8K, PAGE_SIZE, 2 }, /* 16K */112 { PAGESIZE_8K, PAGE_SIZE, 4 }, /* 32K */113 { PAGESIZE_64K, 0, 1}, /* 64K */114 { PAGESIZE_64K, 8 * PAGE_SIZE, 2 },/* 128K */115 { PAGESIZE_64K, 8 * PAGE_SIZE, 4 },/* 256K */116 { PAGESIZE_512K, 0, 1 }, /* 512K */117 { PAGESIZE_512K, 64 * PAGE_SIZE, 2 }, /* 1M */118 { PAGESIZE_512K, 64 * PAGE_SIZE, 4 }, /* 2M */119 { PAGESIZE_4M, 0, 1 }, /* 4M */120 { PAGESIZE_4M, 512 * PAGE_SIZE, 2 }/* 8M */110 { PAGESIZE_8K, 0, 1 }, /* 8K */ 111 { PAGESIZE_8K, MMU_PAGE_SIZE, 2 }, /* 16K */ 112 { PAGESIZE_8K, MMU_PAGE_SIZE, 4 }, /* 32K */ 113 { PAGESIZE_64K, 0, 1}, /* 64K */ 114 { PAGESIZE_64K, 8 * MMU_PAGE_SIZE, 2 }, /* 128K */ 115 { PAGESIZE_64K, 8 * MMU_PAGE_SIZE, 4 }, /* 256K */ 116 { PAGESIZE_512K, 0, 1 }, /* 512K */ 117 { PAGESIZE_512K, 64 * MMU_PAGE_SIZE, 2 }, /* 1M */ 118 { PAGESIZE_512K, 64 * MMU_PAGE_SIZE, 4 }, /* 2M */ 119 { PAGESIZE_4M, 0, 1 }, /* 4M */ 120 { PAGESIZE_4M, 512 * MMU_PAGE_SIZE, 2 } /* 8M */ 121 121 }; 122 122 123 ASSERT(ALIGN_UP(physaddr, PAGE_SIZE) == physaddr);123 ASSERT(ALIGN_UP(physaddr, MMU_PAGE_SIZE) == physaddr); 124 124 ASSERT(size <= 8 * 1024 * 1024); 125 125 126 if (size <= FRAME_SIZE)126 if (size <= MMU_FRAME_SIZE) 127 127 order = 0; 128 128 else 129 order = (fnzb64(size - 1) + 1) - FRAME_WIDTH;129 order = (fnzb64(size - 1) + 1) - MMU_FRAME_WIDTH; 130 130 131 131 /* … … 135 135 */ 136 136 ASSERT(PA2KA(last_frame)); 137 uintptr_t virtaddr = ALIGN_UP(PA2KA(last_frame), 1 << (order + FRAME_WIDTH)); 138 last_frame = ALIGN_UP(KA2PA(virtaddr) + size, 1 << (order + FRAME_WIDTH)); 137 uintptr_t virtaddr = ALIGN_UP(PA2KA(last_frame), 138 1 << (order + FRAME_WIDTH)); 139 last_frame = ALIGN_UP(KA2PA(virtaddr) + size, 140 1 << (order + FRAME_WIDTH)); 139 141 140 142 for (i = 0; i < sizemap[order].count; i++) { … … 143 145 */ 144 146 dtlb_insert_mapping(virtaddr + i * sizemap[order].increment, 145 146 147 physaddr + i * sizemap[order].increment, 148 sizemap[order].pagesize_code, true, false); 147 149 148 150 #ifdef CONFIG_SMP … … 151 153 */ 152 154 bsp_locked_dtlb_entry[bsp_locked_dtlb_entries].virt_page = 153 155 virtaddr + i * sizemap[order].increment; 154 156 bsp_locked_dtlb_entry[bsp_locked_dtlb_entries].phys_page = 155 157 physaddr + i * sizemap[order].increment; 156 158 bsp_locked_dtlb_entry[bsp_locked_dtlb_entries].pagesize_code = 157 159 sizemap[order].pagesize_code; 158 160 bsp_locked_dtlb_entries++; 159 161 #endif -
kernel/arch/sparc64/src/mm/tlb.c
r8d37a06 r2057572 55 55 #endif 56 56 57 static void dtlb_pte_copy(pte_t *t, bool ro);58 static void itlb_pte_copy(pte_t *t );59 static void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, const60 57 static void dtlb_pte_copy(pte_t *t, index_t index, bool ro); 58 static void itlb_pte_copy(pte_t *t, index_t index); 59 static void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, 60 const char *str); 61 61 static void do_fast_data_access_mmu_miss_fault(istate_t *istate, 62 62 tlb_tag_access_reg_t tag, const char *str); 63 63 static void do_fast_data_access_protection_fault(istate_t *istate, 64 64 tlb_tag_access_reg_t tag, const char *str); 65 65 66 66 char *context_encoding[] = { … … 93 93 * @param cacheable True if the mapping is cacheable, false otherwise. 94 94 */ 95 void dtlb_insert_mapping(uintptr_t page, uintptr_t frame, int pagesize, bool96 95 void dtlb_insert_mapping(uintptr_t page, uintptr_t frame, int pagesize, 96 bool locked, bool cacheable) 97 97 { 98 98 tlb_tag_access_reg_t tag; … … 127 127 /** Copy PTE to TLB. 128 128 * 129 * @param t Page Table Entry to be copied. 130 * @param ro If true, the entry will be created read-only, regardless of its w 131 * field. 132 */ 133 void dtlb_pte_copy(pte_t *t, bool ro) 129 * @param t Page Table Entry to be copied. 130 * @param index Zero if lower 8K-subpage, one if higher 8K-subpage. 131 * @param ro If true, the entry will be created read-only, regardless of its 132 * w field. 133 */ 134 void dtlb_pte_copy(pte_t *t, index_t index, bool ro) 134 135 { 135 136 tlb_tag_access_reg_t tag; … … 138 139 frame_address_t fr; 139 140 140 pg.address = t->page ;141 fr.address = t->frame ;141 pg.address = t->page + (index << MMU_PAGE_WIDTH); 142 fr.address = t->frame + (index << MMU_PAGE_WIDTH); 142 143 143 144 tag.value = 0; 144 145 tag.context = t->as->asid; 145 146 tag.vpn = pg.vpn; 146 147 147 148 dtlb_tag_access_write(tag.value); 148 149 149 150 data.value = 0; 150 151 data.v = true; … … 159 160 data.w = ro ? false : t->w; 160 161 data.g = t->g; 161 162 162 163 dtlb_data_in_write(data.value); 163 164 } … … 165 166 /** Copy PTE to ITLB. 166 167 * 167 * @param t Page Table Entry to be copied. 168 */ 169 void itlb_pte_copy(pte_t *t) 168 * @param t Page Table Entry to be copied. 169 * @param index Zero if lower 8K-subpage, one if higher 8K-subpage. 170 */ 171 void itlb_pte_copy(pte_t *t, index_t index) 170 172 { 171 173 tlb_tag_access_reg_t tag; … … 174 176 frame_address_t fr; 175 177 176 pg.address = t->page ;177 fr.address = t->frame ;178 pg.address = t->page + (index << MMU_PAGE_WIDTH); 179 fr.address = t->frame + (index << MMU_PAGE_WIDTH); 178 180 179 181 tag.value = 0; … … 200 202 { 201 203 uintptr_t va = ALIGN_DOWN(istate->tpc, PAGE_SIZE); 204 index_t index = (istate->tpc >> MMU_PAGE_WIDTH) % MMU_PAGES_PER_PAGE; 202 205 pte_t *t; 203 206 … … 210 213 */ 211 214 t->a = true; 212 itlb_pte_copy(t );215 itlb_pte_copy(t, index); 213 216 #ifdef CONFIG_TSB 214 itsb_pte_copy(t );217 itsb_pte_copy(t, index); 215 218 #endif 216 219 page_table_unlock(AS, true); … … 223 226 if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) { 224 227 do_fast_instruction_access_mmu_miss_fault(istate, 225 228 __FUNCTION__); 226 229 } 227 230 } … … 237 240 tlb_tag_access_reg_t tag; 238 241 uintptr_t va; 242 index_t index; 239 243 pte_t *t; 240 244 241 245 tag.value = dtlb_tag_access_read(); 242 va = tag.vpn << PAGE_WIDTH; 246 va = ALIGN_DOWN((uint64_t) tag.vpn << MMU_PAGE_WIDTH, PAGE_SIZE); 247 index = tag.vpn % MMU_PAGES_PER_PAGE; 243 248 244 249 if (tag.context == ASID_KERNEL) { … … 246 251 /* NULL access in kernel */ 247 252 do_fast_data_access_mmu_miss_fault(istate, tag, 248 253 __FUNCTION__); 249 254 } 250 255 do_fast_data_access_mmu_miss_fault(istate, tag, "Unexpected " 251 256 "kernel page fault."); 252 257 } 253 258 … … 260 265 */ 261 266 t->a = true; 262 dtlb_pte_copy(t, true);267 dtlb_pte_copy(t, index, true); 263 268 #ifdef CONFIG_TSB 264 dtsb_pte_copy(t, true);269 dtsb_pte_copy(t, index, true); 265 270 #endif 266 271 page_table_unlock(AS, true); 267 272 } else { 268 273 /* 269 * Forward the page fault to the address space page fault handler. 274 * Forward the page fault to the address space page fault 275 * handler. 270 276 */ 271 277 page_table_unlock(AS, true); 272 278 if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) { 273 279 do_fast_data_access_mmu_miss_fault(istate, tag, 274 280 __FUNCTION__); 275 281 } 276 282 } … … 282 288 tlb_tag_access_reg_t tag; 283 289 uintptr_t va; 290 index_t index; 284 291 pte_t *t; 285 292 286 293 tag.value = dtlb_tag_access_read(); 287 va = tag.vpn << PAGE_WIDTH; 294 va = ALIGN_DOWN((uint64_t) tag.vpn << MMU_PAGE_WIDTH, PAGE_SIZE); 295 index = tag.vpn % MMU_PAGES_PER_PAGE; /* 16K-page emulation */ 288 296 289 297 page_table_lock(AS, true); … … 297 305 t->a = true; 298 306 t->d = true; 299 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, va); 300 dtlb_pte_copy(t, false); 307 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, 308 va + index * MMU_PAGE_SIZE); 309 dtlb_pte_copy(t, index, false); 301 310 #ifdef CONFIG_TSB 302 dtsb_pte_copy(t, false);311 dtsb_pte_copy(t, index, false); 303 312 #endif 304 313 page_table_unlock(AS, true); … … 311 320 if (as_page_fault(va, PF_ACCESS_WRITE, istate) == AS_PF_FAULT) { 312 321 do_fast_data_access_protection_fault(istate, tag, 313 322 __FUNCTION__); 314 323 } 315 324 } … … 329 338 330 339 printf("%d: vpn=%#llx, context=%d, v=%d, size=%d, nfo=%d, " 331 332 333 334 340 "ie=%d, soft2=%#x, diag=%#x, pfn=%#x, soft=%#x, l=%d, " 341 "cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n", i, t.vpn, 342 t.context, d.v, d.size, d.nfo, d.ie, d.soft2, d.diag, 343 d.pfn, d.soft, d.l, d.cp, d.cv, d.e, d.p, d.w, d.g); 335 344 } 336 345 … … 341 350 342 351 printf("%d: vpn=%#llx, context=%d, v=%d, size=%d, nfo=%d, " 343 344 345 346 347 } 348 349 } 350 351 void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, const char352 352 "ie=%d, soft2=%#x, diag=%#x, pfn=%#x, soft=%#x, l=%d, " 353 "cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n", i, t.vpn, 354 t.context, d.v, d.size, d.nfo, d.ie, d.soft2, d.diag, 355 d.pfn, d.soft, d.l, d.cp, d.cv, d.e, d.p, d.w, d.g); 356 } 357 358 } 359 360 void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, 361 const char *str) 353 362 { 354 363 fault_if_from_uspace(istate, "%s\n", str); … … 357 366 } 358 367 359 void do_fast_data_access_mmu_miss_fault(istate_t *istate, tlb_tag_access_reg_t360 368 void do_fast_data_access_mmu_miss_fault(istate_t *istate, 369 tlb_tag_access_reg_t tag, const char *str) 361 370 { 362 371 uintptr_t va; 363 372 364 va = tag.vpn << PAGE_WIDTH;373 va = tag.vpn << MMU_PAGE_WIDTH; 365 374 366 375 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, 367 376 tag.context); 368 377 dump_istate(istate); 369 378 printf("Faulting page: %p, ASID=%d\n", va, tag.context); … … 371 380 } 372 381 373 void do_fast_data_access_protection_fault(istate_t *istate, tlb_tag_access_reg_t374 382 void do_fast_data_access_protection_fault(istate_t *istate, 383 tlb_tag_access_reg_t tag, const char *str) 375 384 { 376 385 uintptr_t va; 377 386 378 va = tag.vpn << PAGE_WIDTH;387 va = tag.vpn << MMU_PAGE_WIDTH; 379 388 380 389 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, 381 390 tag.context); 382 391 printf("Faulting page: %p, ASID=%d\n", va, tag.context); 383 392 dump_istate(istate); … … 394 403 395 404 printf("DTLB SFSR: asi=%#x, ft=%#x, e=%d, ct=%d, pr=%d, w=%d, ow=%d, " 396 397 405 "fv=%d\n", sfsr.asi, sfsr.ft, sfsr.e, sfsr.ct, sfsr.pr, sfsr.w, 406 sfsr.ow, sfsr.fv); 398 407 printf("DTLB SFAR: address=%p\n", sfar); 399 408 … … 482 491 mmu_primary_context_write(ctx.v); 483 492 484 for (i = 0; i < cnt ; i++) {493 for (i = 0; i < cnt * MMU_PAGES_PER_PAGE; i++) { 485 494 itlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_PRIMARY, 486 page + i * PAGE_SIZE);495 page + i * MMU_PAGE_SIZE); 487 496 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_PRIMARY, 488 page + i * PAGE_SIZE);497 page + i * MMU_PAGE_SIZE); 489 498 } 490 499 -
kernel/arch/sparc64/src/mm/tsb.c
r8d37a06 r2057572 35 35 #include <arch/mm/tsb.h> 36 36 #include <arch/mm/tlb.h> 37 #include <arch/mm/page.h> 37 38 #include <arch/barrier.h> 38 39 #include <mm/as.h> … … 41 42 #include <debug.h> 42 43 43 #define TSB_INDEX_MASK ((1 << (21 + 1 + TSB_SIZE -PAGE_WIDTH)) - 1)44 #define TSB_INDEX_MASK ((1 << (21 + 1 + TSB_SIZE - MMU_PAGE_WIDTH)) - 1) 44 45 45 46 /** Invalidate portion of TSB. … … 60 61 ASSERT(as->arch.itsb && as->arch.dtsb); 61 62 62 i0 = (page >> PAGE_WIDTH) & TSB_INDEX_MASK;63 cnt = min(pages , ITSB_ENTRY_COUNT);63 i0 = (page >> MMU_PAGE_WIDTH) & TSB_INDEX_MASK; 64 cnt = min(pages * MMU_PAGES_PER_PAGE, ITSB_ENTRY_COUNT); 64 65 65 66 for (i = 0; i < cnt; i++) { 66 67 as->arch.itsb[(i0 + i) & (ITSB_ENTRY_COUNT - 1)].tag.invalid = 67 68 true; 68 69 as->arch.dtsb[(i0 + i) & (DTSB_ENTRY_COUNT - 1)].tag.invalid = 69 70 true; 70 71 } 71 72 } … … 73 74 /** Copy software PTE to ITSB. 74 75 * 75 * @param t Software PTE. 76 * @param t Software PTE. 77 * @param index Zero if lower 8K-subpage, one if higher 8K subpage. 76 78 */ 77 void itsb_pte_copy(pte_t *t )79 void itsb_pte_copy(pte_t *t, index_t index) 78 80 { 79 81 as_t *as; 80 82 tsb_entry_t *tsb; 83 index_t entry; 81 84 82 85 as = t->as; 83 tsb = &as->arch.itsb[(t->page >> PAGE_WIDTH) & TSB_INDEX_MASK]; 86 entry = ((t->page >> MMU_PAGE_WIDTH) + index) & TSB_INDEX_MASK; 87 tsb = &as->arch.itsb[entry]; 84 88 85 89 /* … … 96 100 97 101 tsb->tag.context = as->asid; 98 tsb->tag.va_tag = t->page >> VA_TAG_PAGE_SHIFT; 102 tsb->tag.va_tag = (t->page + (index << MMU_PAGE_WIDTH)) >> 103 VA_TAG_PAGE_SHIFT; 99 104 tsb->data.value = 0; 100 105 tsb->data.size = PAGESIZE_8K; 101 tsb->data.pfn = t->frame >> FRAME_WIDTH;106 tsb->data.pfn = (t->frame >> MMU_FRAME_WIDTH) + index; 102 107 tsb->data.cp = t->c; 103 108 tsb->data.p = t->k; /* p as privileged */ … … 111 116 /** Copy software PTE to DTSB. 112 117 * 113 * @param t Software PTE. 114 * @param ro If true, the mapping is copied read-only. 118 * @param t Software PTE. 119 * @param index Zero if lower 8K-subpage, one if higher 8K-subpage. 120 * @param ro If true, the mapping is copied read-only. 115 121 */ 116 void dtsb_pte_copy(pte_t *t, bool ro)122 void dtsb_pte_copy(pte_t *t, index_t index, bool ro) 117 123 { 118 124 as_t *as; 119 125 tsb_entry_t *tsb; 126 index_t entry; 120 127 121 128 as = t->as; 122 tsb = &as->arch.dtsb[(t->page >> PAGE_WIDTH) & TSB_INDEX_MASK]; 129 entry = ((t->page >> MMU_PAGE_WIDTH) + index) & TSB_INDEX_MASK; 130 tsb = &as->arch.dtsb[entry]; 123 131 124 132 /* … … 135 143 136 144 tsb->tag.context = as->asid; 137 tsb->tag.va_tag = t->page >> VA_TAG_PAGE_SHIFT; 145 tsb->tag.va_tag = (t->page + (index << MMU_PAGE_WIDTH)) >> 146 VA_TAG_PAGE_SHIFT; 138 147 tsb->data.value = 0; 139 148 tsb->data.size = PAGESIZE_8K; 140 tsb->data.pfn = t->frame >> FRAME_WIDTH;149 tsb->data.pfn = (t->frame >> MMU_FRAME_WIDTH) + index; 141 150 tsb->data.cp = t->c; 142 151 #ifdef CONFIG_VIRT_IDX_DCACHE -
kernel/arch/sparc64/src/smp/ipi.c
r8d37a06 r2057572 40 40 #include <config.h> 41 41 #include <mm/tlb.h> 42 #include <arch/mm/cache.h>43 42 #include <arch/interrupt.h> 44 43 #include <arch/trap/interrupt.h> … … 126 125 func = tlb_shootdown_ipi_recv; 127 126 break; 128 #if (defined(CONFIG_SMP) && (defined(CONFIG_VIRT_IDX_DCACHE)))129 case IPI_DCACHE_SHOOTDOWN:130 func = dcache_shootdown_ipi_recv;131 break;132 #endif133 127 default: 134 128 panic("Unknown IPI (%d).\n", ipi); -
kernel/arch/sparc64/src/trap/interrupt.c
r8d37a06 r2057572 45 45 #include <arch.h> 46 46 #include <mm/tlb.h> 47 #include <arch/mm/cache.h>48 47 #include <config.h> 49 48 #include <synch/spinlock.h> … … 92 91 if (data0 == (uintptr_t) tlb_shootdown_ipi_recv) { 93 92 tlb_shootdown_ipi_recv(); 94 #ifdef CONFIG_VIRT_IDX_DCACHE95 } else if (data0 == (uintptr_t) dcache_shootdown_ipi_recv) {96 dcache_shootdown_ipi_recv();97 #endif98 93 } 99 94 #endif -
kernel/genarch/src/fb/fb.c
r8d37a06 r2057572 512 512 sysinfo_set_item_val("fb.visual", NULL, visual); 513 513 sysinfo_set_item_val("fb.address.physical", NULL, addr); 514 sysinfo_set_item_val("fb.address.color", NULL,515 PAGE_COLOR((uintptr_t) fbaddress));516 514 sysinfo_set_item_val("fb.invert-colors", NULL, invert_colors); 517 515 -
kernel/genarch/src/mm/page_ht.c
r8d37a06 r2057572 56 56 static void remove_callback(link_t *item); 57 57 58 static void ht_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags); 58 static void ht_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, 59 int flags); 59 60 static void ht_mapping_remove(as_t *as, uintptr_t page); 60 61 static pte_t *ht_mapping_find(as_t *as, uintptr_t page); … … 104 105 * hash index. 105 106 */ 106 index = ((page >> PAGE_WIDTH) & (PAGE_HT_ENTRIES -1));107 index = ((page >> PAGE_WIDTH) & (PAGE_HT_ENTRIES - 1)); 107 108 108 109 /* … … 111 112 * hash index. 112 113 */ 113 index |= ((unative_t) as) & (PAGE_HT_ENTRIES -1);114 index |= ((unative_t) as) & (PAGE_HT_ENTRIES - 1); 114 115 115 116 return index; … … 137 138 138 139 if (keys == PAGE_HT_KEYS) { 139 return (key[KEY_AS] == (uintptr_t) t->as) && (key[KEY_PAGE] == t->page); 140 return (key[KEY_AS] == (uintptr_t) t->as) && 141 (key[KEY_PAGE] == t->page); 140 142 } else { 141 143 return (key[KEY_AS] == (uintptr_t) t->as); … … 176 178 { 177 179 pte_t *t; 178 unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 180 unative_t key[2] = { 181 (uintptr_t) as, 182 page = ALIGN_DOWN(page, PAGE_SIZE) 183 }; 179 184 180 185 if (!hash_table_find(&page_ht, key)) { … … 210 215 void ht_mapping_remove(as_t *as, uintptr_t page) 211 216 { 212 unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 217 unative_t key[2] = { 218 (uintptr_t) as, 219 page = ALIGN_DOWN(page, PAGE_SIZE) 220 }; 213 221 214 222 /* … … 235 243 link_t *hlp; 236 244 pte_t *t = NULL; 237 unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 245 unative_t key[2] = { 246 (uintptr_t) as, 247 page = ALIGN_DOWN(page, PAGE_SIZE) 248 }; 238 249 239 250 hlp = hash_table_find(&page_ht, key); -
kernel/generic/src/console/klog.c
r8d37a06 r2057572 91 91 92 92 sysinfo_set_item_val("klog.faddr", NULL, (unative_t) faddr); 93 sysinfo_set_item_val("klog.fcolor", NULL, (unative_t)94 PAGE_COLOR((uintptr_t) klog));95 93 sysinfo_set_item_val("klog.pages", NULL, 1 << KLOG_ORDER); 96 94 sysinfo_set_item_val("klog.devno", NULL, devno); -
kernel/generic/src/ddi/ddi.c
r8d37a06 r2057572 100 100 * syscall, ENOENT if there is no task matching the specified ID or the 101 101 * physical address space is not enabled for mapping and ENOMEM if there 102 * was a problem in creating address space area. ENOTSUP is returned when 103 * an attempt to create an illegal address alias is detected. 102 * was a problem in creating address space area. 104 103 */ 105 104 static int ddi_physmem_map(uintptr_t pf, uintptr_t vp, count_t pages, int flags) … … 140 139 return ENOENT; 141 140 } 142 143 #ifdef CONFIG_VIRT_IDX_DCACHE144 if (PAGE_COLOR(parea->vbase) != PAGE_COLOR(vp)) {145 /*146 * Refuse to create an illegal address alias.147 */148 spinlock_unlock(&parea_lock);149 interrupts_restore(ipl);150 return ENOTSUP;151 }152 #endif /* CONFIG_VIRT_IDX_DCACHE */153 154 141 spinlock_unlock(&parea_lock); 155 142 -
kernel/generic/src/lib/rd.c
r8d37a06 r2057572 91 91 sysinfo_set_item_val("rd.address.physical", NULL, (unative_t) 92 92 KA2PA((void *) header + hsize)); 93 sysinfo_set_item_val("rd.address.color", NULL, (unative_t)94 PAGE_COLOR((uintptr_t) header + hsize));95 93 96 94 return RE_OK; -
kernel/generic/src/mm/as.c
r8d37a06 r2057572 614 614 * or ENOMEM if there was a problem in allocating destination address space 615 615 * area. ENOTSUP is returned if the address space area backend does not support 616 * sharing or if the kernel detects an attempt to create an illegal address 617 * alias. 616 * sharing. 618 617 */ 619 618 int as_area_share(as_t *src_as, uintptr_t src_base, size_t acc_size, … … 667 666 return EPERM; 668 667 } 669 670 #ifdef CONFIG_VIRT_IDX_DCACHE671 if (!(dst_flags_mask & AS_AREA_EXEC)) {672 if (PAGE_COLOR(src_area->base) != PAGE_COLOR(dst_base)) {673 /*674 * Refuse to create an illegal address alias.675 */676 mutex_unlock(&src_area->lock);677 mutex_unlock(&src_as->lock);678 interrupts_restore(ipl);679 return ENOTSUP;680 }681 }682 #endif /* CONFIG_VIRT_IDX_DCACHE */683 668 684 669 /* … … 902 887 * ASID. 903 888 */ 904 905 906 889 ASSERT(old_as->asid != ASID_INVALID); 890 list_append(&old_as->inactive_as_with_asid_link, 891 &inactive_as_with_asid_head); 907 892 } 908 893 mutex_unlock(&old_as->lock); -
kernel/generic/src/mm/backend_anon.c
r8d37a06 r2057572 158 158 panic("Could not insert used space.\n"); 159 159 160 #ifdef CONFIG_VIRT_IDX_DCACHE161 if (dirty && PAGE_COLOR(PA2KA(frame)) != PAGE_COLOR(addr)) {162 /*163 * By writing to the frame using kernel virtual address,164 * we have created an illegal virtual alias. We now have to165 * invalidate cachelines belonging to addr on all processors166 * so that they will be reloaded with the new content on next167 * read.168 */169 dcache_flush_frame(addr, frame);170 dcache_shootdown_start(DCACHE_INVL_FRAME, PAGE_COLOR(addr), frame);171 dcache_shootdown_finalize();172 }173 #endif174 175 160 return AS_PF_OK; 176 161 } … … 241 226 /** @} 242 227 */ 243 -
kernel/generic/src/mm/backend_elf.c
r8d37a06 r2057572 209 209 if (!used_space_insert(area, ALIGN_DOWN(addr, PAGE_SIZE), 1)) 210 210 panic("Could not insert used space.\n"); 211 212 #ifdef CONFIG_VIRT_IDX_DCACHE213 if (dirty && PAGE_COLOR(PA2KA(frame)) != PAGE_COLOR(addr)) {214 /*215 * By writing to the frame using kernel virtual address,216 * we have created an illegal virtual alias. We now have to217 * invalidate cachelines belonging to addr on all processors218 * so that they will be reloaded with the new content on next219 * read.220 */221 dcache_flush_frame(addr, frame);222 dcache_shootdown_start(DCACHE_INVL_FRAME, PAGE_COLOR(addr), frame);223 dcache_shootdown_finalize();224 }225 #endif226 211 227 212 return AS_PF_OK; … … 356 341 /** @} 357 342 */ 358 -
kernel/generic/src/time/clock.c
r8d37a06 r2057572 105 105 */ 106 106 sysinfo_set_item_val("clock.cacheable", NULL, (unative_t) true); 107 sysinfo_set_item_val("clock.fcolor", NULL, (unative_t)108 PAGE_COLOR(clock_parea.vbase));109 107 sysinfo_set_item_val("clock.faddr", NULL, (unative_t) faddr); 110 108 } -
uspace/fb/ega.c
r8d37a06 r2057572 316 316 317 317 sz = scr_width * scr_height * 2; 318 scr_addr = as_get_mappable_page(sz, (int) 319 sysinfo_value("fb.address.color")); 318 scr_addr = as_get_mappable_page(sz); 320 319 321 320 physmem_map(ega_ph_addr, scr_addr, ALIGN_UP(sz, PAGE_SIZE) >> -
uspace/fb/fb.c
r8d37a06 r2057572 756 756 /* We accept one area for data interchange */ 757 757 if (IPC_GET_ARG1(*call) == shm_id) { 758 void *dest = as_get_mappable_page(IPC_GET_ARG2(*call), 759 PAGE_COLOR(IPC_GET_ARG1(*call))); 758 void *dest = as_get_mappable_page(IPC_GET_ARG2(*call)); 760 759 shm_size = IPC_GET_ARG2(*call); 761 760 if (!ipc_answer_fast(callid, 0, (sysarg_t) dest, 0)) … … 1370 1369 1371 1370 asz = fb_scanline * fb_height; 1372 fb_addr = as_get_mappable_page(asz, (int) 1373 sysinfo_value("fb.address.color")); 1371 fb_addr = as_get_mappable_page(asz); 1374 1372 1375 1373 physmem_map(fb_ph_addr, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >> -
uspace/fb/main.c
r8d37a06 r2057572 44 44 void *dest; 45 45 46 dest = as_get_mappable_page(IPC_GET_ARG2(*call), 47 PAGE_COLOR(IPC_GET_ARG1(*call))); 46 dest = as_get_mappable_page(IPC_GET_ARG2(*call)); 48 47 if (ipc_answer_fast(callid, 0, (sysarg_t) dest, 0) == 0) { 49 48 if (*area) -
uspace/klog/klog.c
r8d37a06 r2057572 63 63 printf("Kernel console output.\n"); 64 64 65 mapping = as_get_mappable_page(PAGE_SIZE , sysinfo_value("klog.fcolor"));65 mapping = as_get_mappable_page(PAGE_SIZE); 66 66 res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV, 67 67 (sysarg_t) mapping, PAGE_SIZE, SERVICE_MEM_KLOG, -
uspace/libc/arch/sparc64/_link.ld.in
r8d37a06 r2057572 8 8 9 9 SECTIONS { 10 . = 0x 2000;10 . = 0x4000; 11 11 12 .init ALIGN(0x 2000) : SUBALIGN(0x2000) {12 .init ALIGN(0x4000) : SUBALIGN(0x4000) { 13 13 *(.init); 14 14 } :text … … 18 18 } :text 19 19 20 .got ALIGN(0x 2000) : SUBALIGN(0x2000) {20 .got ALIGN(0x4000) : SUBALIGN(0x4000) { 21 21 _gp = .; 22 22 *(.got*); 23 23 } :data 24 .data ALIGN(0x 2000) : SUBALIGN(0x2000) {24 .data ALIGN(0x4000) : SUBALIGN(0x4000) { 25 25 *(.data); 26 26 *(.sdata); … … 42 42 } :data 43 43 44 . = ALIGN(0x 2000);44 . = ALIGN(0x4000); 45 45 _heap = .; 46 46 -
uspace/libc/arch/sparc64/include/config.h
r8d37a06 r2057572 36 36 #define LIBC_sparc64_CONFIG_H_ 37 37 38 #define PAGE_WIDTH 1 339 #define PAGE_SIZE (1 <<PAGE_WIDTH)40 #define PAGE_COLOR_BITS 1 /**< Bit 13 is the page color. */38 #define PAGE_WIDTH 14 39 #define PAGE_SIZE (1 << PAGE_WIDTH) 40 #define PAGE_COLOR_BITS 0 /**< Only one page color. */ 41 41 42 42 #endif -
uspace/libc/arch/sparc64/include/stack.h
r8d37a06 r2057572 44 44 * 16-extended-word save area for %i[0-7] and %l[0-7] registers. 45 45 */ 46 #define STACK_WINDOW_SAVE_AREA_SIZE (16 *STACK_ITEM_SIZE)46 #define STACK_WINDOW_SAVE_AREA_SIZE (16 * STACK_ITEM_SIZE) 47 47 48 48 /** -
uspace/libc/generic/as.c
r8d37a06 r2057572 56 56 { 57 57 return (void *) __SYSCALL3(SYS_AS_AREA_CREATE, (sysarg_t ) address, 58 58 (sysarg_t) size, (sysarg_t) flags); 59 59 } 60 60 … … 70 70 int as_area_resize(void *address, size_t size, int flags) 71 71 { 72 return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t)73 72 return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, 73 (sysarg_t) size, (sysarg_t) flags); 74 74 } 75 75 … … 144 144 * 145 145 * @param sz Requested size of the allocation. 146 * @param color Requested virtual color of the allocation.147 146 * 148 147 * @return Pointer to the beginning … … 151 150 * the pointer to last area 152 151 */ 153 void *as_get_mappable_page(size_t sz , int color)152 void *as_get_mappable_page(size_t sz) 154 153 { 155 154 void *res; … … 167 166 168 167 /* 169 * Make sure we allocate from naturally aligned address and a page of 170 * appropriate color. 168 * Make sure we allocate from naturally aligned address. 171 169 */ 172 170 i = 0; 173 do { 174 if (!last_allocated) { 175 last_allocated = (void *) ALIGN_UP((void *) &_heap + 176 maxheapsize, asz); 177 } else { 178 last_allocated = (void *) ALIGN_UP(((uintptr_t) 179 last_allocated) + (int) (i > 0), asz); 180 } 181 } while ((asz < (1 << (PAGE_COLOR_BITS + PAGE_WIDTH))) && 182 (PAGE_COLOR((uintptr_t) last_allocated) != color) && 183 (++i < (1 << PAGE_COLOR_BITS))); 171 if (!last_allocated) { 172 last_allocated = (void *) ALIGN_UP((void *) &_heap + 173 maxheapsize, asz); 174 } else { 175 last_allocated = (void *) ALIGN_UP(((uintptr_t) 176 last_allocated) + (int) (i > 0), asz); 177 } 184 178 185 179 res = last_allocated; -
uspace/libc/generic/mman.c
r8d37a06 r2057572 37 37 #include <unistd.h> 38 38 39 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) 39 void *mmap(void *start, size_t length, int prot, int flags, int fd, 40 off_t offset) 40 41 { 41 42 if (!start) 42 start = as_get_mappable_page(length , 0);43 start = as_get_mappable_page(length); 43 44 44 45 // if (! ((flags & MAP_SHARED) ^ (flags & MAP_PRIVATE))) -
uspace/libc/generic/time.c
r8d37a06 r2057572 73 73 74 74 if (!ktime) { 75 mapping = as_get_mappable_page(PAGE_SIZE, (int) 76 sysinfo_value("clock.fcolor")); 75 mapping = as_get_mappable_page(PAGE_SIZE); 77 76 /* Get the mapping of kernel clock */ 78 res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV, (sysarg_t)79 mapping, PAGE_SIZE, SERVICE_MEM_REALTIME, NULL, &rights,80 77 res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV, 78 (sysarg_t) mapping, PAGE_SIZE, SERVICE_MEM_REALTIME, NULL, 79 &rights, NULL); 81 80 if (res) { 82 81 printf("Failed to initialize timeofday memarea\n"); -
uspace/libc/include/as.h
r8d37a06 r2057572 41 41 #include <libarch/config.h> 42 42 43 #define PAGE_COLOR(va) (((va) >> PAGE_WIDTH) & ((1 << PAGE_COLOR_BITS) - 1))44 45 43 extern void *as_area_create(void *address, size_t size, int flags); 46 44 extern int as_area_resize(void *address, size_t size, int flags); 47 45 extern int as_area_destroy(void *address); 48 46 extern void *set_maxheapsize(size_t mhs); 49 extern void * as_get_mappable_page(size_t sz , int color);47 extern void * as_get_mappable_page(size_t sz); 50 48 51 49 #endif -
uspace/ns/ns.c
r8d37a06 r2057572 84 84 static void *klogaddr = NULL; 85 85 86 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, char *colstr,void **addr)86 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, void **addr) 87 87 { 88 88 void *ph_addr; 89 int ph_color;90 89 91 90 if (!*addr) { … … 95 94 return; 96 95 } 97 ph_color = (int) sysinfo_value(colstr); 98 *addr = as_get_mappable_page(PAGE_SIZE, ph_color); 96 *addr = as_get_mappable_page(PAGE_SIZE); 99 97 physmem_map(ph_addr, *addr, 1, AS_AREA_READ | AS_AREA_CACHEABLE); 100 98 } … … 120 118 case SERVICE_MEM_REALTIME: 121 119 get_as_area(callid, &call, "clock.faddr", 122 "clock.fcolor",&clockaddr);120 &clockaddr); 123 121 break; 124 122 case SERVICE_MEM_KLOG: 125 123 get_as_area(callid, &call, "klog.faddr", 126 "klog.fcolor",&klogaddr);124 &klogaddr); 127 125 break; 128 126 default: -
uspace/rd/rd.c
r8d37a06 r2057572 74 74 size_t rd_size = sysinfo_value("rd.size"); 75 75 void * rd_ph_addr = (void *) sysinfo_value("rd.address.physical"); 76 int rd_color = (int) sysinfo_value("rd.address.color");77 76 78 77 if (rd_size == 0) 79 78 return false; 80 79 81 void * rd_addr = as_get_mappable_page(rd_size , rd_color);80 void * rd_addr = as_get_mappable_page(rd_size); 82 81 83 82 physmem_map(rd_ph_addr, rd_addr, ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE);
Note:
See TracChangeset
for help on using the changeset viewer.