File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 235235
236236 available.ctx.x1 = guard as u64; //ctx.x1 is old return address
237237 available.ctx.nx1 = f as u64; //ctx.nx1 is new return address
238- available.ctx.x2 = s_ptr.offset(32) as u64; //cxt.x2 is sp
238+ available.ctx.x2 = s_ptr.offset(- 32) as u64; //cxt.x2 is sp
239239
240240 }
241241 available.state = State::Ready;
327327 #[inline(never)]
328328 unsafe fn switch(old: *mut TaskContext, new: *const TaskContext) {
329329 // a0: old, a1: new
330- llvm_asm !("
330+ asm !("
331331 //if comment below lines: sd x1..., ld x1..., TASK2 can not finish, and will segment fault
332332 sd x1, 0x00(a0)
333333 sd x2, 0x08(a0)
348348 ld t0, 0x70(a1)
349349
350350 jr t0
351- "
352- : : : : "volatile", "alignstack"
351+ ",
352+ options(noreturn)
353353 );
354354 }
355355
388388
389389.. [#explain_green_thread ] https://cfsamson.gitbook.io/green-threads-explained-in-200-lines-of-rust/
390390
391- .. [#code_green_thread ] https://github.com/cfsamson/example-greenthreads
391+ .. [#code_green_thread ] https://github.com/cfsamson/example-greenthreads
You can’t perform that action at this time.
0 commit comments