pspsdk-1.0+beta2
psploadcore.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * psploadcore.h - Interface to LoadCoreForKernel.
7  *
8  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11  *
12  * $Id: psploadcore.h 2433 2008-10-15 10:00:27Z iwn $
13  */
14 
15 #ifndef PSPLOADCORE_H
16 #define PSPLOADCORE_H
17 
18 #include <pspkerneltypes.h>
19 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
29 
31 typedef struct SceModule {
32  struct SceModule *next;
33  unsigned short attribute;
34  unsigned char version[2];
35  char modname[27];
36  char terminal;
37  unsigned int unknown1;
38  unsigned int unknown2;
40  unsigned int unknown3[4];
41  void * ent_top;
42  unsigned int ent_size;
43  void * stub_top;
44  unsigned int stub_size;
45  unsigned int unknown4[4];
46  unsigned int entry_addr;
47  unsigned int gp_value;
48  unsigned int text_addr;
49  unsigned int text_size;
50  unsigned int data_size;
51  unsigned int bss_size;
52  unsigned int nsegment;
53  unsigned int segmentaddr[4];
54  unsigned int segmentsize[4];
55 } SceModule;
56 
59 typedef struct SceLibraryEntryTable {
61  const char * libname;
63  unsigned char version[2];
65  unsigned short attribute;
67  unsigned char len;
69  unsigned char vstubcount;
71  unsigned short stubcount;
74  void * entrytable;
76 
79 typedef struct SceLibraryStubTable {
80  /* The name of the library we're importing from. */
81  const char * libname;
83  unsigned char version[2];
84  /* Import attributes. */
85  unsigned short attribute;
87  unsigned char len;
89  unsigned char vstubcount;
91  unsigned short stubcount;
93  unsigned int * nidtable;
95  void * stubtable;
97  void * vstubtable;
99 
100 
108 SceModule * sceKernelFindModuleByName(const char *modname);
109 
117 SceModule * sceKernelFindModuleByAddress(unsigned int addr);
118 
127 
133 int sceKernelModuleCount(void);
134 
138 void sceKernelIcacheClearAll(void);
139 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif /* PSPLOADCORE_H */