Path: blob/master/arch/x86/kernel/acpi/wakeup_64.S
10820 views
.text1#include <linux/linkage.h>2#include <asm/segment.h>3#include <asm/pgtable_types.h>4#include <asm/page_types.h>5#include <asm/msr.h>6#include <asm/asm-offsets.h>78# Copyright 2003 Pavel Machek <[email protected]>, distribute under GPLv2910.code6411/*12* Hooray, we are in Long 64-bit mode (but still running in low memory)13*/14ENTRY(wakeup_long64)15movq saved_magic, %rax16movq $0x123456789abcdef0, %rdx17cmpq %rdx, %rax18jne bogus_64_magic1920movw $__KERNEL_DS, %ax21movw %ax, %ss22movw %ax, %ds23movw %ax, %es24movw %ax, %fs25movw %ax, %gs26movq saved_rsp, %rsp2728movq saved_rbx, %rbx29movq saved_rdi, %rdi30movq saved_rsi, %rsi31movq saved_rbp, %rbp3233movq saved_rip, %rax34jmp *%rax35ENDPROC(wakeup_long64)3637bogus_64_magic:38jmp bogus_64_magic3940ENTRY(do_suspend_lowlevel)41subq $8, %rsp42xorl %eax, %eax43call save_processor_state4445movq $saved_context, %rax46movq %rsp, pt_regs_sp(%rax)47movq %rbp, pt_regs_bp(%rax)48movq %rsi, pt_regs_si(%rax)49movq %rdi, pt_regs_di(%rax)50movq %rbx, pt_regs_bx(%rax)51movq %rcx, pt_regs_cx(%rax)52movq %rdx, pt_regs_dx(%rax)53movq %r8, pt_regs_r8(%rax)54movq %r9, pt_regs_r9(%rax)55movq %r10, pt_regs_r10(%rax)56movq %r11, pt_regs_r11(%rax)57movq %r12, pt_regs_r12(%rax)58movq %r13, pt_regs_r13(%rax)59movq %r14, pt_regs_r14(%rax)60movq %r15, pt_regs_r15(%rax)61pushfq62popq pt_regs_flags(%rax)6364movq $resume_point, saved_rip(%rip)6566movq %rsp, saved_rsp67movq %rbp, saved_rbp68movq %rbx, saved_rbx69movq %rdi, saved_rdi70movq %rsi, saved_rsi7172addq $8, %rsp73movl $3, %edi74xorl %eax, %eax75call acpi_enter_sleep_state76/* in case something went wrong, restore the machine status and go on */77jmp resume_point7879.align 480resume_point:81/* We don't restore %rax, it must be 0 anyway */82movq $saved_context, %rax83movq saved_context_cr4(%rax), %rbx84movq %rbx, %cr485movq saved_context_cr3(%rax), %rbx86movq %rbx, %cr387movq saved_context_cr2(%rax), %rbx88movq %rbx, %cr289movq saved_context_cr0(%rax), %rbx90movq %rbx, %cr091pushq pt_regs_flags(%rax)92popfq93movq pt_regs_sp(%rax), %rsp94movq pt_regs_bp(%rax), %rbp95movq pt_regs_si(%rax), %rsi96movq pt_regs_di(%rax), %rdi97movq pt_regs_bx(%rax), %rbx98movq pt_regs_cx(%rax), %rcx99movq pt_regs_dx(%rax), %rdx100movq pt_regs_r8(%rax), %r8101movq pt_regs_r9(%rax), %r9102movq pt_regs_r10(%rax), %r10103movq pt_regs_r11(%rax), %r11104movq pt_regs_r12(%rax), %r12105movq pt_regs_r13(%rax), %r13106movq pt_regs_r14(%rax), %r14107movq pt_regs_r15(%rax), %r15108109xorl %eax, %eax110addq $8, %rsp111jmp restore_processor_state112ENDPROC(do_suspend_lowlevel)113114.data115ENTRY(saved_rbp) .quad 0116ENTRY(saved_rsi) .quad 0117ENTRY(saved_rdi) .quad 0118ENTRY(saved_rbx) .quad 0119120ENTRY(saved_rip) .quad 0121ENTRY(saved_rsp) .quad 0122123ENTRY(saved_magic) .quad 0124125126