|
|
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 |
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);
|
|
|
6f8ae4 |
int (*dlclose) (void *p);
|
|
|
6f8ae4 |
char * (*dlerror) (void);
|
|
|
6f8ae4 |
void (*reset_tls) (void);
|
|
|
296178 |
};
|
|
|
296178 |
|
|
|
296178 |
struct __psx_vtbl {
|
|
|
6f8ae4 |
void (*do_global_ctors_fn) ();
|
|
|
6f8ae4 |
void (*do_global_dtors_fn) ();
|
|
|
6f8ae4 |
int (*start_main) (void *, int, char **, int (*)(void *, int, char **));
|
|
|
6f8ae4 |
void (*convert_thread) (void);
|
|
|
6f8ae4 |
void (*unmapself) (void *, void *);
|
|
|
6f8ae4 |
ssize_t (*log_output) (void *, ssize_t);
|
|
|
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 |
|
|
|
6f8ae4 |
struct __psx_context {
|
|
|
6f8ae4 |
int size;
|
|
|
6f8ae4 |
int options;
|
|
|
d52444 |
void * refaddr;
|
|
|
d52444 |
void * libcaddr;
|
|
|
31dfe3 |
const unsigned short * ctty;
|
|
|
6f8ae4 |
void ** sys_vtbl;
|
|
|
6f8ae4 |
const struct __ldso_vtbl * ldso_vtbl;
|
|
|
6f8ae4 |
const struct __psx_vtbl * psx_vtbl;
|
|
|
6f8ae4 |
unsigned int teb_sys_idx;
|
|
|
6f8ae4 |
unsigned int teb_libc_idx;
|
|
|
6f8ae4 |
void * pthread_surrogate_fn;
|
|
|
6f8ae4 |
void * pthread_create_fn;
|
|
|
6f8ae4 |
};
|
|
|
6f8ae4 |
|
|
|
296178 |
typedef int __psx_init_routine(
|
|
|
296178 |
int * argc,
|
|
|
296178 |
char *** argv,
|
|
|
296178 |
char *** envp,
|
|
|
296178 |
struct __psx_context * ctx);
|
|
|
296178 |
|
|
|
296178 |
#endif
|