-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
% | ||
|
||
let api_func::FUNC_NAME := exists api_func::ACTUAL default ( api_func::NAME ) | ||
% | ||
.global % !api_func::FUNC_NAME % | ||
% !api_func::FUNC_NAME %: | ||
ldi r30,% !api_sec::ID_PREFIX %ServiceId_% !api_func::NAME% /* load the service id in r30 */ | ||
call tpl_sc_handler | ||
ret | ||
|
||
.type % !api_func::FUNC_NAME %,@function | ||
// .size % !api_func::FUNC_NAME %,$-% !api_func::FUNC_NAME % | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
%foreach isr in ISRS2 | ||
before | ||
% | ||
//We have to save registers that are not saved by a function call, i.e. | ||
//R18–R27, R30, R31, R0, R1 | ||
|
||
.equ TPL_ISR2_HANDLER, 0x40 | ||
#include <avr/io.h>\n | ||
% | ||
do | ||
let isr_id := INDEX + [TASKS length] | ||
% | ||
.equ % !isr::NAME %_id, %!isr_id% | ||
//ISR2 %!isr::NAME% Handler | ||
.global %!isr::SOURCE% | ||
%!isr::SOURCE%: | ||
push r0 | ||
push r1 | ||
push r18 | ||
push r19 | ||
push r20 | ||
push r21 | ||
push r22 | ||
push r23 | ||
push r24 | ||
push r25 | ||
push r26 | ||
push r27 | ||
push r30 | ||
push r31 | ||
ldi r24, % !isr::NAME %_id | ||
ldi r25, 0 | ||
ldi r30,TPL_ISR2_HANDLER | ||
call tpl_sc_handler | ||
pop r31 | ||
pop r30 | ||
pop r27 | ||
pop r26 | ||
pop r25 | ||
pop r24 | ||
pop r23 | ||
pop r22 | ||
pop r21 | ||
pop r20 | ||
pop r19 | ||
pop r18 | ||
pop r1 | ||
pop r0 | ||
reti | ||
% | ||
end foreach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
% | ||
!PROJECT %/tpl_invoque.S | ||
% | ||
write to PROJECT."/tpl_invoque.S": | ||
let EXTENSION := "S" | ||
let ASSEMBLERHEADER := true | ||
template tpl_invoque in code | ||
end write | ||
|
||
write to PROJECT."/tpl_invoque_isr.S": | ||
let EXTENSION := "S" | ||
template tpl_invoque_isr_s in code | ||
end write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
//avr specific part. | ||
#include <avr/io.h> | ||
#include <avr/interrupt.h> | ||
extern uint8_t tpl_reentrancy_counter; | ||
extern void tpl_switch_to_kernel_stack(); | ||
extern void tpl_switch_to_user_stack(); | ||
//end of avr specific part |