* [Qemu-devel] [PATCH 7/7] Enable fork and MIPS64 specific changes in mq_open syscall
@ 2011-09-28 4:38 khansa
2011-09-28 7:38 ` Andreas Färber
0 siblings, 1 reply; 2+ messages in thread
From: khansa @ 2011-09-28 4:38 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, riku.voipio, Khansa Butt, aurelien
From: Khansa Butt <khansa@kics.edu.pk>
Signed-off-by: Khansa Butt <khansa@kics.edu.pk>
---
configure | 1 +
linux-user/syscall.c | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 5e45a43..8d39fda 100755
--- a/configure
+++ b/configure
@@ -3286,6 +3286,7 @@ case "$target_arch2" in
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
+ target_nptl="yes"
target_phys_bits=64
target_long_alignment=8
;;
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6b73769..97ac9fb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7799,10 +7799,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
{
struct mq_attr posix_mq_attr;
+#if defined(TARGET_MIPS64)
+ arg2 = arg2 & 0xff;
+ arg2 = arg2 | 0x40;
+#endif
+
p = lock_user_string(arg1 - 1);
- if (arg4 != 0)
+ if (arg4 != 0) {
copy_from_user_mq_attr (&posix_mq_attr, arg4);
- ret = get_errno(mq_open(p, arg2, arg3, &posix_mq_attr));
+ ret = get_errno(mq_open(p, arg2, arg3, &posix_mq_attr));
+ } else if (arg4 == 0)
+ ret = get_errno(mq_open(p, arg2, arg3, NULL));
unlock_user (p, arg1, 0);
}
break;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH 7/7] Enable fork and MIPS64 specific changes in mq_open syscall
2011-09-28 4:38 [Qemu-devel] [PATCH 7/7] Enable fork and MIPS64 specific changes in mq_open syscall khansa
@ 2011-09-28 7:38 ` Andreas Färber
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Färber @ 2011-09-28 7:38 UTC (permalink / raw)
To: khansa; +Cc: peter.maydell, riku.voipio, qemu-devel, aurelien
Am 28.09.2011 06:38, schrieb khansa@kics.edu.pk:
> From: Khansa Butt <khansa@kics.edu.pk>
>
Please prefix the subject with "linux-user: ".
Where's the preceding 6 patches?
Patch description is missing.
> Signed-off-by: Khansa Butt <khansa@kics.edu.pk>
> ---
> configure | 1 +
> linux-user/syscall.c | 11 +++++++++--
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 5e45a43..8d39fda 100755
> --- a/configure
> +++ b/configure
> @@ -3286,6 +3286,7 @@ case "$target_arch2" in
> TARGET_ARCH=mips64
> TARGET_BASE_ARCH=mips
> echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
> + target_nptl="yes"
How is this related to the mq_open syscall?
If it isn't, please put it into a separate patch.
> target_phys_bits=64
> target_long_alignment=8
> ;;
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 6b73769..97ac9fb 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -7799,10 +7799,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
> {
> struct mq_attr posix_mq_attr;
>
> +#if defined(TARGET_MIPS64)
> + arg2 = arg2 & 0xff;
> + arg2 = arg2 | 0x40;
What's 0x40? Please use a define or enum instead of the magic number.
I'd also humbly suggest to add inline comments (in addition to an
appropriate description above) to explain *why* this is necessary and
correct.
> +#endif
> +
> p = lock_user_string(arg1 - 1);
> - if (arg4 != 0)
> + if (arg4 != 0) {
> copy_from_user_mq_attr (&posix_mq_attr, arg4);
> - ret = get_errno(mq_open(p, arg2, arg3, &posix_mq_attr));
> + ret = get_errno(mq_open(p, arg2, arg3, &posix_mq_attr));
> + } else if (arg4 == 0)
> + ret = get_errno(mq_open(p, arg2, arg3, NULL));
Coding Style requires braces.
> unlock_user (p, arg1, 0);
> }
> break;
Andreas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-28 7:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28 4:38 [Qemu-devel] [PATCH 7/7] Enable fork and MIPS64 specific changes in mq_open syscall khansa
2011-09-28 7:38 ` Andreas Färber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).