changeset 146:0ab08c1541f0

- fixed armhf ellipsis calls, were ignoring spill area - minor cleanups for consistency - todo update
author cslag
date Thu, 08 Sep 2016 23:00:45 +0200
parents 63892f03e493
children 8ce75240a0f1
files ToDo dyncall/dyncall_call_arm32_arm_armhf.S dyncall/dyncall_callvm_arm32_arm_armhf.c test/plain/test_main.c
diffstat 4 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ToDo	Sat Aug 20 22:27:47 2016 +0200
+++ b/ToDo	Thu Sep 08 23:00:45 2016 +0200
@@ -25,7 +25,6 @@
     - ellipsis (might be test itself, not respecting fixed part of args)
     - callback_plain retval, see above under ARM
     - callf
-- armhf ellipsis: fix weirdness with long long as first ... arg
 - support Solaris11 CFLAGS with -D_FILE_OFFSET_BITS=64
 - make sure selinux works (esp. regarding NX bits, asm might need (or similar): .section .note.GNU-stack,"",@progbits)
   Daniel has a patch for it, if needed, implementing allocwx with two memory blocks, one for w^x, mmaped to one for r|x
@@ -36,6 +35,7 @@
 - quadmath support (long double)
 - add tests using alloca(), as this might depend on the frame pointer being correctly
   set; we don't check for this, currently, at all
+- test on OpenBSD 6.0 which comes with W^X by default
 
 portasm:
 --------
@@ -43,6 +43,9 @@
 
 dyncall:
 --------
+- find big endian arm box (also hardfloat), e.g. cubietruck: http://blog.netbsd.org/tnf/entry/working_arm_multiprocessor_support
+- test if armhf/thumb is actually working... pulls in arm mode code in dyncall_callvm.c
+- dyncall_call_mips_n32.h and dyncall_call_mips_n64.h are pretty much the same, share code
 - support for return values: aggregate return values
 - support for argument values: structures, half-precision, vector types, long double
 - consider automatic type-promotion for arguments passed through DC_CALL_C_ELLIPSIS_VARARGS;
@@ -58,6 +61,10 @@
   EdgeRouter lite uses this: https://blog.netbsd.org/tnf/entry/hands_on_experience_with_edgerouter)
 - implement MIPS64 EABI (gcc -mabi=eabi); both, little and big-endian
 - support for Minix/arm
+- improve ellipsis test:
+  * test not just with one fixed arg, to also simulate alignment problems
+  * test return values
+  * convert from c++ to c, to have it also on plan9, and more portability
 
 dynload:
 --------
@@ -100,6 +107,7 @@
 
 manual:
 -------
+- introduce doc overview tables and common vocab for calling convention specifics, following example of table on page 13 of https://www.linux-mips.org/pub/linux/mips/doc/ABI/MIPS-N32-ABI-Handbook.pdf
 - callconv diagrams:
   * good idea to review it all, anyways, if the calling conventions are actually
     represented correctly (and if they are in sync with the .pdf, we used to have
--- a/dyncall/dyncall_call_arm32_arm_armhf.S	Sat Aug 20 22:27:47 2016 +0200
+++ b/dyncall/dyncall_call_arm32_arm_armhf.S	Thu Sep 08 23:00:45 2016 +0200
@@ -6,7 +6,7 @@
  Description: Call Kernel for ARM 32-bit ARM Architecture - Hard Float
  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
@@ -61,7 +61,7 @@
 	/* Load 16 single-precision registers (= 8 double-precision registers). */
 	fldmiad	r3, {d0-d7}
 
-	sub	r2 , r2 , #16	/* skip spill area */
+	/* nope, or varargs will not work: sub	r2 , r2 , #16	/* skip spill area */
 	cmp     r2, #0
 	ble	armhf_call
 
--- a/dyncall/dyncall_callvm_arm32_arm_armhf.c	Sat Aug 20 22:27:47 2016 +0200
+++ b/dyncall/dyncall_callvm_arm32_arm_armhf.c	Thu Sep 08 23:00:45 2016 +0200
@@ -100,7 +100,7 @@
 
   DCCallVM_arm32_armhf* p = (DCCallVM_arm32_armhf*)in_p;
   if (p->d < 16) {
-    * (double*) &p->S[p->d] = x;
+    * (DCdouble*) &p->S[p->d] = x;
     p->d += 2;
     if (!(p->s & 1)) {
       /* if s is even it always equals d. otherwise, s points to an odd float register. */
--- a/test/plain/test_main.c	Sat Aug 20 22:27:47 2016 +0200
+++ b/test/plain/test_main.c	Thu Sep 08 23:00:45 2016 +0200
@@ -70,7 +70,7 @@
     r = dcCallBool(pc, (DCpointer) &fun_c_b);
     DC_TEST(r == val);
 
-	val=DC_FALSE;
+    val=DC_FALSE;
     dcReset(pc);
     dcArgBool(pc, val);
     r = dcCallBool(pc, (DCpointer) &fun_c_b);
@@ -149,7 +149,7 @@
     r = dcCallBool(pc, (DCpointer) &fun_std_b);
     DC_TEST(r == val);
 
-	val=DC_FALSE;
+    val=DC_FALSE;
     dcReset(pc);
     dcArgBool(pc, val);
     r = dcCallBool(pc, (DCpointer) &fun_std_b);
@@ -234,7 +234,7 @@
     r = dcCallBool(pc, (DCpointer) &fun_fast_b);
     DC_TEST(r == val);
 
-	val=DC_FALSE;
+    val=DC_FALSE;
     dcReset(pc);
     dcArgBool(pc, val);
     r = dcCallBool(pc, (DCpointer) &fun_fast_b);