|
|
860627 |
#ifndef _PSXGLUE_H_
|
|
|
860627 |
#define _PSXGLUE_H_
|
|
|
860627 |
|
|
|
860627 |
#define __PSXOPT_NATIVE 0x0
|
|
|
860627 |
#define __PSXOPT_POSIX 0x1
|
|
|
860627 |
#define __PSXOPT_TTYDBG 0x2
|
|
|
860627 |
#define __PSXOPT_LDSO 0x4
|
|
|
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);
|
|
|
860627 |
typedef void * __ldso_dlopen(const char * file, int mode);
|
|
|
860627 |
typedef int __ldso_dlclose(void *p);
|
|
|
860627 |
typedef char * __ldso_dlerror(void);
|
|
|
860627 |
typedef void __ldso_reset_tls(void);
|
|
|
860627 |
|
|
|
860627 |
typedef void __psx_convert_thread(void);
|
|
|
860627 |
typedef void __psx_unmapself(void *, void *);
|
|
|
860627 |
typedef void * __psx_get_osfhandle(int fd);
|
|
|
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 {
|
|
|
860627 |
__psx_convert_thread * convert_thread;
|
|
|
860627 |
__psx_unmapself * unmapself;
|
|
|
860627 |
__psx_get_osfhandle * get_osfhandle;
|
|
|
860627 |
};
|
|
|
860627 |
|
|
|
860627 |
struct __psx_context {
|
|
|
860627 |
int size;
|
|
|
860627 |
int options;
|
|
|
860627 |
void *** sys_vtbl;
|
|
|
860627 |
struct __ldso_vtbl * ldso_vtbl;
|
|
|
860627 |
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 |
|
|
|
860627 |
struct __tlca {
|
|
|
860627 |
void * pthread_self;
|
|
|
860627 |
int * pthread_set_child_tid;
|
|
|
860627 |
int * pthread_clear_child_tid;
|
|
|
860627 |
char * pthread_tls;
|
|
|
860627 |
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
|