PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
loadcore.h File Reference
#include <types.h>
#include <irx.h>
+ Include dependency graph for loadcore.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _ModuleInfo
 
struct  _IopModuleID
 
struct  _FileInfo
 
struct  _iop_library
 
struct  tag_LC_internals
 
struct  iop_bootmode_t
 
struct  iop_init_entry_t
 
struct  iop_library_table_t
 

Macros

#define MODULE_RESIDENT_END   0
 
#define MODULE_NO_RESIDENT_END   1
 
#define MODULE_REMOVABLE_END   2
 
#define loadcore_IMPORTS
 
#define loadcore_IMPORTS_start   DECLARE_IMPORT_TABLE(loadcore, 1, 1)
 
#define loadcore_IMPORTS_end   END_IMPORT_TABLE
 
#define I_GetLibraryEntryTable   DECLARE_IMPORT(3, GetLibraryEntryTable)
 
#define I_GetLoadcoreInternalData   DECLARE_IMPORT(3, GetLoadcoreInternalData)
 
#define I_FlushIcache   DECLARE_IMPORT(4, FlushIcache)
 
#define I_FlushDcache   DECLARE_IMPORT(5, FlushDcache)
 
#define I_RegisterLibraryEntries   DECLARE_IMPORT(6, RegisterLibraryEntries)
 
#define I_ReleaseLibraryEntries   DECLARE_IMPORT(7, ReleaseLibraryEntries)
 
#define I_LinkLibraryEntries   DECLARE_IMPORT(8, LinkLibraryEntries)
 
#define I_UnLinkLibraryEntries   DECLARE_IMPORT(9, UnLinkLibraryEntries)
 
#define I_RegisterNonAutoLinkEntries   DECLARE_IMPORT(10, RegisterNonAutoLinkEntries)
 
#define I_QueryLibraryEntryTable   DECLARE_IMPORT(11, QueryLibraryEntryTable)
 
#define I_QueryBootMode   DECLARE_IMPORT(12, QueryBootMode)
 
#define I_RegisterBootMode   DECLARE_IMPORT(13, RegisterBootMode)
 
#define I_LockLibraryClient   DECLARE_IMPORT(14, LockLibraryClient)
 
#define I_UnLockLibraryClient   DECLARE_IMPORT(15, UnLockLibraryClient)
 
#define I_RegisterModule   DECLARE_IMPORT(16, RegisterModule)
 
#define I_ReleaseModule   DECLARE_IMPORT(17, ReleaseModule)
 
#define I_AddRebootNotifyHandler   DECLARE_IMPORT(20, AddRebootNotifyHandler)
 
#define I_SetCacheCtrl   DECLARE_IMPORT(21, SetCacheCtrl)
 
#define I_ProbeExecutableObject   DECLARE_IMPORT(22, ProbeExecutableObject)
 
#define I_LoadExecutableObject   DECLARE_IMPORT(23, LoadExecutableObject)
 
#define I_SearchModuleCBByAddr   DECLARE_IMPORT(24, SearchModuleCBByAddr)
 
#define LinkImports(...)   LinkLibraryEntries(__VA_ARGS__)
 
#define UnlinkImports(...)   UnLinkLibraryEntries(__VA_ARGS__)
 
#define SetNonAutoLinkFlag(...)   LockLibraryClient(__VA_ARGS__)
 
#define UnsetNonAutoLinkFlag(...)   UnLockLibraryClient(__VA_ARGS__)
 
#define LinkModule(...)   RegisterModule(__VA_ARGS__)
 
#define UnlinkModule(...)   ReleaseModule(__VA_ARGS__)
 
#define RegisterPostBootCallback(...)   AddRebootNotifyHandler(__VA_ARGS__)
 
#define ReadModuleHeader(...)   ProbeExecutableObject(__VA_ARGS__)
 
#define LoadModuleImage(...)   LoadExecutableObject(__VA_ARGS__)
 
#define FindImageInfo(...)   SearchModuleCBByAddr(__VA_ARGS__)
 
#define I_LinkImports   I_LinkLibraryEntries
 
#define I_UnlinkImports   I_UnLinkLibraryEntries
 
#define I_SetNonAutoLinkFlag   I_LockLibraryClient
 
#define I_UnsetNonAutoLinkFlag   I_UnLockLibraryClient
 
#define I_LinkModule   I_RegisterModule
 
#define I_UnlinkModule   I_ReleaseModule
 
#define I_RegisterPostBootCallback   I_AddRebootNotifyHandler
 
#define I_ReadModuleHeader   I_ProbeExecutableObject
 
#define I_LoadModuleImage   I_LoadExecutableObject
 
#define I_FindImageInfo   I_SearchModuleCBByAddr
 

Typedefs

typedef struct _ModuleInfo ModuleInfo_t
 
typedef struct _IopModuleID IopModuleID_t
 
typedef struct _FileInfo FileInfo_t
 
typedef struct _iop_library iop_library_t
 
typedef struct tag_LC_internals lc_internals_t
 
typedef int(* BootupCallback_t) (iop_init_entry_t *next, int delayed)
 

Functions

iop_library_table_tGetLibraryEntryTable (void) __attribute__((deprecated))
 
lc_internals_tGetLoadcoreInternalData (void)
 
void FlushIcache (void)
 
void FlushDcache (void)
 
int RegisterLibraryEntries (struct irx_export_table *exports)
 
int ReleaseLibraryEntries (struct irx_export_table *exports)
 
int LinkLibraryEntries (void *addr, int size)
 
int UnLinkLibraryEntries (void *addr, int size)
 
int RegisterNonAutoLinkEntries (struct irx_export_table *exports)
 
void * QueryLibraryEntryTable (iop_library_t *library)
 
int * QueryBootMode (int mode)
 
void RegisterBootMode (iop_bootmode_t *b)
 
void LockLibraryClient (struct irx_export_table *export)
 
void UnLockLibraryClient (struct irx_export_table *export)
 
void RegisterModule (ModuleInfo_t *mi)
 
void ReleaseModule (ModuleInfo_t *mi)
 
int AddRebootNotifyHandler (BootupCallback_t func, int priority, int *stat)
 
void SetCacheCtrl (u32 val)
 
int ProbeExecutableObject (void *image, FileInfo_t *result)
 
int LoadExecutableObject (void *image, FileInfo_t *fi)
 
ModuleInfo_tSearchModuleCBByAddr (void *addr)
 

Detailed Description

Kernel module loader.

Definition in file loadcore.h.


Data Structure Documentation

◆ _ModuleInfo

struct _ModuleInfo

Module info entry. Taken from iopmgr.

Definition at line 31 of file loadcore.h.

+ Collaboration diagram for _ModuleInfo:
Data Fields
struct _ModuleInfo * next
char * name
u16 version
u16 newflags

For modload shipped with games.

u16 id
u16 flags

I believe this is where flags are kept for BIOS versions.

u32 entry

_start

u32 gp
u32 text_start
u32 text_size
u32 data_size
u32 bss_size
u32 unused1
u32 unused2

◆ _IopModuleID

struct _IopModuleID

Definition at line 51 of file loadcore.h.

Data Fields
const char * name
unsigned short int version

◆ _FileInfo

struct _FileInfo

Definition at line 56 of file loadcore.h.

+ Collaboration diagram for _FileInfo:
Data Fields
u32 ModuleType
void * EntryPoint
void * gp
void * text_start
u32 text_size
u32 data_size
u32 bss_size
u32 MemSize
IopModuleID_t * mod_id

◆ _iop_library

struct _iop_library

Definition at line 68 of file loadcore.h.

+ Collaboration diagram for _iop_library:
Data Fields
struct _iop_library * prev
struct irx_import_table * caller
u16 version
u16 flags
char name[8]
void * exports[]

◆ tag_LC_internals

struct tag_LC_internals

Loadcore internal data structure. Based on the one from loadcore.c of the FPS2BIOS project from PCSX2.

Definition at line 78 of file loadcore.h.

+ Collaboration diagram for tag_LC_internals:
Data Fields
iop_library_t * let_next
iop_library_t * let_prev
iop_library_t * mda_next
iop_library_t * mda_prev
ModuleInfo_t * image_info

Points to the module image information structure chain that usually starts at 0x800.

int module_count
int module_index
void * reboot_handlers
void * intr_suspend_tbl
int bootmodes[16]
int bootmodes_size

◆ iop_bootmode_t

struct iop_bootmode_t

Definition at line 92 of file loadcore.h.

Data Fields
u16 value
u8 id
u8 len
u32 data[]

◆ iop_init_entry_t

struct iop_init_entry_t

Definition at line 100 of file loadcore.h.

Data Fields
void * callback

◆ iop_library_table_t

struct iop_library_table_t

For backward-compatibility with older projects. Read the comment on GetLibraryEntryTable(). This structure is incomplete.

Definition at line 109 of file loadcore.h.

+ Collaboration diagram for iop_library_table_t:
Data Fields
struct _iop_library * tail
struct _iop_library * head

Macro Definition Documentation

◆ MODULE_RESIDENT_END

#define MODULE_RESIDENT_END   0

Definition at line 22 of file loadcore.h.

◆ MODULE_NO_RESIDENT_END

#define MODULE_NO_RESIDENT_END   1

Definition at line 23 of file loadcore.h.

◆ MODULE_REMOVABLE_END

#define MODULE_REMOVABLE_END   2

Definition at line 24 of file loadcore.h.

◆ loadcore_IMPORTS

#define loadcore_IMPORTS
Value:
loadcore_IMPORTS_start \
\
I_GetLibraryEntryTable \
\
I_FlushIcache \
I_FlushDcache \
\
I_RegisterLibraryEntries \
I_ReleaseLibraryEntries \
\
I_QueryLibraryEntryTable \
I_QueryBootMode \
\
loadcore_IMPORTS_end

Definition at line 152 of file loadcore.h.

◆ loadcore_IMPORTS_start

#define loadcore_IMPORTS_start   DECLARE_IMPORT_TABLE(loadcore, 1, 1)

Definition at line 168 of file loadcore.h.

◆ loadcore_IMPORTS_end

#define loadcore_IMPORTS_end   END_IMPORT_TABLE

Definition at line 169 of file loadcore.h.

◆ I_GetLibraryEntryTable

#define I_GetLibraryEntryTable   DECLARE_IMPORT(3, GetLibraryEntryTable)

Definition at line 171 of file loadcore.h.

◆ I_GetLoadcoreInternalData

#define I_GetLoadcoreInternalData   DECLARE_IMPORT(3, GetLoadcoreInternalData)

Definition at line 172 of file loadcore.h.

◆ I_FlushIcache

#define I_FlushIcache   DECLARE_IMPORT(4, FlushIcache)

Definition at line 173 of file loadcore.h.

◆ I_FlushDcache

#define I_FlushDcache   DECLARE_IMPORT(5, FlushDcache)

Definition at line 174 of file loadcore.h.

◆ I_RegisterLibraryEntries

#define I_RegisterLibraryEntries   DECLARE_IMPORT(6, RegisterLibraryEntries)

Definition at line 175 of file loadcore.h.

◆ I_ReleaseLibraryEntries

#define I_ReleaseLibraryEntries   DECLARE_IMPORT(7, ReleaseLibraryEntries)

Definition at line 176 of file loadcore.h.

◆ I_LinkLibraryEntries

#define I_LinkLibraryEntries   DECLARE_IMPORT(8, LinkLibraryEntries)

Definition at line 177 of file loadcore.h.

◆ I_UnLinkLibraryEntries

#define I_UnLinkLibraryEntries   DECLARE_IMPORT(9, UnLinkLibraryEntries)

Definition at line 178 of file loadcore.h.

◆ I_RegisterNonAutoLinkEntries

#define I_RegisterNonAutoLinkEntries   DECLARE_IMPORT(10, RegisterNonAutoLinkEntries)

Definition at line 179 of file loadcore.h.

◆ I_QueryLibraryEntryTable

#define I_QueryLibraryEntryTable   DECLARE_IMPORT(11, QueryLibraryEntryTable)

Definition at line 180 of file loadcore.h.

◆ I_QueryBootMode

#define I_QueryBootMode   DECLARE_IMPORT(12, QueryBootMode)

Definition at line 181 of file loadcore.h.

◆ I_RegisterBootMode

#define I_RegisterBootMode   DECLARE_IMPORT(13, RegisterBootMode)

Definition at line 182 of file loadcore.h.

◆ I_LockLibraryClient

#define I_LockLibraryClient   DECLARE_IMPORT(14, LockLibraryClient)

Definition at line 183 of file loadcore.h.

◆ I_UnLockLibraryClient

#define I_UnLockLibraryClient   DECLARE_IMPORT(15, UnLockLibraryClient)

Definition at line 184 of file loadcore.h.

◆ I_RegisterModule

#define I_RegisterModule   DECLARE_IMPORT(16, RegisterModule)

Definition at line 185 of file loadcore.h.

◆ I_ReleaseModule

#define I_ReleaseModule   DECLARE_IMPORT(17, ReleaseModule)

Definition at line 186 of file loadcore.h.

◆ I_AddRebootNotifyHandler

#define I_AddRebootNotifyHandler   DECLARE_IMPORT(20, AddRebootNotifyHandler)

Definition at line 187 of file loadcore.h.

◆ I_SetCacheCtrl

#define I_SetCacheCtrl   DECLARE_IMPORT(21, SetCacheCtrl)

Definition at line 188 of file loadcore.h.

◆ I_ProbeExecutableObject

#define I_ProbeExecutableObject   DECLARE_IMPORT(22, ProbeExecutableObject)

Definition at line 189 of file loadcore.h.

◆ I_LoadExecutableObject

#define I_LoadExecutableObject   DECLARE_IMPORT(23, LoadExecutableObject)

Definition at line 190 of file loadcore.h.

◆ I_SearchModuleCBByAddr

#define I_SearchModuleCBByAddr   DECLARE_IMPORT(24, SearchModuleCBByAddr)

Definition at line 191 of file loadcore.h.

◆ LinkImports

#define LinkImports (   ...)    LinkLibraryEntries(__VA_ARGS__)

Definition at line 194 of file loadcore.h.

◆ UnlinkImports

#define UnlinkImports (   ...)    UnLinkLibraryEntries(__VA_ARGS__)

Definition at line 195 of file loadcore.h.

◆ SetNonAutoLinkFlag

#define SetNonAutoLinkFlag (   ...)    LockLibraryClient(__VA_ARGS__)

Definition at line 196 of file loadcore.h.

◆ UnsetNonAutoLinkFlag

#define UnsetNonAutoLinkFlag (   ...)    UnLockLibraryClient(__VA_ARGS__)

Definition at line 197 of file loadcore.h.

◆ LinkModule

#define LinkModule (   ...)    RegisterModule(__VA_ARGS__)

Definition at line 198 of file loadcore.h.

◆ UnlinkModule

#define UnlinkModule (   ...)    ReleaseModule(__VA_ARGS__)

Definition at line 199 of file loadcore.h.

◆ RegisterPostBootCallback

#define RegisterPostBootCallback (   ...)    AddRebootNotifyHandler(__VA_ARGS__)

Definition at line 200 of file loadcore.h.

◆ ReadModuleHeader

#define ReadModuleHeader (   ...)    ProbeExecutableObject(__VA_ARGS__)

Definition at line 201 of file loadcore.h.

◆ LoadModuleImage

#define LoadModuleImage (   ...)    LoadExecutableObject(__VA_ARGS__)

Definition at line 202 of file loadcore.h.

◆ FindImageInfo

#define FindImageInfo (   ...)    SearchModuleCBByAddr(__VA_ARGS__)

Definition at line 203 of file loadcore.h.

◆ I_LinkImports

#define I_LinkImports   I_LinkLibraryEntries

Definition at line 204 of file loadcore.h.

◆ I_UnlinkImports

#define I_UnlinkImports   I_UnLinkLibraryEntries

Definition at line 205 of file loadcore.h.

◆ I_SetNonAutoLinkFlag

#define I_SetNonAutoLinkFlag   I_LockLibraryClient

Definition at line 206 of file loadcore.h.

◆ I_UnsetNonAutoLinkFlag

#define I_UnsetNonAutoLinkFlag   I_UnLockLibraryClient

Definition at line 207 of file loadcore.h.

◆ I_LinkModule

#define I_LinkModule   I_RegisterModule

Definition at line 208 of file loadcore.h.

◆ I_UnlinkModule

#define I_UnlinkModule   I_ReleaseModule

Definition at line 209 of file loadcore.h.

◆ I_RegisterPostBootCallback

#define I_RegisterPostBootCallback   I_AddRebootNotifyHandler

Definition at line 210 of file loadcore.h.

◆ I_ReadModuleHeader

#define I_ReadModuleHeader   I_ProbeExecutableObject

Definition at line 211 of file loadcore.h.

◆ I_LoadModuleImage

#define I_LoadModuleImage   I_LoadExecutableObject

Definition at line 212 of file loadcore.h.

◆ I_FindImageInfo

#define I_FindImageInfo   I_SearchModuleCBByAddr

Definition at line 213 of file loadcore.h.

Typedef Documentation

◆ ModuleInfo_t

typedef struct _ModuleInfo ModuleInfo_t

Module info entry. Taken from iopmgr.

◆ lc_internals_t

Loadcore internal data structure. Based on the one from loadcore.c of the FPS2BIOS project from PCSX2.

◆ BootupCallback_t

typedef int(* BootupCallback_t) (iop_init_entry_t *next, int delayed)

Definition at line 104 of file loadcore.h.

Function Documentation

◆ GetLibraryEntryTable()

iop_library_table_t * GetLibraryEntryTable ( void  )

Retained for backward-compatibility with older projects. This function actually returns a pointer to LOADCORE's internal data structure.

◆ GetLoadcoreInternalData()

lc_internals_t * GetLoadcoreInternalData ( void  )

Definition at line 877 of file loadcore.c.

◆ RegisterLibraryEntries()

int RegisterLibraryEntries ( struct irx_export_table exports)

Definition at line 651 of file loadcore.c.

◆ ReleaseLibraryEntries()

int ReleaseLibraryEntries ( struct irx_export_table exports)

Definition at line 751 of file loadcore.c.

◆ LinkLibraryEntries()

int LinkLibraryEntries ( void *  addr,
int  size 
)

Definition at line 801 of file loadcore.c.

◆ UnLinkLibraryEntries()

int UnLinkLibraryEntries ( void *  addr,
int  size 
)

Definition at line 822 of file loadcore.c.

◆ RegisterNonAutoLinkEntries()

int RegisterNonAutoLinkEntries ( struct irx_export_table exports)

Definition at line 740 of file loadcore.c.

◆ QueryLibraryEntryTable()

void * QueryLibraryEntryTable ( iop_library_t library)

Definition at line 784 of file loadcore.c.

◆ QueryBootMode()

int * QueryBootMode ( int  mode)

Definition at line 549 of file loadcore.c.

◆ RegisterBootMode()

void RegisterBootMode ( iop_bootmode_t b)

Definition at line 523 of file loadcore.c.

◆ LockLibraryClient()

void LockLibraryClient ( struct irx_export_table export)

Definition at line 882 of file loadcore.c.

◆ UnLockLibraryClient()

void UnLockLibraryClient ( struct irx_export_table export)

Definition at line 887 of file loadcore.c.

◆ RegisterModule()

void RegisterModule ( ModuleInfo_t mi)

Definition at line 592 of file loadcore.c.

◆ ReleaseModule()

void ReleaseModule ( ModuleInfo_t mi)

Definition at line 611 of file loadcore.c.

◆ AddRebootNotifyHandler()

int AddRebootNotifyHandler ( BootupCallback_t  func,
int  priority,
int *  stat 
)

Definition at line 566 of file loadcore.c.

◆ ProbeExecutableObject()

int ProbeExecutableObject ( void *  image,
FileInfo_t result 
)

Definition at line 1139 of file loadcore.c.

◆ LoadExecutableObject()

int LoadExecutableObject ( void *  image,
FileInfo_t fi 
)

Definition at line 1202 of file loadcore.c.

◆ SearchModuleCBByAddr()

ModuleInfo_t * SearchModuleCBByAddr ( void *  addr)

Definition at line 632 of file loadcore.c.