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
154a5720
Commit
154a5720
authored
May 02, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: sort exception table
parent
16c017bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
arch/ppc64/kernel/setup.c
arch/ppc64/kernel/setup.c
+1
-0
arch/ppc64/mm/extable.c
arch/ppc64/mm/extable.c
+38
-2
No files found.
arch/ppc64/kernel/setup.c
View file @
154a5720
...
...
@@ -539,6 +539,7 @@ void __init setup_arch(char **cmdline_p)
ppc_md
.
setup_arch
();
paging_init
();
sort_exception_table
();
ppc_md
.
progress
(
"setup_arch: exit"
,
0x3eab
);
}
...
...
arch/ppc64/mm/extable.c
View file @
154a5720
...
...
@@ -9,11 +9,47 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/config.h>
#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
[];
extern
struct
exception_table_entry
__start___ex_table
[];
extern
struct
exception_table_entry
__stop___ex_table
[];
/*
* The exception table needs to be sorted because we use the macros
* 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
* segment and the main kernel text segment.
*/
static
inline
void
sort_ex_table
(
struct
exception_table_entry
*
start
,
struct
exception_table_entry
*
finish
)
{
struct
exception_table_entry
el
,
*
p
,
*
q
;
/* insertion sort */
for
(
p
=
start
+
1
;
p
<
finish
;
++
p
)
{
/* start .. p-1 is sorted */
if
(
p
[
0
].
insn
<
p
[
-
1
].
insn
)
{
/* move element p down to its right place */
el
=
*
p
;
q
=
p
;
do
{
/* el comes before q[-1], move q[-1] up one */
q
[
0
]
=
q
[
-
1
];
--
q
;
}
while
(
q
>
start
&&
el
.
insn
<
q
[
-
1
].
insn
);
*
q
=
el
;
}
}
}
void
sort_exception_table
(
void
)
{
sort_ex_table
(
__start___ex_table
,
__stop___ex_table
);
}
static
inline
unsigned
long
search_one_table
(
const
struct
exception_table_entry
*
first
,
...
...
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