[klibc] [klibc:master] add-mips64-support-headers

klibc-bot for Dejan Latinovic Dejan.Latinovic at imgtec.com
Thu Mar 5 16:54:04 PST 2015


Commit-ID:  493f9a99220aed4eb7c6e3dd9018c037d45b13e2
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=493f9a99220aed4eb7c6e3dd9018c037d45b13e2
Author:     Dejan Latinovic <Dejan.Latinovic at imgtec.com>
AuthorDate: Thu, 5 Mar 2015 16:51:44 -0800
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Thu, 5 Mar 2015 16:51:44 -0800

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

---
 usr/include/arch/mips64/klibc/archconfig.h         |  5 ++++
 .../arch/{mips => mips64}/klibc/archsetjmp.h       | 15 +---------
 usr/include/arch/{mips => mips64}/machine/asm.h    | 32 +++++++++++++---------
 usr/include/fcntl.h                                |  2 +-
 4 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/usr/include/arch/mips64/klibc/archconfig.h b/usr/include/arch/mips64/klibc/archconfig.h
index 4d856a5..df3cf1c 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/mips/klibc/archsetjmp.h b/usr/include/arch/mips64/klibc/archsetjmp.h
similarity index 58%
copy from usr/include/arch/mips/klibc/archsetjmp.h
copy to usr/include/arch/mips64/klibc/archsetjmp.h
index 1fbe83e..c4587dc 100644
--- a/usr/include/arch/mips/klibc/archsetjmp.h
+++ b/usr/include/arch/mips64/klibc/archsetjmp.h
@@ -1,5 +1,5 @@
 /*
- * arch/mips/include/klibc/archsetjmp.h
+ * arch/mips64/include/klibc/archsetjmp.h
  */
 
 #ifndef _KLIBC_ARCHSETJMP_H
@@ -18,19 +18,6 @@ struct __jmp_buf {
 	unsigned long __sp;
 	unsigned long __s8;
 	unsigned long __ra;
-	unsigned long __f20;
-	unsigned long __f21;
-	unsigned long __f22;
-	unsigned long __f23;
-	unsigned long __f24;
-	unsigned long __f25;
-	unsigned long __f26;
-	unsigned long __f27;
-	unsigned long __f28;
-	unsigned long __f29;
-	unsigned long __f30;
-	unsigned long __f31;
-	unsigned long __fcr31;
 	unsigned long __unused;
 } __attribute__ ((aligned(8)));
 
diff --git a/usr/include/arch/mips/machine/asm.h b/usr/include/arch/mips64/machine/asm.h
similarity index 69%
copy from usr/include/arch/mips/machine/asm.h
copy to usr/include/arch/mips64/machine/asm.h
index 0b8cece..42dcaa4 100644
--- a/usr/include/arch/mips/machine/asm.h
+++ b/usr/include/arch/mips64/machine/asm.h
@@ -1,27 +1,32 @@
 /*
- * arch/mips/include/machine/asm.h
+ * arch/mips64/include/machine/asm.h
  */
 
 #ifndef _MACHINE_ASM_H
 #define _MACHINE_ASM_H
 
 /*
- * Symbolic register names for 32 bit ABI
+ * Symbolic register names for 64 bit ABI
  */
 
+
 #define zero    $0      /* wired zero */
-#define AT      $1      /* assembler temp  - uppercase because of ".set at" */
-#define v0      $2      /* return value */
+#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 t0      $8      /* caller saved */
-#define t1      $9
-#define t2      $10
-#define t3      $11
-#define t4      $12
+#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
@@ -34,16 +39,17 @@
 #define s6      $22
 #define s7      $23
 #define t8      $24     /* caller saved */
-#define t9      $25
+#define t9      $25     /* callee address for PIC/temp */
 #define jp      $25     /* PIC jump register */
-#define k0      $26     /* kernel scratch */
+#define k0      $26     /* kernel temporary */
 #define k1      $27
-#define gp      $28     /* global pointer */
+#define gp      $28     /* global pointer - caller saved for PIC */
 #define sp      $29     /* stack pointer */
 #define fp      $30     /* frame pointer */
-#define s8      $30     /* same like fp! */
+#define s8      $30     /* callee saved */
 #define ra      $31     /* return address */
 
+
 /*
  * LEAF - declare leaf routine
  */
diff --git a/usr/include/fcntl.h b/usr/include/fcntl.h
index bbd6917..16128f8 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>


More information about the klibc mailing list