// SPDX-License-Identifier: GPL-2.0-only /* * nvs.c - Routines for saving and restoring ACPI NVS memory region * * Copyright (C) 2008-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
*/
#ifdef CONFIG_ACPI_SLEEP /* * Platforms, like ACPI, may want us to save some memory used by them during * suspend and to restore the contents of this memory during the subsequent * resume. The code below implements a mechanism allowing us to do that.
*/
/** * suspend_nvs_register - register platform NVS memory region to save * @start: Physical address of the region. * @size: Size of the region. * * The NVS region need not be page-aligned (both ends) and we arrange * things so that the data from page-aligned addresses in this region will * be copied into separate RAM pages.
*/ staticint suspend_nvs_register(unsignedlong start, unsignedlong size)
{ struct nvs_page *entry, *next;
/** * suspend_nvs_restore - restore NVS memory regions * * This function is going to be called with interrupts disabled, so it * cannot iounmap the virtual addresses used to access the NVS region.
*/ void suspend_nvs_restore(void)
{ struct nvs_page *entry;
pr_info("Restoring platform NVS memory\n");
list_for_each_entry(entry, &nvs_list, node) if (entry->data)
memcpy(entry->kaddr, entry->data, entry->size);
} #endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
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.