Add initial syscall support for mips64 32-bit ABI

This applies patch by Adhemerval Zanella from
https://github.com/gperftools/gperftools/issues/845.

Only malloc (i.e. tcmalloc_minimal) was tested to work so far.
This commit is contained in:
Aliaksey Kandratsenka 2017-07-04 19:50:04 -07:00
parent a3bf61ca81
commit 208c26caef
2 changed files with 11 additions and 5 deletions

View File

@ -310,7 +310,7 @@ struct kernel_sigaction {
/* include/asm-{arm,i386,mips,ppc,s390}/stat.h */
#ifdef __mips__
#if _MIPS_SIM == _MIPS_SIM_ABI64
#if (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32)
struct kernel_stat {
#else
struct kernel_stat64 {
@ -449,7 +449,8 @@ struct kernel_stat {
unsigned long __unused5;
unsigned long __unused6;
};
#elif (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI64)
#elif defined(__mips__) \
&& !(_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32)
struct kernel_stat {
unsigned st_dev;
int st_pad1[3];
@ -682,7 +683,7 @@ struct kernel_stat {
#define __NR_getcpu (__NR_Linux + 312)
#endif
/* End of MIPS (old 32bit API) definitions */
#elif _MIPS_SIM == _MIPS_SIM_ABI64
#elif (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32)
#ifndef __NR_gettid
#define __NR_gettid (__NR_Linux + 178)
#endif
@ -2559,7 +2560,8 @@ struct kernel_stat {
}
#endif
#if (defined(__aarch64__)) || \
(defined(__mips__) && (_MIPS_ISA == _MIPS_ISA_MIPS64))
(defined(__mips__) \
&& (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32))
LSS_INLINE int LSS_NAME(sigaction)(int signum,
const struct kernel_sigaction *act,
struct kernel_sigaction *oldact) {

View File

@ -52,7 +52,11 @@
// I test for 64-bit first so I don't have to do things like
// '#if (defined(__mips__) && !defined(__MIPS64__))' as a mips32 check.
#if defined(__x86_64__) || defined(__PPC64__) || defined(__aarch64__) || (defined(_MIPS_SIM) && _MIPS_SIM == _ABI64) || defined(__s390__)
#if defined(__x86_64__) \
|| defined(__PPC64__) \
|| defined(__aarch64__) \
|| (defined(_MIPS_SIM) && (_MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32)) \
|| defined(__s390__)
static inline void* do_mmap64(void *start, size_t length,
int prot, int flags,