a5b88166 | 31-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user: Add safe system call macros
Add a series of macros to create system call macros that go via the safe_syscall path.
Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Warner Los
bsd-user: Add safe system call macros
Add a series of macros to create system call macros that go via the safe_syscall path.
Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
0ff05082 | 31-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user: Define target_arg64
target_arg64 is a generic way to extract 64-bits from a pair of arguments. On 32-bit platforms, it returns them joined together as appropriate. On 64-bit platforms, it
bsd-user: Define target_arg64
target_arg64 is a generic way to extract 64-bits from a pair of arguments. On 32-bit platforms, it returns them joined together as appropriate. On 64-bit platforms, it returns the first arg because it's already 64-bits.
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
647afdf1 | 31-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user: introduce target.h
Create target.h. This file is intended to be simple and describe basic things about the architecture. If something is a basic feature of the architecture, it belongs her
bsd-user: introduce target.h
Create target.h. This file is intended to be simple and describe basic things about the architecture. If something is a basic feature of the architecture, it belongs here. Should we need something that's per-BSD there will be a target-os.h that will live in the per-bsd directories.
Define regpairs_aligned to reflect whether or not registers are 'paired' for 64-bit arguments or not. This will be false for all 64-bit targets, and will be true on those architectures that pair (currently just armv7 and powerpc on FreeBSD 14.x).
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
c5c84d16 | 31-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/bsd-file.h: Implementation details for the filesystem calls
An include file that pulls in all the definitions needed for the file related system calls. This also includes the host definitio
bsd-user/bsd-file.h: Implementation details for the filesystem calls
An include file that pulls in all the definitions needed for the file related system calls. This also includes the host definitions to implement the system calls and some helper routines to lock/unlock different aspects of the system call arguments.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
deeff83b | 31-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/freebsd/os-syscall.c: Add get_errno and host_to_target_errno
Add the helper functions get_errno and host_to_target_errno. get_errno returns either the system call results, or the -errno whe
bsd-user/freebsd/os-syscall.c: Add get_errno and host_to_target_errno
Add the helper functions get_errno and host_to_target_errno. get_errno returns either the system call results, or the -errno when system call indicates failure by returning -1. Host_to_target_errno returns errno (since on FreeBSD they are the same on all architectures) along with a comment about why it's the identity.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
66eed099 | 29-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/freebsd/os-syscall.c: Move syscall processing here
While there is some commonality between *BSD syscall processing, there's a number of differences and the system call numbers and ABIs have
bsd-user/freebsd/os-syscall.c: Move syscall processing here
While there is some commonality between *BSD syscall processing, there's a number of differences and the system call numbers and ABIs have been independent since the late 90s. Move FreeBSD's proessing here and delete it.
The upstream implementation is somewhat different than the current implementation. It will be much easier to upstream these from scratch, justifying the final result, rather than working out the diffs and justifying the changes. Also tweak a comment to qemu standard form.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
a941a16f | 30-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user: Remove bsd_type
Remove keeping track of which type of bsd we're running on. It's no longer referenced in the code. Building bsd-user on NetBSD or OpenBSD isn't possible, let alone running
bsd-user: Remove bsd_type
Remove keeping track of which type of bsd we're running on. It's no longer referenced in the code. Building bsd-user on NetBSD or OpenBSD isn't possible, let alone running that code. Stop pretending that we can do the cross BSD thing since there's been a large divergence since 2000 that makes this nearly impossible between FreeBSD and {Net,Open}BSD and at least quite difficult between NetBSD and OpenBSD.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
07240672 | 30-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/x86_64/target_arch_thread.h: Assume a FreeBSD target
Since we can't run on anything else, assume for the moment that this is a FreeBSD target. In the future, we'll need to handle this prope
bsd-user/x86_64/target_arch_thread.h: Assume a FreeBSD target
Since we can't run on anything else, assume for the moment that this is a FreeBSD target. In the future, we'll need to handle this properly via some include file in bsd-user/*bsd/x86_64/mumble.h. There's a number of other diffs that would be needed to make things work on OtherBSD, so it doesn't make sense to preseve this one detail today.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
f1f22450 | 30-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/arm/target_arch_thread.h: Assume a FreeBSD target
Since we can't run on anything else, assume for the moment that this is a FreeBSD target. In the future, we'll need to handle this properly
bsd-user/arm/target_arch_thread.h: Assume a FreeBSD target
Since we can't run on anything else, assume for the moment that this is a FreeBSD target. In the future, we'll need to handle this properly via some include file in bsd-user/*bsd/arm/mumble.h. There's a number of other diffs that would be needed to make things work on OtherBSD, so it doesn't make sense to preseve this one detail today.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
e555e709 | 30-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/arm/target_arch_cpu.h: Only support FreeBSD sys calls
Since we don't build on OpenBSD, only do FreeBSD system calls here. In the future, we'll need to move this to some place like bsd-user/
bsd-user/arm/target_arch_cpu.h: Only support FreeBSD sys calls
Since we don't build on OpenBSD, only do FreeBSD system calls here. In the future, we'll need to move this to some place like bsd-user/freebsd/arm/mumble.h, but until then just leave this inline. This reflects changes to the upstream.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
8f4b4816 | 29-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/i386/target_arch_cpu.h: Remove openbsd syscall
This doesn't build on openbsd at the moment, and this could should arguably be in bsd-user/*bsd/i386 somewhere. Until we refactor to support O
bsd-user/i386/target_arch_cpu.h: Remove openbsd syscall
This doesn't build on openbsd at the moment, and this could should arguably be in bsd-user/*bsd/i386 somewhere. Until we refactor to support OpenBSD/NetBSD again, drop it here.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
2614aed7 | 29-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/x86_64/target_arch_cpu.h: Remove openbsd syscall
This doesn't build on openbsd at the moment, and this could should arguably be in bsd-user/*bsd/x86_64 somewhere. Until we refactor to suppo
bsd-user/x86_64/target_arch_cpu.h: Remove openbsd syscall
This doesn't build on openbsd at the moment, and this could should arguably be in bsd-user/*bsd/x86_64 somewhere. Until we refactor to support OpenBSD/NetBSD again, drop it here.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
show more ...
|
872b349f | 29-Jan-2022 |
Warner Losh <imp@bsdimp.com> |
bsd-user/x86_64/target_arch_cpu.h: int $80 never was a BSD system call on amd64
Although initial versions of NetBSD did use int $80, it was replaced by syscall before any releases. OpenBSD and FreeB
bsd-user/x86_64/target_arch_cpu.h: int $80 never was a BSD system call on amd64
Although initial versions of NetBSD did use int $80, it was replaced by syscall before any releases. OpenBSD and FreeBSD always did syscall.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|