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)
This commit is contained in:
Richard Henderson 2022-04-27 21:03:12 -07:00
parent b89350e830
commit 5f9ca6f3c5
2 changed files with 52 additions and 0 deletions

View file

@ -53,4 +53,7 @@ void softmmu_unlock_user(CPUArchState *env, void *p,
target_ulong addr, target_ulong len);
#define unlock_user(s, args, len) softmmu_unlock_user(env, s, args, len)
ssize_t softmmu_strlen_user(CPUArchState *env, target_ulong addr);
#define target_strlen(p) softmmu_strlen_user(env, p)
#endif /* SEMIHOSTING_SOFTMMU_UACCESS_H */