summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ntux_init_impl.h
blob: 69d008ab41c5961a55fd89b597a197bb70375b8d (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
#ifndef NTUX_INIT_IMPL_H
#define NTUX_INIT_IMPL_H

#include <psxxfi/xfi_ntapi.h>
#include <ntapi/ntapi.h>
#include <ntapi/nt_atomic.h>

extern const ntapi_vtbl * ntux_ntapi;

static int ntux_init(void)
{
	int32_t		status;
	ntapi_vtbl * 	pvtbl;

	if ((status = __xfi_ntapi_init(&pvtbl)))
		return status;

	at_locked_cas(
		(intptr_t *)&ntux_ntapi,
		0,(intptr_t)pvtbl);

	return 0;
}

#endif