summaryrefslogtreecommitdiffhomepage
path: root/src/ntux.c
blob: 6c70d0b9cc8d9a2b42afe000e14553cef3860795 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
}