Renesas M3T-MR100 Network Card User Manual


 
- 183 -
ret_int Returns from an interrupt handler
(when written in assembly language)
[
[
[
[
C
C
L
L
a
a
n
n
g
g
u
u
a
a
g
g
e
e
A
A
P
P
I
I
]
]
]
]
This service call cannot be written in C language.
36
[
[
[
[
A
A
s
s
s
s
e
e
m
m
b
b
l
l
y
y
l
l
a
a
n
n
g
g
u
u
a
a
g
g
e
e
A
A
P
P
I
I
]
]
]
]
.include mr100.inc
ret_int
z
z
P
P
a
a
r
r
a
a
m
m
e
e
t
t
e
e
r
r
s
s
None
[
[
[
[
E
E
r
r
r
r
o
o
r
r
c
c
o
o
d
d
e
e
]
]
]
]
Not return to the interrupt handler that issued this service call.
[
[
[
[
F
F
u
u
n
n
c
c
t
t
i
i
o
o
n
n
a
a
l
l
d
d
e
e
s
s
c
c
r
r
i
i
p
p
t
t
i
i
o
o
n
n
]
]
]
]
This service call performs the processing necessary to return from an interrupt handler. Depending on return processing, it
activates the scheduler to switch tasks from one to another.
If this service call is executed in an interrupt handler, task switching does not occur, and task switching is postponed until
the interrupt handler terminates.
However, if the ret_int service call is issued from an interrupt handler that was invoked from an interrupt that occurred
within another interrupt, the scheduler is not activated. The scheduler is activated for interrupts from a task only.
When writing this service call in assembly language, be aware that the service call cannot be issued from a subroutine that
is invoked from an interrupt handler entry routine. Always make sure this service call is executed in the entry routine or
entry function of an interrupt handler. For example, a program like the one shown below may not operate normally.
.include mr100.inc
/* NG */
.GLB intr
intr:
jsr.b func
:
func:
ret_int
Therefore, write the program as shown below.
.include mr100.inc
/* OK */
.GLB intr
intr:
jsr.b func
ret_int
func:
:
rts
Make sure this service call is issued from only an interrupt handler. If issued from a cyclic handler, alarm handler, or a task,
this service call may not operate normally.
36
If the starting function of an interrupt handler is declared by #pragma INTHANDLER, the ret_int service call is automatically issued at the
exit of the function.