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
ec146bb1
Commit
ec146bb1
authored
Jan 05, 2003
by
Richard Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ALPHA] Update for generic exception table cleanup.
parent
487cffcd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
52 deletions
+18
-52
arch/alpha/kernel/traps.c
arch/alpha/kernel/traps.c
+3
-2
arch/alpha/mm/extable.c
arch/alpha/mm/extable.c
+6
-37
arch/alpha/mm/fault.c
arch/alpha/mm/fault.c
+3
-2
include/asm-alpha/uaccess.h
include/asm-alpha/uaccess.h
+6
-11
No files found.
arch/alpha/kernel/traps.c
View file @
ec146bb1
...
...
@@ -14,6 +14,7 @@
#include <linux/tty.h>
#include <linux/delay.h>
#include <linux/smp_lock.h>
#include <linux/module.h>
#include <asm/gentrap.h>
#include <asm/uaccess.h>
...
...
@@ -465,7 +466,7 @@ do_entUna(void * va, unsigned long opcode, unsigned long reg,
{
long
error
,
tmp1
,
tmp2
,
tmp3
,
tmp4
;
unsigned
long
pc
=
regs
.
pc
-
4
;
unsigned
fixup
;
const
struct
exception_table_entry
*
fixup
;
unaligned
[
0
].
count
++
;
unaligned
[
0
].
va
=
(
unsigned
long
)
va
;
...
...
@@ -638,7 +639,7 @@ do_entUna(void * va, unsigned long opcode, unsigned long reg,
got_exception:
/* Ok, we caught the exception, but we don't want it. Is there
someone to pass it along to? */
if
((
fixup
=
search_exception_table
(
pc
))
!=
0
)
{
if
((
fixup
=
search_exception_table
s
(
pc
))
!=
0
)
{
unsigned
long
newpc
;
newpc
=
fixup_exception
(
una_reg
,
fixup
,
pc
);
...
...
arch/alpha/mm/extable.c
View file @
ec146bb1
...
...
@@ -6,13 +6,10 @@
#include <linux/module.h>
#include <asm/uaccess.h>
extern
const
struct
exception_table_entry
__start___ex_table
[];
extern
const
struct
exception_table_entry
__stop___ex_table
[];
static
inline
unsigned
search_one_table
(
const
struct
exception_table_entry
*
first
,
const
struct
exception_table_entry
*
last
,
unsigned
long
value
)
const
struct
exception_table_entry
*
search_extable
(
const
struct
exception_table_entry
*
first
,
const
struct
exception_table_entry
*
last
,
unsigned
long
value
)
{
while
(
first
<=
last
)
{
const
struct
exception_table_entry
*
mid
;
...
...
@@ -21,40 +18,12 @@ search_one_table(const struct exception_table_entry *first,
mid
=
(
last
-
first
)
/
2
+
first
;
mid_value
=
(
unsigned
long
)
&
mid
->
insn
+
mid
->
insn
;
if
(
mid_value
==
value
)
return
mid
->
fixup
.
unit
;
return
mid
;
else
if
(
mid_value
<
value
)
first
=
mid
+
1
;
else
last
=
mid
-
1
;
}
return
0
;
}
unsigned
search_exception_table
(
unsigned
long
addr
)
{
unsigned
ret
;
#ifndef CONFIG_MODULES
ret
=
search_one_table
(
__start___ex_table
,
__stop___ex_table
-
1
,
addr
);
#else
unsigned
long
flags
;
struct
list_head
*
i
;
ret
=
0
;
spin_lock_irqsave
(
&
modlist_lock
,
flags
);
list_for_each
(
i
,
&
extables
)
{
struct
exception_table
*
ex
=
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
);
if
(
ret
)
break
;
}
spin_unlock_irqrestore
(
&
modlist_lock
,
flags
);
#endif
return
ret
;
return
NULL
;
}
arch/alpha/mm/fault.c
View file @
ec146bb1
...
...
@@ -24,6 +24,7 @@
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <asm/system.h>
#include <asm/uaccess.h>
...
...
@@ -88,7 +89,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
{
struct
vm_area_struct
*
vma
;
struct
mm_struct
*
mm
=
current
->
mm
;
unsigned
int
fixup
;
const
struct
exception_table_entry
*
fixup
;
int
fault
,
si_code
=
SEGV_MAPERR
;
siginfo_t
info
;
...
...
@@ -176,7 +177,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
no_context:
/* Are we prepared to handle this fault as an exception? */
if
((
fixup
=
search_exception_table
(
regs
->
pc
))
!=
0
)
{
if
((
fixup
=
search_exception_table
s
(
regs
->
pc
))
!=
0
)
{
unsigned
long
newpc
;
newpc
=
fixup_exception
(
dpf_reg
,
fixup
,
regs
->
pc
);
regs
->
pc
=
newpc
;
...
...
include/asm-alpha/uaccess.h
View file @
ec146bb1
...
...
@@ -501,19 +501,14 @@ struct exception_table_entry
}
fixup
;
};
/* Returns 0 if exception not found and fixup.unit otherwise. */
extern
unsigned
search_exception_table
(
unsigned
long
);
/* Returns the new pc */
#define fixup_exception(map_reg, fixup
_unit, pc)
\
#define fixup_exception(map_reg, fixup
, pc)
\
({ \
union exception_fixup __fie_fixup; \
__fie_fixup.unit = fixup_unit; \
if (__fie_fixup.bits.valreg != 31) \
map_reg(__fie_fixup.bits.valreg) = 0; \
if (__fie_fixup.bits.errreg != 31) \
map_reg(__fie_fixup.bits.errreg) = -EFAULT; \
(pc) + __fie_fixup.bits.nextinsn; \
if ((fixup)->fixup.bits.valreg != 31) \
map_reg((fixup)->fixup.bits.valreg) = 0; \
if ((fixup)->fixup.bits.errreg != 31) \
map_reg((fixup)->fixup.bits.errreg) = -EFAULT; \
(pc) + (fixup)->fixup.bits.nextinsn; \
})
...
...
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