This commit is contained in:
mpabi 2024-06-06 15:38:22 +00:00
parent c6ba51009c
commit 5cc5bf3f04
2 changed files with 10 additions and 7 deletions

View File

@ -3,20 +3,22 @@
.global irqCallback
.section .start_jump,"ax",@progbits
crtStart:
crtStart: // 0x 8000 0000
//long jump to allow crtInit to be anywhere
//do it always in 12 bytes
lui x2, %hi(crtInit)
addi x2, x2, %lo(crtInit)
jalr x1,x2
nop
nop // 0x 8000 0010
.section .text
.global trap_entry
.align 5
.align 5 //2^5 = 32 = 0x 20
trap_entry:
sw x1, - 1*4(sp)
sw x1, - 1*4(sp) // 0x 8000 0020
sw x5, - 2*4(sp)
sw x6, - 3*4(sp)
sw x7, - 4*4(sp)

View File

@ -57,10 +57,11 @@ int main() {
TIMER_INTERRUPT->PENDINGS = 0xF;
TIMER_INTERRUPT->MASKS = 0x1;
while(1){
++mati;
// Thread 0
while( 1){
++mati;
}
}
extern "C" void irqCallback(){