From c02c82cbd6a4847c96f8b91a53f2f40b1d5a1bff Mon Sep 17 00:00:00 2001 From: WangRunji Date: Sun, 20 May 2018 15:34:13 +0800 Subject: [PATCH] Fix a lot of bugs by adding an instruction. --- src/arch/x86_64/interrupt/template.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arch/x86_64/interrupt/template.rs b/src/arch/x86_64/interrupt/template.rs index 64020cc..0c639d9 100644 --- a/src/arch/x86_64/interrupt/template.rs +++ b/src/arch/x86_64/interrupt/template.rs @@ -342,7 +342,8 @@ macro_rules! interrupt_switch { // Get reference to stack variables let rsp: usize; - asm!("" : "={rsp}"(rsp) : : : "intel", "volatile"); + asm!("mov rbp, rsp" : "={rsp}"(rsp) : : : "intel", "volatile"); + // "mov rbp, rsp" <-- Fix a lot of bugs! // Call inner rust function let rsp = inner(&mut *(rsp as *mut InterruptStackP));