Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
system_mm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
15#ifndef ZEPHYR_INCLUDE_DRIVERS_SYSTEM_MM_H_
16#define ZEPHYR_INCLUDE_DRIVERS_SYSTEM_MM_H_
17
18#include <kernel.h>
19
20#ifndef _ASMLANGUAGE
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
32/*
33 * Caching mode definitions. These are mutually exclusive.
34 */
35
37#define SYS_MM_MEM_CACHE_NONE 2
38
40#define SYS_MM_MEM_CACHE_WT 1
41
43#define SYS_MM_MEM_CACHE_WB 0
44
46#define SYS_MM_MEM_CACHE_MASK (BIT(3) - 1)
47
48/*
49 * Region permission attributes.
50 * Default should be read-only, no user, no exec.
51 */
52
54#define SYS_MM_MEM_PERM_RW BIT(3)
55
57#define SYS_MM_MEM_PERM_EXEC BIT(4)
58
60#define SYS_MM_MEM_PERM_USER BIT(5)
61
83
105int sys_mm_drv_map_region(void *virt, uintptr_t phys,
106 size_t size, uint32_t flags);
107
129int sys_mm_drv_map_array(void *virt, uintptr_t *phys,
130 size_t cnt, uint32_t flags);
131
153int sys_mm_drv_unmap_page(void *virt);
154
177int sys_mm_drv_unmap_region(void *virt, size_t size);
178
196int sys_mm_drv_page_phys_get(void *virt, uintptr_t *phys);
197
225int sys_mm_drv_remap_region(void *virt_old, size_t size, void *virt_new);
226
258int sys_mm_drv_move_region(void *virt_old, size_t size, void *virt_new,
259 uintptr_t phys_new);
260
293int sys_mm_drv_move_array(void *virt_old, size_t size, void *virt_new,
294 uintptr_t *phys_new, size_t phys_cnt);
295
300#ifdef __cplusplus
301}
302#endif
303
304#endif /* _ASMLANGUAGE */
305
306#endif /* ZEPHYR_INCLUDE_DRIVERS_SYSTEM_MM_H_ */
int sys_mm_drv_map_region(void *virt, uintptr_t phys, size_t size, uint32_t flags)
Map a region of physical memory into the virtual address space.
int sys_mm_drv_move_region(void *virt_old, size_t size, void *virt_new, uintptr_t phys_new)
Physically move memory, with copy.
int sys_mm_drv_map_page(void *virt, uintptr_t phys, uint32_t flags)
Map one physical page into the virtual address space.
int sys_mm_drv_page_phys_get(void *virt, uintptr_t *phys)
Get the mapped physical memory address from virtual address.
int sys_mm_drv_move_array(void *virt_old, size_t size, void *virt_new, uintptr_t *phys_new, size_t phys_cnt)
Physically move memory, with copy.
int sys_mm_drv_map_array(void *virt, uintptr_t *phys, size_t cnt, uint32_t flags)
Map an array of physical memory into the virtual address space.
int sys_mm_drv_unmap_page(void *virt)
Remove mapping for one page of the provided virtual address.
int sys_mm_drv_unmap_region(void *virt, size_t size)
Remove mappings for a provided virtual address range.
int sys_mm_drv_remap_region(void *virt_old, size_t size, void *virt_new)
Remap virtual pages into new address.
flags
Definition: http_parser.h:131
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:75