1# Copyright (c) 2024 BayLibre SAS
2#
3# SPDX-License-Identifier: Apache-2.0
4
5menu "POSIX memory"
6
7config POSIX_PAGE_SIZE
8	hex
9	# TODO: something similar and arch-independent for MPUs
10	default MMU_PAGE_SIZE if MMU
11	default 0x40
12	help
13	  This option is not user-configurable.
14
15config POSIX_SHARED_MEMORY_OBJECTS
16	bool "POSIX shared memory objects [EXPERIMENTAL]"
17	select EXPERIMENTAL
18	select SYS_HASH_FUNC32
19	select SYS_HASH_FUNC32_DJB2
20	select FDTABLE
21	select POSIX_MAPPED_FILES
22	help
23	  Select 'y' here and Zephyr will provide implementations of shm_open() and shm_unlink().
24
25	  For more information, please see
26	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
27	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
28
29config POSIX_MAPPED_FILES
30	bool "POSIX memory-mapped files [EXPERIMENTAL]"
31	select EXPERIMENTAL
32	imply MMU
33	help
34	  Select 'y' here and Zephyr will provide support for mmap(), msync(), and munmap().
35
36	  For more information, please see
37	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
38	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
39
40if POSIX_MAPPED_FILES
41
42config POSIX_MEMLOCK
43	bool "POSIX memory locking [EXPERIMENTAL]"
44	select EXPERIMENTAL
45	help
46	  Select 'y' here and Zephyr will provide support for mlockall() and munlockall().
47
48	  For more information, please see
49	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
50	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
51
52config POSIX_MEMLOCK_RANGE
53	bool "POSIX range memory locking [EXPERIMENTAL]"
54	select EXPERIMENTAL
55	imply MMU
56	imply DEMAND_PAGING
57	help
58	  Select 'y' here and Zephyr will provide support for mlock() and munlock().
59
60	  For more information, please see
61	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
62	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
63
64endif
65
66config POSIX_MEMORY_PROTECTION
67	bool "POSIX memory protection [EXPERIMENTAL]"
68	select EXPERIMENTAL
69	help
70	  Select 'y' here and Zephyr will provide support for mprotect().
71
72	  For more information, please see
73	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
74	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
75
76endmenu
77