/// Resume a `state` that was saved by the kernel on a trap or interrupt.
Resume a `state` that was saved by the kernel on a trap or interrupt.
Resume a ` state ` that was saved by the kernel on a trap or interrupt .
pub unsafe fn resume(control: &mut kpi::arch::VirtualCpu) -> ! {
    // Enable upcalls (Note: we will remain disabled while the instruction pointer
    // is in this function (i.e., between the `resume` and `resume_end`
    // symbol (see asm! below))
    control.enable_upcalls();
    //debug!("resume enabled_state {:p}", &control.enabled_state);
    llvm_asm! {"
            // Restore gs
            //movq 18*8(%rsi), %rdi
            //wrgsbase %rdi
            // Restore fs
            movq 19*8(%rsi), %rdi
            wrfsbase %rdi
            // Restore vector register
            fxrstor 28*8(%rsi)
            // Restore CPU registers
            movq  0*8(%rsi), %rax
            movq  1*8(%rsi), %rbx
            movq  2*8(%rsi), %rcx
            movq  3*8(%rsi), %rdx
            // rsi is restored at the end (before iretq)
            movq  5*8(%rsi), %rdi
            movq  6*8(%rsi), %rbp
            // rsp is restored through iretq at the end
            movq  8*8(%rsi), %r8
            movq  9*8(%rsi), %r9
            movq 10*8(%rsi), %r10
            movq 11*8(%rsi), %r11
            movq 12*8(%rsi), %r12
            movq 13*8(%rsi), %r13
            movq 14*8(%rsi), %r14
            movq 15*8(%rsi), %r15
            //
            // Set-up stack to return from interrupt
            //
            // SS
            pushq $$35
            // %rsp
            pushq 7*8(%rsi)
            // RFLAGS
            pushq 17*8(%rsi)
            // code-segment
            pushq $$27
            // %rip
            pushq 16*8(%rsi)
            // Restore rsi register last, since it was used to reach `state`
            movq 4*8(%rsi), %rsi
            iretq
            .global resume_end
            resume_end:"
    : /* No output */
    :
      "{rsi}" (&control.enabled_state)
    :
    :
    };
    unreachable!("Resume can't go here")
}
pub unsafe fn resume ( control : & mut kpi :: arch :: VirtualCpu ) -> ! { // Enable upcalls (Note: we will remain disabled while the instruction pointer // is in this function (i.e., between the `resume` and `resume_end` // symbol (see asm! below)) control . enable_upcalls ( ) ; //debug!("resume enabled_state {:p}", &control.enabled_state); llvm_asm ! { " " /* No output */ " " ( control enabled_state ) } ; unreachable ! ( " " ) }
Resume a `state` that was saved by the kernel on a trap or interrupt.
Resume a ` state ` that was saved by the kernel on a trap or interrupt .
control
&mut kpi::arch::VirtualCpu