[openSUSE] linux-user: use target_ulong
Linux syscalls pass pointers or data length or other information of that sort to the kernel. This is all stuff you don't want to have sign extended. Otherwise a host 64bit variable parameter with a size parameter will extend it to a negative number, breaking lseek for example. Pass syscall arguments as ulong always. Signed-off-by: Alexander Graf <agraf@suse.de> [JRZ: changes from linux-user/qemu.h wass moved to linux-user/user-internals.h] Signed-off-by: Jose R Ziviani <jziviani@suse.de> [DF: Forward port, i.e., use ulong for do_prctl too] Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
This commit is contained in:
		@@ -6341,8 +6341,8 @@ static abi_long do_prctl_inval1(CPUArchState *env, abi_long arg2)
 | 
			
		||||
#define do_prctl_sme_set_vl do_prctl_inval1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
 | 
			
		||||
                         abi_long arg3, abi_long arg4, abi_long arg5)
 | 
			
		||||
static abi_long do_prctl(CPUArchState *env, abi_ulong option, abi_ulong arg2,
 | 
			
		||||
                         abi_ulong arg3, abi_ulong arg4, abi_ulong arg5)
 | 
			
		||||
{
 | 
			
		||||
    abi_long ret;
 | 
			
		||||
 | 
			
		||||
@@ -9082,10 +9082,10 @@ _syscall5(int, sys_move_mount, int, __from_dfd, const char *, __from_pathname,
 | 
			
		||||
 * of syscall results, can be performed.
 | 
			
		||||
 * All errnos that do_syscall() returns must be -TARGET_<errcode>.
 | 
			
		||||
 */
 | 
			
		||||
static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
 | 
			
		||||
                            abi_long arg2, abi_long arg3, abi_long arg4,
 | 
			
		||||
                            abi_long arg5, abi_long arg6, abi_long arg7,
 | 
			
		||||
                            abi_long arg8)
 | 
			
		||||
static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_ulong arg1,
 | 
			
		||||
                            abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
 | 
			
		||||
                            abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
 | 
			
		||||
                            abi_ulong arg8)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu = env_cpu(cpu_env);
 | 
			
		||||
    abi_long ret;
 | 
			
		||||
@@ -13755,10 +13755,10 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1,
 | 
			
		||||
                    abi_long arg2, abi_long arg3, abi_long arg4,
 | 
			
		||||
                    abi_long arg5, abi_long arg6, abi_long arg7,
 | 
			
		||||
                    abi_long arg8)
 | 
			
		||||
abi_long do_syscall(CPUArchState *cpu_env, int num, abi_ulong arg1,
 | 
			
		||||
                    abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
 | 
			
		||||
                    abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
 | 
			
		||||
                    abi_ulong arg8)
 | 
			
		||||
{
 | 
			
		||||
    CPUState *cpu = env_cpu(cpu_env);
 | 
			
		||||
    abi_long ret;
 | 
			
		||||
 
 | 
			
		||||
@@ -60,10 +60,10 @@ int info_is_fdpic(struct image_info *info);
 | 
			
		||||
 | 
			
		||||
void target_set_brk(abi_ulong new_brk);
 | 
			
		||||
void syscall_init(void);
 | 
			
		||||
abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1,
 | 
			
		||||
                    abi_long arg2, abi_long arg3, abi_long arg4,
 | 
			
		||||
                    abi_long arg5, abi_long arg6, abi_long arg7,
 | 
			
		||||
                    abi_long arg8);
 | 
			
		||||
abi_long do_syscall(CPUArchState *cpu_env, int num, abi_ulong arg1,
 | 
			
		||||
                    abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
 | 
			
		||||
                    abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
 | 
			
		||||
                    abi_ulong arg8);
 | 
			
		||||
extern __thread CPUState *thread_cpu;
 | 
			
		||||
G_NORETURN void cpu_loop(CPUArchState *env);
 | 
			
		||||
abi_long get_errno(abi_long ret);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user