Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
7f18f151
Commit
7f18f151
authored
Jul 29, 2007
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MIPS] Fix build warning in unaligned load/store emulator.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
c3dd8cdf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
31 deletions
+20
-31
arch/mips/kernel/unaligned.c
arch/mips/kernel/unaligned.c
+20
-31
No files found.
arch/mips/kernel/unaligned.c
View file @
7f18f151
...
@@ -101,16 +101,14 @@ static u32 unaligned_action;
...
@@ -101,16 +101,14 @@ static u32 unaligned_action;
#endif
#endif
extern
void
show_registers
(
struct
pt_regs
*
regs
);
extern
void
show_registers
(
struct
pt_regs
*
regs
);
static
inline
int
emulate_load_store_insn
(
struct
pt_regs
*
regs
,
static
void
emulate_load_store_insn
(
struct
pt_regs
*
regs
,
void
__user
*
addr
,
unsigned
int
__user
*
pc
,
void
__user
*
addr
,
unsigned
int
__user
*
pc
)
unsigned
long
**
regptr
,
unsigned
long
*
newvalue
)
{
{
union
mips_instruction
insn
;
union
mips_instruction
insn
;
unsigned
long
value
;
unsigned
long
value
;
unsigned
int
res
;
unsigned
int
res
;
regs
->
regs
[
0
]
=
0
;
regs
->
regs
[
0
]
=
0
;
*
regptr
=
NULL
;
/*
/*
* This load never faults.
* This load never faults.
...
@@ -179,8 +177,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -179,8 +177,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
if
(
res
)
if
(
res
)
goto
fault
;
goto
fault
;
*
newvalue
=
value
;
compute_return_epc
(
regs
)
;
*
regptr
=
&
regs
->
regs
[
insn
.
i_format
.
rt
]
;
regs
->
regs
[
insn
.
i_format
.
rt
]
=
value
;
break
;
break
;
case
lw_op
:
case
lw_op
:
...
@@ -209,8 +207,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -209,8 +207,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
if
(
res
)
if
(
res
)
goto
fault
;
goto
fault
;
*
newvalue
=
value
;
compute_return_epc
(
regs
)
;
*
regptr
=
&
regs
->
regs
[
insn
.
i_format
.
rt
]
;
regs
->
regs
[
insn
.
i_format
.
rt
]
=
value
;
break
;
break
;
case
lhu_op
:
case
lhu_op
:
...
@@ -243,8 +241,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -243,8 +241,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
if
(
res
)
if
(
res
)
goto
fault
;
goto
fault
;
*
newvalue
=
value
;
compute_return_epc
(
regs
)
;
*
regptr
=
&
regs
->
regs
[
insn
.
i_format
.
rt
]
;
regs
->
regs
[
insn
.
i_format
.
rt
]
=
value
;
break
;
break
;
case
lwu_op
:
case
lwu_op
:
...
@@ -283,8 +281,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -283,8 +281,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
if
(
res
)
if
(
res
)
goto
fault
;
goto
fault
;
*
newvalue
=
value
;
compute_return_epc
(
regs
)
;
*
regptr
=
&
regs
->
regs
[
insn
.
i_format
.
rt
]
;
regs
->
regs
[
insn
.
i_format
.
rt
]
=
value
;
break
;
break
;
#endif
/* CONFIG_64BIT */
#endif
/* CONFIG_64BIT */
...
@@ -325,8 +323,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -325,8 +323,8 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
:
"r"
(
addr
),
"i"
(
-
EFAULT
));
if
(
res
)
if
(
res
)
goto
fault
;
goto
fault
;
*
newvalue
=
value
;
compute_return_epc
(
regs
)
;
*
regptr
=
&
regs
->
regs
[
insn
.
i_format
.
rt
]
;
regs
->
regs
[
insn
.
i_format
.
rt
]
=
value
;
break
;
break
;
#endif
/* CONFIG_64BIT */
#endif
/* CONFIG_64BIT */
...
@@ -367,6 +365,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -367,6 +365,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
:
"r"
(
value
),
"r"
(
addr
),
"i"
(
-
EFAULT
));
:
"r"
(
value
),
"r"
(
addr
),
"i"
(
-
EFAULT
));
if
(
res
)
if
(
res
)
goto
fault
;
goto
fault
;
compute_return_epc
(
regs
);
break
;
break
;
case
sw_op
:
case
sw_op
:
...
@@ -397,6 +396,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -397,6 +396,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
:
"r"
(
value
),
"r"
(
addr
),
"i"
(
-
EFAULT
));
:
"r"
(
value
),
"r"
(
addr
),
"i"
(
-
EFAULT
));
if
(
res
)
if
(
res
)
goto
fault
;
goto
fault
;
compute_return_epc
(
regs
);
break
;
break
;
case
sd_op
:
case
sd_op
:
...
@@ -435,6 +435,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -435,6 +435,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
:
"r"
(
value
),
"r"
(
addr
),
"i"
(
-
EFAULT
));
:
"r"
(
value
),
"r"
(
addr
),
"i"
(
-
EFAULT
));
if
(
res
)
if
(
res
)
goto
fault
;
goto
fault
;
compute_return_epc
(
regs
);
break
;
break
;
#endif
/* CONFIG_64BIT */
#endif
/* CONFIG_64BIT */
...
@@ -473,34 +474,31 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
...
@@ -473,34 +474,31 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
unaligned_instructions
++
;
unaligned_instructions
++
;
#endif
#endif
return
0
;
return
;
fault:
fault:
/* Did we have an exception handler installed? */
/* Did we have an exception handler installed? */
if
(
fixup_exception
(
regs
))
if
(
fixup_exception
(
regs
))
return
1
;
return
;
die_if_kernel
(
"Unhandled kernel unaligned access"
,
regs
);
die_if_kernel
(
"Unhandled kernel unaligned access"
,
regs
);
send_sig
(
SIGSEGV
,
current
,
1
);
send_sig
(
SIGSEGV
,
current
,
1
);
return
0
;
return
;
sigbus:
sigbus:
die_if_kernel
(
"Unhandled kernel unaligned access"
,
regs
);
die_if_kernel
(
"Unhandled kernel unaligned access"
,
regs
);
send_sig
(
SIGBUS
,
current
,
1
);
send_sig
(
SIGBUS
,
current
,
1
);
return
0
;
return
;
sigill:
sigill:
die_if_kernel
(
"Unhandled kernel unaligned access or invalid instruction"
,
regs
);
die_if_kernel
(
"Unhandled kernel unaligned access or invalid instruction"
,
regs
);
send_sig
(
SIGILL
,
current
,
1
);
send_sig
(
SIGILL
,
current
,
1
);
return
0
;
}
}
asmlinkage
void
do_ade
(
struct
pt_regs
*
regs
)
asmlinkage
void
do_ade
(
struct
pt_regs
*
regs
)
{
{
unsigned
long
*
regptr
,
newval
;
extern
int
do_dsemulret
(
struct
pt_regs
*
);
extern
int
do_dsemulret
(
struct
pt_regs
*
);
unsigned
int
__user
*
pc
;
unsigned
int
__user
*
pc
;
mm_segment_t
seg
;
mm_segment_t
seg
;
...
@@ -538,16 +536,7 @@ asmlinkage void do_ade(struct pt_regs *regs)
...
@@ -538,16 +536,7 @@ asmlinkage void do_ade(struct pt_regs *regs)
seg
=
get_fs
();
seg
=
get_fs
();
if
(
!
user_mode
(
regs
))
if
(
!
user_mode
(
regs
))
set_fs
(
KERNEL_DS
);
set_fs
(
KERNEL_DS
);
if
(
!
emulate_load_store_insn
(
regs
,
(
void
__user
*
)
regs
->
cp0_badvaddr
,
pc
,
emulate_load_store_insn
(
regs
,
(
void
__user
*
)
regs
->
cp0_badvaddr
,
pc
);
&
regptr
,
&
newval
))
{
compute_return_epc
(
regs
);
/*
* Now that branch is evaluated, update the dest
* register if necessary
*/
if
(
regptr
)
*
regptr
=
newval
;
}
set_fs
(
seg
);
set_fs
(
seg
);
return
;
return
;
...
...
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