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
nexedi
linux
Commits
7bf640b1
Commit
7bf640b1
authored
Jan 09, 2003
by
Rob Radez
Committed by
David S. Miller
Jan 09, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC32]: Copy over sparc64 exception table changes.
parent
60e7fd5e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
48 deletions
+30
-48
arch/sparc/kernel/unaligned.c
arch/sparc/kernel/unaligned.c
+2
-1
arch/sparc/mm/extable.c
arch/sparc/mm/extable.c
+24
-44
arch/sparc/mm/fault.c
arch/sparc/mm/fault.c
+3
-2
include/asm-sparc/uaccess.h
include/asm-sparc/uaccess.h
+1
-1
No files found.
arch/sparc/kernel/unaligned.c
View file @
7bf640b1
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <asm/ptrace.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/system.h>
...
@@ -342,7 +343,7 @@ void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("ke
...
@@ -342,7 +343,7 @@ void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("ke
void
kernel_mna_trap_fault
(
struct
pt_regs
*
regs
,
unsigned
int
insn
)
void
kernel_mna_trap_fault
(
struct
pt_regs
*
regs
,
unsigned
int
insn
)
{
{
unsigned
long
g2
=
regs
->
u_regs
[
UREG_G2
];
unsigned
long
g2
=
regs
->
u_regs
[
UREG_G2
];
unsigned
long
fixup
=
search_ex
ception_table
(
regs
->
pc
,
&
g2
);
unsigned
long
fixup
=
search_ex
tables_range
(
regs
->
pc
,
&
g2
);
if
(
!
fixup
)
{
if
(
!
fixup
)
{
unsigned
long
address
=
compute_effective_address
(
regs
,
insn
);
unsigned
long
address
=
compute_effective_address
(
regs
,
insn
);
...
...
arch/sparc/mm/extable.c
View file @
7bf640b1
...
@@ -6,13 +6,11 @@
...
@@ -6,13 +6,11 @@
#include <linux/module.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
extern
const
struct
exception_table_entry
__start___ex_table
[];
/* Caller knows they are in a range if ret->fixup == 0 */
extern
const
struct
exception_table_entry
__stop___ex_table
[];
const
struct
exception_table_entry
*
search_extable
(
const
struct
exception_table_entry
*
start
,
static
unsigned
long
const
struct
exception_table_entry
*
last
,
search_one_table
(
const
struct
exception_table_entry
*
start
,
unsigned
long
value
)
const
struct
exception_table_entry
*
end
,
unsigned
long
value
,
unsigned
long
*
g2
)
{
{
const
struct
exception_table_entry
*
walk
;
const
struct
exception_table_entry
*
walk
;
...
@@ -30,7 +28,7 @@ search_one_table(const struct exception_table_entry *start,
...
@@ -30,7 +28,7 @@ search_one_table(const struct exception_table_entry *start,
*/
*/
/* 1. Try to find an exact match. */
/* 1. Try to find an exact match. */
for
(
walk
=
start
;
walk
<=
end
;
walk
++
)
{
for
(
walk
=
start
;
walk
<=
last
;
walk
++
)
{
if
(
walk
->
fixup
==
0
)
{
if
(
walk
->
fixup
==
0
)
{
/* A range entry, skip both parts. */
/* A range entry, skip both parts. */
walk
++
;
walk
++
;
...
@@ -38,55 +36,37 @@ search_one_table(const struct exception_table_entry *start,
...
@@ -38,55 +36,37 @@ search_one_table(const struct exception_table_entry *start,
}
}
if
(
walk
->
insn
==
value
)
if
(
walk
->
insn
==
value
)
return
walk
->
fixup
;
return
walk
;
}
}
/* 2. Try to find a range match. */
/* 2. Try to find a range match. */
for
(
walk
=
start
;
walk
<=
(
end
-
1
);
walk
++
)
{
for
(
walk
=
start
;
walk
<=
(
last
-
1
);
walk
++
)
{
if
(
walk
->
fixup
)
if
(
walk
->
fixup
)
continue
;
continue
;
if
(
walk
[
0
].
insn
<=
value
&&
if
(
walk
[
0
].
insn
<=
value
&&
walk
[
1
].
insn
>
value
)
walk
[
1
].
insn
>
value
)
{
return
walk
;
*
g2
=
(
value
-
walk
[
0
].
insn
)
/
4
;
return
walk
[
1
].
fixup
;
}
walk
++
;
walk
++
;
}
}
return
0
;
return
NULL
;
}
}
extern
spinlock_t
modlist_lock
;
/* Special extable search, which handles ranges. Returns fixup */
unsigned
long
search_extables_range
(
unsigned
long
addr
,
unsigned
long
*
g2
)
unsigned
long
search_exception_table
(
unsigned
long
addr
,
unsigned
long
*
g2
)
{
{
unsigned
long
ret
=
0
;
const
struct
exception_table_entry
*
entry
;
#ifndef CONFIG_MODULES
entry
=
search_exception_tables
(
addr
);
/* There is only the kernel to search. */
if
(
!
entry
)
ret
=
search_one_table
(
__start___ex_table
,
return
0
;
__stop___ex_table
-
1
,
addr
,
g2
);
return
ret
;
#else
unsigned
long
flags
;
struct
list_head
*
i
;
/* The kernel is the last "module" -- no need to treat it special. */
/* Inside range? Fix g2 and return correct fixup */
spin_lock_irqsave
(
&
modlist_lock
,
flags
);
if
(
!
entry
->
fixup
)
{
list_for_each
(
i
,
&
extables
)
{
*
g2
=
(
addr
-
entry
->
insn
)
/
4
;
struct
exception_table
*
ex
=
return
(
entry
+
1
)
->
fixup
;
list_entry
(
i
,
struct
exception_table
,
list
);
if
(
ex
->
num_entries
==
0
)
continue
;
ret
=
search_one_table
(
ex
->
entry
,
ex
->
entry
+
ex
->
num_entries
-
1
,
addr
,
g2
);
if
(
ret
)
break
;
}
}
spin_unlock_irqrestore
(
&
modlist_lock
,
flags
);
return
ret
;
return
entry
->
fixup
;
#endif
}
}
arch/sparc/mm/fault.c
View file @
7bf640b1
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <linux/smp.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/smp_lock.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/segment.h>
#include <asm/segment.h>
...
@@ -161,7 +162,7 @@ asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc,
...
@@ -161,7 +162,7 @@ asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc,
unsigned
int
insn
;
unsigned
int
insn
;
int
i
;
int
i
;
i
=
search_ex
ception_tabl
e
(
ret_pc
,
&
g2
);
i
=
search_ex
tables_rang
e
(
ret_pc
,
&
g2
);
switch
(
i
)
{
switch
(
i
)
{
case
3
:
case
3
:
/* load & store will be handled by fixup */
/* load & store will be handled by fixup */
...
@@ -316,7 +317,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
...
@@ -316,7 +317,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
/* Is this in ex_table? */
/* Is this in ex_table? */
no_context:
no_context:
g2
=
regs
->
u_regs
[
UREG_G2
];
g2
=
regs
->
u_regs
[
UREG_G2
];
if
(
!
from_user
&&
(
fixup
=
search_ex
ception_table
(
regs
->
pc
,
&
g2
)))
{
if
(
!
from_user
&&
(
fixup
=
search_ex
tables_range
(
regs
->
pc
,
&
g2
)))
{
if
(
fixup
>
10
)
{
/* Values below are reserved for other things */
if
(
fixup
>
10
)
{
/* Values below are reserved for other things */
extern
const
unsigned
__memset_start
[];
extern
const
unsigned
__memset_start
[];
extern
const
unsigned
__memset_end
[];
extern
const
unsigned
__memset_end
[];
...
...
include/asm-sparc/uaccess.h
View file @
7bf640b1
...
@@ -78,7 +78,7 @@ struct exception_table_entry
...
@@ -78,7 +78,7 @@ struct exception_table_entry
};
};
/* Returns 0 if exception not found and fixup otherwise. */
/* Returns 0 if exception not found and fixup otherwise. */
extern
unsigned
long
search_ex
ception_table
(
unsigned
long
,
unsigned
long
*
);
extern
unsigned
long
search_ex
tables_range
(
unsigned
long
addr
,
unsigned
long
*
g2
);
extern
void
__ret_efault
(
void
);
extern
void
__ret_efault
(
void
);
...
...
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