Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uboot-i9100
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
onny
uboot-i9100
Commits
1a50f164
Commit
1a50f164
authored
17 years ago
by
Michal Simek
Browse files
Options
Downloads
Patches
Plain Diff
add: Microblaze V5 exception handling
parent
ab874d50
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cpu/microblaze/exception.c
+8
-2
8 additions, 2 deletions
cpu/microblaze/exception.c
include/asm-microblaze/asm.h
+8
-0
8 additions, 0 deletions
include/asm-microblaze/asm.h
include/configs/ml401.h
+1
-0
1 addition, 0 deletions
include/configs/ml401.h
with
17 additions
and
2 deletions
cpu/microblaze/exception.c
+
8
−
2
View file @
1a50f164
...
...
@@ -23,15 +23,16 @@
*/
#include
<common.h>
#include
<asm/asm.h>
void
_hw_exception_handler
(
void
)
{
int
address
=
0
;
int
state
=
0
;
/* loading address of exception EAR */
__asm__
__volatile
(
"mfs %0,rear"
::
"r"
(
address
)
:
"memory"
);
MFSEAR
(
address
);
/* loading excetpion state register ESR */
__asm__
__volatile
(
"mfs %0,resr"
::
"r"
(
state
)
:
"memory"
);
MFSESR
(
state
);
printf
(
"Hardware exception at 0x%x address
\n
"
,
address
);
switch
(
state
&
0x1f
)
{
/* mask on exception cause */
case
0x1
:
...
...
@@ -49,6 +50,11 @@ void _hw_exception_handler (void)
case
0x5
:
puts
(
"Divide by zero exception
\n
"
);
break
;
#ifdef MICROBLAZE_V5
case
0x1000
:
puts
(
"Exception in delay slot
\n
"
);
break
;
#endif
default:
puts
(
"Undefined cause
\n
"
);
break
;
...
...
This diff is collapsed.
Click to expand it.
include/asm-microblaze/asm.h
+
8
−
0
View file @
1a50f164
...
...
@@ -48,12 +48,20 @@
__asm__ __volatile__ ("cput %0, rfsl" #fslnum ::"r" (val));
/* CPU dependent */
/* machine status register */
#define MFS(val) \
__asm__ __volatile__ ("mfs %0, rmsr":"=r" (val));
#define MTS(val) \
__asm__ __volatile__ ("mts rmsr, %0"::"r" (val));
/* exception status register */
#define MFSEAR(val) \
__asm__ __volatile ("mfs %0,rear":"=r" (val));
#define MFSESR(val) \
__asm__ __volatile ("mfs %0,resr":"=r" (val));
/* get return address from interrupt */
#define R14(val) \
__asm__ __volatile__ ("addi %0, r14, 0":"=r" (val));
...
...
This diff is collapsed.
Click to expand it.
include/configs/ml401.h
+
1
−
0
View file @
1a50f164
...
...
@@ -28,6 +28,7 @@
#include
"../board/xilinx/ml401/xparameters.h"
#define CONFIG_MICROBLAZE 1
/* MicroBlaze CPU */
#define MICROBLAZE_V5 1
#define CONFIG_ML401 1
/* ML401 Board */
/* uart */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment