Changeset 3da11f37 in mainline for kernel/arch/sparc64/src/mm/sun4v/tlb.c
- Timestamp:
- 2009-11-28T20:19:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3f35634c
- Parents:
- 18baf9c0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/sun4v/tlb.c
r18baf9c0 r3da11f37 1 1 /* 2 2 * Copyright (c) 2005 Jakub Jermar 3 * Copyright (c) 2008 Pavel Rimsky 3 4 * All rights reserved. 4 5 * … … 52 53 #include <panic.h> 53 54 #include <arch/asm.h> 55 #include <arch/cpu.h> 56 #include <arch/mm/pagesize.h> 54 57 55 58 #ifdef CONFIG_TSB … … 518 521 void tlb_invalidate_asid(asid_t asid) 519 522 { 520 tlb_context_reg_t pc_save, ctx;521 522 523 /* switch to nucleus because we are mapped by the primary context */ 523 524 nucleus_enter(); 524 525 ctx.v = pc_save.v = mmu_primary_context_read(); 526 ctx.context = asid; 527 mmu_primary_context_write(ctx.v); 528 529 itlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_PRIMARY, 0); 530 dtlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_PRIMARY, 0); 531 532 mmu_primary_context_write(pc_save.v); 533 525 __hypercall_fast4(MMU_DEMAP_CTX, 0, 0, asid, 526 MMU_FLAG_ITLB | MMU_FLAG_DTLB); 527 534 528 nucleus_leave(); 535 529 } … … 545 539 { 546 540 unsigned int i; 547 tlb_context_reg_t pc_save, ctx;548 541 549 542 /* switch to nucleus because we are mapped by the primary context */ 550 543 nucleus_enter(); 551 552 ctx.v = pc_save.v = mmu_primary_context_read(); 553 ctx.context = asid; 554 mmu_primary_context_write(ctx.v); 555 556 for (i = 0; i < cnt * MMU_PAGES_PER_PAGE; i++) { 557 itlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_PRIMARY, 558 page + i * MMU_PAGE_SIZE); 559 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_PRIMARY, 560 page + i * MMU_PAGE_SIZE); 561 } 562 563 mmu_primary_context_write(pc_save.v); 564 544 545 for (i = 0; i < cnt; i++) { 546 __hypercall_fast5(MMU_DEMAP_PAGE, 0, 0, page, asid, 547 MMU_FLAG_DTLB | MMU_FLAG_ITLB); 548 } 549 565 550 nucleus_leave(); 566 551 }
Note:
See TracChangeset
for help on using the changeset viewer.