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
8afe742b
Commit
8afe742b
authored
Oct 06, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: clean up exception table code, we werent taking the modlist_lock
parent
77d3065b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
arch/ppc64/mm/extable.c
arch/ppc64/mm/extable.c
+23
-18
No files found.
arch/ppc64/mm/extable.c
View file @
8afe742b
/*
/*
* linux/arch/ppc/mm/extable.c
* linux/arch/ppc
64
/mm/extable.c
*
*
* from linux/arch/i386/mm/extable.c
* from linux/arch/i386/mm/extable.c
*
*
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include <linux/config.h>
#include <linux/config.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
extern
struct
exception_table_entry
__start___ex_table
[];
extern
struct
exception_table_entry
__start___ex_table
[];
...
@@ -19,8 +20,7 @@ extern struct exception_table_entry __stop___ex_table[];
...
@@ -19,8 +20,7 @@ extern struct exception_table_entry __stop___ex_table[];
/*
/*
* The exception table needs to be sorted because we use the macros
* The exception table needs to be sorted because we use the macros
* which put things into the exception table in a variety of segments
* which put things into the exception table in a variety of segments
* such as the prep, pmac, chrp, etc. segments as well as the init
* as well as the init segment and the main kernel text segment.
* segment and the main kernel text segment.
*/
*/
static
inline
void
static
inline
void
sort_ex_table
(
struct
exception_table_entry
*
start
,
sort_ex_table
(
struct
exception_table_entry
*
start
,
...
@@ -56,43 +56,48 @@ search_one_table(const struct exception_table_entry *first,
...
@@ -56,43 +56,48 @@ search_one_table(const struct exception_table_entry *first,
const
struct
exception_table_entry
*
last
,
const
struct
exception_table_entry
*
last
,
unsigned
long
value
)
unsigned
long
value
)
{
{
while
(
first
<=
last
)
{
while
(
first
<=
last
)
{
const
struct
exception_table_entry
*
mid
;
const
struct
exception_table_entry
*
mid
;
long
diff
;
long
diff
;
mid
=
(
last
-
first
)
/
2
+
first
;
mid
=
(
last
-
first
)
/
2
+
first
;
diff
=
mid
->
insn
-
value
;
diff
=
mid
->
insn
-
value
;
if
(
diff
==
0
)
if
(
diff
==
0
)
{
return
mid
->
fixup
;
return
mid
->
fixup
;
else
if
(
diff
<
0
)
}
else
if
(
diff
<
0
)
first
=
mid
+
1
;
first
=
mid
+
1
;
else
else
last
=
mid
-
1
;
last
=
mid
-
1
;
}
}
return
0
;
return
0
;
}
}
extern
spinlock_t
modlist_lock
;
unsigned
long
unsigned
long
search_exception_table
(
unsigned
long
addr
)
search_exception_table
(
unsigned
long
addr
)
{
{
unsigned
long
ret
;
unsigned
long
ret
=
0
;
#ifndef CONFIG_MODULES
#ifndef CONFIG_MODULES
/* There is only the kernel to search. */
/* There is only the kernel to search. */
ret
=
search_one_table
(
__start___ex_table
,
__stop___ex_table
-
1
,
addr
);
ret
=
search_one_table
(
__start___ex_table
,
__stop___ex_table
-
1
,
addr
);
if
(
ret
)
return
ret
;
return
ret
;
#else
#else
unsigned
long
flags
;
/* The kernel is the last "module" -- no need to treat it special. */
/* The kernel is the last "module" -- no need to treat it special. */
struct
module
*
mp
;
struct
module
*
mp
;
spin_lock_irqsave
(
&
modlist_lock
,
flags
);
for
(
mp
=
module_list
;
mp
!=
NULL
;
mp
=
mp
->
next
)
{
for
(
mp
=
module_list
;
mp
!=
NULL
;
mp
=
mp
->
next
)
{
if
(
mp
->
ex_table_start
==
NULL
)
if
(
mp
->
ex_table_start
==
NULL
||
!
(
mp
->
flags
&
(
MOD_RUNNING
|
MOD_INITIALIZING
))
)
continue
;
continue
;
ret
=
search_one_table
(
mp
->
ex_table_start
,
ret
=
search_one_table
(
mp
->
ex_table_start
,
mp
->
ex_table_end
-
1
,
addr
);
mp
->
ex_table_end
-
1
,
addr
);
if
(
ret
)
if
(
ret
)
return
ret
;
break
;
}
}
spin_unlock_irqrestore
(
&
modlist_lock
,
flags
);
return
ret
;
#endif
#endif
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