summaryrefslogtreecommitdiffhomepage
path: root/src/ntux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ntux.c')
-rw-r--r--src/ntux.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ntux.c b/src/ntux.c
new file mode 100644
index 0000000..6c70d0b
--- /dev/null
+++ b/src/ntux.c
@@ -0,0 +1,34 @@
+/***********************************************************/
+/* ntux: native translation und extension */
+/* Copyright (C) 2016 Z. Gilboa */
+/* Released under GPLv2 and GPLv3; see COPYING.NTUX. */
+/***********************************************************/
+
+#include <psxabi/sys_sysapi.h>
+#include <ntux/ntux.h>
+#include "ntux_driver_impl.h"
+
+int ntux_entry_point(void)
+{
+ int argc;
+ char ** argv;
+ char ** envp;
+ struct __psx_context ctx = {0,0,0,0,0,0,0,0,0,0,0};
+
+ /* ctx */
+ ctx.size = sizeof(ctx);
+
+ /* __psx_init must succeed... */
+ if (__psx_init(&argc,&argv,&envp,&ctx))
+ return -1;
+
+ /* ...and conform */
+ else if (envp != argv + (argc + 1))
+ return -1;
+
+ /* invoke main */
+ __sys_exit_group(
+ ntux_main(argc,argv,envp));
+
+ return NT_STATUS_INTERNAL_ERROR;
+}