Lines Matching +full:address +full:- +full:aligned
4 * SPDX-License-Identifier: Apache-2.0
11 * This contains APIs for a system-wide memory management
30 * This contains APIs for a system-wide memory management
48 /** Write-through caching */
51 /** Full write-back caching */
55 #define SYS_MM_MEM_CACHE_MASK (BIT(3) - 1)
64 * Default should be read-only, no user, no exec.
69 /** Region will have read/write access (and not read-only) */
75 /** Region will be accessible to user mode (normally supervisor-only) */
91 * @brief Map one physical page into the virtual address space
93 * This maps one physical page into the virtual address space.
94 * Behavior when providing unaligned address is undefined, this
95 * is assumed to be page aligned.
102 * @param virt Page-aligned destination virtual address to map
103 * @param phys Page-aligned source physical address to map
107 * @retval -EINVAL if invalid arguments are provided
108 * @retval -EFAULT if virtual address has already been mapped
113 * @brief Map a region of physical memory into the virtual address space
115 * This maps a region of physical memory into the virtual address space.
117 * are assumed to be page aligned.
124 * @param virt Page-aligned destination virtual address to map
125 * @param phys Page-aligned source physical address to map
126 * @param size Page-aligned size of the mapped memory region in bytes
130 * @retval -EINVAL if invalid arguments are provided
131 * @retval -EFAULT if any virtual addresses have already been mapped
137 * @brief Map an array of physical memory into the virtual address space
139 * This maps an array of physical pages into a continuous virtual address
141 * are assumed to be page aligned.
148 * @param virt Page-aligned destination virtual address to map
149 * @param phys Array of pge-aligned source physical address to map
154 * @retval -EINVAL if invalid arguments are provided
155 * @retval -EFAULT if any virtual addresses have already been mapped
161 * @brief Remove mapping for one page of the provided virtual address
163 * This unmaps one page from the virtual address space.
170 * Behavior when providing unaligned address is undefined, this
171 * is assumed to be page aligned.
175 * @param virt Page-aligned virtual address to un-map
178 * @retval -EINVAL if invalid arguments are provided
179 * @retval -EFAULT if virtual address is not mapped
184 * @brief Remove mappings for a provided virtual address range
186 * This unmaps pages in the provided virtual address range.
193 * Behavior when providing unaligned address is undefined, this
194 * is assumed to be page aligned.
198 * @param virt Page-aligned base virtual address to un-map
199 * @param size Page-aligned region size
202 * @retval -EINVAL if invalid arguments are provided
203 * @retval -EFAULT if virtual address is not mapped
208 * @brief Remap virtual pages into new address
214 * aligned and valid.
224 * @param virt_old Page-aligned base virtual address of existing memory
225 * @param size Page-aligned size of the mapped memory region in bytes
226 * @param virt_new Page-aligned base virtual address to which to remap
230 * @retval -EINVAL if invalid arguments are provided
231 * @retval -EFAULT if old virtual addresses are not all mapped or
251 * This maps a region of physical memory into the new virtual address space
253 * address space (@p virt_old). The new virtual memory region is mapped
257 * are assumed to be page aligned.
267 * @param virt_old Page-aligned base virtual address of existing memory
268 * @param size Page-aligned size of the mapped memory region in bytes
269 * @param virt_new Page-aligned base virtual address to which to map
271 * @param phys_new Page-aligned base physical address to contain
275 * @retval -EINVAL if invalid arguments are provided
276 * @retval -EFAULT if old virtual addresses are not all mapped or
285 * This maps a region of physical memory into the new virtual address space
287 * address space (@p virt_old). The new virtual memory region is mapped
291 * are assumed to be page aligned.
301 * @param virt_old Page-aligned base virtual address of existing memory
302 * @param size Page-aligned size of the mapped memory region in bytes
303 * @param virt_new Page-aligned base virtual address to which to map
305 * @param phys_new Array of page-aligned physical address to contain
310 * @retval -EINVAL if invalid arguments are provided
311 * @retval -EFAULT if old virtual addresses are not all mapped or
333 * mapped to a virtual address. This is useful when use case of
336 * it needs to be read-write and after it has already
338 * attributes need to be changed to read-only/executable.
341 * @param virt Page-aligned virtual address to be updated
345 * @retval -EINVAL if invalid arguments are provided
346 * @retval -EFAULT if virtual addresses is not mapped
355 * mapped to a virtual address. This is useful when use case of
358 * it needs to be read-write and after it has already
360 * attributes need to be changed to read-only/executable.
363 * @param virt Page-aligned virtual address to be updated
364 * @param size Page-aligned size of the mapped memory region in bytes
368 * @retval -EINVAL if invalid arguments are provided
369 * @retval -EFAULT if virtual addresses is not mapped
387 * @brief Get the mapped physical memory address from virtual address.
390 * memory address of a mapped virtual address.
392 * Behavior when providing unaligned address is undefined, this
393 * is assumed to be page aligned.
395 * @param virt Page-aligned virtual address
396 * @param[out] phys Mapped physical address (can be NULL if only checking
397 * if virtual address is mapped)
400 * @retval -EINVAL if invalid arguments are provided
401 * @retval -EFAULT if virtual address is not mapped
412 void *addr; /**< @brief Address of the memory region */
425 for (iter = regions; iter->size; iter++)
435 * @retval regions A possibly empty array - i.e. containing only the sentinel
436 * marking at the end - of memory regions.