/* Used by PM helper macros in asm/pm.h */ struct mips_static_suspend_state mips_static_suspend_state;
/** * mips_cpu_save() - Save general CPU state. * Ensures that general CPU context is saved, notably FPU and DSP.
*/ staticint mips_cpu_save(void)
{ /* Save FPU state */
lose_fpu(1);
/* Save DSP state */
save_dsp(current);
return 0;
}
/** * mips_cpu_restore() - Restore general CPU state. * Restores important CPU context.
*/ staticvoid mips_cpu_restore(void)
{ unsignedint cpu = smp_processor_id();
/* Restore ASID */ if (current->mm)
write_c0_entryhi(cpu_asid(cpu, current->mm));
/* Restore DSP state */
restore_dsp(current);
/* Restore UserLocal */ if (cpu_has_userlocal)
write_c0_userlocal(current_thread_info()->tp_value);
/** * mips_pm_notifier() - Notifier for preserving general CPU context. * @self: Notifier block. * @cmd: CPU PM event. * @v: Private data (unused). * * This is called when a CPU power management event occurs, and is used to * ensure that important CPU context is preserved across a CPU power down.
*/ staticint mips_pm_notifier(struct notifier_block *self, unsignedlong cmd, void *v)
{ int ret;
switch (cmd) { case CPU_PM_ENTER:
ret = mips_cpu_save(); if (ret) return NOTIFY_STOP; break; case CPU_PM_ENTER_FAILED: case CPU_PM_EXIT:
mips_cpu_restore(); break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.