diff mbox

[2/6] linux-user/alpha: Add define for NR_shmat to enable shmat syscall

Message ID 1420719588-8138-3-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell Jan. 8, 2015, 12:19 p.m. UTC
For historical reasons, the define for the shmat() syscall on Alpha is
NR_osf_shmat; however it has the same semantics as this syscall does
on all other architectures, so define TARGET_NR_shmat as well so that
QEMU's code for the syscall is enabled.

This patch brings our behaviour on the LTP shmat tests into line
with that for ARM (still not a perfect pass rate but not "this syscall
is completely broken" as we had before).

(Problem detected via a clang warning that the do_shmat() function
was unused on Alpha.)

Cc: Richard Henderson <rth@twiddle.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Possibly other _osf_ syscalls need similar defines; somebody who
cares about Alpha might like to audit?
---
 linux-user/alpha/syscall_nr.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Peter Maydell Jan. 10, 2015, 3:56 p.m. UTC | #1
Oops, just realized I got RTH's email wrong on the cc. Sorry...

-- PMM

On 8 January 2015 at 12:19, Peter Maydell <peter.maydell@linaro.org> wrote:
> For historical reasons, the define for the shmat() syscall on Alpha is
> NR_osf_shmat; however it has the same semantics as this syscall does
> on all other architectures, so define TARGET_NR_shmat as well so that
> QEMU's code for the syscall is enabled.
>
> This patch brings our behaviour on the LTP shmat tests into line
> with that for ARM (still not a perfect pass rate but not "this syscall
> is completely broken" as we had before).
>
> (Problem detected via a clang warning that the do_shmat() function
> was unused on Alpha.)
>
> Cc: Richard Henderson <rth@twiddle.org>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Possibly other _osf_ syscalls need similar defines; somebody who
> cares about Alpha might like to audit?
> ---
>  linux-user/alpha/syscall_nr.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/linux-user/alpha/syscall_nr.h b/linux-user/alpha/syscall_nr.h
> index 625f301..dde8d5c 100644
> --- a/linux-user/alpha/syscall_nr.h
> +++ b/linux-user/alpha/syscall_nr.h
> @@ -185,6 +185,10 @@
>  #define TARGET_NR_osf_utsname  207
>  #define TARGET_NR_lchown               208
>  #define TARGET_NR_osf_shmat            209
> +/* this has the usual shmat semantics so give it the name syscall.c expects
> + * so that our support for it is enabled.
> + */
> +#define TARGET_NR_shmat TARGET_NR_osf_shmat
>  #define TARGET_NR_shmctl               210
>  #define TARGET_NR_shmdt                211
>  #define TARGET_NR_shmget               212
> --
> 1.9.1
>
>
Richard Henderson Jan. 10, 2015, 9:02 p.m. UTC | #2
On 01/10/2015 07:56 AM, Peter Maydell wrote:
>>  #define TARGET_NR_osf_shmat            209
>> +/* this has the usual shmat semantics so give it the name syscall.c expects
>> + * so that our support for it is enabled.
>> + */
>> +#define TARGET_NR_shmat TARGET_NR_osf_shmat

Eh, you could just s/osf_// on this line if you like.
But otherwise looks good.

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/linux-user/alpha/syscall_nr.h b/linux-user/alpha/syscall_nr.h
index 625f301..dde8d5c 100644
--- a/linux-user/alpha/syscall_nr.h
+++ b/linux-user/alpha/syscall_nr.h
@@ -185,6 +185,10 @@ 
 #define TARGET_NR_osf_utsname	207
 #define TARGET_NR_lchown		208
 #define TARGET_NR_osf_shmat		209
+/* this has the usual shmat semantics so give it the name syscall.c expects
+ * so that our support for it is enabled.
+ */
+#define TARGET_NR_shmat TARGET_NR_osf_shmat
 #define TARGET_NR_shmctl		210
 #define TARGET_NR_shmdt		211
 #define TARGET_NR_shmget		212