9a894704 | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split out semihost_sys_lseek
Split out the non-ARM specific portions of SYS_SEEK to a reusable function. This handles all GuestFD. Isolate the curious ARM-specific return value proces
semihosting: Split out semihost_sys_lseek
Split out the non-ARM specific portions of SYS_SEEK to a reusable function. This handles all GuestFD. Isolate the curious ARM-specific return value processing to a new callback, common_semi_seek_cb.
Expand the internal type of the offset to int64_t, and provide the whence argument, which will be required by m68k and nios2 semihosting.
Note that gdb_do_syscall %x reads target_ulong, not int.
Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
40f1219a | 29-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Bound length for semihost_sys_{read,write}
Fixes a minor bug in which a 64-bit guest on a 32-bit host could truncate the length. This would only ever cause a problem if there were no b
semihosting: Bound length for semihost_sys_{read,write}
Fixes a minor bug in which a 64-bit guest on a 32-bit host could truncate the length. This would only ever cause a problem if there were no bits set in the low 32, so that it truncates to 0.
Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
aa915bd0 | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split out semihost_sys_write
Split out the non-ARM specific portions of SYS_WRITE to a reusable function. This handles all GuestFD. This removes the last use of common_semi_syscall_le
semihosting: Split out semihost_sys_write
Split out the non-ARM specific portions of SYS_WRITE to a reusable function. This handles all GuestFD. This removes the last use of common_semi_syscall_len.
Note that gdb_do_syscall %x reads target_ulong, not int.
Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
af0484b5 | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split out semihost_sys_read
Split out the non-ARM specific portions of SYS_READ to a reusable function. This handles all GuestFD. Isolate the curious ARM-specific return value process
semihosting: Split out semihost_sys_read
Split out the non-ARM specific portions of SYS_READ to a reusable function. This handles all GuestFD. Isolate the curious ARM-specific return value processing to a new callback, common_semi_rw_cb.
Note that gdb_do_syscall %x reads target_ulong, not int.
Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
5eadbbfc | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split out semihost_sys_close
Split out the non-ARM specific portions of SYS_CLOSE to a reusable function. This handles all GuestFD.
Note that gdb_do_syscall %x reads target_ulong, not
semihosting: Split out semihost_sys_close
Split out the non-ARM specific portions of SYS_CLOSE to a reusable function. This handles all GuestFD.
Note that gdb_do_syscall %x reads target_ulong, not int.
Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
5b3f39cb | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split out semihost_sys_open
Split out the non-ARM specific portions of SYS_OPEN to a reusable function. This handles gdb and host file i/o.
Add helpers to validate the length of the f
semihosting: Split out semihost_sys_open
Split out the non-ARM specific portions of SYS_OPEN to a reusable function. This handles gdb and host file i/o.
Add helpers to validate the length of the filename string. Prepare for usage by other semihosting by allowing the filename length parameter to be 0, and calling strlen.
Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
3753b00e | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Move GET_ARG/SET_ARG earlier in the file
Moving this to be useful for another function besides do_common_semihosting.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Pet
semihosting: Move GET_ARG/SET_ARG earlier in the file
Moving this to be useful for another function besides do_common_semihosting.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
189878ae | 29-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Use env more often in do_common_semihosting
We've already loaded cs->env_ptr into a local variable; use it. Since env is unconditionally used, we don't need a dummy use.
Reviewed-by: L
semihosting: Use env more often in do_common_semihosting
We've already loaded cs->env_ptr into a local variable; use it. Since env is unconditionally used, we don't need a dummy use.
Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
1b3b7693 | 07-Jun-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split out common-semi-target.h
Move the ARM and RISCV specific helpers into their own header file.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Luc Michel <lmichel@ka
semihosting: Split out common-semi-target.h
Move the ARM and RISCV specific helpers into their own header file.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
a1df4bab | 29-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split out common_semi_has_synccache
We already have some larger ifdef blocks for ARM and RISCV; split out a boolean test for SYS_SYNCCACHE.
Reviewed-by: Alistair Francis <alistair.fran
semihosting: Split out common_semi_has_synccache
We already have some larger ifdef blocks for ARM and RISCV; split out a boolean test for SYS_SYNCCACHE.
Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
3c820ddc | 29-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split common_semi_flen_buf per target
We already have some larger ifdef blocks for ARM and RISCV; split out common_semi_stack_bottom per target.
Reviewed-by: Peter Maydell <peter.mayde
semihosting: Split common_semi_flen_buf per target
We already have some larger ifdef blocks for ARM and RISCV; split out common_semi_stack_bottom per target.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
ef9c5ea8 | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split is_64bit_semihosting per target
We already have some larger ifdef blocks for ARM and RISCV; split the function into multiple implementations per arch.
Reviewed-by: Peter Maydell
semihosting: Split is_64bit_semihosting per target
We already have some larger ifdef blocks for ARM and RISCV; split the function into multiple implementations per arch.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
cd7f29e3 | 29-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Use struct gdb_stat in common_semi_flen_cb
Load the entire 64-bit size value. While we're at it, use offsetof instead of an integer constant.
Reviewed-by: Peter Maydell <peter.maydell
semihosting: Use struct gdb_stat in common_semi_flen_cb
Load the entire 64-bit size value. While we're at it, use offsetof instead of an integer constant.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
94b14fe0 | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
include/exec: Move gdb open flags to gdbstub.h
There were 3 copies of these flags. Place them in the file with gdb_do_syscall, with which they belong.
Reviewed-by: Alex Bennée <alex.bennee@linaro.
include/exec: Move gdb open flags to gdbstub.h
There were 3 copies of these flags. Place them in the file with gdb_do_syscall, with which they belong.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
a1a2a3e6 | 07-Jun-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Remove GDB_O_BINARY
The value is zero, and gdb always opens files in binary mode.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@
semihosting: Remove GDB_O_BINARY
The value is zero, and gdb always opens files in binary mode.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
bb3b8821 | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Move common-semi.h to include/semihosting/
This header is not private to the top-level semihosting directory, so place it in the public include directory.
Reviewed-by: Alex Bennée <ale
semihosting: Move common-semi.h to include/semihosting/
This header is not private to the top-level semihosting directory, so place it in the public include directory.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
ed3a06b1 | 28-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Return void from do_common_semihosting
Perform the cleanup in the FIXME comment in common_semi_gdb_syscall. Do not modify guest registers until the syscall is complete, which in the gdb
semihosting: Return void from do_common_semihosting
Perform the cleanup in the FIXME comment in common_semi_gdb_syscall. Do not modify guest registers until the syscall is complete, which in the gdbstub case is asynchronous.
In the synchronous non-gdbstub case, use common_semi_set_ret to set the result. Merge set_swi_errno into common_semi_cb. Rely on the latter for combined return value / errno setting.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
4cfeff4a | 16-May-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Clean up common_semi_open_cb
Use common_semi_cb to return results instead of calling set_swi_errno and common_semi_set_ret directly.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> S
semihosting: Clean up common_semi_open_cb
Use common_semi_cb to return results instead of calling set_swi_errno and common_semi_set_ret directly.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
84ca0dfd | 16-May-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Clean up common_semi_flen_cb
Do not read from the gdb struct stat buffer if the callback is reporting an error. Use common_semi_cb to finish returning results.
Reviewed-by: Alex Bennée
semihosting: Clean up common_semi_flen_cb
Do not read from the gdb struct stat buffer if the callback is reporting an error. Use common_semi_cb to finish returning results.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
709fe27b | 29-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Adjust error checking in common_semi_cb
The err parameter is non-zero if and only if an error occured. Use this instead of ret == -1 for determining if we need to update the saved errno
semihosting: Adjust error checking in common_semi_cb
The err parameter is non-zero if and only if an error occured. Use this instead of ret == -1 for determining if we need to update the saved errno.
This fixes the errno setting of SYS_ISTTY, which returns 0 on error, not -1.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
5aadd182 | 16-May-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Inline set_swi_errno into common_semi_cb
Do not store 'err' into errno only to read it back immediately. Use 'ret' for the return value, not 'reg0'.
Reviewed-by: Peter Maydell <peter.m
semihosting: Inline set_swi_errno into common_semi_cb
Do not store 'err' into errno only to read it back immediately. Use 'ret' for the return value, not 'reg0'.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
1c6ff720 | 27-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Split out guestfd.c
In arm-compat-semi.c, we have more advanced treatment of guest file descriptors than we do in other implementations. Split out GuestFD and related functions to a new
semihosting: Split out guestfd.c
In arm-compat-semi.c, we have more advanced treatment of guest file descriptors than we do in other implementations. Split out GuestFD and related functions to a new file so that they can be shared.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
3d5e2b4f | 27-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Simplify softmmu_lock_user_string
We are not currently bounding the search to the 1024 bytes that we allocated, possibly overrunning the buffer. Use softmmu_strlen_user to find the leng
semihosting: Simplify softmmu_lock_user_string
We are not currently bounding the search to the 1024 bytes that we allocated, possibly overrunning the buffer. Use softmmu_strlen_user to find the length and allocate the correct size from the beginning.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
5f9ca6f3 | 27-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Add target_strlen for softmmu-uaccess.h
Mirror the interface of the user-only function of the same name. Use probe_access_flags for the common case of ram, and cpu_memory_rw_debug for t
semihosting: Add target_strlen for softmmu-uaccess.h
Mirror the interface of the user-only function of the same name. Use probe_access_flags for the common case of ram, and cpu_memory_rw_debug for the uncommon case of mmio.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- v3: Use probe_access_flags (pmm)
show more ...
|
0a922181 | 27-Apr-2022 |
Richard Henderson <richard.henderson@linaro.org> |
semihosting: Move softmmu-uaccess.h functions out of line
Rather that static (and not even inline) functions within a header, move the functions to semihosting/uaccess.c.
Reviewed-by: Peter Maydell
semihosting: Move softmmu-uaccess.h functions out of line
Rather that static (and not even inline) functions within a header, move the functions to semihosting/uaccess.c.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|