aboutsummaryrefslogtreecommitdiff
path: root/bsd-user/bsd-mem.h
AgeCommit message (Collapse)Author
2024-05-06exec/cpu: Extract page-protection definitions to page-protection.hPhilippe Mathieu-Daudé
Extract page-protection definitions from "exec/cpu-all.h" to "exec/page-protection.h". The list of files requiring the new header was generated using: $ git grep -wE \ 'PAGE_(READ|WRITE|EXEC|RWX|VALID|ANON|RESERVED|TARGET_.|PASSTHROUGH)' Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Nicholas Piggin <npiggin@gmail.com> Acked-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240427155714.53669-3-philmd@linaro.org>
2023-11-15bsd-user: spelling fixes: necesary, agrument, undocummentedMichael Tokarev
Fixes: a99d74034754 "bsd-user: Implement do_obreak function" Fixes: 8632729060bf "bsd-user: Implement freebsd_exec_common, used in implementing execve/fexecve." Fixes: bf14f13d8be8 "bsd-user: Implement stat related syscalls" Reviewed-by: Warner Losh <imp@bsdimp.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2023-10-03bsd-user: Add stubs for vadvise(), sbrk() and sstk()Warner Losh
The above system calls are not supported by qemu. Signed-off-by: Warner Losh <imp@bsdimp.com> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-24-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement shmat(2) and shmdt(2)Stacey Son
Use `WITH_MMAP_LOCK_GUARD` instead of mmap_lock() and mmap_unlock(), to match linux-user implementation, according to the following commits: 69fa2708a216df715ba5102a0f98468b540a464e linux-user: Use WITH_MMAP_LOCK_GUARD in target_{shmat,shmdt} ceda5688b650646248f269a992c06b11148c5759 linux-user: Fix shmdt Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Message-Id: <20230925182709.4834-23-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement shmctl(2)Stacey Son
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-22-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement shm_unlink(2) and shmget(2)Stacey Son
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-21-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement shm_open(2)Stacey Son
Co-authored-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-20-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement do_obreak functionStacey Son
Match linux-user, by manually applying the following commits, in order: d28b3c90cfad1a7e211ae2bce36ecb9071086129 linux-user: Make sure initial brk(0) is page-aligned 15ad98536ad9410fb32ddf1ff09389b677643faa linux-user: Fix qemu brk() to not zero bytes on current page dfe49864afb06e7e452a4366051697bc4fcfc1a5 linux-user: Prohibit brk() to to shrink below initial heap address eac78a4b0b7da4de2c0a297f4d528ca9cc6256a3 linux-user: Fix signed math overflow in brk() syscall c6cc059eca18d9f6e4e26bb8b6d1135ddb35d81a linux-user: Do not call get_errno() in do_brk() e69e032d1a8ee8d754ca119009a3c2c997f8bb30 linux-user: Use MAP_FIXED_NOREPLACE for do_brk() cb9d5d1fda0bc2312fc0c779b4ea1d7bf826f31f linux-user: Do nothing if too small brk is specified 2aea137a425a87b930a33590177b04368fd7cc12 linux-user: Do not align brk with host page size Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-19-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement mincore(2)Stacey Son
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-18-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implment madvise(2) to match the linux-user implementation.Karim Taha
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-17-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement mlock(2), munlock(2), mlockall(2), munlockall(2), ↵Stacey Son
minherit(2) Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-16-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement msync(2)Stacey Son
Co-authored-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-15-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement mprotect(2)Stacey Son
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Warner Losh <imp@bsdimp.com> Message-Id: <20230925182709.4834-14-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Implement mmap(2) and munmap(2)Stacey Son
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-13-kariem.taha2.7@gmail.com>
2023-10-03bsd-user: Introduce bsd-mem.h to the source treeStacey Son
Preserve the copyright notice and help with the 'Author' info for subsequent changes to the file. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230925182709.4834-12-kariem.taha2.7@gmail.com>