mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00

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>
25 lines
748 B
C
25 lines
748 B
C
/*
|
|
* Syscall implementations for semihosting.
|
|
*
|
|
* Copyright (c) 2022 Linaro
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef SEMIHOSTING_SYSCALLS_H
|
|
#define SEMIHOSTING_SYSCALLS_H
|
|
|
|
/*
|
|
* Argument loading from the guest is performed by the caller;
|
|
* results are returned via the 'complete' callback.
|
|
*
|
|
* String operands are in address/len pairs. The len argument may be 0
|
|
* (when the semihosting abi does not already provide the length),
|
|
* or non-zero (where it should include the terminating zero).
|
|
*/
|
|
|
|
void semihost_sys_open(CPUState *cs, gdb_syscall_complete_cb complete,
|
|
target_ulong fname, target_ulong fname_len,
|
|
int gdb_flags, int mode);
|
|
|
|
#endif /* SEMIHOSTING_SYSCALLS_H */
|