uofw/include/modulemgr_init.h
Felix-Dev b0146f24a2
Add Module Manager (#69)
* src/modulemgr: sceKernelQueryModuleInfo(): Improved documentation

* src/modulemgr: Fixed various incorrect SDK versions

* src/modulemgr.c: sceKernelQueryModuleInfo(): Fixed two syntax errors.

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleWithBlockOffset().

* src/modulemgr/modulemgr.c: Fixed wrong handling of various sceIoIoctl() status values.

* src/modulemgr/modulemgr.c: Added missing sysmem_kernel.h include.

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleByIDWithBlockOffset().

* src/modulemgr/modulemgr.c: Fixed register K1 permission checks in various user-exported loadModule() functions.

* src/modulemgr/modulemgr.c: sceKernelLoadModuleForUser(): Fixed handling of parameter "opt" when being NULL.

* src/modulemgr/modulemgr.c: Fixed sdkVersion return codes in various LoadModule() functions.

* include/iofilemgr_kernel.h: Added back SCE_O_UNKNOWN0.

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleDNAS().

* src/modulemgr: Updated and added documentation

- Added documentation for sceKernelLoadModuleById(),
sceKernelLoadModuleWithBlockOffset(), and sceKernelLoadModuleDNAS
- Updated documentation of ModuleMgrForKernel_2B7FC10D(),
sceKernelLoadModule(), sceKernelGetModuleIdList(),
sceKernelQueryModuleInfo(), sceKernelGetModuleId(),
sceKernelGetModuleIdByAddress(), and sceKernelGetModuleGPByAddress()

* src/modulemgr: Updated documentation: case when SCE_ERROR_KERNEL_ILLEGAL_ADDRESS is returned

Affects sceKernelLoadModuleWithBlockOffset() and
sceKernelLoadModuleByIDWithBlockOffset().

* src/modulemgr: sceKernelLoadModuleDNAS(): Forgot a word in documentation

* src/modulemgr: sceKernelLoadModuleDNAS(): Forgot quotation marks in documentation

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleNpDrm().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleMs().

* src/modulemgr/modulemgr.c: Added sceKernelSelfStopUnloadModule().

* src/modulemgr/modulemgr.c: Added sceKernelStopModule().

* src/modulemgr: sceKernelLoadModuleNpDrm(): Fixed a pointer issue

* include/common/memory.h: Added pspClearMemory*() functions. These functions should be used as an alternative to corresponding memset calls.

* src/modulemgr/modulemgr.c: Replaced the variable <modParams> clearing-for-loops with the pspClearMemory32() function.

* src/modulemgr: sceKernelLoadModuleNpDrm(): Added documentation

* src/modulemgr: Added sceKernelLoadModuleBufferUsbWlan()

* src/modulemgr: sceKernelLoadModuleBufferUsbWlan(): Fixed return type

* src/modulemgr: Added _LoadModuleByBufferID()

* src/modulemgr: Added _start_exe_thread()

* src/modulemgr: Added sub_00007620()

* src/modulemgr: Added sub_00007698()

* src/modulemgr: Rename sub_00007620() to _CheckOption()

* src/modulemgr: _CheckOption(): Fix return type

* src/modulemgr: Added _SelfStopUnloadModule()

* src/modulemgr/: Added loadModuleChecks_inline.h containing commonly used checks in loadModule() functions. The check functions introduced there should be used in loadModule() functions.

* src/modulemgr/modulemgr.c: Preparations for the use of _check functions().

* src/modulemgr/modulemgr.c: Removed _CheckOptions(). Its equivalent function is _checkLMOptionConditions() defined in loadModuleChecks_inline.h.

* src/modulemgr/modulemgr.c: loadModule _check() functions are now being used.

* src/modulemgr/loadModuleChecks_inline.h: Removed _setupChecks() and _terminateChecks().

* src/modulemgr/modulemgr.c: Fixed _SelfStopUnloadModule().

* src/modulemgr/modulemgr.c: Forgot to fix pointer errors in _SelfStopUnloadModule() in previous commit.

* src/modulemgr/modulemgr.c: Added _EpilogueModule().

* src/modulemgr: Added sub_000077F0()

* src/modulemgr: _EpilogueModule(): Replaced hardcoded size by sizeof()

* modulemgr: renamed sub_000077F0 to _StopUnloadSelfModuleWithStatus()

* src/modulemgr/modulemgr.c: Added _ModuleReleaseLibraries().

* src/modulemgr: Added _checkSMOptionConditions() and fixed small issues in _StopUnloadSelfModuleWithStatus().

* src/modulemgr/modulemgr.c: Added sceKernelStartModule().

* include/threadman_kernel: Added more thread attribute values.

* src/modulemgr/modulemgr.c: Added sceKernelRebootBeforeForUser().

* src/modulemgr/modulemgr.c: Added sceKernelRebootPhaseForKernel().

* src/modulemgr/modulemgr.c: Added sceKernelRebootBeforeForKernel().

* include/modulemgr_user.h: Added documentation for sceKernelLoadModuleMs().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHDisc().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHDiscUpdater().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHDiscDebug().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHDiscEmu().

* src/modulemgr/modulemgr.c: Added ModuleMgrForKernel_C2A5E6CA().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHMs1().

* added current work from months ago

* src/modulemgr: Cleaned modulemgr directory and added first code.

* src/modulemgr: Finished ModuleMgrInit().

* src/modulemgr: ModuleMgrInit(): Added ChunkInit() call.

* src/modulemgr: Added _ModuleMgrRebootBefore().

* include/threadman_kernel.h: Added sceKernelSuspendThread().

* src\modulemgr\modulemgr.c: Added functions to reverse

* src/modulemgr: Fixed ModuleMgrRebootBefore prefix

ModuleMgrRebootBefore was prefixed with _ although it's not an internal
function

* src/modulmgr: Added ModuleMgrRebootPhase().

* src/modulemgr: Added exe_thread().

* src/modulemgr: Added_UnloadModule().

* src/modulemgr: Fixed a mistake in_UnloadModule().

* src/modulemgr: Added sceKernelGetModuleId().

* src/modulemgr: sceKernelGetModuleId(): Clarified variable name and type.

* src/modulemgr: sceKernelGetModuleId(): Changed return type (forgot it in last commit) for clarification reasons.

* src/modulemgr: sceKernelGetModuleId(): Fixed K1 register handling.

* include/iofilemgr_kernel.h: Added more sceIoOpen() flags.

* src/modulemgr: Added sceKernelGetModuleIdByAddress()

* src/modulemgr: Documentation for sceKernelGetModuleId()

* src/modulemgr: sceKernelGetModuleIdByAddress():  Fixed pspK1PtrOk() argument

* src/modulemgr: Added sceKernelGetModuleGPByAddress()

* src/modulemgr: Fixed missing const statement in arguments

* include/iofilemgr_kernel.h: Added sceKernelLoadModuleForLoadExecForUser().

* src/modulemgr.c: sceKernelGetModuleGPByAddress(): Added retVal declaration.

* src/modulemgr.c: sceKernelLoadModuleForLoadExecForUser(): Added back SCeUID fd declaration (it was eaten by some ghosts I guess).

* src/modulemgr: Added sceKernelGetModuleIdList()

* src/modulemgr: Added sceKernelLoadModule()

* src/modulemgr: sceKernelLoadModuleForLoadExecForUser(): Fixed pointer issues, added some comments

* src/modulemgr: sceKernelLoadModule(): Fixed missing structure field set

* src/modulemgr: sceKernelLoadModuleForLoadExecForUser() and sceKernelLoadModule(): Added documentation

* src/modulemgr: struct SceKernelLMOption: Added documentation

* src/modulemgr: sceKernelLoadModule(): Fixed return value

* src/modulemgr.c: Removed SceKernelLMOption declaration (it is already declared in include/modulemgr_options.h).

* include/modulemgr_options.h: Added back the doxygen documentation for SceKernelLMOption.

* src/modulemgr.c: Added sceKernelLoadModuleByID().

* src/modulemgr.c: sceKernelLoadModule(): Fixed ioctl command.

* src/modulemgr.c: Renamed sceKernelLoadModule() -> sceKernelLoadModuleForUser().

* src/modulemgr.c: sceKernelLoadModuleForUser(): Fixed ioctl command (another one).

* src/modulemgr: Added sceKernelQueryModuleInfo()

* src/modulemgr: sceKernelQueryModuleInfo(): Improved documentation

* src/modulemgr: Fixed various incorrect SDK versions

* src/modulemgr.c: sceKernelQueryModuleInfo(): Fixed two syntax errors.

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleWithBlockOffset().

* src/modulemgr/modulemgr.c: Fixed wrong handling of various sceIoIoctl() status values.

* src/modulemgr/modulemgr.c: Added missing sysmem_kernel.h include.

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleByIDWithBlockOffset().

* src/modulemgr/modulemgr.c: Fixed register K1 permission checks in various user-exported loadModule() functions.

* src/modulemgr/modulemgr.c: sceKernelLoadModuleForUser(): Fixed handling of parameter "opt" when being NULL.

* src/modulemgr/modulemgr.c: Fixed sdkVersion return codes in various LoadModule() functions.

* include/iofilemgr_kernel.h: Added back SCE_O_UNKNOWN0.

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleDNAS().

* src/modulemgr: Updated and added documentation

- Added documentation for sceKernelLoadModuleById(),
sceKernelLoadModuleWithBlockOffset(), and sceKernelLoadModuleDNAS
- Updated documentation of ModuleMgrForKernel_2B7FC10D(),
sceKernelLoadModule(), sceKernelGetModuleIdList(),
sceKernelQueryModuleInfo(), sceKernelGetModuleId(),
sceKernelGetModuleIdByAddress(), and sceKernelGetModuleGPByAddress()

* src/modulemgr: Updated documentation: case when SCE_ERROR_KERNEL_ILLEGAL_ADDRESS is returned

Affects sceKernelLoadModuleWithBlockOffset() and
sceKernelLoadModuleByIDWithBlockOffset().

* src/modulemgr: sceKernelLoadModuleDNAS(): Forgot a word in documentation

* src/modulemgr: sceKernelLoadModuleDNAS(): Forgot quotation marks in documentation

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleNpDrm().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleMs().

* src/modulemgr/modulemgr.c: Added sceKernelSelfStopUnloadModule().

* src/modulemgr/modulemgr.c: Added sceKernelStopModule().

* src/modulemgr: sceKernelLoadModuleNpDrm(): Fixed a pointer issue

* include/common/memory.h: Added pspClearMemory*() functions. These functions should be used as an alternative to corresponding memset calls.

* src/modulemgr/modulemgr.c: Replaced the variable <modParams> clearing-for-loops with the pspClearMemory32() function.

* src/modulemgr: sceKernelLoadModuleNpDrm(): Added documentation

* src/modulemgr: Added sceKernelLoadModuleBufferUsbWlan()

* src/modulemgr: sceKernelLoadModuleBufferUsbWlan(): Fixed return type

* src/modulemgr: Added _LoadModuleByBufferID()

* src/modulemgr: Added _start_exe_thread()

* src/modulemgr: Added sub_00007620()

* src/modulemgr: Added sub_00007698()

* src/modulemgr: Rename sub_00007620() to _CheckOption()

* src/modulemgr: _CheckOption(): Fix return type

* src/modulemgr: Added _SelfStopUnloadModule()

* src/modulemgr/: Added loadModuleChecks_inline.h containing commonly used checks in loadModule() functions. The check functions introduced there should be used in loadModule() functions.

* src/modulemgr/modulemgr.c: Preparations for the use of _check functions().

* src/modulemgr/modulemgr.c: Removed _CheckOptions(). Its equivalent function is _checkLMOptionConditions() defined in loadModuleChecks_inline.h.

* src/modulemgr/modulemgr.c: loadModule _check() functions are now being used.

* src/modulemgr/loadModuleChecks_inline.h: Removed _setupChecks() and _terminateChecks().

* src/modulemgr/modulemgr.c: Fixed _SelfStopUnloadModule().

* src/modulemgr/modulemgr.c: Forgot to fix pointer errors in _SelfStopUnloadModule() in previous commit.

* src/modulemgr/modulemgr.c: Added _EpilogueModule().

* src/modulemgr: Added sub_000077F0()

* src/modulemgr: _EpilogueModule(): Replaced hardcoded size by sizeof()

* modulemgr: renamed sub_000077F0 to _StopUnloadSelfModuleWithStatus()

* src/modulemgr/modulemgr.c: Added _ModuleReleaseLibraries().

* src/modulemgr: Added _checkSMOptionConditions() and fixed small issues in _StopUnloadSelfModuleWithStatus().

* src/modulemgr/modulemgr.c: Added sceKernelStartModule().

* include/threadman_kernel: Added more thread attribute values.

* src/modulemgr/modulemgr.c: Added sceKernelRebootBeforeForUser().

* src/modulemgr/modulemgr.c: Added sceKernelRebootPhaseForKernel().

* src/modulemgr/modulemgr.c: Added sceKernelRebootBeforeForKernel().

* include/modulemgr_user.h: Added documentation for sceKernelLoadModuleMs().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHDisc().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHDiscUpdater().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHDiscDebug().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHDiscEmu().

* src/modulemgr/modulemgr.c: Added ModuleMgrForKernel_C2A5E6CA().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHMs1().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHMs2().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHMs3().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHMs4().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHMs5().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecVSHMs6().

* src/modulemgr/modulemgr.c: Added ModuleMgrForKernel_8DD336D4().

* src/modulemgr: Simplified ModuleMgrRebootBefore(()

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForLoadExecNpDrm().

* src/modulemgr/modulemgr.c: Minor line indentation corrections.

* src/modulemgr/modulemgr.c: option-> pOpt name change in several functions.

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleVSH().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleVSHByID().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleForKernel().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleByIDForKernel().

* src/modulemgr/modulemgr.c: Added more functions.

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleBufferForExitGame() and sceKernelLoadModuleBufferMs().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleBufferApp().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleBufferForLoadExecBufferVSHUsbWlan().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleBufferForLoadExecBufferVSHUsbWlanDebug().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleBufferVSH().

* src/modulemgr/modulemgr.c: Added sceKernelLoadModuleBufferForExitVSHVSH().

* src/modulemgr/modulemgr.c: Added more functions.

* src/modulemgr/modulemgr.c: Added sceKernelUnloadModule().

* src/modulemgr/modulemgr.c: Added sceKernelSearchModuleByName().

* src/modulemgr/modulemgr.c: Added sceKernelSearchModuleByAddress().

* src/modulemgr/modulemgr.c: Added sceKernelSetNpDrmGetModuleKeyFunction().

* src/modulemgr/modulemgr.c: Added sceKernelNpDrmGetModuleKey().

* src/modulemgr/modulemgr.c: Added sceKernelModuleMgrMode().

* src/modulemgr/modulemgr.c: Added _StartModule().

* src/modulemgr/modulemgr.c: Added __StopModule().

* src/modulemgr/modulemgr.c: Added _PrologueModule().

* src/modulemgr/modulemgr.c: Added _ModuleRegisterLibraries().

* src/modulemgr/modulemgr.c: Fixed error in _ModuleReleaseLibraries().

* Moved NID_MODULE_* NIDs from src/loadcore/nid.h -> include/modulemgr_nids.h.

* src/modulemgr/modulemgr.c: Added _ProcessModuleExportEnt().

* include/loadcore.h: Renamed SceLoadCoreExecFileInfo.unk104 -> SceLoadCoreExecFileInfo.secureInstallId.

* include/sysmem_user.h: SceSysMemBlockType: Added more members.

* src/modulemgr/modulemgr.c: Added _LoadModule().

* src/modulemgr/modulemgr.c: Added _PartitionCheck().

* src/modulemgr/modulemgr.c: Added _CheckSkipPbpHeader().

* src/modulemgr/modulemgr.c: Fixes and reduced use of magic numbers

* src/modulemgr/modulemgr.c: Fixes and reduced use of magic numbers (2)

* src/modulemgr/modulemgr.c: Fixed mistake in sceKernelQueryModuleInfo().

* src/modulemgr/modulemgr.c: More small fixes and code cleanup.

* Modulemgr: Remove already reverse-engineered function

* src/modulemgr/modulemgr.c: Fixed a few compilation issues.

* src/modulemgr: Broke up modulemgr.c into several .c files.

* modulemgr: Reverse _CheckOverride()

- Move _CheckOverride() into a separate file

- Reverse _CheckOverride()

- Add the rules for overriding modules' file descriptors

* src/modulemgr/modulemgr.c: Fixed _CheckSkipPbpHeader.

* src/modulemgr/override.c: Fixed syntax errors.

* modulemgr: Fix more mistakes in override

* src/modulemgr: Added pbp.h ( .PBP header description).

* src/modulemgr/modulemgr.c: Added _RelocateModule().

* src/modulemgr/modulemgr.c: Fixed mistake in ModuleRegisterLibraries().

* include/sysmem_kernel.h: Updated prototype of sceKernelGetId().

* src/modulemgr/modulemgr.c: Added ModuleMgrForUser_CDE1C1FE().

* src/modulemgr/modulemgr.c: Added allocate_module_block().

* src/modulemgr/override.c: Fixed mistakes in _CheckOverride() and added more documentation about its purpose.

* modulemgr/rebootModule: Replace hexa with constant

* modulemgr/modulemgr: ModuleMgrForUser_CDE1C1FE(): s32 -> SceBool

* modulemgr: Fixes, re-writes, improved naming, added some documentation. It does not compile yet!

* modulemgr: Make it compilable.

* Removed include/modulemgr.h.

* src/modulemgr: Added missing Makefile.

* modulemgr: Updated its static libraries to reflect name changes of its exported functions.

* modulemgr: Made Loadcore and Loadexec compilable again. They were broken after changes have been made for modulemgr.

* modulemgr: Fixed a few mistakes.

* modulemgr: More fixes and updated some documentation.

* modulemgr: Added .PBP file layout and PARAM.SFO information.

* include/modulemgr_init.h: Added more SCE_EXEC_FILE_* members.

* include/common/errors.h: Added error-value format description.

* modulemgr: More fixes. Also added debug code for modulemgr (dbg.c). It will be removed before merging into 'master'.

* modulemgr: Added missing debug code.

* src/modulemgr: Fixed more errors.

* update .gitignore with version on master

* update .gitignore

* update .gitignore

* Module manager: Remove debug code

* Revert changes made to debug header.

* Add modulemgr to global makefile.

Co-authored-by: devnoname120 <devnoname120@gmail.com>
Co-authored-by: Felix-Dev <FelixDev91.gmail.com>
Co-authored-by: Kern Walster <wals0323@umn.edu>
Co-authored-by: Martin Charles <martincharles07@gmail.com>
Co-authored-by: devnoname120 <devnoname120+gh@gmail.com>
2021-01-02 16:30:44 +01:00

352 lines
12 KiB
C

/* Copyright (C) 2011 - 2015 The uOFW team
See the file COPYING for copying permission.
*/
#include "common_header.h"
#include "loadcore.h"
#include "loadexec_kernel.h"
/** @defgroup ModuleManager Module Manager
* Module Management.
*/
/** @defgroup InitForKernel Init For Kernel
* @ingroup ModuleManager
* The InitForKernel library.
* @{
*/
#ifndef MODULEMGR_INIT_H
#define MODULEMGR_INIT_H
/**
* The possible boot medium types for an executable.
*/
enum SceBootMediumType {
/** The executable was booted via Flash 0 (1, 2). */
SCE_INIT_BOOT_FLASH = 0,
/** The executable was booted via a Disc medium. */
SCE_INIT_BOOT_DISC = 0x20,
/** The executable was booted via a Game-sharing medium. */
SCE_INIT_BOOT_USBWLAN = 0x30,
/** The executable was booted via the Memory Stick medium. */
SCE_INIT_BOOT_MS = 0x40,
/** The executable was booted via an unknown medium. */
SCE_INIT_BOOT_EF = 0x50,
/** The executable was booted via Flash 3.*/
SCE_INIT_BOOT_FLASH3 = 0x80,
};
/**
* Application types of an executable.
*/
enum SceApplicationType {
/** The application is a VSH application (i.e. VSH modules). */
SCE_INIT_APPLICATION_VSH = 0x100,
/** The application is an updater. */
SCE_INIT_APPLICATION_UPDATER = 0x110,
/** The application is a PSP game. */
SCE_INIT_APPLICATION_GAME = 0x200,
/** The application is a Playstation One game. */
SCE_INIT_APPLICATION_POPS = 0x300,
/** The application is a PSP application (i.e. Skype). */
SCE_INIT_APPLICATION_APP = 0x400,
};
/**
* API types of an executable.
*/
enum SceFileExecApiType {
SCE_EXEC_FILE_APITYPE_MODULE_KERNEL = 0x000,
SCE_EXEC_FILE_APITYPE_MODULE_BUFFER_KERNEL = 0x002,
SCE_EXEC_FILE_APITYPE_MODULE_KERNEL_BLOCK = 0x003,
SCE_EXEC_FILE_APITYPE_MODULE_USER = 0x010,
SCE_EXEC_FILE_APITYPE_MODULE_MS = 0x011,
SCE_EXEC_FILE_APITYPE_MODULE_DNAS = 0x013,
SCE_EXEC_FILE_APITYPE_MODULE_NPDRM = 0x014,
SCE_EXEC_FILE_APITYPE_MODULE_VSH = 0x020,
SCE_EXEC_FILE_APITYPE_MODULE_BUFFER_VSH = 0x021,
SCE_EXEC_FILE_APITYPE_MODULE_BUFFER_USBWLAN = 0x030,
SCE_EXEC_FILE_APITYPE_MODULE_BUFFER_MS = 0x042,
SCE_EXEC_FILE_APITYPE_MODULE_BUFFER_APP = 0x043,
SCE_EXEC_FILE_APITYPE_MODULE_BUFFER_BOOT_INIT_BTCNF = 0x051,
SCE_EXEC_FILE_APITYPE_MODULE_BOOT_INIT_CONFIG = 0x052,
SCE_EXEC_FILE_APITYPE_MODULE_DECI = 0x070,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_UNK100 = 0x100,
/** GAME EBOOT. */
SCE_EXEC_FILE_APITYPE_GAME_EBOOT = 0x110,
/** GAME BOOT. */
SCE_EXEC_FILE_APITYPE_GAME_BOOT = 0x111,
/** Emulated EBOOT Memory-Stick. */
SCE_EXEC_FILE_APITYPE_EMU_EBOOT_MS = 0x112,
/** Emulated BOOT Memory-Stick. */
SCE_EXEC_FILE_APITYPE_EMU_BOOT_MS = 0x113,
/** Emulated EBOOT EF. */
SCE_EXEC_FILE_APITYPE_EMU_EBOOT_EF = 0x114,
/** Emulated BOOT EF. */
SCE_EXEC_FILE_APITYPE_EMU_BOOT_EF = 0x115,
/** NP-DRM Memory-Stick. */
SCE_EXEC_FILE_APITYPE_NPDRM_MS = 0x116, /* Distributed programs and data through the Playstation Store. */
/** Unknown. */
SCE_EXEC_FILE_APITYPE_UNK117 = 0x117,
/** NP-DRM EF. */
SCE_EXEC_FILE_APITYPE_NPDRM_EF = 0x118, /* NP-DRM: PlayStation Network Platform Digital Rights Management */
/** Unknown. */
SCE_EXEC_FILE_APITYPE_UNK119 = 0x119,
/** Executable on a disc. */
SCE_EXEC_FILE_APITYPE_DISC = 0x120,
/** Updater executable on a disc.*/
SCE_EXEC_FILE_APITYPE_DISC_UPDATER = 0x121,
/** Disc debugger. */
SCE_EXEC_FILE_APITYPE_DISC_DEBUG = 0x122,
/** NP-9660 game. */
SCE_EXEC_FILE_APITYPE_DISC_EMU_MS1 = 0x123,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_DISC_EMU_MS2 = 0x124,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_DISC_EMU_EF1 = 0x125,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_DISC_EMU_EF2 = 0x126,
/** Game-sharing executable. */
SCE_EXEC_FILE_APITYPE_USBWLAN = 0x130,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_USBWLAN_DEBUG = 0x131,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_UNK132 = 0x132,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_UNK133 = 0x133,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_MS1 = 0x140,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_MS2 = 0x141,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_MS3 = 0x142,
/** Applications (i.e. Comic Reader) */
SCE_EXEC_FILE_APITYPE_MS4 = 0x143,
/** Playstation One executable. */
SCE_EXEC_FILE_APITYPE_MS5 = 0x144,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_MS6 = 0x145,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_EF1 = 0x151,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_EF2 = 0x152,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_EF3 = 0x153,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_EF4 = 0x154,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_EF5 = 0x155,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_EF6 = 0x156,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_UNK160 = 0x160,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_UNK161 = 0x161,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_MLNAPP_MS = 0x170,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_MLNAPP_EF = 0x171,
/** Unknown. */
SCE_EXEC_FILE_APITYPE_KERNEL_1 = 0x200,
/** Exit Game. */
SCE_EXEC_FILE_APITYPE_VSH_1 = 0x210,
/** Exit VSH. */
SCE_EXEC_FILE_APITYPE_VSH_2 = 0x220,
/** Kernel reboot. */
SCE_EXEC_FILE_APITYPE_KERNEL_REBOOT = 0x300,
/** Debug. */
SCE_EXEC_FILE_APITYPE_DEBUG = 0x420 /* doesn't start reboot */
};
/**
* This structure represents an Init control block. It holds information about the
* currently booted module by Init.
*/
typedef struct {
/** The API type of the currently loaded module. One of ::SceFileExecApiType. */
s32 apiType; //0
/** The address of a memory protection block of type ::SCE_PROTECT_INFO_TYPE_FILE_NAME. */
void *fileModAddr; //4
/** The address of a memory protection block of type ::SCE_PROTECT_INFO_TYPE_DISC_IMAGE. */
void *discModAddr; //8
/** VSH parameters. Used to reboot the kernel. */
SceKernelLoadExecVSHParam vshParam; //12
/** Unknown. */
s32 unk60;
/** Unknown. */
s32 unk64;
/** Unknown. */
s32 unk68;
/** Unknown. */
s32 unk72;
/** Unknown. */
s32 unk76;
/** Unknown. */
s32 unk80;
/** Unknown. */
s32 unk84;
/** Unknown. */
s32 unk88;
/** The application type of the currently loaded module. One of ::SceApplicationType. */
u32 applicationType; //92
/** The number of power locks used by Init. */
s32 numPowerLocks; //96
/** The address of a memory protection block of type ::SCE_PROTECT_INFO_TYPE_PARAM_SFO. */
void *paramSfoBase; //100
/** The size of of the memory block pointed to by ::paramSfoBase. */
SceSize paramSfoSize; //104
/** Unknown. */
s32 lptSummary; //108
/** Pointer to boot callbacks of modules. */
SceBootCallback *bootCallbacks1; //112
/** The current boot callback 1 slot used to hold the registered boot callback. */
SceBootCallback *curBootCallback1; //116
/** Pointer to boot callbacks of modules. */
SceBootCallback *bootCallbacks2; //120
/** The current boot callback 2 slot used to hold the registered boot callback. */
SceBootCallback *curBootCallback2; //124
} SceInit;
/**
* Get the boot medium of the executable calling this function.
*
* @return The boot medium type. One of ::SceBootMediumType.
*/
u32 sceKernelBootFrom(void);
/**
* Get the boot medium of the executable calling this function. For PSP-GO only?
*
* @return The boot medium type. One of ::SceBootMediumType.
*/
u32 InitForKernel_9D33A110(void);
/**
* Get the application type of a module.
*
* @return The application type. One of ::SceApplicationType.
*/
s32 sceKernelApplicationType(void);
/**
* Get the API type of a module.
*
* @return The API type. One of ::SceFileExecApiType.
*/
s32 sceKernelInitApitype(void);
/**
* Set a boot callback. Call this function during a module boot process.
*
* @param bootCBFunc The boot callback function to execute once the module has been loaded by the Init
* module.
* @param flag Defines the execute order of the callbacks. Pass 0 for earliest execution, 3 for latest.
* 1 and 2 are between these two. Pass 4 - 7 for execution after Init loaded all modules, again
* 4 is earliest, 7 is latest.
* @param pStatus The returned status of bootCBFunc in case it was executed directly.
*
* @return SCE_ERROR_OK for directly executing the boot callback function. SCE_BOOT_CALLBACK_FUNCTION_QUEUED
* indicates boot callback function was enqueued into other existing boot callbacks and will be called
* when Init boots the rest of the system modules.
*/
u32 sceKernelSetInitCallback(SceKernelBootCallbackFunction bootCBFunc, u32 flag, s32 *pStatus);
/**
* Disabled debug function.
*
* @return SCE_ERROR_OK.
*/
u32 sceKernelStartIntrLogging(void);
/**
* Disabled debug function.
*
* @return SCE_ERROR_OK.
*/
u32 sceKernelShowIntrHandlerInfo(void);
/**
* Disabled debug function.
*
* @return SCE_ERROR_OK.
*/
u32 sceKernelShowIntrMaskTime(void);
/**
* Retrieve Init's internal control block. This control block manages execution details of an
* executable, like its API type, its boot medium and its application type.
*
* @return A pointer to Init's internal control block.
*/
SceInit *sceKernelQueryInitCB(void);
/**
* Get the file name of the currently booted executable.
*
* @return The file name.
*/
char *sceKernelInitFileName(void);
/**
* Get the disc image of the currently booted executable.
*
* @return The disc image. Return null if there is no disc image.
*/
void *sceKernelInitDiscImage(void);
/**
* Get information about a paramSfo block of a module to boot.
*
* @param pSize The size of the paramSfo block.
*
* @return A pointer to the head address of the paramSfo block.
*/
void *sceKernelInitParamSfo(SceSize *pSize);
/**
* Get the LPT summary. Unknown.
*
* @return The LPT summary of the system.
*/
s32 sceKernelInitLptSummary(void);
/**
* Get a chunk's memory block ID.
*
* @param chunkId The ID of the chunk which memory block ID you want to receive.
* Between 0 - 15.
*
* @return The memory block ID on success (greater than or equal to 0) or
* SCE_ERROR_KERNEL_ILLEGAL_CHUNK_ID.
*/
SceUID sceKernelGetChunk(s32 chunkId);
/**
* Register a chunk in the system.
*
* @param chunkId The ID of the chunk to hold the memory block ID. Between 0 - 15.
* @param blockId The memory block ID to register.
*
* @return The blockId stored into the chunk on success, otherwise
* SCE_ERROR_KERNEL_ILLEGAL_CHUNK_ID.
*/
SceUID sceKernelRegisterChunk(s32 chunkId, SceUID blockId);
/**
* Release a used chunk.
*
* @param chunkId The ID of the chunk to release. Between 0 -15.
*
* @return The new value of the chunk, typically -1, on success, otherwise
* SCE_ERROR_KERNEL_ILLEGAL_CHUNK_ID.
*/
s32 sceKernelReleaseChunk(SceUID chunkId);
#endif /* MODULEMGR_INIT_H */
/** @} */