diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-05-14 02:07:52 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-05-14 02:07:52 -0400 |
commit | 9a7b7739f9dba4014fc93531e4c2b6efac41b0a7 (patch) | |
tree | 8f9f69de41c2b46f3c1e174e4b0676ca9f53dece /arch/sh/mm/tlbflush_64.c | |
parent | 5a1dc78a38bfb04159a08cd493e5b3d844939e6c (diff) |
sh64: Utilize thread fault code encoding.
This plugs in fault code encoding for the sh64 page fault, too.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/tlbflush_64.c')
-rw-r--r-- | arch/sh/mm/tlbflush_64.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c index be01f92f8c89..99c5833036be 100644 --- a/arch/sh/mm/tlbflush_64.c +++ b/arch/sh/mm/tlbflush_64.c | |||
@@ -61,15 +61,17 @@ static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address) | |||
61 | * and the problem, and then passes it off to one of the appropriate | 61 | * and the problem, and then passes it off to one of the appropriate |
62 | * routines. | 62 | * routines. |
63 | */ | 63 | */ |
64 | asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess, | 64 | asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, |
65 | unsigned long textaccess, unsigned long address) | 65 | unsigned long address) |
66 | { | 66 | { |
67 | struct task_struct *tsk; | 67 | struct task_struct *tsk; |
68 | struct mm_struct *mm; | 68 | struct mm_struct *mm; |
69 | struct vm_area_struct * vma; | 69 | struct vm_area_struct * vma; |
70 | const struct exception_table_entry *fixup; | 70 | const struct exception_table_entry *fixup; |
71 | int write = error_code & FAULT_CODE_WRITE; | ||
72 | int textaccess = error_code & FAULT_CODE_ITLB; | ||
71 | unsigned int flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | | 73 | unsigned int flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | |
72 | (writeaccess ? FAULT_FLAG_WRITE : 0)); | 74 | (write ? FAULT_FLAG_WRITE : 0)); |
73 | pte_t *pte; | 75 | pte_t *pte; |
74 | int fault; | 76 | int fault; |
75 | 77 | ||
@@ -122,7 +124,7 @@ good_area: | |||
122 | if (!(vma->vm_flags & VM_EXEC)) | 124 | if (!(vma->vm_flags & VM_EXEC)) |
123 | goto bad_area; | 125 | goto bad_area; |
124 | } else { | 126 | } else { |
125 | if (writeaccess) { | 127 | if (write) { |
126 | if (!(vma->vm_flags & VM_WRITE)) | 128 | if (!(vma->vm_flags & VM_WRITE)) |
127 | goto bad_area; | 129 | goto bad_area; |
128 | } else { | 130 | } else { |
@@ -239,7 +241,7 @@ no_context: | |||
239 | printk(KERN_ALERT "Unable to handle kernel paging request"); | 241 | printk(KERN_ALERT "Unable to handle kernel paging request"); |
240 | printk(" at virtual address %08lx\n", address); | 242 | printk(" at virtual address %08lx\n", address); |
241 | printk(KERN_ALERT "pc = %08Lx%08Lx\n", regs->pc >> 32, regs->pc & 0xffffffff); | 243 | printk(KERN_ALERT "pc = %08Lx%08Lx\n", regs->pc >> 32, regs->pc & 0xffffffff); |
242 | die("Oops", regs, writeaccess); | 244 | die("Oops", regs, error_code); |
243 | do_exit(SIGKILL); | 245 | do_exit(SIGKILL); |
244 | 246 | ||
245 | /* | 247 | /* |