Skip to content

Commit

Permalink
ACPICA: Cleanup asmlinkage for ACPICA APIs.
Browse files Browse the repository at this point in the history
Add an asmlinkage wrapper around acpi_enter_sleep_state() to prevent
an empty stub from being called by assmebly code for ACPI_REDUCED_HARDWARE
set.

As arch/x86/kernel/acpi/wakeup_xx.S is only compiled when CONFIG_ACPI=y
and there are no users of ACPI_HARDWARE_REDUCED, currently this is in
fact not a real issue, but a cleanup to reduce source code differences
between Linux and ACPICA upstream.

[rjw: Changelog]
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Oct 31, 2013
1 parent efb8354 commit 40bce10
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
11 changes: 11 additions & 0 deletions arch/x86/kernel/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ unsigned long acpi_realmode_flags;
static char temp_stack[4096];
#endif

/**
* x86_acpi_enter_sleep_state - enter sleep state
* @state: Sleep state to enter.
*
* Wrapper around acpi_enter_sleep_state() to be called by assmebly.
*/
acpi_status asmlinkage x86_acpi_enter_sleep_state(u8 state)
{
return acpi_enter_sleep_state(state);
}

/**
* x86_acpi_suspend_lowlevel - save kernel state
*
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/acpi/sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ extern void wakeup_long64(void);
extern void do_suspend_lowlevel(void);

extern int x86_acpi_suspend_lowlevel(void);

acpi_status asmlinkage x86_acpi_enter_sleep_state(u8 state);
2 changes: 1 addition & 1 deletion arch/x86/kernel/acpi/wakeup_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ENTRY(do_suspend_lowlevel)
call save_processor_state
call save_registers
pushl $3
call acpi_enter_sleep_state
call x86_acpi_enter_sleep_state
addl $4, %esp

# In case of S3 failure, we'll emerge here. Jump
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/acpi/wakeup_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ENTRY(do_suspend_lowlevel)
addq $8, %rsp
movl $3, %edi
xorl %eax, %eax
call acpi_enter_sleep_state
call x86_acpi_enter_sleep_state
/* in case something went wrong, restore the machine status and go on */
jmp resume_point

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/hwxfsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector64)
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
acpi_status acpi_enter_sleep_state_s4bios(void)
{
u32 in_value;
acpi_status status;
Expand Down Expand Up @@ -361,7 +361,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
acpi_status acpi_enter_sleep_state(u8 sleep_state)
{
acpi_status status;

Expand Down
4 changes: 2 additions & 2 deletions include/acpi/acpixf.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b);

acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);

acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
acpi_status acpi_enter_sleep_state(u8 sleep_state);

ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void))
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))

acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);

Expand Down

0 comments on commit 40bce10

Please sign in to comment.