Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12612 Discussions

question about uc/os2 port on nios2

Altera_Forum
Honored Contributor II
926 Views

.global OSIntCtxSw  

.global OSCtxSw 

 

OSIntCtxSw: 

OSCtxSw: 

addi sp, sp, -44 

# ifdef ALT_STACK_CHECK 

 

bltu sp, et, .Lstack_overflow // stack overflow branch to .Lstack_overflow 

# endif 

# if OS_THREAD_SAFE_NEWLIB 

ldw r3, %gprel(_rimpure_pt)(gp) /* load the pointer */# endif /* OS_THREAD_SAFE_NEWLIB */ 

 

ldw r4, %gprel(OSTCBCur)(gp) // save OSTCBCur  

 

stw ra, 0(sp) // save return address 

stw fp, 4(sp) // save frame pointer 

stw r23, 8(sp) 

stw r22, 12(sp) //save callee register(r16 -r23); 

stw r21, 16(sp) 

stw r20, 20(sp) 

stw r19, 24(sp) 

stw r18, 28(sp) 

stw r17, 32(sp) 

stw r16, 36(sp) 

............. 

............ 

 

this is a part program of uc/os2's port which is related with the nios 2 cpu .  

I am not clear abou nios 2 's c complier , in part of the program , the program only save r16~r23(be called callee saved registers),ra,fp,why? the complier haved saved other register? 

 

I am not clera that the complier how deal with the internal register ,the nios2's hardware handbook have few introduction about the register ,where can i find details about the registers' function. 

 

thanks
0 Kudos
0 Replies
Reply