Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdde6b3c authored by Tkhai Kirill's avatar Tkhai Kirill Committed by David S. Miller
Browse files

sparc64: Hibernation support



This patch adds CONFIG_HIBERNATION support for sparc64
architecture. The suspend function is the same as on another
platforms. The restore function uses Bypass feature of MMU
which allows to make the process more comfortable and plesant.

Signed-off-by: default avatarKirill Tkhai <tkhai@yandex.ru>
CC: David Miller <davem@davemloft.net>
CC: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ab0a676
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -100,6 +100,9 @@ config HAVE_LATENCYTOP_SUPPORT
	bool
	default y if SPARC64

config ARCH_HIBERNATION_POSSIBLE
	def_bool y if SPARC64

config AUDIT_ARCH
	bool
	default y
@@ -327,6 +330,10 @@ config ARCH_SPARSEMEM_DEFAULT

source "mm/Kconfig"

if SPARC64
source "kernel/power/Kconfig"
endif

config SCHED_SMT
	bool "SMT (Hyperthreading) scheduler support"
	depends on SPARC64 && SMP
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ core-y += arch/sparc/
libs-y                 += arch/sparc/prom/
libs-y                 += arch/sparc/lib/

drivers-$(CONFIG_PM) += arch/sparc/power/
drivers-$(CONFIG_OPROFILE)	+= arch/sparc/oprofile/

boot := arch/sparc/boot
+23 −0
Original line number Diff line number Diff line
/*
 * hibernate.h:  Hibernaton support specific for sparc64.
 *
 * Copyright (C) 2013 Kirill V Tkhai (tkhai@yandex.ru)
 */

#ifndef ___SPARC_HIBERNATE_H
#define ___SPARC_HIBERNATE_H

struct saved_context {
	unsigned long fp;
	unsigned long cwp;
	unsigned long wstate;

	unsigned long tick;
	unsigned long pstate;

	unsigned long g4;
	unsigned long g5;
	unsigned long g6;
};

#endif
+15 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
// #include <linux/mm.h>
#include <linux/kbuild.h>

#include <asm/hibernate.h>

#ifdef CONFIG_SPARC32
int sparc32_foo(void)
{
@@ -24,6 +26,19 @@ int sparc32_foo(void)
#else
int sparc64_foo(void)
{
#ifdef CONFIG_HIBERNATION
	BLANK();
	OFFSET(SC_REG_FP, saved_context, fp);
	OFFSET(SC_REG_CWP, saved_context, cwp);
	OFFSET(SC_REG_WSTATE, saved_context, wstate);

	OFFSET(SC_REG_TICK, saved_context, tick);
	OFFSET(SC_REG_PSTATE, saved_context, pstate);

	OFFSET(SC_REG_G4, saved_context, g4);
	OFFSET(SC_REG_G5, saved_context, g5);
	OFFSET(SC_REG_G6, saved_context, g6);
#endif
	return 0;
}
#endif
+3 −0
Original line number Diff line number Diff line
# Makefile for Sparc-specific hibernate files.

obj-$(CONFIG_HIBERNATION)	+= hibernate.o hibernate_asm.o
Loading