a3075dcb17
A couple of functions are defined by the architecture and declared in linux/suspend.h, but mips is lacking the corresponding #include statement before the definition: arch/mips/power/cpu.c:16:6: warning: no previous prototype for 'save_processor_state' [-Wmissing-prototypes] arch/mips/power/cpu.c:26:6: warning: no previous prototype for 'restore_processor_state' [-Wmissing-prototypes] arch/mips/power/cpu.c:36:5: warning: no previous prototype for 'pfn_is_nosave' [-Wmissing-prototypes] arch/mips/power/hibernate.c:6:5: warning: no previous prototype for 'swsusp_arch_resume' [-Wmissing-prototypes] Link: https://lkml.kernel.org/r/20231204115710.2247097-18-arnd@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Stephen Rothwell <sfr@rothwell.id.au> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
44 lines
860 B
C
44 lines
860 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Suspend support specific for mips.
|
|
*
|
|
* Copyright (C) 2009 Lemote Inc.
|
|
* Author: Hu Hongbing <huhb@lemote.com>
|
|
* Wu Zhangjin <wuzhangjin@gmail.com>
|
|
*/
|
|
#include <linux/suspend.h>
|
|
#include <asm/sections.h>
|
|
#include <asm/fpu.h>
|
|
#include <asm/dsp.h>
|
|
|
|
static u32 saved_status;
|
|
struct pt_regs saved_regs;
|
|
|
|
void save_processor_state(void)
|
|
{
|
|
saved_status = read_c0_status();
|
|
|
|
if (is_fpu_owner())
|
|
save_fp(current);
|
|
|
|
save_dsp(current);
|
|
}
|
|
|
|
void restore_processor_state(void)
|
|
{
|
|
write_c0_status(saved_status);
|
|
|
|
if (is_fpu_owner())
|
|
restore_fp(current);
|
|
|
|
restore_dsp(current);
|
|
}
|
|
|
|
int pfn_is_nosave(unsigned long pfn)
|
|
{
|
|
unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin));
|
|
unsigned long nosave_end_pfn = PFN_UP(__pa(&__nosave_end));
|
|
|
|
return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
|
|
}
|