aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan Latinovic <Dejan.Latinovic@imgtec.com>2015-03-05 16:51:44 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2015-03-05 16:51:44 -0800
commit493f9a99220aed4eb7c6e3dd9018c037d45b13e2 (patch)
tree3900c556cef177b0b162b8fc99a3a83a0506bfe3
parent68848113de73373a7a7ed3aec4ce8d1213e18b35 (diff)
downloadklibc-493f9a99220aed4eb7c6e3dd9018c037d45b13e2.tar.gz
add-mips64-support-headers
Description: Added header files for mips64. Modeled on mips 32 header files and adapted for 64 bit ABI. - archsetjmp.h: do not save floating-point state - asm.h: Symbolic register names for 64 bit ABI
-rw-r--r--usr/include/arch/mips64/klibc/archconfig.h5
-rw-r--r--usr/include/arch/mips64/klibc/archsetjmp.h26
-rw-r--r--usr/include/arch/mips64/machine/asm.h82
-rw-r--r--usr/include/fcntl.h2
4 files changed, 114 insertions, 1 deletions
diff --git a/usr/include/arch/mips64/klibc/archconfig.h b/usr/include/arch/mips64/klibc/archconfig.h
index 4d856a593d56a..df3cf1c085121 100644
--- a/usr/include/arch/mips64/klibc/archconfig.h
+++ b/usr/include/arch/mips64/klibc/archconfig.h
@@ -12,7 +12,12 @@
/* MIPS has nonstandard socket definitions */
#define _KLIBC_HAS_ARCHSOCKET_H 1
+#define _KLIBC_STATFS_F_TYPE_64 1
+
/* We can use RT signals on MIPS */
#define _KLIBC_USE_RT_SIG 1
+/* MIPS has architecture-specific code for vfork() */
+#define _KLIBC_REAL_VFORK 1
+
#endif /* _KLIBC_ARCHCONFIG_H */
diff --git a/usr/include/arch/mips64/klibc/archsetjmp.h b/usr/include/arch/mips64/klibc/archsetjmp.h
new file mode 100644
index 0000000000000..c4587dc3dd0c3
--- /dev/null
+++ b/usr/include/arch/mips64/klibc/archsetjmp.h
@@ -0,0 +1,26 @@
+/*
+ * arch/mips64/include/klibc/archsetjmp.h
+ */
+
+#ifndef _KLIBC_ARCHSETJMP_H
+#define _KLIBC_ARCHSETJMP_H
+
+struct __jmp_buf {
+ unsigned long __s0;
+ unsigned long __s1;
+ unsigned long __s2;
+ unsigned long __s3;
+ unsigned long __s4;
+ unsigned long __s5;
+ unsigned long __s6;
+ unsigned long __s7;
+ unsigned long __gp;
+ unsigned long __sp;
+ unsigned long __s8;
+ unsigned long __ra;
+ unsigned long __unused;
+} __attribute__ ((aligned(8)));
+
+typedef struct __jmp_buf jmp_buf[1];
+
+#endif /* _KLIBC_ARCHSETJMP_H */
diff --git a/usr/include/arch/mips64/machine/asm.h b/usr/include/arch/mips64/machine/asm.h
new file mode 100644
index 0000000000000..42dcaa4f44d9d
--- /dev/null
+++ b/usr/include/arch/mips64/machine/asm.h
@@ -0,0 +1,82 @@
+/*
+ * arch/mips64/include/machine/asm.h
+ */
+
+#ifndef _MACHINE_ASM_H
+#define _MACHINE_ASM_H
+
+/*
+ * Symbolic register names for 64 bit ABI
+ */
+
+
+#define zero $0 /* wired zero */
+#define AT $at /* assembler temp - uppercase because of ".set at" */
+#define v0 $2 /* return value - caller saved */
+#define v1 $3
+#define a0 $4 /* argument registers */
+#define a1 $5
+#define a2 $6
+#define a3 $7
+#define a4 $8 /* arg reg 64 bit; caller saved in 32 bit */
+#define ta0 $8
+#define a5 $9
+#define ta1 $9
+#define a6 $10
+#define ta2 $10
+#define a7 $11
+#define ta3 $11
+#define t4 $12 /* caller saved */
+#define t5 $13
+#define t6 $14
+#define t7 $15
+#define s0 $16 /* callee saved */
+#define s1 $17
+#define s2 $18
+#define s3 $19
+#define s4 $20
+#define s5 $21
+#define s6 $22
+#define s7 $23
+#define t8 $24 /* caller saved */
+#define t9 $25 /* callee address for PIC/temp */
+#define jp $25 /* PIC jump register */
+#define k0 $26 /* kernel temporary */
+#define k1 $27
+#define gp $28 /* global pointer - caller saved for PIC */
+#define sp $29 /* stack pointer */
+#define fp $30 /* frame pointer */
+#define s8 $30 /* callee saved */
+#define ra $31 /* return address */
+
+
+/*
+ * LEAF - declare leaf routine
+ */
+#define LEAF(symbol) \
+ .globl symbol; \
+ .align 2; \
+ .type symbol,@function; \
+ .ent symbol,0; \
+symbol: .frame sp,0,ra
+
+
+/*
+ * NESTED - declare nested routine entry point
+ */
+#define NESTED(symbol, framesize, rpc) \
+ .globl symbol; \
+ .align 2; \
+ .type symbol,@function; \
+ .ent symbol,0; \
+symbol: .frame sp, framesize, rpc
+
+/*
+ * END - mark end of function
+ */
+#define END(function) \
+ .end function; \
+ .size function,.-function
+
+
+#endif /* _MACHINE_ASM_H */
diff --git a/usr/include/fcntl.h b/usr/include/fcntl.h
index bbd6917334ffd..16128f83e4229 100644
--- a/usr/include/fcntl.h
+++ b/usr/include/fcntl.h
@@ -9,7 +9,7 @@
#include <klibc/compiler.h>
#include <klibc/seek.h>
#include <sys/types.h>
-#if defined(__mips__) && !defined(__mips64__)
+#if defined(__mips__) && ! defined(__mips64)
# include <klibc/archfcntl.h>
#endif
#include <linux/fcntl.h>