if ((phys_addr_t)offset + bytes > priv->mem->size) return -EIO;
/* * Only map the reserved memory at this point to avoid potential rogue * kernel threads inadvertently modifying it. Based on the current * uses-cases for this driver, the performance hit isn't a concern. * Nor is likely to be, given the nature of the subsystem. Most nvmem * devices operate over slow buses to begin with. * * An alternative would be setting the memory as RO, set_memory_ro(), * but as of Dec 2020 this isn't possible on arm64.
*/
addr = memremap(priv->mem->base, priv->mem->size, MEMREMAP_WB); if (!addr) {
dev_err(priv->dev, "Failed to remap memory region\n"); return -ENOMEM;
}
ret = rmem_read(priv, 0, &header, sizeof(header)); if (ret) return ret;
if (header.magic != RMEM_EYEQ5_MAGIC) return -EINVAL;
/* * Avoid massive kmalloc() if header read is invalid; * the check would be done by the next rmem_read() anyway.
*/ if (header.size > priv->mem->size) return -EINVAL;
MODULE_AUTHOR("Nicolas Saenz Julienne ");
MODULE_DESCRIPTION("Reserved Memory Based nvmem Driver");
MODULE_LICENSE("GPL");
Messung V0.5
¤ 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.0.3Bemerkung:
¤
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.