Skip to contentSkip to conversation

Fix sync_file_range for Mips

PATCH New Dejan Jovicevic 2 participants 2 messages Oct 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix sync_file_range for Mips

For Mips there is a second argument which is actually a padding. This can be confirmed in glibc.

---
 testcases/kernel/syscalls/sync_file_range/sync_file_range01.c | 5 +++++
 1 file changed, 5 insertions(+)
testcases/kernel/syscalls/sync_file_range/sync_file_range01.c +5 -0
index 935786b..ea05195 100644
@@ -216,6 +216,11 @@ static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes,
 	return ltp_syscall(__NR_sync_file_range, fd, (int)(offset >> 32),
 		(int)offset, (int)(nbytes >> 32), (int)nbytes, flags);
 
+/* mips */
+#elif defined(__mips__) && __WORDSIZE == 32
+	return ltp_syscall(__NR_sync_file_range, fd, 0, (int)(offset >> 32),
+		(int)offset, (int)(nbytes >> 32), (int)nbytes, flags);
+
 /* other */
 #else
 	return ltp_syscall(__NR_sync_file_range, fd, offset, nbytes, flags);
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 Fix sync_file_range for Mips

----- Original Message -----

Quoted 7 lines

From: "Dejan Jovicevic" <[email protected]>
To: [email protected]
Sent: Monday, 3 October, 2016 1:06:46 PM
Subject: [LTP] [PATCH] Fix sync_file_range for Mips

For Mips there is a second argument which is actually a padding. This can be confirmed in glibc.

<glibc>/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c or [1]:

LONG LONG in 32-bit mode:
If GR > r10, go to STACK. Otherwise, if GR is odd, advance GR to the next register. Load the 64-bit long long value into register pair GR and GR+1. Advance GR to GR+2 and go to SCAN.

Pushed with slightly modified commit message. Please include Signed-off-by line in future.

Thanks,
Jan

[1] http://www.cygwin.com/ml/binutils/2003-06/msg00436.html