PS2SDK
PS2 Homebrew Libraries
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

◆ 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.

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.

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.