|
|
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 |
|
|
|
1a03f6 |
struct __seh_vtbl;
|
|
|
1a03f6 |
|
|
|
860627 |
struct __ldso_vtbl {
|
|
|
6f8ae4 |
int (*dladdr) (const void * addr, void * info);
|
|
|
6f8ae4 |
int (*dlinfo) (void * dso, int req, void * res);
|
|
|
6f8ae4 |
void * (*dlsym) (void * p, const char * s, void * ra);
|
|
|
6f8ae4 |
void * (*dlopen) (const char * file, int mode, const char ** pathv, int * status);
|
|
|
724fbc |
void * (*dldopen) (int fd, int mode, int * status);
|
|
|
724fbc |
void * (*dlsopen) (const char * file, int mode, int * status);
|
|
|
6f8ae4 |
int (*dlclose) (void *p);
|
|
|
6f8ae4 |
char * (*dlerror) (void);
|
|
|
07b681 |
void (*tlsreset) (void);
|
|
|
860627 |
};
|
|
|
860627 |
|
|
|
860627 |
struct __psx_vtbl {
|
|
|
6f8ae4 |
void (*do_global_ctors_fn) ();
|
|
|
6f8ae4 |
void (*do_global_dtors_fn) ();
|
|
|
da370a |
int (*mm_start_main) (int, char **, int (*)());
|
|
|
da370a |
void (*mm_convert_thread) (void);
|
|
|
da370a |
void (*mm_unmapself) (void *, size_t);
|
|
|
da370a |
ssize_t (*mm_log_output) (void *, ssize_t);
|
|
|
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 |
|
|
|
6f8ae4 |
struct __psx_context {
|
|
|
6f8ae4 |
int size;
|
|
|
6f8ae4 |
int options;
|
|
|
6c368a |
void * ldsoaddr;
|
|
|
31dfe3 |
const unsigned short * ctty;
|
|
|
6f8ae4 |
void ** sys_vtbl;
|
|
|
65a872 |
const struct __psx_vtbl * psx_vtbl;
|
|
|
1a03f6 |
const struct __seh_vtbl * seh_vtbl;
|
|
|
65a872 |
const struct __dbg_vtbl * dbg_vtbl;
|
|
|
6f8ae4 |
const struct __ldso_vtbl * ldso_vtbl;
|
|
|
6f8ae4 |
unsigned int teb_sys_idx;
|
|
|
6f8ae4 |
unsigned int teb_libc_idx;
|
|
|
6f8ae4 |
void * pthread_surrogate_fn;
|
|
|
6f8ae4 |
void * pthread_create_fn;
|
|
|
faeb23 |
int (*usrmain)();
|
|
|
6f8ae4 |
};
|
|
|
6f8ae4 |
|
|
|
860627 |
typedef int __psx_init_routine(
|
|
|
860627 |
int * argc,
|
|
|
860627 |
char *** argv,
|
|
|
860627 |
char *** envp,
|
|
|
860627 |
struct __psx_context * ctx);
|
|
|
860627 |
|
|
|
860627 |
#endif
|