|
|
860627 |
#ifndef _PSXGLUE_H_
|
|
|
860627 |
#define _PSXGLUE_H_
|
|
|
860627 |
|
|
|
860627 |
#define __PSXOPT_NATIVE 0x0
|
|
|
860627 |
#define __PSXOPT_POSIX 0x1
|
|
|
3cf872 |
#define __PSXOPT_DINGA 0x2
|
|
|
860627 |
#define __PSXOPT_LDSO 0x4
|
|
|
96b093 |
#define __PSXOPT_VRFS 0x8
|
|
|
860627 |
|
|
|
860627 |
typedef int __ldso_dladdr(const void * addr, void * info);
|
|
|
860627 |
typedef int __ldso_dlinfo(void * dso, int req, void * res);
|
|
|
860627 |
typedef void * __ldso_dlsym(void * p, const char * s, void * ra);
|
|
|
ca0f58 |
typedef void * __ldso_dlopen(const char * file, int mode, const char * path, void * reserved);
|
|
|
860627 |
typedef int __ldso_dlclose(void *p);
|
|
|
860627 |
typedef char * __ldso_dlerror(void);
|
|
|
860627 |
typedef void __ldso_reset_tls(void);
|
|
|
860627 |
|
|
|
81fff6 |
typedef int __psx_start_main(void *, int, char **, int (*)(void *, int, char **));
|
|
|
860627 |
typedef void __psx_convert_thread(void);
|
|
|
860627 |
typedef void __psx_unmapself(void *, void *);
|
|
|
2d8d61 |
typedef long __psx_log_output(char *, signed int);
|
|
|
860627 |
|
|
|
860627 |
struct __ldso_vtbl {
|
|
|
860627 |
__ldso_dladdr * dladdr;
|
|
|
860627 |
__ldso_dlinfo * dlinfo;
|
|
|
860627 |
__ldso_dlsym * dlsym;
|
|
|
860627 |
__ldso_dlopen * dlopen;
|
|
|
860627 |
__ldso_dlclose * dlclose;
|
|
|
860627 |
__ldso_dlerror * dlerror;
|
|
|
860627 |
__ldso_reset_tls * reset_tls;
|
|
|
860627 |
};
|
|
|
860627 |
|
|
|
860627 |
struct __psx_vtbl {
|
|
|
81fff6 |
__psx_start_main * start_main;
|
|
|
860627 |
__psx_convert_thread * convert_thread;
|
|
|
860627 |
__psx_unmapself * unmapself;
|
|
|
2d8d61 |
__psx_log_output * log_output;
|
|
|
860627 |
};
|
|
|
860627 |
|
|
|
860627 |
struct __psx_context {
|
|
|
860627 |
int size;
|
|
|
860627 |
int options;
|
|
|
13724e |
void ** sys_vtbl;
|
|
|
860627 |
struct __ldso_vtbl * ldso_vtbl;
|
|
|
81fff6 |
const struct __psx_vtbl*psx_vtbl;
|
|
|
860627 |
unsigned int teb_sys_idx;
|
|
|
860627 |
unsigned int teb_libc_idx;
|
|
|
860627 |
void * pthread_surrogate_fn;
|
|
|
860627 |
void * pthread_create_fn;
|
|
|
5085e9 |
void * do_global_ctors_fn;
|
|
|
5085e9 |
void * do_global_dtors_fn;
|
|
|
860627 |
};
|
|
|
860627 |
|
|
|
bd9527 |
struct __tlca_abi {
|
|
|
860627 |
void * pthread_self;
|
|
|
860627 |
int * pthread_set_child_tid;
|
|
|
860627 |
int * pthread_clear_child_tid;
|
|
|
860627 |
char * pthread_tls;
|
|
|
44d991 |
char ** pthread_dtls;
|
|
|
860627 |
};
|
|
|
860627 |
|
|
|
860627 |
typedef int __psx_init_routine(
|
|
|
860627 |
int * argc,
|
|
|
860627 |
char *** argv,
|
|
|
860627 |
char *** envp,
|
|
|
860627 |
struct __psx_context * ctx);
|
|
|
860627 |
|
|
|
860627 |
#endif
|