Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47428
b: refs/heads/master
c: 9b87ed7
h: refs/heads/master
v: v3
  • Loading branch information
Hirokazu Takata authored and Linus Torvalds committed Feb 11, 2007
1 parent d196ad2 commit 9835cd0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9674dcf795a4c7384e4e42c8f38fcb87517b1a43
refs/heads/master: 9b87ed790714bd3a8d492feb24f6c48f8bb59c3a
40 changes: 19 additions & 21 deletions trunk/arch/m32r/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,10 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
if (!pte_present(*pte_k))
goto no_context;

addr = (address & PAGE_MASK) | (error_code & ACE_INSTRUCTION);
addr = (address & PAGE_MASK);
set_thread_fault_code(error_code);
update_mmu_cache(NULL, addr, *pte_k);
set_thread_fault_code(0);
return;
}
}
Expand All @@ -377,7 +379,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr,
pte_t pte)
{
unsigned long *entry1, *entry2;
volatile unsigned long *entry1, *entry2;
unsigned long pte_data, flags;
unsigned int *entry_dat;
int inst = get_thread_fault_code() & ACE_INSTRUCTION;
Expand All @@ -391,30 +393,26 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr,

vaddr = (vaddr & PAGE_MASK) | get_asid();

pte_data = pte_val(pte);

#ifdef CONFIG_CHIP_OPSP
entry1 = (unsigned long *)ITLB_BASE;
for(i = 0 ; i < NR_TLB_ENTRIES; i++) {
if(*entry1++ == vaddr) {
pte_data = pte_val(pte);
set_tlb_data(entry1, pte_data);
break;
}
entry1++;
for (i = 0; i < NR_TLB_ENTRIES; i++) {
if (*entry1++ == vaddr) {
set_tlb_data(entry1, pte_data);
break;
}
entry1++;
}
entry2 = (unsigned long *)DTLB_BASE;
for(i = 0 ; i < NR_TLB_ENTRIES ; i++) {
if(*entry2++ == vaddr) {
pte_data = pte_val(pte);
set_tlb_data(entry2, pte_data);
break;
}
entry2++;
for (i = 0; i < NR_TLB_ENTRIES; i++) {
if (*entry2++ == vaddr) {
set_tlb_data(entry2, pte_data);
break;
}
entry2++;
}
local_irq_restore(flags);
return;
#else
pte_data = pte_val(pte);

/*
* Update TLB entries
* entry1: ITLB entry address
Expand All @@ -439,6 +437,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr,
"i" (MSVA_offset), "i" (MTOP_offset), "i" (MIDXI_offset)
: "r4", "memory"
);
#endif

if ((!inst && entry2 >= DTLB_END) || (inst && entry1 >= ITLB_END))
goto notfound;
Expand Down Expand Up @@ -482,7 +481,6 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr,
set_tlb_data(entry1, pte_data);

goto found;
#endif
}

/*======================================================================*
Expand Down

0 comments on commit 9835cd0

Please sign in to comment.