changeset 145:63892f03e493

- minix fix for callbacks (floats are also returned via eax/edx on minix)
author cslag
date Sat, 20 Aug 2016 22:27:47 +0200
parents 5fa2d7d5de10
children 0ab08c1541f0
files ToDo doc/manual/callconvs/callconv_x86.tex dyncallback/dyncall_callback_x86.S dyncallback/dyncall_thunk.h
diffstat 4 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ToDo	Sat Aug 20 15:57:20 2016 +0200
+++ b/ToDo	Sat Aug 20 22:27:47 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
-- fix Minix/x86 callbacks (see callback_suite)
 - 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)
--- a/doc/manual/callconvs/callconv_x86.tex	Sat Aug 20 15:57:20 2016 +0200
+++ b/doc/manual/callconvs/callconv_x86.tex	Sat Aug 20 22:27:47 2016 +0200
@@ -79,7 +79,7 @@
 \begin{itemize}
 \item return values of pointer or integral type (\textless=\ 32 bits) are returned via the eax register
 \item integers \textgreater\ 32 bits are returned via the eax and edx registers
-\item floating point types are returned via the st0 register
+\item floating point types are returned via the st0 register (except on Minix, where they are returned as integers are)
 \end{itemize}
 
 
--- a/dyncallback/dyncall_callback_x86.S	Sat Aug 20 15:57:20 2016 +0200
+++ b/dyncallback/dyncall_callback_x86.S	Sat Aug 20 22:27:47 2016 +0200
@@ -24,6 +24,8 @@
 
 
 #include "../portasm/portasm-x86.S"
+#include "../dyncall/dyncall_macros.h"
+
 BEGIN_ASM
 DCThunk_size		= 16
 DCArgs_size		= 20
@@ -85,11 +87,13 @@
 	LEA(DWORD(EBP,frame_DCValue), EDX)
 	MOVL(DWORD(EBP,0), EBP)			/* EBP = parent frame */
 	/* handle return value */
-	
+
+#if !defined(DC__OS_Minix)
 	CMP(LIT(ASCII_f),AL)
 	JE(LOCAL(return_f32))
 	CMP(LIT(ASCII_d),AL)
 	JE(LOCAL(return_f64))
+#endif
 	
 	/* All int cases (+ pointer & string cases) fall in the return_i64 case, here */
 LOCAL(return_i64):
--- a/dyncallback/dyncall_thunk.h	Sat Aug 20 15:57:20 2016 +0200
+++ b/dyncallback/dyncall_thunk.h	Sat Aug 20 22:27:47 2016 +0200
@@ -51,7 +51,7 @@
  **
  **/
 
-#include "dyncall_macros.h"
+#include "../dyncall/dyncall_macros.h"
 
 typedef struct DCThunk_ DCThunk;