/* * linux/arch/unicore32/kernel/pm.c * * Code specific to PKUnity SoC and UniCore ISA * * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn> * Copyright (C) 2001-2010 Guan Xuetao * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/init.h> #include <linux/module.h> #include <linux/suspend.h> #include <linux/errno.h> #include <linux/slab.h> #include <linux/io.h> #include <mach/hardware.h> #include <mach/pm.h> #include "setup.h" struct puv3_cpu_pm_fns *puv3_cpu_pm_fns; static unsigned long *sleep_save;
int puv3_pm_enter(suspend_state_t state) { unsigned long sleep_save_checksum = 0, checksum = 0; int i; /* skip registers saving for standby */ if (state != PM_SUSPEND_STANDBY) { puv3_cpu_pm_fns->save(sleep_save); /* before sleeping, calculate and save a checksum */ for (i = 0; i < puv3_cpu_pm_fns->save_count - 1; i++) sleep_save_checksum += sleep_save[i]; } /* *** go zzz *** */ puv3_cpu_pm_fns->enter(state); cpu_init(); #ifdef CONFIG_INPUT_KEYBOARD puv3_ps2_init(); #endif #ifdef CONFIG_PCI pci_puv3_preinit(); #endif if (state != PM_SUSPEND_STANDBY) { /* after sleeping, validate the checksum */ for (i = 0; i < puv3_cpu_pm_fns->save_count - 1; i++) checksum += sleep_save[i]; /* if invalid, display message and wait for a hardware reset */ if (checksum != sleep_save_checksum) { while (1) puv3_cpu_pm_fns->enter(state); } puv3_cpu_pm_fns->restore(sleep_save); } pr_debug("*** made it back from resume\n"); return 0; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 157 | 100.00% | 1 | 100.00% |
Total | 157 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 25 | 100.00% | 1 | 100.00% |
Total | 25 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 31 | 100.00% | 1 | 100.00% |
Total | 31 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 21 | 100.00% | 1 | 100.00% |
Total | 21 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 69 | 100.00% | 1 | 100.00% |
Total | 69 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 395 | 100.00% | 1 | 100.00% |
Total | 395 | 100.00% | 1 | 100.00% |