staticunsignedlong mmio_address;
module_param_hw(mmio_address, ulong, iomem, 0);
MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB " "(or 8 MB if read_far is non-zero).");
staticunsignedlong read_far = 0x400100;
module_param(read_far, ulong, 0);
MODULE_PARM_DESC(read_far, " Offset of a 32-bit read within 8 MB " "(default: 0x400100).");
for (i = 0; i < 10; ++i) {
p = ioremap(mmio_address, PAGE_SIZE); if (p)
iounmap(p);
}
/* Force freeing. If it will crash we will know why. */
synchronize_rcu();
}
staticint __init init(void)
{ unsignedlong size = (read_far) ? (8 << 20) : (16 << 10); int ret = security_locked_down(LOCKDOWN_MMIOTRACE);
if (ret) return ret;
if (mmio_address == 0) {
pr_err("you have to use the module argument mmio_address.\n");
pr_err("DO NOT LOAD THIS MODULE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!\n"); return -ENXIO;
}
pr_warn("WARNING: mapping %lu kB @ 0x%08lx in PCI address space, " "and writing 16 kB of rubbish in there.\n",
size >> 10, mmio_address);
do_test(size);
do_test_bulk_ioremapping();
pr_info("All done.\n"); return0;
}
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.