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
6be84779
Commit
6be84779
authored
Jan 27, 2004
by
David Mosberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ia64: Implement exception-table sorting for real.
parent
b6f995cc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
12 deletions
+53
-12
arch/ia64/kernel/unaligned.c
arch/ia64/kernel/unaligned.c
+2
-2
arch/ia64/mm/extable.c
arch/ia64/mm/extable.c
+45
-3
arch/ia64/mm/fault.c
arch/ia64/mm/fault.c
+1
-1
include/asm-ia64/uaccess.h
include/asm-ia64/uaccess.h
+5
-6
No files found.
arch/ia64/kernel/unaligned.c
View file @
6be84779
/*
/*
* Architecture-specific unaligned trap handling.
* Architecture-specific unaligned trap handling.
*
*
* Copyright (C) 1999-2002 Hewlett-Packard Co
* Copyright (C) 1999-2002
, 2004
Hewlett-Packard Co
* Stephane Eranian <eranian@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com>
* David Mosberger-Tang <davidm@hpl.hp.com>
* David Mosberger-Tang <davidm@hpl.hp.com>
*
*
...
@@ -1328,7 +1328,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
...
@@ -1328,7 +1328,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
* handler into reading an arbitrary kernel addresses...
* handler into reading an arbitrary kernel addresses...
*/
*/
if
(
!
user_mode
(
regs
))
if
(
!
user_mode
(
regs
))
eh
=
SEARCH_EXCEPTION_TABLE
(
regs
);
eh
=
search_exception_tables
(
regs
->
cr_iip
+
ia64_psr
(
regs
)
->
ri
);
if
(
user_mode
(
regs
)
||
eh
)
{
if
(
user_mode
(
regs
)
||
eh
)
{
if
((
current
->
thread
.
flags
&
IA64_THREAD_UAC_SIGBUS
)
!=
0
)
if
((
current
->
thread
.
flags
&
IA64_THREAD_UAC_SIGBUS
)
!=
0
)
goto
force_sigbus
;
goto
force_sigbus
;
...
...
arch/ia64/mm/extable.c
View file @
6be84779
/*
/*
* Kernel exception handling table support. Derived from arch/alpha/mm/extable.c.
* Kernel exception handling table support. Derived from arch/alpha/mm/extable.c.
*
*
* Copyright (C) 1998, 1999, 2001-2002 Hewlett-Packard Co
* Copyright (C) 1998, 1999, 2001-2002
, 2004
Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
*/
...
@@ -10,9 +10,51 @@
...
@@ -10,9 +10,51 @@
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/module.h>
#include <asm/module.h>
void
sort_extable
(
struct
exception_table_entry
*
start
,
static
inline
int
struct
exception_table_entry
*
finish
)
compare_entries
(
struct
exception_table_entry
*
l
,
struct
exception_table_entry
*
r
)
{
{
u64
lip
=
(
u64
)
&
l
->
addr
+
l
->
addr
;
u64
rip
=
(
u64
)
&
r
->
addr
+
r
->
addr
;
if
(
lip
<
rip
)
return
-
1
;
if
(
lip
==
rip
)
return
0
;
else
return
1
;
}
static
inline
void
swap_entries
(
struct
exception_table_entry
*
l
,
struct
exception_table_entry
*
r
)
{
u64
delta
=
(
u64
)
r
-
(
u64
)
l
;
struct
exception_table_entry
tmp
;
tmp
=
*
l
;
l
->
addr
=
r
->
addr
+
delta
;
l
->
cont
=
r
->
cont
+
delta
;
r
->
addr
=
tmp
.
addr
-
delta
;
r
->
cont
=
tmp
.
cont
-
delta
;
}
/*
* Sort the exception table. It's usually already sorted, but there may be unordered
* entries due to multiple text sections (such as the .init text section). Note that the
* exception-table-entries contain location-relative addresses, which requires a bit of
* care during sorting to avoid overflows in the offset members (e.g., it would not be
* safe to make a temporary copy of an exception-table entry on the stack, because the
* stack may be more than 2GB away from the exception-table).
*/
void
sort_extable
(
struct
exception_table_entry
*
start
,
struct
exception_table_entry
*
finish
)
{
struct
exception_table_entry
*
p
,
*
q
;
/* insertion sort */
for
(
p
=
start
+
1
;
p
<
finish
;
++
p
)
/* start .. p-1 is sorted; push p down to it's proper place */
for
(
q
=
p
;
q
>
start
&&
compare_entries
(
&
q
[
0
],
&
q
[
-
1
])
<
0
;
--
q
)
swap_entries
(
&
q
[
0
],
&
q
[
-
1
]);
}
}
const
struct
exception_table_entry
*
const
struct
exception_table_entry
*
...
...
arch/ia64/mm/fault.c
View file @
6be84779
...
@@ -58,7 +58,7 @@ mapped_kernel_page_is_present (unsigned long address)
...
@@ -58,7 +58,7 @@ mapped_kernel_page_is_present (unsigned long address)
if
(
pgd_none
(
*
pgd
)
||
pgd_bad
(
*
pgd
))
if
(
pgd_none
(
*
pgd
)
||
pgd_bad
(
*
pgd
))
return
0
;
return
0
;
pmd
=
pmd_offset
(
pgd
,
address
);
pmd
=
pmd_offset
(
pgd
,
address
);
if
(
pmd_none
(
*
pmd
)
||
pmd_bad
(
*
pmd
))
if
(
pmd_none
(
*
pmd
)
||
pmd_bad
(
*
pmd
))
return
0
;
return
0
;
...
...
include/asm-ia64/uaccess.h
View file @
6be84779
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
*
*
* Based on <asm-alpha/uaccess.h>.
* Based on <asm-alpha/uaccess.h>.
*
*
* Copyright (C) 1998, 1999, 2001-200
3
Hewlett-Packard Co
* Copyright (C) 1998, 1999, 2001-200
4
Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
*/
...
@@ -283,24 +283,23 @@ extern unsigned long __strnlen_user (const char *, long);
...
@@ -283,24 +283,23 @@ extern unsigned long __strnlen_user (const char *, long);
__su_ret; \
__su_ret; \
})
})
/* Generic code can't deal with the location-relative format that we use for compactness. */
#define ARCH_HAS_SORT_EXTABLE
#define ARCH_HAS_SORT_EXTABLE
#define ARCH_HAS_SEARCH_EXTABLE
#define ARCH_HAS_SEARCH_EXTABLE
struct
exception_table_entry
{
struct
exception_table_entry
{
int
addr
;
/*
gp
-relative address of insn this fixup is for */
int
addr
;
/*
location
-relative address of insn this fixup is for */
int
cont
;
/*
gp-relative continuation address
; if bit 2 is set, r9 is set to 0 */
int
cont
;
/*
location-relative continuation addr.
; if bit 2 is set, r9 is set to 0 */
};
};
extern
void
handle_exception
(
struct
pt_regs
*
regs
,
const
struct
exception_table_entry
*
e
);
extern
void
handle_exception
(
struct
pt_regs
*
regs
,
const
struct
exception_table_entry
*
e
);
extern
const
struct
exception_table_entry
*
search_exception_tables
(
unsigned
long
addr
);
extern
const
struct
exception_table_entry
*
search_exception_tables
(
unsigned
long
addr
);
# define SEARCH_EXCEPTION_TABLE(regs) search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri)
static
inline
int
static
inline
int
done_with_exception
(
struct
pt_regs
*
regs
)
done_with_exception
(
struct
pt_regs
*
regs
)
{
{
const
struct
exception_table_entry
*
e
;
const
struct
exception_table_entry
*
e
;
e
=
SEARCH_EXCEPTION_TABLE
(
regs
);
e
=
search_exception_tables
(
regs
->
cr_iip
+
ia64_psr
(
regs
)
->
ri
);
if
(
e
)
{
if
(
e
)
{
handle_exception
(
regs
,
e
);
handle_exception
(
regs
,
e
);
return
1
;
return
1
;
...
...
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