linux/arch/x86/kernel/acpi
Konrad Rzeszutek Wilk cd74257b97 x86, acpi: Call acpi_enter_sleep_state via an asmlinkage C function from assembler
With commit a2ef5c4fd4
"ACPI: Move module parameter gts and bfs to sleep.c" the
wake_sleep_flags is required when calling acpi_enter_sleep_state.

The assembler code in wakeup_*.S did not do that. One solution
is to call it from assembler and stick the wake_sleep_flags on
the stack (for 32-bit) or in %esi (for 64-bit). hpa and rafael
both suggested however to create a wrapper function to call
acpi_enter_sleep_state and call said wrapper function
("acpi_enter_s3") from assembler.

For 32-bit, the acpi_enter_s3 ends up looking as so:

  push   %ebp
  mov    %esp,%ebp
  sub    $0x8,%esp
  movzbl 0xc1809314,%eax [wake_sleep_flags]
  movl   $0x3,(%esp)
  mov    %eax,0x4(%esp)
  call   0xc12d1fa0 <acpi_enter_sleep_state>
  leave
  ret

And 64-bit:

  movzbl 0x9afde1(%rip),%esi        [wake_sleep_flags]
  push   %rbp
  mov    $0x3,%edi
  mov    %rsp,%rbp
  callq  0xffffffff812e9800 <acpi_enter_sleep_state>
  leaveq
  retq

Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Suggested-by: H. Peter Anvin <hpa@zytor.com>
[v2: Remove extra assembler operations, per hpa review]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Link: http://lkml.kernel.org/r/1335150198-21899-3-git-send-email-konrad.wilk@oracle.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-04-23 13:29:18 -07:00
..
realmode x86, suspend: Restore MISC_ENABLE MSR in realmode wakeup 2011-07-06 20:09:34 -07:00
Makefile ACPI: processor: unify arch_acpi_processor_cleanup_pdc 2009-12-22 03:24:14 -05:00
boot.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-03-30 16:45:39 -07:00
cstate.c Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
sleep.c x86, acpi: Call acpi_enter_sleep_state via an asmlinkage C function from assembler 2012-04-23 13:29:18 -07:00
sleep.h x86, acpi: Call acpi_enter_sleep_state via an asmlinkage C function from assembler 2012-04-23 13:29:18 -07:00
wakeup_32.S x86, acpi: Call acpi_enter_sleep_state via an asmlinkage C function from assembler 2012-04-23 13:29:18 -07:00
wakeup_64.S x86, acpi: Call acpi_enter_sleep_state via an asmlinkage C function from assembler 2012-04-23 13:29:18 -07:00
wakeup_rm.S x86: Fix binutils-2.21 symbol related build failures 2011-03-09 10:25:45 +01:00