/** * setup_physmem() - Setup physical memory for UML * @start: Start address of the physical kernel memory, * i.e start address of the executable image. * @reserve_end: end address of the physical kernel memory. * @len: Length of total physical memory that should be mapped/made * available, in bytes. * * Creates an unlinked temporary file of size (len) and memory maps * it on the last executable image address (uml_reserved). * * The offset is needed as the length of the total physical memory * (len) includes the size of the memory used be the executable image, * but the mapped-to address is the last address of the executable image * (uml_reserved == end address of executable image). * * The memory mapped memory of the temporary file is used as backing memory * of all user space processes/kernel tasks.
*/ void __init setup_physmem(unsignedlong start, unsignedlong reserve_end, unsignedlong len)
{ unsignedlong reserve = reserve_end - start; unsignedlong map_size = len - reserve; int err;
if (len <= reserve) {
os_warn("Too few physical memory! Needed=%lu, given=%lu\n",
reserve, len); exit(1);
}
/* * Special kludge - This page will be mapped in to userspace processes * from physmem_fd, so it needs to be written out there.
*/
os_seek_file(physmem_fd, __pa(__syscall_stub_start));
os_write_file(physmem_fd, __syscall_stub_start, PAGE_SIZE);
staticint __init uml_mem_setup(char *line, int *add)
{ char *retptr;
*add = 0;
physmem_size = memparse(line,&retptr); return 0;
}
__uml_setup("mem=", uml_mem_setup, "mem=\n" " This controls how much \"physical\" memory the kernel allocates\n" " for the system. The size is specified as a number followed by\n" " one of 'k', 'K', 'm', 'M', which have the obvious meanings.\n" " This is not related to the amount of memory in the host. It can\n" " be more, and the excess, if it's ever used, will just be swapped out.\n" " Example: mem=64M\n\n"
);
__uml_setup("iomem=", parse_iomem, "iomem=,\n" " Configure as an IO memory region named .\n\n"
);
/* * This list is constructed in parse_iomem and addresses filled in * setup_iomem, both of which run during early boot. Afterwards, it's * unchanged.
*/ struct iomem_region *iomem_regions;
/* Initialized in parse_iomem and unchanged thereafter */ int iomem_size;
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.