PS2SDK
PS2 Homebrew Libraries
loadfile-common.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2009, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
16 #ifndef __LOADFILE_COMMON_H__
17 #define __LOADFILE_COMMON_H__
18 
19 #include <tamtypes.h>
20 
21 // loadfile common definitions
22 
23 #define LF_PATH_MAX 252
24 #define LF_ARG_MAX 252
25 
26 enum _lf_val_types {
27  LF_VAL_BYTE = 0,
28  LF_VAL_SHORT,
29  LF_VAL_LONG
30 };
31 
32 enum _lf_functions {
33  LF_F_MOD_LOAD = 0,
34  LF_F_ELF_LOAD,
35 
36  LF_F_SET_ADDR,
37  LF_F_GET_ADDR,
38 
39  LF_F_MG_MOD_LOAD,
40  LF_F_MG_ELF_LOAD,
41 
42  LF_F_MOD_BUF_LOAD,
43 
44  LF_F_MOD_STOP,
45  LF_F_MOD_UNLOAD,
46 
47  LF_F_SEARCH_MOD_BY_NAME,
48  LF_F_SEARCH_MOD_BY_ADDRESS,
49 
50  LF_F_GET_VERSION = 0xFF,
51 };
52 
53 typedef struct
54 {
55  u32 epc;
56  u32 gp;
57  u32 sp;
58  u32 dummy;
59 } t_ExecData;
60 
62 {
63  union
64  {
65  u32 iop_addr;
66  int result;
67  } p;
68  int type;
69  union
70  {
71  u8 b;
72  u16 s;
73  u32 l;
74  } val;
75 } __attribute__((aligned(16)));
76 
78 {
79  union
80  {
81  int arg_len;
82  int result;
83  } p;
84  int modres;
85  char path[LF_PATH_MAX];
86  char args[LF_ARG_MAX];
87 } __attribute__((aligned(16)));
88 
90 {
91  union
92  {
93  int id;
94  int result;
95  } p;
96  union
97  {
98  int arg_len;
99  int modres;
100  } q;
101  char dummy[LF_PATH_MAX];
102  char args[LF_ARG_MAX];
103 } __attribute__((aligned(16)));
104 
106 {
107  int id;
108  int result;
109 } __attribute__((aligned(16)));
110 
112 {
113  int id;
114  int dummy1;
115  char name[LF_PATH_MAX];
116  char dummy2[LF_ARG_MAX];
117 } __attribute__((aligned(16)));
118 
120 {
121  union
122  {
123  const void *ptr;
124  int id;
125  } p;
126 } __attribute__((aligned(16)));
127 
129 {
130  u32 epc;
131  u32 gp;
132  char path[LF_PATH_MAX];
133  char secname[LF_ARG_MAX];
134 } __attribute__((aligned(16)));
135 
137 {
138  union
139  {
140  void *ptr;
141  int result;
142  } p;
143  union
144  {
145  int arg_len;
146  int modres;
147  } q;
148  char unused[LF_PATH_MAX];
149  char args[LF_ARG_MAX];
150 } __attribute__((aligned(16)));
151 
152 #endif
_lf_search_module_by_name_arg
Definition: loadfile-common.h:111
_lf_module_stop_arg
Definition: loadfile-common.h:89
_lf_module_load_arg
Definition: loadfile-common.h:77
_lf_module_buffer_load_arg
Definition: loadfile-common.h:136
_lf_elf_load_arg
Definition: loadfile-common.h:128
tamtypes.h
t_ExecData
Definition: loadfile-common.h:53
_lf_search_module_by_address_arg
Definition: loadfile-common.h:119
_lf_module_unload_arg
Definition: loadfile-common.h:105
__attribute__
Definition: gif_registers.h:38
_lf_iop_val_arg
Definition: loadfile-common.h:61