diff options
Diffstat (limited to 'src/internal/ntux_init_impl.h')
-rw-r--r-- | src/internal/ntux_init_impl.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/internal/ntux_init_impl.h b/src/internal/ntux_init_impl.h new file mode 100644 index 0000000..69d008a --- /dev/null +++ b/src/internal/ntux_init_impl.h @@ -0,0 +1,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 |