Lines Matching +full:memory +full:- +full:region

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
12 #include <as-layout.h>
18 static int physmem_fd = -1;
50 if (err == -ENOMEM) in map_memory()
53 "memory size>/4096\n"); in map_memory()
60 * setup_physmem() - Setup physical memory for UML
61 * @start: Start address of the physical kernel memory,
63 * @reserve_end: end address of the physical kernel memory.
64 * @len: Length of total physical memory that should be mapped/made
68 * Creates an unlinked temporary file of size (len + highmem) and memory maps
71 * The offset is needed as the length of the total physical memory
72 * (len + highmem) includes the size of the memory used be the executable image,
73 * but the mapped-to address is the last address of the executable image
76 * The memory mapped memory of the temporary file is used as backing memory
82 unsigned long reserve = reserve_end - start; in setup_physmem()
83 unsigned long map_size = len - reserve; in setup_physmem()
87 os_warn("Too few physical memory! Needed=%lu, given=%lu\n", in setup_physmem()
97 os_warn("setup_physmem - mapping %lu bytes of memory at 0x%p " in setup_physmem()
98 "failed - errno = %d\n", map_size, in setup_physmem()
104 * Special kludge - This page will be mapped in to userspace processes in setup_physmem()
120 int fd = -1; in phys_mapping()
127 struct iomem_region *region = iomem_regions; in phys_mapping() local
129 while (region != NULL) { in phys_mapping()
130 if ((phys >= region->phys) && in phys_mapping()
131 (phys < region->phys + region->size)) { in phys_mapping()
132 fd = region->fd; in phys_mapping()
133 *offset_out = phys - region->phys; in phys_mapping()
136 region = region->next; in phys_mapping()
141 *offset_out = phys - iomem_size; in phys_mapping()
156 " This controls how much \"physical\" memory the kernel allocates\n"
159 " This is not related to the amount of memory in the host. It can\n"
168 " Configure <file> as an IO memory region named <name>.\n\n"
183 struct iomem_region *region = iomem_regions; in find_iomem() local
185 while (region != NULL) { in find_iomem()
186 if (!strcmp(region->driver, driver)) { in find_iomem()
187 *len_out = region->size; in find_iomem()
188 return region->virt; in find_iomem()
191 region = region->next; in find_iomem()
200 struct iomem_region *region = iomem_regions; in setup_iomem() local
204 while (region != NULL) { in setup_iomem()
205 err = os_map_memory((void *) iomem_start, region->fd, 0, in setup_iomem()
206 region->size, 1, 1, 0); in setup_iomem()
208 printk(KERN_ERR "Mapping iomem region for driver '%s' " in setup_iomem()
209 "failed, errno = %d\n", region->driver, -err); in setup_iomem()
211 region->virt = iomem_start; in setup_iomem()
212 region->phys = __pa(region->virt); in setup_iomem()
215 iomem_start += region->size + PAGE_SIZE; in setup_iomem()
216 region = region->next; in setup_iomem()