Does the glibc coroutine library utilize the feature of returning stack to support coroutines?

55 views
Skip to first unread message

san zhang

unread,
Jul 28, 2024, 4:20:52 AMJul 28
to RISC-V ISA Dev
    setjmp.jpgras.jpg     I have attempted to use glibc's coroutine-related library functions, and from the disassembled assembly code, it seems that they do not utilize the feature mentioned in the instruction manual: "When two different link registers (x1 and x5) are given as rs1 and rd, then the RAS is both popped and pushed to support coroutines." The library functions I used are longjmp/setjmp. It appears that ucontext-related library functions behave similarly. 
    Additionally, I would like to confirm my understanding: the statement in the instruction manual means that the top item of the RAS stack will be replaced with the content pushed, and the address content popped has no special purpose. I would appreciate any help with the following question.
Reply all
Reply to author
Forward
0 new messages