changeset 131:21537652361e

- fixed mips64 n32 build (not sure if working, though) - cosmetics, comments cleanups
author cslag
date Thu, 07 Jul 2016 14:51:30 +0200
parents 01a2aee8d30b
children b0cca984c740
files dyncall/dyncall_call_mips_n32.h dyncall/dyncall_call_mips_n32_gas.s dyncall/dyncall_call_mips_n64.h dyncall/dyncall_callvm_mips_n32.c dyncall/dyncall_callvm_mips_n32.h dyncall/dyncall_callvm_mips_n64.c dyncall/dyncall_callvm_mips_n64.h
diffstat 7 files changed, 78 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/dyncall/dyncall_call_mips_n32.h	Wed Jul 06 20:07:08 2016 +0200
+++ b/dyncall/dyncall_call_mips_n32.h	Thu Jul 07 14:51:30 2016 +0200
@@ -3,10 +3,10 @@
  Package: dyncall
  Library: dyncall
  File: dyncall/dyncall_call_mips_n32.h
- Description: mips "n32" ABI call-kernel C interface.
+ Description: mips64 "n32" ABI call-kernel C interface.
  License:
 
-   Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>, 
+   Copyright (c) 2007-2016 Daniel Adler <dadler@uni-goettingen.de>, 
                            Tassilo Philipp <tphilipp@potion-studios.com>
 
    Permission to use, copy, modify, and distribute this software for any
@@ -52,12 +52,13 @@
 
 struct DCRegData_mips_n32
 {
-  DClonglong   mIntData[8];
+  DClonglong                       mIntData[8];
   union { DCfloat f; DCdouble d; } mFloatData[8];
-  DClonglong   mUseDouble; /* bitmask: lower 8 bits specifies to use float or double from union array. */
+  DClonglong                       mUseDouble; /* bitmask: lower 8 bits specify to use float or double from union array. */
 };
 
 void dcCall_mips_n32(DCpointer target, struct DCRegData_mips_n32* regdata, DCsize stksize, DCpointer stkdata);
+/* @@@ this is the same as n64, combine code */
 
 #ifdef __cplusplus
 }
--- a/dyncall/dyncall_call_mips_n32_gas.s	Wed Jul 06 20:07:08 2016 +0200
+++ b/dyncall/dyncall_call_mips_n32_gas.s	Thu Jul 07 14:51:30 2016 +0200
@@ -3,10 +3,10 @@
  Package: dyncall
  Library: dyncall
  File: dyncall/dyncall_call_mips_n32_gas.s
- Description: mips "n32" abi call kernel implementation in GNU Assembler
+ Description: mips64 "n32" abi call kernel implementation in GNU Assembler
  License:
 
-   Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>, 
+   Copyright (c) 2007-2016 Daniel Adler <dadler@uni-goettingen.de>, 
                            Tassilo Philipp <tphilipp@potion-studios.com>
 
    Permission to use, copy, modify, and distribute this software for any
--- a/dyncall/dyncall_call_mips_n64.h	Wed Jul 06 20:07:08 2016 +0200
+++ b/dyncall/dyncall_call_mips_n64.h	Thu Jul 07 14:51:30 2016 +0200
@@ -52,9 +52,9 @@
 
 struct DCRegData_mips_n64
 {
-  DClonglong   mIntData[8];
+  DClonglong                       mIntData[8];
   union { DCfloat f; DCdouble d; } mFloatData[8];
-  DClonglong   mUseDouble; /* bitmask: lower 8 bits specifies to use float or double from union array. */
+  DClonglong                       mUseDouble; /* bitmask: lower 8 bits specify to use float or double from union array. */
 };
 
 void dcCall_mips_n64(DCpointer target, struct DCRegData_mips_n64* regdata, DCsize stksize, DCpointer stkdata);
--- a/dyncall/dyncall_callvm_mips_n32.c	Wed Jul 06 20:07:08 2016 +0200
+++ b/dyncall/dyncall_callvm_mips_n32.c	Thu Jul 07 14:51:30 2016 +0200
@@ -3,10 +3,10 @@
  Package: dyncall
  Library: dyncall
  File: dyncall/dyncall_callvm_mips_n32.c
- Description: mips "n32" ABI callvm implementation
+ Description: mips64 "n32" ABI callvm implementation
  License:
 
-   Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>, 
+   Copyright (c) 2007-2016 Daniel Adler <dadler@uni-goettingen.de>,
                            Tassilo Philipp <tphilipp@potion-studios.com>
 
    Permission to use, copy, modify, and distribute this software for any
@@ -139,7 +139,7 @@
 }
 
 
-/* Ellipsis calls: 
+/* Ellipsis calls:
    - float is promoted to double (due to ANSI C).
    - double is passed via integer register-file (due to MIPS ABI).
 */
@@ -161,7 +161,7 @@
 {
   DCCallVM_mips_n32* self = (DCCallVM_mips_n32*)in_self;
   /* at minimum provide 16-bytes
-     which hold the first four integer register as spill area 
+     which hold the first four integer register as spill area
      and are automatically loaded to $4-$7
    */
   size_t size = DC_MAX(16, ( ( (unsigned) dcVecSize(&self->mVecHead) ) +7UL ) & (-8UL) );
@@ -178,7 +178,7 @@
 , &dc_callvm_mode_mips_n32
 , &dc_callvm_argBool_mips_n32
 , &dc_callvm_argChar_mips_n32
-, &dc_callvm_argShort_mips_n32 
+, &dc_callvm_argShort_mips_n32
 , &dc_callvm_argInt_mips_n32
 , &dc_callvm_argLong_mips_n32
 , &dc_callvm_argLongLong_mips_n32
@@ -235,14 +235,14 @@
   switch(mode) {
     case DC_CALL_C_DEFAULT:
     case DC_CALL_C_MIPS64_N32:
+    case DC_CALL_C_ELLIPSIS:
       vt = &gVT_mips_n32;
       break;
-    case DC_CALL_C_ELLIPSIS:
     case DC_CALL_C_ELLIPSIS_VARARGS:
       vt = &gVT_mips_n32_ellipsis;
       break;
     default:
-      self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE; 
+      self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
       return;
   }
   dc_callvm_base_init(&self->mInterface, vt);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dyncall/dyncall_callvm_mips_n32.h	Thu Jul 07 14:51:30 2016 +0200
@@ -0,0 +1,53 @@
+/*
+
+ Package: dyncall
+ Library: dyncall
+ File: dyncall/dyncall_callvm_mips_n32.h
+ Description: mips64 "n32" ABI callvm C interface.
+ License:
+
+   Copyright (c) 2007-2016 Daniel Adler <dadler@uni-goettingen.de>,
+                           Tassilo Philipp <tphilipp@potion-studios.com>
+
+   Permission to use, copy, modify, and distribute this software for any
+   purpose with or without fee is hereby granted, provided that the above
+   copyright notice and this permission notice appear in all copies.
+
+   THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+   ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+*/
+
+
+
+#ifndef DYNCALL_CALLVM_MIPS_N32_H
+#define DYNCALL_CALLVM_MIPS_N32_H
+
+#include "dyncall_call_mips_n32.h"
+#include "dyncall_callvm.h"
+#include "dyncall_vector.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct
+{
+  DCCallVM                  mInterface;
+  DCint                     mRegCount;
+  struct DCRegData_mips_n32 mRegData;
+  DCVecHead                 mVecHead;
+} DCCallVM_mips_n32;
+/* @@@ this is the same as n64, combine code */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DYNCALL_CALLVM_MIPS_N32_H */
+
--- a/dyncall/dyncall_callvm_mips_n64.c	Wed Jul 06 20:07:08 2016 +0200
+++ b/dyncall/dyncall_callvm_mips_n64.c	Thu Jul 07 14:51:30 2016 +0200
@@ -6,7 +6,7 @@
  Description: mips "n64" ABI callvm implementation
  License:
 
-   Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>, 
+   Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
                            Tassilo Philipp <tphilipp@potion-studios.com>
 
    Permission to use, copy, modify, and distribute this software for any
@@ -139,7 +139,7 @@
 }
 
 
-/* Ellipsis calls: 
+/* Ellipsis calls:
    - float is promoted to double (due to ANSI C).
    - double is passed via integer register-file (due to MIPS ABI).
 */
@@ -161,7 +161,7 @@
 {
   DCCallVM_mips_n64* self = (DCCallVM_mips_n64*)in_self;
   /* at minimum provide 16-bytes
-     which hold the first four integer register as spill area 
+     which hold the first four integer register as spill area
      and are automatically loaded to $4-$7
    */
   size_t size = DC_MAX(16, ( ( (unsigned) dcVecSize(&self->mVecHead) ) +7UL ) & (-8UL) );
@@ -177,7 +177,7 @@
 , &dc_callvm_mode_mips_n64
 , &dc_callvm_argBool_mips_n64
 , &dc_callvm_argChar_mips_n64
-, &dc_callvm_argShort_mips_n64 
+, &dc_callvm_argShort_mips_n64
 , &dc_callvm_argInt_mips_n64
 , &dc_callvm_argLong_mips_n64
 , &dc_callvm_argLongLong_mips_n64
@@ -241,7 +241,7 @@
       vt = &gVT_mips_n64_ellipsis;
       break;
     default:
-      self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE; 
+      self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
       return;
   }
   dc_callvm_base_init(&self->mInterface, vt);
--- a/dyncall/dyncall_callvm_mips_n64.h	Wed Jul 06 20:07:08 2016 +0200
+++ b/dyncall/dyncall_callvm_mips_n64.h	Thu Jul 07 14:51:30 2016 +0200
@@ -6,7 +6,7 @@
  Description: mips "n64" ABI callvm C interface.
  License:
 
-   Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>, 
+   Copyright (c) 2007-2016 Daniel Adler <dadler@uni-goettingen.de>,
                            Tassilo Philipp <tphilipp@potion-studios.com>
 
    Permission to use, copy, modify, and distribute this software for any
@@ -38,10 +38,10 @@
 
 typedef struct
 {
-  DCCallVM  mInterface;
-  int mRegCount;
+  DCCallVM                  mInterface;
+  DCint                     mRegCount;
   struct DCRegData_mips_n64 mRegData;
-  DCVecHead mVecHead;
+  DCVecHead                 mVecHead;
 } DCCallVM_mips_n64;
 
 #ifdef __cplusplus