* [LTP] [PATCH] syscalls/sync_file_range01: support 31-bit s390
@ 2015-03-05 15:24 Jiri Jaburek
2015-03-06 16:21 ` Jiri Jaburek
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Jaburek @ 2015-03-05 15:24 UTC (permalink / raw)
To: ltp-list
The ifdef'd part is identical to how arm/ppc handles big endianness,
however the syscall number and argument order are different.
Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
---
testcases/kernel/syscalls/sync_file_range/sync_file_range01.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
index 3d26f8f..3eac52d 100644
--- a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
+++ b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
@@ -196,7 +196,7 @@ void setup(void)
static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes,
unsigned int flags)
{
-
+/* arm and powerpc */
#if (defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__))
#if (__WORDSIZE == 32)
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -210,10 +210,16 @@ static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes,
#else
return ltp_syscall(__NR_sync_file_range2, fd, flags, offset, nbytes);
#endif
+
+/* s390 */
+#elif (defined(__s390__) || defined(__s390x__)) && __WORDSIZE == 32
+ return ltp_syscall(__NR_sync_file_range, fd, (int)(offset >> 32),
+ (int)offset, (int)(nbytes >> 32), (int)nbytes, flags);
+
+/* other */
#else
return ltp_syscall(__NR_sync_file_range, fd, offset, nbytes, flags);
#endif
-
}
/******************************************************************************/
--
2.1.0
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [LTP] [PATCH] syscalls/sync_file_range01: support 31-bit s390
2015-03-05 15:24 [LTP] [PATCH] syscalls/sync_file_range01: support 31-bit s390 Jiri Jaburek
@ 2015-03-06 16:21 ` Jiri Jaburek
2015-03-06 16:39 ` [LTP] [PATCHv2] " Jiri Jaburek
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Jaburek @ 2015-03-06 16:21 UTC (permalink / raw)
To: ltp-list
On 03/05/2015 04:24 PM, Jiri Jaburek wrote:
> The ifdef'd part is identical to how arm/ppc handles big endianness,
> however the syscall number and argument order are different.
>
> Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
> ---
> testcases/kernel/syscalls/sync_file_range/sync_file_range01.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
> index 3d26f8f..3eac52d 100644
> --- a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
> +++ b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
> @@ -196,7 +196,7 @@ void setup(void)
> static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes,
> unsigned int flags)
> {
> -
> +/* arm and powerpc */
> #if (defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__))
> #if (__WORDSIZE == 32)
> #if __BYTE_ORDER == __BIG_ENDIAN
> @@ -210,10 +210,16 @@ static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes,
> #else
> return ltp_syscall(__NR_sync_file_range2, fd, flags, offset, nbytes);
> #endif
> +
> +/* s390 */
> +#elif (defined(__s390__) || defined(__s390x__)) && __WORDSIZE == 32
> + return ltp_syscall(__NR_sync_file_range, fd, (int)(offset >> 32),
> + (int)offset, (int)(nbytes >> 32), (int)nbytes, flags);
> +
Ugh, I somehow managed to leave spaces instead of tabs here, will post
v2 with correct formatting, sorry.
> +/* other */
> #else
> return ltp_syscall(__NR_sync_file_range, fd, offset, nbytes, flags);
> #endif
> -
> }
>
> /******************************************************************************/
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread* [LTP] [PATCHv2] syscalls/sync_file_range01: support 31-bit s390
2015-03-06 16:21 ` Jiri Jaburek
@ 2015-03-06 16:39 ` Jiri Jaburek
0 siblings, 0 replies; 3+ messages in thread
From: Jiri Jaburek @ 2015-03-06 16:39 UTC (permalink / raw)
To: ltp-list
The ifdef'd part is identical to how arm/ppc handles big endianness,
however the syscall number and argument order are different.
Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
---
testcases/kernel/syscalls/sync_file_range/sync_file_range01.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
index 3d26f8f..33d2e31 100644
--- a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
+++ b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
@@ -196,7 +196,7 @@ void setup(void)
static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes,
unsigned int flags)
{
-
+/* arm and powerpc */
#if (defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__))
#if (__WORDSIZE == 32)
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -210,10 +210,16 @@ static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes,
#else
return ltp_syscall(__NR_sync_file_range2, fd, flags, offset, nbytes);
#endif
+
+/* s390 */
+#elif (defined(__s390__) || defined(__s390x__)) && __WORDSIZE == 32
+ return ltp_syscall(__NR_sync_file_range, fd, (int)(offset >> 32),
+ (int)offset, (int)(nbytes >> 32), (int)nbytes, flags);
+
+/* other */
#else
return ltp_syscall(__NR_sync_file_range, fd, offset, nbytes, flags);
#endif
-
}
/******************************************************************************/
--
2.1.0
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-06 16:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 15:24 [LTP] [PATCH] syscalls/sync_file_range01: support 31-bit s390 Jiri Jaburek
2015-03-06 16:21 ` Jiri Jaburek
2015-03-06 16:39 ` [LTP] [PATCHv2] " Jiri Jaburek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox