mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
semihosting/uaccess: Remove uses of target_ulong type
Replace target_ulong by vaddr or size_t types to match cpu_memory_rw_debug() prototype in "exec/cpu-common.h": > int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, > void *ptr, size_t len, > bool is_write); Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250526095213.14113-2-philmd@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-ID: <20250627112512.1880708-4-alex.bennee@linaro.org>
This commit is contained in:
parent
374a245573
commit
328c1a0b86
2 changed files with 11 additions and 11 deletions
|
@ -15,9 +15,9 @@
|
|||
#endif
|
||||
|
||||
#include "exec/cpu-common.h"
|
||||
#include "exec/cpu-defs.h"
|
||||
#include "exec/tswap.h"
|
||||
#include "exec/page-protection.h"
|
||||
#include "exec/vaddr.h"
|
||||
|
||||
/**
|
||||
* get_user_u64:
|
||||
|
@ -89,8 +89,8 @@
|
|||
*
|
||||
* The returned pointer should be freed using uaccess_unlock_user().
|
||||
*/
|
||||
void *uaccess_lock_user(CPUArchState *env, target_ulong addr,
|
||||
target_ulong len, bool copy);
|
||||
void *uaccess_lock_user(CPUArchState *env, vaddr addr,
|
||||
size_t len, bool copy);
|
||||
/**
|
||||
* lock_user:
|
||||
*
|
||||
|
@ -103,7 +103,7 @@ void *uaccess_lock_user(CPUArchState *env, target_ulong addr,
|
|||
*
|
||||
* The returned string should be freed using uaccess_unlock_user().
|
||||
*/
|
||||
char *uaccess_lock_user_string(CPUArchState *env, target_ulong addr);
|
||||
char *uaccess_lock_user_string(CPUArchState *env, vaddr addr);
|
||||
/**
|
||||
* uaccess_lock_user_string:
|
||||
*
|
||||
|
@ -112,10 +112,10 @@ char *uaccess_lock_user_string(CPUArchState *env, target_ulong addr);
|
|||
#define lock_user_string(p) uaccess_lock_user_string(env, p)
|
||||
|
||||
void uaccess_unlock_user(CPUArchState *env, void *p,
|
||||
target_ulong addr, target_ulong len);
|
||||
vaddr addr, size_t len);
|
||||
#define unlock_user(s, args, len) uaccess_unlock_user(env, s, args, len)
|
||||
|
||||
ssize_t uaccess_strlen_user(CPUArchState *env, target_ulong addr);
|
||||
ssize_t uaccess_strlen_user(CPUArchState *env, vaddr addr);
|
||||
#define target_strlen(p) uaccess_strlen_user(env, p)
|
||||
|
||||
#endif /* SEMIHOSTING_SOFTMMU_UACCESS_H */
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#include "exec/tlb-flags.h"
|
||||
#include "semihosting/uaccess.h"
|
||||
|
||||
void *uaccess_lock_user(CPUArchState *env, target_ulong addr,
|
||||
target_ulong len, bool copy)
|
||||
void *uaccess_lock_user(CPUArchState *env, vaddr addr,
|
||||
size_t len, bool copy)
|
||||
{
|
||||
void *p = malloc(len);
|
||||
if (p && copy) {
|
||||
|
@ -27,7 +27,7 @@ void *uaccess_lock_user(CPUArchState *env, target_ulong addr,
|
|||
return p;
|
||||
}
|
||||
|
||||
ssize_t uaccess_strlen_user(CPUArchState *env, target_ulong addr)
|
||||
ssize_t uaccess_strlen_user(CPUArchState *env, vaddr addr)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env_cpu(env), false);
|
||||
size_t len = 0;
|
||||
|
@ -75,7 +75,7 @@ ssize_t uaccess_strlen_user(CPUArchState *env, target_ulong addr)
|
|||
}
|
||||
}
|
||||
|
||||
char *uaccess_lock_user_string(CPUArchState *env, target_ulong addr)
|
||||
char *uaccess_lock_user_string(CPUArchState *env, vaddr addr)
|
||||
{
|
||||
ssize_t len = uaccess_strlen_user(env, addr);
|
||||
if (len < 0) {
|
||||
|
@ -85,7 +85,7 @@ char *uaccess_lock_user_string(CPUArchState *env, target_ulong addr)
|
|||
}
|
||||
|
||||
void uaccess_unlock_user(CPUArchState *env, void *p,
|
||||
target_ulong addr, target_ulong len)
|
||||
vaddr addr, size_t len)
|
||||
{
|
||||
if (len) {
|
||||
cpu_memory_rw_debug(env_cpu(env), addr, p, len, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue