The previous approach with memfd has 3 problems: 1) The close operation on the memfd isn't tied with optee_shm_close, therefore close(fd) doesn't free the optee_shm struct allocated by the kernel. 2) The kernel unnecessarily maps the file descriptor to its memory, however only userspace should need to do that. 3) Since the kernel doesn't need to map the file descriptor we don't need to unmap it. To use anonymous mapping, the prototype of map_anonymous() was moved from fs/mmap/fs_anonmap.h to include/nuttx/fs/fs.h. Since fs_anonmap.h didn't contain any other information it is deleted. A type from fs/mmap/fs_rammap.h was moved to the public : include/nuttx/fs/fs.h as well. Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| fs_anonmap.c | ||
| fs_mmap.c | ||
| fs_mmisc.c | ||
| fs_msync.c | ||
| fs_munmap.c | ||
| fs_rammap.c | ||
| fs_rammap.h | ||
| Kconfig | ||
| Make.defs | ||