-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nds32: MMU fault handling and page table management
This patch includes page fault handler, mmap and fixup implementations. Signed-off-by: Vincent Chen <vincentc@andestech.com> Signed-off-by: Greentime Hu <greentime@andestech.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
- Loading branch information
Greentime Hu
committed
Feb 22, 2018
1 parent
59fd53c
commit 664eec4
Showing
4 changed files
with
536 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
// Copyright (C) 2005-2017 Andes Technology Corporation | ||
|
||
#include <linux/linkage.h> | ||
#include <asm/page.h> | ||
|
||
.text | ||
ENTRY(copy_page) | ||
pushm $r2, $r10 | ||
movi $r2, PAGE_SIZE >> 5 | ||
.Lcopy_loop: | ||
lmw.bim $r3, [$r1], $r10 | ||
smw.bim $r3, [$r0], $r10 | ||
subi45 $r2, #1 | ||
bnez38 $r2, .Lcopy_loop | ||
popm $r2, $r10 | ||
ret | ||
ENDPROC(copy_page) | ||
|
||
ENTRY(clear_page) | ||
pushm $r1, $r9 | ||
movi $r1, PAGE_SIZE >> 5 | ||
movi55 $r2, #0 | ||
movi55 $r3, #0 | ||
movi55 $r4, #0 | ||
movi55 $r5, #0 | ||
movi55 $r6, #0 | ||
movi55 $r7, #0 | ||
movi55 $r8, #0 | ||
movi55 $r9, #0 | ||
.Lclear_loop: | ||
smw.bim $r2, [$r0], $r9 | ||
subi45 $r1, #1 | ||
bnez38 $r1, .Lclear_loop | ||
popm $r1, $r9 | ||
ret | ||
ENDPROC(clear_page) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
// Copyright (C) 2005-2017 Andes Technology Corporation | ||
|
||
#include <linux/extable.h> | ||
#include <linux/uaccess.h> | ||
|
||
int fixup_exception(struct pt_regs *regs) | ||
{ | ||
const struct exception_table_entry *fixup; | ||
|
||
fixup = search_exception_tables(instruction_pointer(regs)); | ||
if (fixup) | ||
regs->ipc = fixup->fixup; | ||
|
||
return fixup != NULL; | ||
} |
Oops, something went wrong.