*
* Syscall Distribution
*/
-#define DEBUG 1
+#define DEBUG 0
#include <acess.h>
#include <threads.h>
#include <events.h>
+#if DEBUG == 0
+# define DONT_INCLUDE_SYSCALL_NAMES
+#endif
#include "../syscalls.h"
// === IMPORTS ===
extern int Threads_Fork(void); // AcessNative only function
+extern int Threads_Spawn(int nFD, int FDs[], const void *info);
// === TYPES ===
typedef int (*tSyscallHandler)(Uint *Errno, const char *Format, void *Args, int *Sizes);
return *a0;
);
+SYSCALL3(Syscall_AN_Spawn, "ddd", int *, int *, void *,
+ if(Sizes[0] < sizeof(int))
+ return -1;
+ *a0 = Threads_Spawn(Sizes[1] / sizeof(int), a1, a2);
+ return *a0;
+);
+
SYSCALL2(Syscall_SendMessage, "id", int, void *,
return Proc_SendMessage(a0, Sizes[1], a1);
);
Syscall_Sleep,
Syscall_AN_Fork,
+ Syscall_AN_Spawn,
Syscall_SendMessage,
Syscall_GetMessage,
}
// Allocate the return
- ret = malloc(sizeof(tRequestHeader) + retValueCount * sizeof(tRequestValue)
- + retDataLen);
+ size_t msglen = sizeof(tRequestHeader) + retValueCount * sizeof(tRequestValue) + retDataLen;
+ ret = malloc(msglen);
ret->ClientID = Request->ClientID;
ret->CallID = Request->CallID;
ret->NParams = retValueCount;
+ ret->MessageLength = msglen;
inData = (char*)&ret->Params[ ret->NParams ];
// Static Uint64 return value
*(Uint64*)inData = retVal;
inData += sizeof(Uint64);
- Log_Debug("Syscalls", "Return 0x%llx", retVal);
+ //Log_Debug("Syscalls", "Return 0x%llx", retVal);
retValueCount = 1;
for( i = 0; i < Request->NParams; i ++ )