If I'm reading https://github.com/Xudong-Huang/generator-rs/blob/master/src/detail/asm/asm_riscv64_c_elf.S correctly, basically what it's asking for is a function prologue to save registers. This must obey the OpenPOWER SysV ABI, so it would be something like
mflr r0
std r0,16(r1)
mfcr r0
std r0,8(r1)
stdu r1,-FRAMESIZE(r1)
and then start saving your callee-saved registers into the frame, which is basically any non-volatile GPRs and FPRs your routine might touch.
Not quite sure what it's doing with the green task routine but I only read the source cursorily.
From my understanding the RISV asm consists of 3 functions:
* The prefetch function is essentially a no-op function
* The bootstrap_green_task function sets up arguments and then jumps to the address contained in register s4, effectively starting a new task or function.
* The swap_registers function saves the current values of a large number of registers (both general-purpose and floating-point) to memory and then restores them from another memory location
Thanks for show me the OpenPOWER SysV ABI example, let me do a bit homework