Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
f44ce2e5
Commit
f44ce2e5
authored
Apr 14, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] Use #defined constants for handle_mm_fault and __do_page_fault.
parent
03a3cda8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
arch/arm/mm/fault-common.c
arch/arm/mm/fault-common.c
+10
-8
No files found.
arch/arm/mm/fault-common.c
View file @
f44ce2e5
...
...
@@ -164,6 +164,9 @@ do_bad_area(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr,
__do_kernel_fault
(
mm
,
addr
,
fsr
,
regs
);
}
#define VM_FAULT_BADMAP (-20)
#define VM_FAULT_BADACCESS (-21)
static
int
__do_page_fault
(
struct
mm_struct
*
mm
,
unsigned
long
addr
,
unsigned
int
fsr
,
struct
task_struct
*
tsk
)
...
...
@@ -172,7 +175,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
int
fault
,
mask
;
vma
=
find_vma
(
mm
,
addr
);
fault
=
-
2
;
/* bad map area */
fault
=
VM_FAULT_BADMAP
;
if
(
!
vma
)
goto
out
;
if
(
vma
->
vm_start
>
addr
)
...
...
@@ -188,7 +191,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
else
mask
=
VM_WRITE
;
fault
=
-
1
;
/* bad access type */
fault
=
VM_FAULT_BADACCESS
;
if
(
!
(
vma
->
vm_flags
&
mask
))
goto
out
;
...
...
@@ -204,16 +207,15 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
* Handle the "normal" cases first - successful and sigbus
*/
switch
(
fault
)
{
case
2
:
case
VM_FAULT_MAJOR
:
tsk
->
maj_flt
++
;
return
fault
;
case
1
:
case
VM_FAULT_MINOR
:
tsk
->
min_flt
++
;
case
0
:
case
VM_FAULT_SIGBUS
:
return
fault
;
}
fault
=
-
3
;
/* out of memory */
if
(
tsk
->
pid
!=
1
)
goto
out
;
...
...
@@ -271,7 +273,7 @@ int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
if
(
!
user_mode
(
regs
))
goto
no_context
;
if
(
fault
==
-
3
)
{
if
(
fault
==
VM_FAULT_OOM
)
{
/*
* We ran out of memory, or some other thing happened to
* us that made us unable to handle the page fault gracefully.
...
...
@@ -279,7 +281,7 @@ int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
printk
(
"VM: killing process %s
\n
"
,
tsk
->
comm
);
do_exit
(
SIGKILL
);
}
else
__do_user_fault
(
tsk
,
addr
,
fsr
,
fault
==
-
1
?
__do_user_fault
(
tsk
,
addr
,
fsr
,
fault
==
VM_FAULT_BADACCESS
?
SEGV_ACCERR
:
SEGV_MAPERR
,
regs
);
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment