I tried to do what you suggested, but I'm not shure if I'm doing it right.
I have now in reset.S:
Code: Select all
.text
.extern kernel1
.globl kernel1
.globl kernel1.nstackwords
.globl kernel1.maxthreads
.globl kernel1.maxtimers
.globl kernel1.maxchanends
.linkset kernel1.nstackwords, 1
.linkset kernel1.maxthreads, 0
.linkset kernel1.maxtimers, 0
.linkset kernel1.maxchanends, 0
.cc_top kernel1.func, kernel1
.align 128 // align the kernel section to 128 bytes
kernel1: // entry point for exceptions
entsp 1 // increase current stack with 1 word
bl ex_handler_1 // jump to the exception handler written in C
inf_loop1:
// we do not expect to get here!
bu inf_loop1
.cc_bottom kernel1.func
.extern kernel2
.globl kernel2
.globl kernel2.nstackwords
.globl kernel2.maxthreads
.globl kernel2.maxtimers
.globl kernel2.maxchanends
.linkset kernel2.nstackwords, 1
.linkset kernel2.maxthreads, 0
.linkset kernel2.maxtimers, 0
.linkset kernel2.maxchanends, 0
.cc_top kernel2.func, kernel2
.align 128 // align the kernel section to 128 bytes
kernel2: // entry point for exceptions
entsp 1 // increase current stack with 1 word
bl ex_handler_2 // jump to the exception handler written in C
inf_loop2:
// we do not expect to get here!
bu inf_loop2
.cc_bottom kernel2.func
.extern kernel3
.globl kernel3
.globl kernel3.nstackwords
.globl kernel3.maxthreads
.globl kernel3.maxtimers
.globl kernel3.maxchanends
.linkset kernel3.nstackwords, 1
.linkset kernel3.maxthreads, 0
.linkset kernel3.maxtimers, 0
.linkset kernel3.maxchanends, 0
.cc_top kernel3.func, kernel3
.align 128 // align the kernel section to 128 bytes
kernel3: // entry point for exceptions
entsp 1 // increase current stack with 1 word
bl ex_handler_3 // jump to the exception handler written in C
inf_loop3:
// we do not expect to get here!
bu inf_loop3
.cc_bottom kernel3.func
.extern kernel4
.globl kernel4
.globl kernel4.nstackwords
.globl kernel4.maxthreads
.globl kernel4.maxtimers
.globl kernel4.maxchanends
.linkset kernel4.nstackwords, 1
.linkset kernel4.maxthreads, 0
.linkset kernel4.maxtimers, 0
.linkset kernel4.maxchanends, 0
.cc_top kernel4.func, kernel4
.align 128 // align the kernel section to 128 bytes
kernel4: // entry point for exceptions
entsp 1 // increase current stack with 1 word
bl ex_handler_4 // jump to the exception handler written in C
inf_loop4:
// we do not expect to get here!
bu inf_loop4
.cc_bottom kernel4.func
Code: Select all
asm("ldap r11, kernel1":::"r11");
asm("set kep, r11");
asm("ldap r11, kernel2":::"r11");
asm("set kep, r11");
asm("ldap r11, kernel3":::"r11");
asm("set kep, r11");
asm("ldap r11, kernel4":::"r11");
asm("set kep, r11");