kaniini / libucontext

ucontext implementation featuring glibc-compatible ABI
Other
106 stars 41 forks source link

Error in riscv64/swapcontext.S #67

Closed mobsense closed 1 month ago

mobsense commented 1 month ago

Should the code:

    /* return register block */
    sd x0, REG_OFFSET(REG_A0)(a0)
    sd x0, REG_OFFSET(REG_A1)(a0)

not be:

/* return register block */
sd x0, REG_OFFSET(REG_A0)(a0)
sd x1, REG_OFFSET(REG_A1)(a0)

.ie.

Should the second x0 be x1?

mobsense commented 1 month ago

Same in riscv/swapcontext.S

kaniini commented 1 month ago

No. We want the return registers to be saved as zero. x0 is always zero.

mobsense commented 1 month ago

Thanks for the quick turn around.