message: disable interrupts during a stack switch
diff: @@ -36,6 +36,7 @@ macro_rules! println {
  macro_rules! switch_to_kernel {
  () => {
  + ::arch::irq::disable();
  #[allow(unused)]
  unsafe {
  let user_stack_pointer;
  @@ -46,6 +47,7 @@ macro_rules! switch_to_kernel {
  );
  core_scheduler().set_current_user_stack(user_stack_pointer);
  }
  + ::arch::irq::enable();
  }
  }
  @@ -53,12 +55,14 @@ macro_rules! switch_to_user {
  () => {
  use arch::kernel::percore::*;
  + ::arch::irq::disable();
  let user_stack_pointer = core_scheduler().get_current_user_stack();
  #[allow(unused)]
  unsafe {
  // Switch to the user stack
  llvm_asm!("mov $0, %rsp" :: "r"(user_stack_pointer) :: "volatile");
  }
  + ::arch::irq::enable();
  }
  }
  @@ -68,6 +72,7 @@ macro_rules! kernel_function {
  #[allow(unused)]
  unsafe {
  + ::arch::irq::disable();
  let user_stack_pointer;
  // Store the user stack pointer and switch to the kernel stack
  llvm_asm!(
  @@ -77,14 +82,17 @@ macro_rules! kernel_function {
  :: "volatile"
  );
  core_scheduler().set_current_user_stack(user_stack_pointer);
  + ::arch::irq::enable();
  let ret = $f($($x)*);
  + ::arch::irq::disable();
  // Switch to the user stack
  llvm_asm!("mov $0, %rsp"
  :: "r"(core_scheduler().get_current_user_stack())
  :: "volatile"
  );
  + ::arch::irq::enable();
  ret
  }
  