sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
loadcore.h File Reference
#include <types.h>
#include <irx.h>

Go to the source code of this file.

Classes

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(...)
#define UnlinkImports(...)
#define SetNonAutoLinkFlag(...)
#define UnsetNonAutoLinkFlag(...)
#define LinkModule(...)
#define UnlinkModule(...)
#define RegisterPostBootCallback(...)
#define ReadModuleHeader(...)
#define LoadModuleImage(...)
#define FindImageInfo(...)
#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_t * GetLibraryEntryTable (void) __attribute__((deprecated))
lc_internals_t * GetLoadcoreInternalData (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_t * SearchModuleCBByAddr (void *addr)

Detailed Description

Kernel module loader.

Definition in file loadcore.h.

Macro Definition Documentation

◆ FindImageInfo

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

Definition at line 204 of file loadcore.h.

◆ I_AddRebootNotifyHandler

#define I_AddRebootNotifyHandler   DECLARE_IMPORT(20, AddRebootNotifyHandler)

Definition at line 188 of file loadcore.h.

◆ I_FindImageInfo

#define I_FindImageInfo   I_SearchModuleCBByAddr

Definition at line 214 of file loadcore.h.

◆ I_FlushDcache

#define I_FlushDcache   DECLARE_IMPORT(5, FlushDcache)

Definition at line 175 of file loadcore.h.

◆ I_FlushIcache

#define I_FlushIcache   DECLARE_IMPORT(4, FlushIcache)

Definition at line 174 of file loadcore.h.

◆ I_GetLibraryEntryTable

#define I_GetLibraryEntryTable   DECLARE_IMPORT(3, GetLibraryEntryTable)

Definition at line 172 of file loadcore.h.

◆ I_GetLoadcoreInternalData

#define I_GetLoadcoreInternalData   DECLARE_IMPORT(3, GetLoadcoreInternalData)

Definition at line 173 of file loadcore.h.

◆ I_LinkImports

#define I_LinkImports   I_LinkLibraryEntries

Definition at line 205 of file loadcore.h.

◆ I_LinkLibraryEntries

#define I_LinkLibraryEntries   DECLARE_IMPORT(8, LinkLibraryEntries)

Definition at line 178 of file loadcore.h.

◆ I_LinkModule

#define I_LinkModule   I_RegisterModule

Definition at line 209 of file loadcore.h.

◆ I_LoadExecutableObject

#define I_LoadExecutableObject   DECLARE_IMPORT(23, LoadExecutableObject)

Definition at line 191 of file loadcore.h.

◆ I_LoadModuleImage

#define I_LoadModuleImage   I_LoadExecutableObject

Definition at line 213 of file loadcore.h.

◆ I_LockLibraryClient

#define I_LockLibraryClient   DECLARE_IMPORT(14, LockLibraryClient)

Definition at line 184 of file loadcore.h.

◆ I_ProbeExecutableObject

#define I_ProbeExecutableObject   DECLARE_IMPORT(22, ProbeExecutableObject)

Definition at line 190 of file loadcore.h.

◆ I_QueryBootMode

#define I_QueryBootMode   DECLARE_IMPORT(12, QueryBootMode)

Definition at line 182 of file loadcore.h.

◆ I_QueryLibraryEntryTable

#define I_QueryLibraryEntryTable   DECLARE_IMPORT(11, QueryLibraryEntryTable)

Definition at line 181 of file loadcore.h.

◆ I_ReadModuleHeader

#define I_ReadModuleHeader   I_ProbeExecutableObject

Definition at line 212 of file loadcore.h.

◆ I_RegisterBootMode

#define I_RegisterBootMode   DECLARE_IMPORT(13, RegisterBootMode)

Definition at line 183 of file loadcore.h.

◆ I_RegisterLibraryEntries

#define I_RegisterLibraryEntries   DECLARE_IMPORT(6, RegisterLibraryEntries)

Definition at line 176 of file loadcore.h.

◆ I_RegisterModule

#define I_RegisterModule   DECLARE_IMPORT(16, RegisterModule)

Definition at line 186 of file loadcore.h.

◆ I_RegisterNonAutoLinkEntries

#define I_RegisterNonAutoLinkEntries   DECLARE_IMPORT(10, RegisterNonAutoLinkEntries)

Definition at line 180 of file loadcore.h.

◆ I_RegisterPostBootCallback

#define I_RegisterPostBootCallback   I_AddRebootNotifyHandler

Definition at line 211 of file loadcore.h.

◆ I_ReleaseLibraryEntries

#define I_ReleaseLibraryEntries   DECLARE_IMPORT(7, ReleaseLibraryEntries)

Definition at line 177 of file loadcore.h.

◆ I_ReleaseModule

#define I_ReleaseModule   DECLARE_IMPORT(17, ReleaseModule)

Definition at line 187 of file loadcore.h.

◆ I_SearchModuleCBByAddr

#define I_SearchModuleCBByAddr   DECLARE_IMPORT(24, SearchModuleCBByAddr)

Definition at line 192 of file loadcore.h.

◆ I_SetCacheCtrl

#define I_SetCacheCtrl   DECLARE_IMPORT(21, SetCacheCtrl)

Definition at line 189 of file loadcore.h.

◆ I_SetNonAutoLinkFlag

#define I_SetNonAutoLinkFlag   I_LockLibraryClient

Definition at line 207 of file loadcore.h.

◆ I_UnlinkImports

#define I_UnlinkImports   I_UnLinkLibraryEntries

Definition at line 206 of file loadcore.h.

◆ I_UnLinkLibraryEntries

#define I_UnLinkLibraryEntries   DECLARE_IMPORT(9, UnLinkLibraryEntries)

Definition at line 179 of file loadcore.h.

◆ I_UnlinkModule

#define I_UnlinkModule   I_ReleaseModule

Definition at line 210 of file loadcore.h.

◆ I_UnLockLibraryClient

#define I_UnLockLibraryClient   DECLARE_IMPORT(15, UnLockLibraryClient)

Definition at line 185 of file loadcore.h.

◆ I_UnsetNonAutoLinkFlag

#define I_UnsetNonAutoLinkFlag   I_UnLockLibraryClient

Definition at line 208 of file loadcore.h.

◆ LinkImports

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

Definition at line 195 of file loadcore.h.

◆ LinkModule

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

Definition at line 199 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 153 of file loadcore.h.

◆ loadcore_IMPORTS_end

#define loadcore_IMPORTS_end   END_IMPORT_TABLE

Definition at line 170 of file loadcore.h.

◆ loadcore_IMPORTS_start

#define loadcore_IMPORTS_start   DECLARE_IMPORT_TABLE(loadcore, 1, 1)

Definition at line 169 of file loadcore.h.

◆ LoadModuleImage

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

Definition at line 203 of file loadcore.h.

◆ MODULE_NO_RESIDENT_END

#define MODULE_NO_RESIDENT_END   1

Definition at line 24 of file loadcore.h.

◆ MODULE_REMOVABLE_END

#define MODULE_REMOVABLE_END   2

Definition at line 25 of file loadcore.h.

◆ MODULE_RESIDENT_END

#define MODULE_RESIDENT_END   0

Definition at line 23 of file loadcore.h.

◆ ReadModuleHeader

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

Definition at line 202 of file loadcore.h.

◆ RegisterPostBootCallback

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

Definition at line 201 of file loadcore.h.

◆ SetNonAutoLinkFlag

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

Definition at line 197 of file loadcore.h.

◆ UnlinkImports

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

Definition at line 196 of file loadcore.h.

◆ UnlinkModule

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

Definition at line 200 of file loadcore.h.

◆ UnsetNonAutoLinkFlag

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

Definition at line 198 of file loadcore.h.

Typedef Documentation

◆ BootupCallback_t

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

Definition at line 105 of file loadcore.h.

◆ lc_internals_t

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

◆ ModuleInfo_t

typedef struct _ModuleInfo ModuleInfo_t

Module info entry. Taken from iopmgr.

Function Documentation

◆ AddRebootNotifyHandler()

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

Definition at line 567 of file loadcore.c.

◆ GetLibraryEntryTable()

iop_library_table_t * GetLibraryEntryTable ( void )
extern

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 )
extern

Definition at line 877 of file loadcore.c.

◆ LinkLibraryEntries()

int LinkLibraryEntries ( void * addr,
int size )
extern

Definition at line 801 of file loadcore.c.

◆ LoadExecutableObject()

int LoadExecutableObject ( void * image,
FileInfo_t * fi )
extern

Definition at line 1202 of file loadcore.c.

◆ LockLibraryClient()

void LockLibraryClient ( struct irx_export_table * export)
extern

Definition at line 882 of file loadcore.c.

◆ ProbeExecutableObject()

int ProbeExecutableObject ( void * image,
FileInfo_t * result )
extern

Definition at line 1139 of file loadcore.c.

◆ QueryBootMode()

int * QueryBootMode ( int mode)
extern

Definition at line 550 of file loadcore.c.

◆ QueryLibraryEntryTable()

void * QueryLibraryEntryTable ( iop_library_t * library)
extern

Definition at line 784 of file loadcore.c.

◆ RegisterBootMode()

void RegisterBootMode ( iop_bootmode_t * b)
extern

Definition at line 524 of file loadcore.c.

◆ RegisterLibraryEntries()

int RegisterLibraryEntries ( struct irx_export_table * exports)
extern

Definition at line 651 of file loadcore.c.

◆ RegisterModule()

void RegisterModule ( ModuleInfo_t * mi)
extern

Definition at line 592 of file loadcore.c.

◆ RegisterNonAutoLinkEntries()

int RegisterNonAutoLinkEntries ( struct irx_export_table * exports)
extern

Definition at line 740 of file loadcore.c.

◆ ReleaseLibraryEntries()

int ReleaseLibraryEntries ( struct irx_export_table * exports)
extern

Definition at line 751 of file loadcore.c.

◆ ReleaseModule()

void ReleaseModule ( ModuleInfo_t * mi)
extern

Definition at line 611 of file loadcore.c.

◆ SearchModuleCBByAddr()

ModuleInfo_t * SearchModuleCBByAddr ( void * addr)
extern

Definition at line 632 of file loadcore.c.

◆ UnLinkLibraryEntries()

int UnLinkLibraryEntries ( void * addr,
int size )
extern

Definition at line 822 of file loadcore.c.

◆ UnLockLibraryClient()

void UnLockLibraryClient ( struct irx_export_table * export)
extern

Definition at line 887 of file loadcore.c.