From 253f5a498267aff2bd916f54048a495639ca1126 Mon Sep 17 00:00:00 2001 From: Yu Chen Date: Fri, 29 Apr 2022 12:02:06 +0800 Subject: [PATCH] add comments about inline asm in usr/src/bin/stackful_coroutine.rs --- user/src/bin/stackful_coroutine.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user/src/bin/stackful_coroutine.rs b/user/src/bin/stackful_coroutine.rs index d5896969..91a12263 100644 --- a/user/src/bin/stackful_coroutine.rs +++ b/user/src/bin/stackful_coroutine.rs @@ -261,10 +261,11 @@ pub fn yield_task() { /// to as saved context and in general our assembly will not work as expected. /// /// see: https://github.com/rust-lang/rfcs/blob/master/text/1201-naked-fns.md +/// see: https://doc.rust-lang.org/nightly/reference/inline-assembly.html +/// see: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html #[naked] #[no_mangle] unsafe fn switch(old: *mut TaskContext, new: *const TaskContext) { -//unsafe extern "C" fn switch() { // a0: _old, a1: _new asm!(" sd x1, 0x00(a0)