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