Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305256
b: refs/heads/master
c: fd37e75
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed May 14, 2012
1 parent 096acfe commit 9bda3fe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 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: 392c3822a6fc247c0708c9e52c0818d1fbc9d7d7
refs/heads/master: fd37e75ed56e3f9ddde15c57a9cbde8256221404
20 changes: 19 additions & 1 deletion trunk/arch/sh/mm/tlbex_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ static struct expevt_lookup expevt_lookup_table = {
.is_text_access = {1, 1, 0, 0, 0, 0, 0, 0}
};

static inline unsigned int
expevt_to_fault_code(unsigned long expevt)
{
if (expevt == 0xa40)
return FAULT_CODE_ITLB;
else if (expevt == 0x060)
return FAULT_CODE_WRITE;

return 0;
}

/*
This routine handles page faults that can be serviced just by refilling a
TLB entry from an existing page table entry. (This case represents a very
Expand All @@ -123,6 +134,7 @@ do_fast_page_fault(unsigned long long ssr_md, unsigned long long expevt,
unsigned long long protection_flags;
unsigned long long index;
unsigned long long expevt4;
unsigned int fault_code;

/* The next few lines implement a way of hashing EXPEVT into a
* small array index which can be used to lookup parameters
Expand All @@ -139,10 +151,16 @@ do_fast_page_fault(unsigned long long ssr_md, unsigned long long expevt,
index = expevt4 ^ (expevt4 >> 5);
index &= 7;

fault_code = expevt_to_fault_code(expevt);

protection_flags = expevt_lookup_table.protection_flags[index];

if (expevt_lookup_table.is_text_access[index])
set_thread_fault_code(FAULT_CODE_ITLB);
fault_code |= FAULT_CODE_ITLB;
if (!ssr_md)
fault_code |= FAULT_CODE_USER;

set_thread_fault_code(fault_code);

return handle_tlbmiss(protection_flags, address);
}

0 comments on commit 9bda3fe

Please sign in to comment.