|
|
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 |
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);
|
|
|
860627 |
};
|
|
|
860627 |
|
|
|
860627 |
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);
|
|
|
62780c |
void (*unmapself) (void *, size_t);
|
|
|
6f8ae4 |
ssize_t (*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;
|
|
|
51a010 |
void * usrmain;
|
|
|
6c368a |
void * ldsoaddr;
|
|
|
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 |
|
|
|
860627 |
typedef int __psx_init_routine(
|
|
|
860627 |
int * argc,
|
|
|
860627 |
char *** argv,
|
|
|
860627 |
char *** envp,
|
|
|
860627 |
struct __psx_context * ctx);
|
|
|
860627 |
|
|
|
860627 |
#endif
|