mirror of
https://github.com/fluencelabs/musl
synced 2025-04-25 15:22:15 +00:00
fix pread/pwrite syscall calling convention on sh
despite sh not generally using register-pair alignment for 64-bit syscall arguments, there are arch-specific versions of the syscall entry points for pread and pwrite which include a dummy argument for alignment before the 64-bit offset argument.
This commit is contained in:
parent
39494a273e
commit
7cc3a28eed
@ -2,6 +2,7 @@
|
|||||||
((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
|
((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
|
||||||
((union { long long ll; long l[2]; }){ .ll = x }).l[1]
|
((union { long long ll; long l[2]; }){ .ll = x }).l[1]
|
||||||
#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
|
#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
|
||||||
|
#define __SYSCALL_LL_PRW(x) 0, __SYSCALL_LL_E((x))
|
||||||
|
|
||||||
/* The extra OR instructions are to work around a hardware bug:
|
/* The extra OR instructions are to work around a hardware bug:
|
||||||
* http://documentation.renesas.com/doc/products/mpumcu/tu/tnsh7456ae.pdf
|
* http://documentation.renesas.com/doc/products/mpumcu/tu/tnsh7456ae.pdf
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
#define SYSCALL_MMAP2_UNIT 4096ULL
|
#define SYSCALL_MMAP2_UNIT 4096ULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __SYSCALL_LL_PRW
|
||||||
|
#define __SYSCALL_LL_PRW(x) __SYSCALL_LL_O(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __scc
|
#ifndef __scc
|
||||||
#define __scc(X) ((long) (X))
|
#define __scc(X) ((long) (X))
|
||||||
typedef long syscall_arg_t;
|
typedef long syscall_arg_t;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
ssize_t pread(int fd, void *buf, size_t size, off_t ofs)
|
ssize_t pread(int fd, void *buf, size_t size, off_t ofs)
|
||||||
{
|
{
|
||||||
return syscall_cp(SYS_pread, fd, buf, size, __SYSCALL_LL_O(ofs));
|
return syscall_cp(SYS_pread, fd, buf, size, __SYSCALL_LL_PRW(ofs));
|
||||||
}
|
}
|
||||||
|
|
||||||
LFS64(pread);
|
LFS64(pread);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
ssize_t pwrite(int fd, const void *buf, size_t size, off_t ofs)
|
ssize_t pwrite(int fd, const void *buf, size_t size, off_t ofs)
|
||||||
{
|
{
|
||||||
return syscall_cp(SYS_pwrite, fd, buf, size, __SYSCALL_LL_O(ofs));
|
return syscall_cp(SYS_pwrite, fd, buf, size, __SYSCALL_LL_PRW(ofs));
|
||||||
}
|
}
|
||||||
|
|
||||||
LFS64(pwrite);
|
LFS64(pwrite);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user