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"
17	select SYS_HASH_FUNC32
18	select SYS_HASH_FUNC32_DJB2
19	select FDTABLE
20	select POSIX_MAPPED_FILES
21	help
22	  Select 'y' here and Zephyr will provide implementations of shm_open() and shm_unlink().
23
24	  For more information, please see
25	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
26	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
27
28config POSIX_MAPPED_FILES
29	bool "POSIX memory-mapped files"
30	help
31	  Select 'y' here and Zephyr will provide support for mmap(), msync(), and munmap().
32
33	  Note: This feature depends on hardware MMU support. If the underlying platform does not
34	  support an MMU, then affected POSIX API functions may return -1 and set errno to ENOTSUP.
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"
44	help
45	  Select 'y' here and Zephyr will provide support for mlockall() and munlockall().
46
47	  Note: This feature depends on hardware MMU support as well as DEMAND_PAGING. If the
48	  underlying platform does not support an MMU or DEMAND_PAGING, then affected POSIX API
49	  functions will return -1 and set errno to ENOTSUP.
50
51	  For more information, please see
52	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
53	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
54
55config POSIX_MEMLOCK_RANGE
56	bool "POSIX range memory locking"
57	imply DEMAND_PAGING
58	help
59	  Select 'y' here and Zephyr will provide support for mlock() and munlock().
60
61	  Note: This feature depends on hardware MMU support. If the underlying platform does not
62	  support an MMU, then affected POSIX API functions will return -1 and set errno to ENOTSUP.
63
64	  For more information, please see
65	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
66	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
67
68endif
69
70config POSIX_MEMORY_PROTECTION
71	bool "POSIX memory protection"
72	help
73	  Select 'y' here and Zephyr will provide support for mprotect().
74
75	  For more information, please see
76	  https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/V2_chap02.html
77	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_port.html#tag_24_03_04
78
79endmenu
80