From 81bbe906c89b6b7af58a1eeb96ec5a0bfdc3386f Mon Sep 17 00:00:00 2001 From: "takasi-y@ops.dti.ne.jp" Date: Mon, 12 Apr 2010 04:07:35 +0900 Subject: linux-user: rlimit conversion between host and target. rlim_t conversion between host and target added. Otherwise there are some incorrect case like - RLIM_INFINITY on 32bit target -> 64bit host. - RLIM_INFINITY on 64bit host -> mips and sparc target ? - Big value(for 32bit target) on 64bit host -> 32bit target. One is added into getrlimit, setrlimit, and ugetrlimit. It converts both RLIM_INFINITY and value bigger than target can hold(>31bit) to RLIM_INFINITY. Another one is added to guest_stack_size calculation introduced by 703e0e89. The rule is mostly same except the result on the case is keeping the value of guest_stack_size. Slightly tested for SH4, and x86_64 -linux-user on x86_64-pc-linux host. Signed-off-by: Takashi YOSHII Acked-by: Richard Henderson Signed-off-by: Aurelien Jarno --- linux-user/syscall_defs.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linux-user/syscall_defs.h') diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 63c2bc3..255e89c 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -669,6 +669,14 @@ struct target_rlimit { abi_ulong rlim_max; }; +#if defined(TARGET_ALPHA) +#define TARGET_RLIM_INFINITY 0x7ffffffffffffffful +#elif defined(TARGET_MIPS) || defined(TARGET_SPARC) +#define TARGET_RLIM_INFINITY 0x7fffffffUL +#else +#define TARGET_RLIM_INFINITY ((target_ulong)~0UL) +#endif + struct target_pollfd { int fd; /* file descriptor */ short events; /* requested events */ -- cgit v1.1