Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
db01b38c
Commit
db01b38c
authored
Nov 21, 2018
by
Damien George
Browse files
leon: In sparcisr, get location to install TA 3 handler from TBR.
The base location of TBR may be different from 0x40000000.
parent
730865d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
leon-common/sparcisr.c
View file @
db01b38c
...
...
@@ -6,13 +6,25 @@
#include <stdint.h>
#include "leon-common/sparcisr.h"
// This function retrieves the value of the Trap Base Register, to be used
// to install a window flushing trap handler next.
static
void
TRAP_read_TBR
(
volatile
uint32_t
*
const
tbrPtr
)
{
asm
(
"mov %0, %%o1"
:
:
"r"
(
tbrPtr
)
:
"%o1"
);
asm
(
"rd %%tbr, %%o0"
:
:
:
"%o0"
);
asm
(
"st %o0, [%o1]"
);
}
// This function installs the "ta 3" ISR which handles window flushing.
// It is only needed for Edisoft RTEMS 4.8 because the trap handler is not
// included in that version, but it is needed by MicroPython to implement
// setjmp/longjmp calls for exception handling.
void
sparc_install_ta_3_window_flush_isr
(
void
)
{
extern
int
sparc_window_flush_trap_handler
(
void
);
uint32_t
*
m
=
(
uint32_t
*
)
0x40000830
;
volatile
uint32_t
tbr
=
0
;
TRAP_read_TBR
(
&
tbr
);
tbr
&=
0xfffff000
;
tbr
|=
0x830
;
uint32_t
*
m
=
(
uint32_t
*
)
tbr
;
uint32_t
addr
=
(
uint32_t
)
sparc_window_flush_trap_handler
;
m
[
0
]
=
0xa1480000
;
// rd %psr, %l0
m
[
1
]
=
0x29100000
|
(
addr
>>
10
);
// sethi %hi(addr), %l4
...
...
Write
Preview
Supports
Markdown
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