ret->ImplInt = strlen(ret->Data);\r
ret->ImplPtr = info;\r
ret->Inode = (Uint64)dp;\r
+ ret->Flags = VFS_FFLAG_DIRECTORY;\r
\r
ret->Type = &gNativeFS_DirNodeType; \r
\r
#define DEBUG 1
#include <acess.h>
#include <threads.h>
+#include <events.h>
#include "../syscalls.h"
// === IMPORTS ===
return Proc_GetMessage(a0, a1);
);
+SYSCALL1(Syscall_WaitEvent, "i", int,
+ return Threads_WaitEvents(a0);
+);
+
const tSyscallHandler caSyscalls[] = {
Syscall_Null,
Syscall_Exit,
Syscall_SendMessage,
Syscall_GetMessage,
- Syscall_select
+ Syscall_select,
+ Syscall_WaitEvent
};
const int ciNumSyscalls = sizeof(caSyscalls)/sizeof(caSyscalls[0]);
/**
//printf("Binary_GetSymbol: RETURN 0, not found\n");
printf("--- ERROR: Unable to find symbol '%s'\n", SymbolName);
-
+
+ exit( -1 );
return 0;
}
int acess_SysGetMessage(int *SourceTID, void *Data)
{
- return _Syscall(SYS_GETMSG, "<d <d",
+// static __thread int lastlen = 1024;
+ int lastlen;
+
+ lastlen = _Syscall(SYS_GETMSG, "<d <d",
SourceTID ? sizeof(int) : 0, SourceTID,
- Data ? 4096 : 0, Data
+ Data ? 1024 : 0, Data
);
+ return lastlen;
+}
+
+int acess__SysWaitEvent(int Mask)
+{
+ return _Syscall(SYS_WAITEVENT, ">i", Mask);
}
// --- Logging
DEFSYM(_SysAllocate),
DEFSYM(_SysDebug),
- DEFSYM(_SysSetFaultHandler)
+ DEFSYM(_SysSetFaultHandler),
+ DEFSYM(_SysWaitEvent)
};
const int ciNumBuiltinSymbols = sizeof(caBuiltinSymbols)/sizeof(caBuiltinSymbols[0]);
return -1;
}
#else
- printf("AllocateMemory: mmap(%p, %lx, ...)\n", (void*)base, ByteCount);
+// printf("AllocateMemory: mmap(%p, 0x%lx, ...)\n", (void*)base, ByteCount);
tmp = mmap((void*)base, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
if( tmp == MAP_FAILED ) {
printf("ERROR: Unable to allocate memory\n");
perror("AllocateMemory");
return -1;
}
- printf("AllocateMemory: RETURN 0\n");
+// printf("AllocateMemory: RETURN 0\n");
#endif
return 0;
}
SYS_SENDMSG,
SYS_GETMSG,
SYS_SELECT,
+ SYS_WAITEVENT,
N_SYSCALLS
};
"SYS_AN_FORK",
"SYS_SENDMSG",
"SYS_GETMSG",
- "SYS_SELECT"
+ "SYS_SELECT",
+ "SYS_WAITEVENT"
};
#endif