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

Go to the source code of this file.

Data Structures

struct  loadfile_elf32_ehdr_
 
struct  loadfile_elf32_phdr_
 
struct  loadfile_elf32_shdr_
 
struct  loadfile_file_load_handler_struct_
 
struct  loadfile_ee_elf_ringbuffer_content_
 
struct  loadfile_allocate_handler_struct_
 
struct  SetLoadfileCallbacks_struct_
 

Macros

#define modload_IMPORTS_start   DECLARE_IMPORT_TABLE(modload, 1, 1)
 
#define modload_IMPORTS_end   END_IMPORT_TABLE
 
#define I_GetModloadInternalData   DECLARE_IMPORT(3, GetModloadInternalData);
 
#define I_ReBootStart   DECLARE_IMPORT(4, ReBootStart)
 
#define I_LoadModuleAddress   DECLARE_IMPORT(5, LoadModuleAddress)
 
#define I_LoadModule   DECLARE_IMPORT(6, LoadModule)
 
#define I_LoadStartModule   DECLARE_IMPORT(7, LoadStartModule)
 
#define I_StartModule   DECLARE_IMPORT(8, StartModule)
 
#define I_LoadModuleBufferAddress   DECLARE_IMPORT(9, LoadModuleBufferAddress)
 
#define I_LoadModuleBuffer   DECLARE_IMPORT(10, LoadModuleBuffer)
 
#define I_LoadStartKelfModule   DECLARE_IMPORT(11, LoadStartKelfModule)
 
#define I_SetSecrmanCallbacks   DECLARE_IMPORT(12, SetSecrmanCallbacks)
 
#define I_SetCheckKelfPathCallback   DECLARE_IMPORT(13, SetCheckKelfPathCallback)
 
#define I_GetLoadfileCallbacks   DECLARE_IMPORT(14, GetLoadfileCallbacks)
 
#define I_IsIllegalBootDevice   DECLARE_IMPORT(15, IsIllegalBootDevice)
 

Typedefs

typedef struct loadfile_elf32_ehdr_ loadfile_elf32_ehdr_t
 
typedef struct loadfile_elf32_phdr_ loadfile_elf32_phdr_t
 
typedef struct loadfile_elf32_shdr_ loadfile_elf32_shdr_t
 
typedef struct loadfile_file_load_handler_struct_ loadfile_file_load_handler_struct_t
 
typedef struct loadfile_ee_elf_ringbuffer_content_ loadfile_ee_elf_ringbuffer_content_t
 
typedef struct loadfile_allocate_handler_struct_ loadfile_allocate_handler_struct_t
 
typedef int(* loadfile_read_chunk_callback_t) (int fd, loadfile_allocate_handler_struct_t *allocate_info, void *read_callback_userdata)
 
typedef int(* loadfile_elf_load_proc_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs, void *read_callback_userdata, loadfile_read_chunk_callback_t read_callback)
 
typedef int(* loadfile_check_valid_ee_elf_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs)
 
typedef int(* loadfile_elf_get_program_header_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs)
 
typedef void *(* loadfile_elf_load_alloc_buffer_from_heap_callback_t) (u32 size)
 
typedef void(* loadfile_elf_load_dealloc_buffer_from_heap_callback_t) (void *buffer)
 
typedef int(* loadfile_load_kelf_from_card_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs, int port, int slot, int *result_out, int *result_module_out)
 
typedef int(* loadfile_load_kelf_from_disk_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs, int *result_out, int *result_module_out)
 
typedef struct SetLoadfileCallbacks_struct_ SetLoadfileCallbacks_struct_t
 
typedef void *(* SecrCardBootFile_callback_t) (int port, int slot, void *buffer)
 
typedef void *(* SecrDiskBootFile_callback_t) (void *buffer)
 
typedef void(* SetLoadfileCallbacks_callback_t) (SetLoadfileCallbacks_struct_t *callbackinfo)
 
typedef int(* CheckKelfPath_callback_t) (const char *filename, int *port, int *slot)
 

Functions

void GetModloadInternalData (void **pInternalData)
 
int ReBootStart (const char *command, unsigned int flags)
 
int LoadModuleAddress (const char *name, void *addr, int offset)
 
int LoadModule (const char *name)
 
int LoadStartModule (const char *name, int arglen, const char *args, int *result)
 
int StartModule (int modid, const char *name, int arglen, const char *args, int *result)
 
int LoadModuleBufferAddress (void *buffer, void *addr, int offset)
 
int LoadModuleBuffer (void *buffer)
 
int LoadStartKelfModule (const char *name, int arglen, const char *args, int *result)
 
void SetSecrmanCallbacks (SecrCardBootFile_callback_t SecrCardBootFile_fnc, SecrDiskBootFile_callback_t SecrDiskBootFile_fnc, SetLoadfileCallbacks_callback_t SetLoadfileCallbacks_fnc)
 
void SetCheckKelfPathCallback (CheckKelfPath_callback_t CheckKelfPath_fnc)
 
void GetLoadfileCallbacks (CheckKelfPath_callback_t *CheckKelfPath_fnc, SetLoadfileCallbacks_callback_t *SetLoadfileCallbacks_fnc)
 
int IsIllegalBootDevice (const char *path)
 

Detailed Description

Kernel module loader.

Definition in file modload.h.


Data Structure Documentation

◆ loadfile_elf32_ehdr_

struct loadfile_elf32_ehdr_

Definition at line 26 of file modload.h.

Data Fields
u8 e_ident[16]
u16 e_type
u16 e_machine
u32 e_version
u32 e_entry
u32 e_phoff
u32 e_shoff
u32 e_flags
u16 e_ehsize
u16 e_phentsize
u16 e_phnum
u16 e_shentsize
u16 e_shnum
u16 e_shstrndx

◆ loadfile_elf32_phdr_

struct loadfile_elf32_phdr_

Definition at line 44 of file modload.h.

Data Fields
u32 p_type
u32 p_offset
u32 p_vaddr
u32 p_paddr
u32 p_filesz
u32 p_memsz
u32 p_flags
u32 p_align

◆ loadfile_elf32_shdr_

struct loadfile_elf32_shdr_

Definition at line 56 of file modload.h.

Data Fields
u32 sh_name
u32 sh_type
u32 sh_flags
u32 sh_addr
u32 sh_offset
u32 sh_size
u32 sh_link
u32 sh_info
u32 sh_addralign
u32 sh_entsize

◆ loadfile_file_load_handler_struct_

struct loadfile_file_load_handler_struct_

Definition at line 70 of file modload.h.

+ Collaboration diagram for loadfile_file_load_handler_struct_:
Data Fields
int fd
const char * filename
u8 * section_contents
int unknown_0C
loadfile_elf32_ehdr_t elf_header
loadfile_elf32_phdr_t * program_header
loadfile_elf32_shdr_t * section_headers
int unknown_4C

◆ loadfile_ee_elf_ringbuffer_content_

struct loadfile_ee_elf_ringbuffer_content_

Definition at line 82 of file modload.h.

Data Fields
u8 * buffer_base
int buffer_offset
int buffer_length
int dma_handle

◆ loadfile_allocate_handler_struct_

struct loadfile_allocate_handler_struct_

Definition at line 90 of file modload.h.

+ Collaboration diagram for loadfile_allocate_handler_struct_:
Data Fields
int read_buffer_length
int read_buffer_offset
loadfile_ee_elf_ringbuffer_content_t ring_buffer_contents[2]
int ring_buffer_index
int unknown_2C

◆ SetLoadfileCallbacks_struct_

struct SetLoadfileCallbacks_struct_

Definition at line 108 of file modload.h.

+ Collaboration diagram for SetLoadfileCallbacks_struct_:
Data Fields
loadfile_elf_load_proc_callback_t elf_load_proc
loadfile_check_valid_ee_elf_callback_t check_valid_ee_elf
loadfile_elf_get_program_header_callback_t elf_get_program_header
loadfile_elf_load_alloc_buffer_from_heap_callback_t elf_load_alloc_buffer_from_heap
loadfile_elf_load_dealloc_buffer_from_heap_callback_t elf_load_dealloc_buffer_from_heap
loadfile_load_kelf_from_card_callback_t load_kelf_from_card
loadfile_load_kelf_from_disk_callback_t load_kelf_from_disk

Macro Definition Documentation

◆ modload_IMPORTS_start

#define modload_IMPORTS_start   DECLARE_IMPORT_TABLE(modload, 1, 1)

Definition at line 139 of file modload.h.

◆ modload_IMPORTS_end

#define modload_IMPORTS_end   END_IMPORT_TABLE

Definition at line 140 of file modload.h.

◆ I_GetModloadInternalData

#define I_GetModloadInternalData   DECLARE_IMPORT(3, GetModloadInternalData);

Definition at line 142 of file modload.h.

◆ I_ReBootStart

#define I_ReBootStart   DECLARE_IMPORT(4, ReBootStart)

Definition at line 143 of file modload.h.

◆ I_LoadModuleAddress

#define I_LoadModuleAddress   DECLARE_IMPORT(5, LoadModuleAddress)

Definition at line 144 of file modload.h.

◆ I_LoadModule

#define I_LoadModule   DECLARE_IMPORT(6, LoadModule)

Definition at line 145 of file modload.h.

◆ I_LoadStartModule

#define I_LoadStartModule   DECLARE_IMPORT(7, LoadStartModule)

Definition at line 146 of file modload.h.

◆ I_StartModule

#define I_StartModule   DECLARE_IMPORT(8, StartModule)

Definition at line 147 of file modload.h.

◆ I_LoadModuleBufferAddress

#define I_LoadModuleBufferAddress   DECLARE_IMPORT(9, LoadModuleBufferAddress)

Definition at line 148 of file modload.h.

◆ I_LoadModuleBuffer

#define I_LoadModuleBuffer   DECLARE_IMPORT(10, LoadModuleBuffer)

Definition at line 149 of file modload.h.

◆ I_LoadStartKelfModule

#define I_LoadStartKelfModule   DECLARE_IMPORT(11, LoadStartKelfModule)

Definition at line 150 of file modload.h.

◆ I_SetSecrmanCallbacks

#define I_SetSecrmanCallbacks   DECLARE_IMPORT(12, SetSecrmanCallbacks)

Definition at line 151 of file modload.h.

◆ I_SetCheckKelfPathCallback

#define I_SetCheckKelfPathCallback   DECLARE_IMPORT(13, SetCheckKelfPathCallback)

Definition at line 152 of file modload.h.

◆ I_GetLoadfileCallbacks

#define I_GetLoadfileCallbacks   DECLARE_IMPORT(14, GetLoadfileCallbacks)

Definition at line 153 of file modload.h.

◆ I_IsIllegalBootDevice

#define I_IsIllegalBootDevice   DECLARE_IMPORT(15, IsIllegalBootDevice)

Definition at line 154 of file modload.h.

Typedef Documentation

◆ loadfile_read_chunk_callback_t

typedef int(* loadfile_read_chunk_callback_t) (int fd, loadfile_allocate_handler_struct_t *allocate_info, void *read_callback_userdata)

Definition at line 99 of file modload.h.

◆ loadfile_elf_load_proc_callback_t

typedef int(* loadfile_elf_load_proc_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs, void *read_callback_userdata, loadfile_read_chunk_callback_t read_callback)

Definition at line 100 of file modload.h.

◆ loadfile_check_valid_ee_elf_callback_t

typedef int(* loadfile_check_valid_ee_elf_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs)

Definition at line 101 of file modload.h.

◆ loadfile_elf_get_program_header_callback_t

typedef int(* loadfile_elf_get_program_header_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs)

Definition at line 102 of file modload.h.

◆ loadfile_elf_load_alloc_buffer_from_heap_callback_t

typedef void *(* loadfile_elf_load_alloc_buffer_from_heap_callback_t) (u32 size)

Definition at line 103 of file modload.h.

◆ loadfile_elf_load_dealloc_buffer_from_heap_callback_t

typedef void(* loadfile_elf_load_dealloc_buffer_from_heap_callback_t) (void *buffer)

Definition at line 104 of file modload.h.

◆ loadfile_load_kelf_from_card_callback_t

typedef int(* loadfile_load_kelf_from_card_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs, int port, int slot, int *result_out, int *result_module_out)

Definition at line 105 of file modload.h.

◆ loadfile_load_kelf_from_disk_callback_t

typedef int(* loadfile_load_kelf_from_disk_callback_t) (loadfile_allocate_handler_struct_t *allocate_info, loadfile_file_load_handler_struct_t *flhs, int *result_out, int *result_module_out)

Definition at line 106 of file modload.h.

◆ SecrCardBootFile_callback_t

typedef void *(* SecrCardBootFile_callback_t) (int port, int slot, void *buffer)

Definition at line 119 of file modload.h.

◆ SecrDiskBootFile_callback_t

typedef void *(* SecrDiskBootFile_callback_t) (void *buffer)

Definition at line 120 of file modload.h.

◆ SetLoadfileCallbacks_callback_t

typedef void(* SetLoadfileCallbacks_callback_t) (SetLoadfileCallbacks_struct_t *callbackinfo)

Definition at line 121 of file modload.h.

◆ CheckKelfPath_callback_t

typedef int(* CheckKelfPath_callback_t) (const char *filename, int *port, int *slot)

Definition at line 122 of file modload.h.

Function Documentation

◆ GetModloadInternalData()

void GetModloadInternalData ( void **  pInternalData)

Definition at line 736 of file modload.c.

◆ ReBootStart()

int ReBootStart ( const char *  command,
unsigned int  flags 
)

Definition at line 2085 of file modload.c.

◆ LoadModuleAddress()

int LoadModuleAddress ( const char *  name,
void *  addr,
int  offset 
)

Definition at line 388 of file modload.c.

◆ LoadModule()

int LoadModule ( const char *  name)

Definition at line 407 of file modload.c.

◆ LoadStartModule()

int LoadStartModule ( const char *  name,
int  arglen,
const char *  args,
int *  result 
)

Definition at line 434 of file modload.c.

◆ StartModule()

int StartModule ( int  modid,
const char *  name,
int  arglen,
const char *  args,
int *  result 
)

Definition at line 453 of file modload.c.

◆ LoadModuleBufferAddress()

int LoadModuleBufferAddress ( void *  buffer,
void *  addr,
int  offset 
)

Definition at line 412 of file modload.c.

◆ LoadModuleBuffer()

int LoadModuleBuffer ( void *  buffer)

Definition at line 429 of file modload.c.

◆ LoadStartKelfModule()

int LoadStartKelfModule ( const char *  name,
int  arglen,
const char *  args,
int *  result 
)

Definition at line 614 of file modload.c.

◆ SetSecrmanCallbacks()

void SetSecrmanCallbacks ( SecrCardBootFile_callback_t  SecrCardBootFile_fnc,
SecrDiskBootFile_callback_t  SecrDiskBootFile_fnc,
SetLoadfileCallbacks_callback_t  SetLoadfileCallbacks_fnc 
)

Definition at line 1899 of file modload.c.

◆ SetCheckKelfPathCallback()

void SetCheckKelfPathCallback ( CheckKelfPath_callback_t  CheckKelfPath_fnc)

Definition at line 1909 of file modload.c.

◆ GetLoadfileCallbacks()

void GetLoadfileCallbacks ( CheckKelfPath_callback_t *  CheckKelfPath_fnc,
SetLoadfileCallbacks_callback_t *  SetLoadfileCallbacks_fnc 
)

Definition at line 1914 of file modload.c.

◆ IsIllegalBootDevice()

int IsIllegalBootDevice ( const char *  path)

Definition at line 1247 of file modload.c.