first commit

This commit is contained in:
Dan Peori
2010-10-18 12:54:49 -03:00
commit 8a3bef9012
612 changed files with 74685 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
.set noreorder
#include "pspimport.s"
#ifdef F_InterruptManager_0000
IMPORT_START "InterruptManager",0x40000000
#endif
#ifdef F_InterruptManager_0001
IMPORT_FUNC "InterruptManager",0xCA04A2B9,sceKernelRegisterSubIntrHandler
#endif
#ifdef F_InterruptManager_0002
IMPORT_FUNC "InterruptManager",0xD61E6961,sceKernelReleaseSubIntrHandler
#endif
#ifdef F_InterruptManager_0003
IMPORT_FUNC "InterruptManager",0xFB8E22EC,sceKernelEnableSubIntr
#endif
#ifdef F_InterruptManager_0004
IMPORT_FUNC "InterruptManager",0x8A389411,sceKernelDisableSubIntr
#endif
#ifdef F_InterruptManager_0005
IMPORT_FUNC "InterruptManager",0x5CB5A78B,sceKernelSuspendSubIntr
#endif
#ifdef F_InterruptManager_0006
IMPORT_FUNC "InterruptManager",0x7860E0DC,sceKernelResumeSubIntr
#endif
#ifdef F_InterruptManager_0007
IMPORT_FUNC "InterruptManager",0xFC4374B8,sceKernelIsSubInterruptOccurred
#endif
#ifdef F_InterruptManager_0008
IMPORT_FUNC "InterruptManager",0xD2E8363F,QueryIntrHandlerInfo
#endif
#ifdef F_InterruptManager_0009
IMPORT_FUNC "InterruptManager",0xEEE43F47,sceKernelRegisterUserSpaceIntrStack
#endif

115
src/user/IoFileMgrForUser.S Normal file
View File

@@ -0,0 +1,115 @@
.set noreorder
#include "pspimport.s"
#ifdef F_IoFileMgrForUser_0000
IMPORT_START "IoFileMgrForUser",0x40010000
#endif
#ifdef F_IoFileMgrForUser_0001
IMPORT_FUNC "IoFileMgrForUser",0x3251EA56,sceIoPollAsync
#endif
#ifdef F_IoFileMgrForUser_0002
IMPORT_FUNC "IoFileMgrForUser",0xE23EEC33,sceIoWaitAsync
#endif
#ifdef F_IoFileMgrForUser_0003
IMPORT_FUNC "IoFileMgrForUser",0x35DBD746,sceIoWaitAsyncCB
#endif
#ifdef F_IoFileMgrForUser_0004
IMPORT_FUNC "IoFileMgrForUser",0xCB05F8D6,sceIoGetAsyncStat
#endif
#ifdef F_IoFileMgrForUser_0005
IMPORT_FUNC "IoFileMgrForUser",0xB293727F,sceIoChangeAsyncPriority
#endif
#ifdef F_IoFileMgrForUser_0006
IMPORT_FUNC "IoFileMgrForUser",0xA12A0514,sceIoSetAsyncCallback
#endif
#ifdef F_IoFileMgrForUser_0007
IMPORT_FUNC "IoFileMgrForUser",0x810C4BC3,sceIoClose
#endif
#ifdef F_IoFileMgrForUser_0008
IMPORT_FUNC "IoFileMgrForUser",0xFF5940B6,sceIoCloseAsync
#endif
#ifdef F_IoFileMgrForUser_0009
IMPORT_FUNC "IoFileMgrForUser",0x109F50BC,sceIoOpen
#endif
#ifdef F_IoFileMgrForUser_0010
IMPORT_FUNC "IoFileMgrForUser",0x89AA9906,sceIoOpenAsync
#endif
#ifdef F_IoFileMgrForUser_0011
IMPORT_FUNC "IoFileMgrForUser",0x6A638D83,sceIoRead
#endif
#ifdef F_IoFileMgrForUser_0012
IMPORT_FUNC "IoFileMgrForUser",0xA0B5A7C2,sceIoReadAsync
#endif
#ifdef F_IoFileMgrForUser_0013
IMPORT_FUNC "IoFileMgrForUser",0x42EC03AC,sceIoWrite
#endif
#ifdef F_IoFileMgrForUser_0014
IMPORT_FUNC "IoFileMgrForUser",0x0FACAB19,sceIoWriteAsync
#endif
#ifdef F_IoFileMgrForUser_0015
IMPORT_FUNC "IoFileMgrForUser",0x27EB27B8,sceIoLseek
#endif
#ifdef F_IoFileMgrForUser_0016
IMPORT_FUNC "IoFileMgrForUser",0x71B19E77,sceIoLseekAsync
#endif
#ifdef F_IoFileMgrForUser_0017
IMPORT_FUNC "IoFileMgrForUser",0x68963324,sceIoLseek32
#endif
#ifdef F_IoFileMgrForUser_0018
IMPORT_FUNC "IoFileMgrForUser",0x1B385D8F,sceIoLseek32Async
#endif
#ifdef F_IoFileMgrForUser_0019
IMPORT_FUNC "IoFileMgrForUser",0x63632449,sceIoIoctl
#endif
#ifdef F_IoFileMgrForUser_0020
IMPORT_FUNC "IoFileMgrForUser",0xE95A012B,sceIoIoctlAsync
#endif
#ifdef F_IoFileMgrForUser_0021
IMPORT_FUNC "IoFileMgrForUser",0xB29DDF9C,sceIoDopen
#endif
#ifdef F_IoFileMgrForUser_0022
IMPORT_FUNC "IoFileMgrForUser",0xE3EB004C,sceIoDread
#endif
#ifdef F_IoFileMgrForUser_0023
IMPORT_FUNC "IoFileMgrForUser",0xEB092469,sceIoDclose
#endif
#ifdef F_IoFileMgrForUser_0024
IMPORT_FUNC "IoFileMgrForUser",0xF27A9C51,sceIoRemove
#endif
#ifdef F_IoFileMgrForUser_0025
IMPORT_FUNC "IoFileMgrForUser",0x06A70004,sceIoMkdir
#endif
#ifdef F_IoFileMgrForUser_0026
IMPORT_FUNC "IoFileMgrForUser",0x1117C65F,sceIoRmdir
#endif
#ifdef F_IoFileMgrForUser_0027
IMPORT_FUNC "IoFileMgrForUser",0x55F4717D,sceIoChdir
#endif
#ifdef F_IoFileMgrForUser_0028
IMPORT_FUNC "IoFileMgrForUser",0xAB96437F,sceIoSync
#endif
#ifdef F_IoFileMgrForUser_0029
IMPORT_FUNC "IoFileMgrForUser",0xACE946E8,sceIoGetstat
#endif
#ifdef F_IoFileMgrForUser_0030
IMPORT_FUNC "IoFileMgrForUser",0xB8A740F4,sceIoChstat
#endif
#ifdef F_IoFileMgrForUser_0031
IMPORT_FUNC "IoFileMgrForUser",0x779103A0,sceIoRename
#endif
#ifdef F_IoFileMgrForUser_0032
IMPORT_FUNC "IoFileMgrForUser",0x54F5FB11,sceIoDevctl
#endif
#ifdef F_IoFileMgrForUser_0033
IMPORT_FUNC "IoFileMgrForUser",0x08BD7374,sceIoGetDevType
#endif
#ifdef F_IoFileMgrForUser_0034
IMPORT_FUNC "IoFileMgrForUser",0xB2A628C1,sceIoAssign
#endif
#ifdef F_IoFileMgrForUser_0035
IMPORT_FUNC "IoFileMgrForUser",0x6D08A871,sceIoUnassign
#endif
#ifdef F_IoFileMgrForUser_0036
IMPORT_FUNC "IoFileMgrForUser",0xE8BC6571,sceIoCancel
#endif

22
src/user/Kernel_Library.S Normal file
View File

@@ -0,0 +1,22 @@
.set noreorder
#include "pspimport.s"
#ifdef F_Kernel_Library_0000
IMPORT_START "Kernel_Library",0x00010000
#endif
#ifdef F_Kernel_Library_0001
IMPORT_FUNC "Kernel_Library",0x092968F4,sceKernelCpuSuspendIntr
#endif
#ifdef F_Kernel_Library_0002
IMPORT_FUNC "Kernel_Library",0x5F10D406,sceKernelCpuResumeIntr
#endif
#ifdef F_Kernel_Library_0003
IMPORT_FUNC "Kernel_Library",0x3B84732D,sceKernelCpuResumeIntrWithSync
#endif
#ifdef F_Kernel_Library_0004
IMPORT_FUNC "Kernel_Library",0x47A0B729,sceKernelIsCpuIntrSuspended
#endif
#ifdef F_Kernel_Library_0005
IMPORT_FUNC "Kernel_Library",0xB55249D2,sceKernelIsCpuIntrEnable
#endif

View File

@@ -0,0 +1,19 @@
.set noreorder
#include "pspimport.s"
#ifdef F_LoadExecForUser_0000
IMPORT_START "LoadExecForUser",0x40010000
#endif
#ifdef F_LoadExecForUser_0001
IMPORT_FUNC "LoadExecForUser",0xBD2F1094,sceKernelLoadExec
#endif
#ifdef F_LoadExecForUser_0002
IMPORT_FUNC "LoadExecForUser",0x2AC9954B,sceKernelExitGameWithStatus
#endif
#ifdef F_LoadExecForUser_0003
IMPORT_FUNC "LoadExecForUser",0x05572A5F,sceKernelExitGame
#endif
#ifdef F_LoadExecForUser_0004
IMPORT_FUNC "LoadExecForUser",0x4AC57943,sceKernelRegisterExitCallback
#endif

116
src/user/Makefile.am Normal file
View File

@@ -0,0 +1,116 @@
libdir = @PSPSDK_LIBDIR@
CC = @PSP_CC@
CCAS = $(CC)
AR = @PSP_AR@
RANLIB = @PSP_RANLIB@
INCLUDES = -I$(top_srcdir)/src/base
CFLAGS = @PSPSDK_CFLAGS@
CCASFLAGS = $(CFLAGS) $(INCLUDES)
IO_OBJS = IoFileMgrForUser_0000.o IoFileMgrForUser_0001.o IoFileMgrForUser_0002.o IoFileMgrForUser_0003.o IoFileMgrForUser_0004.o IoFileMgrForUser_0005.o IoFileMgrForUser_0006.o IoFileMgrForUser_0007.o IoFileMgrForUser_0008.o IoFileMgrForUser_0009.o IoFileMgrForUser_0010.o IoFileMgrForUser_0011.o IoFileMgrForUser_0012.o IoFileMgrForUser_0013.o IoFileMgrForUser_0014.o IoFileMgrForUser_0015.o IoFileMgrForUser_0016.o IoFileMgrForUser_0017.o IoFileMgrForUser_0018.o IoFileMgrForUser_0019.o IoFileMgrForUser_0020.o IoFileMgrForUser_0021.o IoFileMgrForUser_0022.o IoFileMgrForUser_0023.o IoFileMgrForUser_0024.o IoFileMgrForUser_0025.o IoFileMgrForUser_0026.o IoFileMgrForUser_0027.o IoFileMgrForUser_0028.o IoFileMgrForUser_0029.o IoFileMgrForUser_0030.o IoFileMgrForUser_0031.o IoFileMgrForUser_0032.o IoFileMgrForUser_0033.o IoFileMgrForUser_0034.o IoFileMgrForUser_0035.o IoFileMgrForUser_0036.o
KERNEL_OBJS = Kernel_Library_0000.o Kernel_Library_0001.o Kernel_Library_0002.o Kernel_Library_0003.o Kernel_Library_0004.o Kernel_Library_0005.o
MODMGR_OBJS = ModuleMgrForUser_0000.o ModuleMgrForUser_0001.o ModuleMgrForUser_0002.o ModuleMgrForUser_0003.o ModuleMgrForUser_0004.o ModuleMgrForUser_0005.o ModuleMgrForUser_0006.o ModuleMgrForUser_0007.o ModuleMgrForUser_0008.o ModuleMgrForUser_0009.o ModuleMgrForUser_0010.o ModuleMgrForUser_0011.o
STDIO_OBJS = StdioForUser_0000.o StdioForUser_0001.o StdioForUser_0002.o StdioForUser_0003.o StdioForUser_0004.o StdioForUser_0005.o StdioForUser_0006.o StdioForUser_0007.o StdioForUser_0008.o StdioForUser_0009.o
SUSPEND_OBJS = sceSuspendForUser_0000.o sceSuspendForUser_0001.o sceSuspendForUser_0002.o sceSuspendForUser_0003.o sceSuspendForUser_0004.o sceSuspendForUser_005.o sceSuspendForUser_0006.o
SYSMEM_OBJS = SysMemUserForUser_0000.o SysMemUserForUser_0001.o SysMemUserForUser_0002.o SysMemUserForUser_0003.o SysMemUserForUser_0004.o SysMemUserForUser_0005.o SysMemUserForUser_0006.o SysMemUserForUser_0007.o
THREADMAN_OBJS = ThreadManForUser_0000.o ThreadManForUser_0001.o ThreadManForUser_0002.o ThreadManForUser_0003.o ThreadManForUser_0004.o ThreadManForUser_0005.o ThreadManForUser_0006.o ThreadManForUser_0007.o ThreadManForUser_0008.o ThreadManForUser_0009.o ThreadManForUser_0010.o ThreadManForUser_0011.o ThreadManForUser_0012.o ThreadManForUser_0013.o ThreadManForUser_0014.o ThreadManForUser_0015.o ThreadManForUser_0016.o ThreadManForUser_0017.o ThreadManForUser_0018.o ThreadManForUser_0019.o ThreadManForUser_0020.o ThreadManForUser_0021.o ThreadManForUser_0022.o ThreadManForUser_0023.o ThreadManForUser_0024.o ThreadManForUser_0025.o ThreadManForUser_0026.o ThreadManForUser_0027.o ThreadManForUser_0028.o ThreadManForUser_0029.o ThreadManForUser_0030.o ThreadManForUser_0031.o ThreadManForUser_0032.o ThreadManForUser_0033.o ThreadManForUser_0034.o ThreadManForUser_0035.o ThreadManForUser_0036.o ThreadManForUser_0037.o ThreadManForUser_0038.o ThreadManForUser_0039.o ThreadManForUser_0040.o ThreadManForUser_0041.o ThreadManForUser_0042.o ThreadManForUser_0043.o ThreadManForUser_0044.o ThreadManForUser_0045.o ThreadManForUser_0046.o ThreadManForUser_0047.o ThreadManForUser_0048.o ThreadManForUser_0049.o ThreadManForUser_0050.o ThreadManForUser_0051.o ThreadManForUser_0052.o ThreadManForUser_0053.o ThreadManForUser_0054.o ThreadManForUser_0055.o ThreadManForUser_0056.o ThreadManForUser_0057.o ThreadManForUser_0058.o ThreadManForUser_0059.o ThreadManForUser_0060.o ThreadManForUser_0061.o ThreadManForUser_0062.o ThreadManForUser_0063.o ThreadManForUser_0064.o ThreadManForUser_0065.o ThreadManForUser_0066.o ThreadManForUser_0067.o ThreadManForUser_0068.o ThreadManForUser_0069.o ThreadManForUser_0070.o ThreadManForUser_0071.o ThreadManForUser_0072.o ThreadManForUser_0073.o ThreadManForUser_0074.o ThreadManForUser_0075.o ThreadManForUser_0076.o ThreadManForUser_0077.o ThreadManForUser_0078.o ThreadManForUser_0079.o ThreadManForUser_0080.o ThreadManForUser_0081.o ThreadManForUser_0082.o ThreadManForUser_0083.o ThreadManForUser_0084.o ThreadManForUser_0085.o ThreadManForUser_0086.o ThreadManForUser_0087.o ThreadManForUser_0088.o ThreadManForUser_0089.o ThreadManForUser_0090.o ThreadManForUser_0091.o ThreadManForUser_0092.o ThreadManForUser_0093.o ThreadManForUser_0094.o ThreadManForUser_0095.o ThreadManForUser_0096.o ThreadManForUser_0097.o ThreadManForUser_0098.o ThreadManForUser_0099.o ThreadManForUser_0100.o ThreadManForUser_0101.o ThreadManForUser_0102.o ThreadManForUser_0103.o ThreadManForUser_0104.o ThreadManForUser_0105.o ThreadManForUser_0106.o ThreadManForUser_0107.o ThreadManForUser_0108.o ThreadManForUser_0109.o ThreadManForUser_0110.o ThreadManForUser_0111.o ThreadManForUser_0112.o ThreadManForUser_0113.o ThreadManForUser_0114.o ThreadManForUser_0115.o ThreadManForUser_0116.o ThreadManForUser_0117.o ThreadManForUser_0118.o ThreadManForUser_0119.o ThreadManForUser_0120.o ThreadManForUser_0121.o ThreadManForUser_0122.o ThreadManForUser_0123.o ThreadManForUser_0124.o ThreadManForUser_0125.o ThreadManForUser_0126.o
UTILS_OBJS = UtilsForUser_0000.o UtilsForUser_0001.o UtilsForUser_0002.o UtilsForUser_0003.o UtilsForUser_0004.o UtilsForUser_0005.o UtilsForUser_0006.o UtilsForUser_0007.o UtilsForUser_0008.o UtilsForUser_0009.o UtilsForUser_0010.o UtilsForUser_0011.o UtilsForUser_0012.o UtilsForUser_0013.o UtilsForUser_0014.o UtilsForUser_0015.o UtilsForUser_0016.o UtilsForUser_0017.o UtilsForUser_0018.o UtilsForUser_0019.o UtilsForUser_0020.o UtilsForUser_0021.o UtilsForUser_0022.o UtilsForUser_0023.o UtilsForUser_0024.o
INTERRUPT_OBJS = InterruptManager_0000.o InterruptManager_0001.o InterruptManager_0002.o InterruptManager_0003.o InterruptManager_0004.o InterruptManager_0005.o InterruptManager_0006.o InterruptManager_0007.o InterruptManager_0008.o InterruptManager_0009.o
LOADEXEC_OBJS = LoadExecForUser_0000.o LoadExecForUser_0001.o LoadExecForUser_0002.o LoadExecForUser_0003.o LoadExecForUser_0004.o
IMPOSE_OBJS = sceImpose_0000.o sceImpose_0001.o sceImpose_0002.o sceImpose_0003.o sceImpose_0004.o sceImpose_0005.o sceImpose_0006.o sceImpose_0007.o sceImpose_0008.o sceImpose_0009.o sceImpose_0010.o sceImpose_0011.o sceImpose_0012.o sceImpose_0013.o sceImpose_0014.o sceImpose_0015.o
libpspuserincludedir = @PSPSDK_INCLUDEDIR@
libpspuserinclude_HEADERS = \
pspiofilemgr.h \
pspiofilemgr_dirent.h \
pspiofilemgr_fcntl.h \
pspiofilemgr_stat.h \
pspkerneltypes.h \
pspkerror.h \
psploadexec.h \
pspmscm.h \
pspmoduleinfo.h \
pspmodulemgr.h \
pspsuspend.h \
pspsysmem.h \
pspthreadman.h \
pspstdio.h \
pspuser.h \
psputils.h \
pspintrman.h \
pspmoduleexport.h
lib_LIBRARIES = libpspuser.a
libpspuser_a_SOURCES = \
IoFileMgrForUser.S \
InterruptManager.S \
Kernel_Library.S \
LoadExecForUser.S \
ModuleMgrForUser.S \
StdioForUser.S \
SysMemUserForUser.S \
ThreadManForUser.S \
UtilsForUser.S \
sceSuspendForUser.S \
pspintrman.c \
sceImpose.S
libpspuser_a_LIBADD = \
$(IO_OBJS) \
$(KERNEL_OBJS) \
$(MODMGR_OBJS) \
$(STDIO_OBJS) \
$(SUSPEND_OBJS) \
$(SYSMEM_OBJS) \
$(THREADMAN_OBJS) \
$(UTILS_OBJS) \
$(INTERRUPT_OBJS) \
$(LOADEXEC_OBJS) \
$(IMPOSE_OBJS)
$(IO_OBJS): IoFileMgrForUser.S
$(COMPILE) -DF_$* $< -c -o $@
$(KERNEL_OBJS): Kernel_Library.S
$(COMPILE) -DF_$* $< -c -o $@
$(MODMGR_OBJS): ModuleMgrForUser.S
$(COMPILE) -DF_$* $< -c -o $@
$(STDIO_OBJS): StdioForUser.S
$(COMPILE) -DF_$* $< -c -o $@
$(SUSPEND_OBJS): sceSuspendForUser.S
$(COMPILE) -DF_$* $< -c -o $@
$(SYSMEM_OBJS): SysMemUserForUser.S
$(COMPILE) -DF_$* $< -c -o $@
$(THREADMAN_OBJS): ThreadManForUser.S
$(COMPILE) -DF_$* $< -c -o $@
$(UTILS_OBJS): UtilsForUser.S
$(COMPILE) -DF_$* $< -c -o $@
$(INTERRUPT_OBJS): InterruptManager.S
$(COMPILE) -DF_$* $< -c -o $@
$(LOADEXEC_OBJS): LoadExecForUser.S
$(COMPILE) -DF_$* $< -c -o $@
$(IMPOSE_OBJS): sceImpose.S
$(COMPILE) -DF_$* $< -c -o $@

View File

@@ -0,0 +1,40 @@
.set noreorder
#include "pspimport.s"
#ifdef F_ModuleMgrForUser_0000
IMPORT_START "ModuleMgrForUser",0x40010000
#endif
#ifdef F_ModuleMgrForUser_0001
IMPORT_FUNC "ModuleMgrForUser",0xB7F46618,sceKernelLoadModuleByID
#endif
#ifdef F_ModuleMgrForUser_0002
IMPORT_FUNC "ModuleMgrForUser",0x977DE386,sceKernelLoadModule
#endif
#ifdef F_ModuleMgrForUser_0003
IMPORT_FUNC "ModuleMgrForUser",0x710F61B5,sceKernelLoadModuleMs
#endif
#ifdef F_ModuleMgrForUser_0004
IMPORT_FUNC "ModuleMgrForUser",0xF9275D98,sceKernelLoadModuleBufferUsbWlan
#endif
#ifdef F_ModuleMgrForUser_0005
IMPORT_FUNC "ModuleMgrForUser",0x50F0C1EC,sceKernelStartModule
#endif
#ifdef F_ModuleMgrForUser_0006
IMPORT_FUNC "ModuleMgrForUser",0xD1FF982A,sceKernelStopModule
#endif
#ifdef F_ModuleMgrForUser_0007
IMPORT_FUNC "ModuleMgrForUser",0x2E0911AA,sceKernelUnloadModule
#endif
#ifdef F_ModuleMgrForUser_0008
IMPORT_FUNC "ModuleMgrForUser",0xD675EBB8,sceKernelSelfStopUnloadModule
#endif
#ifdef F_ModuleMgrForUser_0009
IMPORT_FUNC "ModuleMgrForUser",0xCC1D3699,sceKernelStopUnloadSelfModule
#endif
#ifdef F_ModuleMgrForUser_0010
IMPORT_FUNC "ModuleMgrForUser",0x748CBED9,sceKernelQueryModuleInfo
#endif
#ifdef F_ModuleMgrForUser_0011
IMPORT_FUNC "ModuleMgrForUser", 0x644395E2,sceKernelGetModuleIdList
#endif

34
src/user/StdioForUser.S Normal file
View File

@@ -0,0 +1,34 @@
.set noreorder
#include "pspimport.s"
#ifdef F_StdioForUser_0000
IMPORT_START "StdioForUser",0x40010000
#endif
#ifdef F_StdioForUser_0001
IMPORT_FUNC "StdioForUser",0x3054D478,sceKernelStdioRead
#endif
#ifdef F_StdioForUser_0002
IMPORT_FUNC "StdioForUser",0x0CBB0571,sceKernelStdioLseek
#endif
#ifdef F_StdioForUser_0003
IMPORT_FUNC "StdioForUser",0xA46785C9,sceKernelStdioSendChar
#endif
#ifdef F_StdioForUser_0004
IMPORT_FUNC "StdioForUser",0xA3B931DB,sceKernelStdioWrite
#endif
#ifdef F_StdioForUser_0005
IMPORT_FUNC "StdioForUser",0x9D061C19,sceKernelStdioClose
#endif
#ifdef F_StdioForUser_0006
IMPORT_FUNC "StdioForUser",0x924ABA61,sceKernelStdioOpen
#endif
#ifdef F_StdioForUser_0007
IMPORT_FUNC "StdioForUser",0x172D316E,sceKernelStdin
#endif
#ifdef F_StdioForUser_0008
IMPORT_FUNC "StdioForUser",0xA6BAB2E9,sceKernelStdout
#endif
#ifdef F_StdioForUser_0009
IMPORT_FUNC "StdioForUser",0xF78BA90A,sceKernelStderr
#endif

View File

@@ -0,0 +1,28 @@
.set noreorder
#include "pspimport.s"
#ifdef F_SysMemUserForUser_0000
IMPORT_START "SysMemUserForUser",0x40000000
#endif
#ifdef F_SysMemUserForUser_0001
IMPORT_FUNC "SysMemUserForUser",0xA291F107,sceKernelMaxFreeMemSize
#endif
#ifdef F_SysMemUserForUser_0002
IMPORT_FUNC "SysMemUserForUser",0xF919F628,sceKernelTotalFreeMemSize
#endif
#ifdef F_SysMemUserForUser_0003
IMPORT_FUNC "SysMemUserForUser",0x237DBD4F,sceKernelAllocPartitionMemory
#endif
#ifdef F_SysMemUserForUser_0004
IMPORT_FUNC "SysMemUserForUser",0xB6D61D02,sceKernelFreePartitionMemory
#endif
#ifdef F_SysMemUserForUser_0005
IMPORT_FUNC "SysMemUserForUser",0x9D9A5BA1,sceKernelGetBlockHeadAddr
#endif
#ifdef F_SysMemUserForUser_0006
IMPORT_FUNC "SysMemUserForUser",0x3FC9AE6A,sceKernelDevkitVersion
#endif
#ifdef F_SysMemUserForUser_0007
IMPORT_FUNC "SysMemUserForUser",0x13A5ABEF,sceKernelPrintf
#endif

385
src/user/ThreadManForUser.S Normal file
View File

@@ -0,0 +1,385 @@
.set noreorder
#include "pspimport.s"
#ifdef F_ThreadManForUser_0000
IMPORT_START "ThreadManForUser",0x40010000
#endif
#ifdef F_ThreadManForUser_0001
IMPORT_FUNC "ThreadManForUser",0x6E9EA350,_sceKernelReturnFromCallback
#endif
#ifdef F_ThreadManForUser_0002
IMPORT_FUNC "ThreadManForUser",0x0C106E53,sceKernelRegisterThreadEventHandler
#endif
#ifdef F_ThreadManForUser_0003
IMPORT_FUNC "ThreadManForUser",0x72F3C145,sceKernelReleaseThreadEventHandler
#endif
#ifdef F_ThreadManForUser_0004
IMPORT_FUNC "ThreadManForUser",0x369EEB6B,sceKernelReferThreadEventHandlerStatus
#endif
#ifdef F_ThreadManForUser_0005
IMPORT_FUNC "ThreadManForUser",0xE81CAF8F,sceKernelCreateCallback
#endif
#ifdef F_ThreadManForUser_0006
IMPORT_FUNC "ThreadManForUser",0xEDBA5844,sceKernelDeleteCallback
#endif
#ifdef F_ThreadManForUser_0007
IMPORT_FUNC "ThreadManForUser",0xC11BA8C4,sceKernelNotifyCallback
#endif
#ifdef F_ThreadManForUser_0008
IMPORT_FUNC "ThreadManForUser",0xBA4051D6,sceKernelCancelCallback
#endif
#ifdef F_ThreadManForUser_0009
IMPORT_FUNC "ThreadManForUser",0x2A3D44FF,sceKernelGetCallbackCount
#endif
#ifdef F_ThreadManForUser_0010
IMPORT_FUNC "ThreadManForUser",0x349D6D6C,sceKernelCheckCallback
#endif
#ifdef F_ThreadManForUser_0011
IMPORT_FUNC "ThreadManForUser",0x730ED8BC,sceKernelReferCallbackStatus
#endif
#ifdef F_ThreadManForUser_0012
IMPORT_FUNC "ThreadManForUser",0x9ACE131E,sceKernelSleepThread
#endif
#ifdef F_ThreadManForUser_0013
IMPORT_FUNC "ThreadManForUser",0x82826F70,sceKernelSleepThreadCB
#endif
#ifdef F_ThreadManForUser_0014
IMPORT_FUNC "ThreadManForUser",0xD59EAD2F,sceKernelWakeupThread
#endif
#ifdef F_ThreadManForUser_0015
IMPORT_FUNC "ThreadManForUser",0xFCCFAD26,sceKernelCancelWakeupThread
#endif
#ifdef F_ThreadManForUser_0016
IMPORT_FUNC "ThreadManForUser",0x9944F31F,sceKernelSuspendThread
#endif
#ifdef F_ThreadManForUser_0017
IMPORT_FUNC "ThreadManForUser",0x75156E8F,sceKernelResumeThread
#endif
#ifdef F_ThreadManForUser_0018
IMPORT_FUNC "ThreadManForUser",0x278C0DF5,sceKernelWaitThreadEnd
#endif
#ifdef F_ThreadManForUser_0019
IMPORT_FUNC "ThreadManForUser",0x840E8133,sceKernelWaitThreadEndCB
#endif
#ifdef F_ThreadManForUser_0020
IMPORT_FUNC "ThreadManForUser",0xCEADEB47,sceKernelDelayThread
#endif
#ifdef F_ThreadManForUser_0021
IMPORT_FUNC "ThreadManForUser",0x68DA9E36,sceKernelDelayThreadCB
#endif
#ifdef F_ThreadManForUser_0022
IMPORT_FUNC "ThreadManForUser",0xBD123D9E,sceKernelDelaySysClockThread
#endif
#ifdef F_ThreadManForUser_0023
IMPORT_FUNC "ThreadManForUser",0x1181E963,sceKernelDelaySysClockThreadCB
#endif
#ifdef F_ThreadManForUser_0024
IMPORT_FUNC "ThreadManForUser",0xD6DA4BA1,sceKernelCreateSema
#endif
#ifdef F_ThreadManForUser_0025
IMPORT_FUNC "ThreadManForUser",0x28B6489C,sceKernelDeleteSema
#endif
#ifdef F_ThreadManForUser_0026
IMPORT_FUNC "ThreadManForUser",0x3F53E640,sceKernelSignalSema
#endif
#ifdef F_ThreadManForUser_0027
IMPORT_FUNC "ThreadManForUser",0x4E3A1105,sceKernelWaitSema
#endif
#ifdef F_ThreadManForUser_0028
IMPORT_FUNC "ThreadManForUser",0x6D212BAC,sceKernelWaitSemaCB
#endif
#ifdef F_ThreadManForUser_0029
IMPORT_FUNC "ThreadManForUser",0x58B1F937,sceKernelPollSema
#endif
#ifdef F_ThreadManForUser_0030
IMPORT_FUNC "ThreadManForUser",0x8FFDF9A2,sceKernelCancelSema
#endif
#ifdef F_ThreadManForUser_0031
IMPORT_FUNC "ThreadManForUser",0xBC6FEBC5,sceKernelReferSemaStatus
#endif
#ifdef F_ThreadManForUser_0032
IMPORT_FUNC "ThreadManForUser",0x55C20A00,sceKernelCreateEventFlag
#endif
#ifdef F_ThreadManForUser_0033
IMPORT_FUNC "ThreadManForUser",0xEF9E4C70,sceKernelDeleteEventFlag
#endif
#ifdef F_ThreadManForUser_0034
IMPORT_FUNC "ThreadManForUser",0x1FB15A32,sceKernelSetEventFlag
#endif
#ifdef F_ThreadManForUser_0035
IMPORT_FUNC "ThreadManForUser",0x812346E4,sceKernelClearEventFlag
#endif
#ifdef F_ThreadManForUser_0036
IMPORT_FUNC "ThreadManForUser",0x402FCF22,sceKernelWaitEventFlag
#endif
#ifdef F_ThreadManForUser_0037
IMPORT_FUNC "ThreadManForUser",0x328C546A,sceKernelWaitEventFlagCB
#endif
#ifdef F_ThreadManForUser_0038
IMPORT_FUNC "ThreadManForUser",0x30FD48F0,sceKernelPollEventFlag
#endif
#ifdef F_ThreadManForUser_0039
IMPORT_FUNC "ThreadManForUser",0xCD203292,sceKernelCancelEventFlag
#endif
#ifdef F_ThreadManForUser_0040
IMPORT_FUNC "ThreadManForUser",0xA66B0120,sceKernelReferEventFlagStatus
#endif
#ifdef F_ThreadManForUser_0041
IMPORT_FUNC "ThreadManForUser",0x8125221D,sceKernelCreateMbx
#endif
#ifdef F_ThreadManForUser_0042
IMPORT_FUNC "ThreadManForUser",0x86255ADA,sceKernelDeleteMbx
#endif
#ifdef F_ThreadManForUser_0043
IMPORT_FUNC "ThreadManForUser",0xE9B3061E,sceKernelSendMbx
#endif
#ifdef F_ThreadManForUser_0044
IMPORT_FUNC "ThreadManForUser",0x18260574,sceKernelReceiveMbx
#endif
#ifdef F_ThreadManForUser_0045
IMPORT_FUNC "ThreadManForUser",0xF3986382,sceKernelReceiveMbxCB
#endif
#ifdef F_ThreadManForUser_0046
IMPORT_FUNC "ThreadManForUser",0x0D81716A,sceKernelPollMbx
#endif
#ifdef F_ThreadManForUser_0047
IMPORT_FUNC "ThreadManForUser",0x87D4DD36,sceKernelCancelReceiveMbx
#endif
#ifdef F_ThreadManForUser_0048
IMPORT_FUNC "ThreadManForUser",0xA8E8C846,sceKernelReferMbxStatus
#endif
#ifdef F_ThreadManForUser_0049
IMPORT_FUNC "ThreadManForUser",0x7C0DC2A0,sceKernelCreateMsgPipe
#endif
#ifdef F_ThreadManForUser_0050
IMPORT_FUNC "ThreadManForUser",0xF0B7DA1C,sceKernelDeleteMsgPipe
#endif
#ifdef F_ThreadManForUser_0051
IMPORT_FUNC "ThreadManForUser",0x876DBFAD,sceKernelSendMsgPipe
#endif
#ifdef F_ThreadManForUser_0052
IMPORT_FUNC "ThreadManForUser",0x7C41F2C2,sceKernelSendMsgPipeCB
#endif
#ifdef F_ThreadManForUser_0053
IMPORT_FUNC "ThreadManForUser",0x884C9F90,sceKernelTrySendMsgPipe
#endif
#ifdef F_ThreadManForUser_0054
IMPORT_FUNC "ThreadManForUser",0x74829B76,sceKernelReceiveMsgPipe
#endif
#ifdef F_ThreadManForUser_0055
IMPORT_FUNC "ThreadManForUser",0xFBFA697D,sceKernelReceiveMsgPipeCB
#endif
#ifdef F_ThreadManForUser_0056
IMPORT_FUNC "ThreadManForUser",0xDF52098F,sceKernelTryReceiveMsgPipe
#endif
#ifdef F_ThreadManForUser_0057
IMPORT_FUNC "ThreadManForUser",0x349B864D,sceKernelCancelMsgPipe
#endif
#ifdef F_ThreadManForUser_0058
IMPORT_FUNC "ThreadManForUser",0x33BE4024,sceKernelReferMsgPipeStatus
#endif
#ifdef F_ThreadManForUser_0059
IMPORT_FUNC "ThreadManForUser",0x56C039B5,sceKernelCreateVpl
#endif
#ifdef F_ThreadManForUser_0060
IMPORT_FUNC "ThreadManForUser",0x89B3D48C,sceKernelDeleteVpl
#endif
#ifdef F_ThreadManForUser_0061
IMPORT_FUNC "ThreadManForUser",0xBED27435,sceKernelAllocateVpl
#endif
#ifdef F_ThreadManForUser_0062
IMPORT_FUNC "ThreadManForUser",0xEC0A693F,sceKernelAllocateVplCB
#endif
#ifdef F_ThreadManForUser_0063
IMPORT_FUNC "ThreadManForUser",0xAF36D708,sceKernelTryAllocateVpl
#endif
#ifdef F_ThreadManForUser_0064
IMPORT_FUNC "ThreadManForUser",0xB736E9FF,sceKernelFreeVpl
#endif
#ifdef F_ThreadManForUser_0065
IMPORT_FUNC "ThreadManForUser",0x1D371B8A,sceKernelCancelVpl
#endif
#ifdef F_ThreadManForUser_0066
IMPORT_FUNC "ThreadManForUser",0x39810265,sceKernelReferVplStatus
#endif
#ifdef F_ThreadManForUser_0067
IMPORT_FUNC "ThreadManForUser",0xC07BB470,sceKernelCreateFpl
#endif
#ifdef F_ThreadManForUser_0068
IMPORT_FUNC "ThreadManForUser",0xED1410E0,sceKernelDeleteFpl
#endif
#ifdef F_ThreadManForUser_0069
IMPORT_FUNC "ThreadManForUser",0xD979E9BF,sceKernelAllocateFpl
#endif
#ifdef F_ThreadManForUser_0070
IMPORT_FUNC "ThreadManForUser",0xE7282CB6,sceKernelAllocateFplCB
#endif
#ifdef F_ThreadManForUser_0071
IMPORT_FUNC "ThreadManForUser",0x623AE665,sceKernelTryAllocateFpl
#endif
#ifdef F_ThreadManForUser_0072
IMPORT_FUNC "ThreadManForUser",0xF6414A71,sceKernelFreeFpl
#endif
#ifdef F_ThreadManForUser_0073
IMPORT_FUNC "ThreadManForUser",0xA8AA591F,sceKernelCancelFpl
#endif
#ifdef F_ThreadManForUser_0074
IMPORT_FUNC "ThreadManForUser",0xD8199E4C,sceKernelReferFplStatus
#endif
#ifdef F_ThreadManForUser_0075
IMPORT_FUNC "ThreadManForUser",0x0E927AED,_sceKernelReturnFromTimerHandler
#endif
#ifdef F_ThreadManForUser_0076
IMPORT_FUNC "ThreadManForUser",0x110DEC9A,sceKernelUSec2SysClock
#endif
#ifdef F_ThreadManForUser_0077
IMPORT_FUNC "ThreadManForUser",0xC8CD158C,sceKernelUSec2SysClockWide
#endif
#ifdef F_ThreadManForUser_0078
IMPORT_FUNC "ThreadManForUser",0xBA6B92E2,sceKernelSysClock2USec
#endif
#ifdef F_ThreadManForUser_0079
IMPORT_FUNC "ThreadManForUser",0xE1619D7C,sceKernelSysClock2USecWide
#endif
#ifdef F_ThreadManForUser_0080
IMPORT_FUNC "ThreadManForUser",0xDB738F35,sceKernelGetSystemTime
#endif
#ifdef F_ThreadManForUser_0081
IMPORT_FUNC "ThreadManForUser",0x82BC5777,sceKernelGetSystemTimeWide
#endif
#ifdef F_ThreadManForUser_0082
IMPORT_FUNC "ThreadManForUser",0x369ED59D,sceKernelGetSystemTimeLow
#endif
#ifdef F_ThreadManForUser_0083
IMPORT_FUNC "ThreadManForUser",0x6652B8CA,sceKernelSetAlarm
#endif
#ifdef F_ThreadManForUser_0084
IMPORT_FUNC "ThreadManForUser",0xB2C25152,sceKernelSetSysClockAlarm
#endif
#ifdef F_ThreadManForUser_0085
IMPORT_FUNC "ThreadManForUser",0x7E65B999,sceKernelCancelAlarm
#endif
#ifdef F_ThreadManForUser_0086
IMPORT_FUNC "ThreadManForUser",0xDAA3F564,sceKernelReferAlarmStatus
#endif
#ifdef F_ThreadManForUser_0087
IMPORT_FUNC "ThreadManForUser",0x20FFF560,sceKernelCreateVTimer
#endif
#ifdef F_ThreadManForUser_0088
IMPORT_FUNC "ThreadManForUser",0x328F9E52,sceKernelDeleteVTimer
#endif
#ifdef F_ThreadManForUser_0089
IMPORT_FUNC "ThreadManForUser",0xB3A59970,sceKernelGetVTimerBase
#endif
#ifdef F_ThreadManForUser_0090
IMPORT_FUNC "ThreadManForUser",0xB7C18B77,sceKernelGetVTimerBaseWide
#endif
#ifdef F_ThreadManForUser_0091
IMPORT_FUNC "ThreadManForUser",0x034A921F,sceKernelGetVTimerTime
#endif
#ifdef F_ThreadManForUser_0092
IMPORT_FUNC "ThreadManForUser",0xC0B3FFD2,sceKernelGetVTimerTimeWide
#endif
#ifdef F_ThreadManForUser_0093
IMPORT_FUNC "ThreadManForUser",0x542AD630,sceKernelSetVTimerTime
#endif
#ifdef F_ThreadManForUser_0094
IMPORT_FUNC "ThreadManForUser",0xFB6425C3,sceKernelSetVTimerTimeWide
#endif
#ifdef F_ThreadManForUser_0095
IMPORT_FUNC "ThreadManForUser",0xC68D9437,sceKernelStartVTimer
#endif
#ifdef F_ThreadManForUser_0096
IMPORT_FUNC "ThreadManForUser",0xD0AEEE87,sceKernelStopVTimer
#endif
#ifdef F_ThreadManForUser_0097
IMPORT_FUNC "ThreadManForUser",0xD8B299AE,sceKernelSetVTimerHandler
#endif
#ifdef F_ThreadManForUser_0098
IMPORT_FUNC "ThreadManForUser",0x53B00E9A,sceKernelSetVTimerHandlerWide
#endif
#ifdef F_ThreadManForUser_0099
IMPORT_FUNC "ThreadManForUser",0xD2D615EF,sceKernelCancelVTimerHandler
#endif
#ifdef F_ThreadManForUser_0100
IMPORT_FUNC "ThreadManForUser",0x5F32BEAA,sceKernelReferVTimerStatus
#endif
#ifdef F_ThreadManForUser_0101
IMPORT_FUNC "ThreadManForUser",0x446D8DE6,sceKernelCreateThread
#endif
#ifdef F_ThreadManForUser_0102
IMPORT_FUNC "ThreadManForUser",0x9FA03CD3,sceKernelDeleteThread
#endif
#ifdef F_ThreadManForUser_0103
IMPORT_FUNC "ThreadManForUser",0xF475845D,sceKernelStartThread
#endif
#ifdef F_ThreadManForUser_0104
IMPORT_FUNC "ThreadManForUser",0x532A522E,_sceKernelExitThread
#endif
#ifdef F_ThreadManForUser_0105
IMPORT_FUNC "ThreadManForUser",0xAA73C935,sceKernelExitThread
#endif
#ifdef F_ThreadManForUser_0106
IMPORT_FUNC "ThreadManForUser",0x809CE29B,sceKernelExitDeleteThread
#endif
#ifdef F_ThreadManForUser_0107
IMPORT_FUNC "ThreadManForUser",0x616403BA,sceKernelTerminateThread
#endif
#ifdef F_ThreadManForUser_0108
IMPORT_FUNC "ThreadManForUser",0x383F7BCC,sceKernelTerminateDeleteThread
#endif
#ifdef F_ThreadManForUser_0109
IMPORT_FUNC "ThreadManForUser",0x3AD58B8C,sceKernelSuspendDispatchThread
#endif
#ifdef F_ThreadManForUser_0110
IMPORT_FUNC "ThreadManForUser",0x27E22EC2,sceKernelResumeDispatchThread
#endif
#ifdef F_ThreadManForUser_0111
IMPORT_FUNC "ThreadManForUser",0xEA748E31,sceKernelChangeCurrentThreadAttr
#endif
#ifdef F_ThreadManForUser_0112
IMPORT_FUNC "ThreadManForUser",0x71BC9871,sceKernelChangeThreadPriority
#endif
#ifdef F_ThreadManForUser_0113
IMPORT_FUNC "ThreadManForUser",0x912354A7,sceKernelRotateThreadReadyQueue
#endif
#ifdef F_ThreadManForUser_0114
IMPORT_FUNC "ThreadManForUser",0x2C34E053,sceKernelReleaseWaitThread
#endif
#ifdef F_ThreadManForUser_0115
IMPORT_FUNC "ThreadManForUser",0x293B45B8,sceKernelGetThreadId
#endif
#ifdef F_ThreadManForUser_0116
IMPORT_FUNC "ThreadManForUser",0x94AA61EE,sceKernelGetThreadCurrentPriority
#endif
#ifdef F_ThreadManForUser_0117
IMPORT_FUNC "ThreadManForUser",0x3B183E26,sceKernelGetThreadExitStatus
#endif
#ifdef F_ThreadManForUser_0118
IMPORT_FUNC "ThreadManForUser",0xD13BDE95,sceKernelCheckThreadStack
#endif
#ifdef F_ThreadManForUser_0119
IMPORT_FUNC "ThreadManForUser",0x52089CA1,sceKernelGetThreadStackFreeSize
#endif
#ifdef F_ThreadManForUser_0120
IMPORT_FUNC "ThreadManForUser",0x17C1684E,sceKernelReferThreadStatus
#endif
#ifdef F_ThreadManForUser_0121
IMPORT_FUNC "ThreadManForUser",0xFFC36A14,sceKernelReferThreadRunStatus
#endif
#ifdef F_ThreadManForUser_0122
IMPORT_FUNC "ThreadManForUser",0x627E6F3A,sceKernelReferSystemStatus
#endif
#ifdef F_ThreadManForUser_0123
IMPORT_FUNC "ThreadManForUser",0x94416130,sceKernelGetThreadmanIdList
#endif
#ifdef F_ThreadManForUser_0124
IMPORT_FUNC "ThreadManForUser",0x57CF62DD,sceKernelGetThreadmanIdType
#endif
#ifdef F_ThreadManForUser_0125
IMPORT_FUNC "ThreadManForUser",0x64D4540E,sceKernelReferThreadProfiler
#endif
#ifdef F_ThreadManForUser_0126
IMPORT_FUNC "ThreadManForUser",0x8218B4DD,sceKernelReferGlobalProfiler
#endif

79
src/user/UtilsForUser.S Normal file
View File

@@ -0,0 +1,79 @@
.set noreorder
#include "pspimport.s"
#ifdef F_UtilsForUser_0000
IMPORT_START "UtilsForUser",0x40010000
#endif
#ifdef F_UtilsForUser_0001
IMPORT_FUNC "UtilsForUser",0xBFA98062,sceKernelDcacheInvalidateRange
#endif
#ifdef F_UtilsForUser_0002
IMPORT_FUNC "UtilsForUser",0xC8186A58,sceKernelUtilsMd5Digest
#endif
#ifdef F_UtilsForUser_0003
IMPORT_FUNC "UtilsForUser",0x9E5C5086,sceKernelUtilsMd5BlockInit
#endif
#ifdef F_UtilsForUser_0004
IMPORT_FUNC "UtilsForUser",0x61E1E525,sceKernelUtilsMd5BlockUpdate
#endif
#ifdef F_UtilsForUser_0005
IMPORT_FUNC "UtilsForUser",0xB8D24E78,sceKernelUtilsMd5BlockResult
#endif
#ifdef F_UtilsForUser_0006
IMPORT_FUNC "UtilsForUser",0x840259F1,sceKernelUtilsSha1Digest
#endif
#ifdef F_UtilsForUser_0007
IMPORT_FUNC "UtilsForUser",0xF8FCD5BA,sceKernelUtilsSha1BlockInit
#endif
#ifdef F_UtilsForUser_0008
IMPORT_FUNC "UtilsForUser",0x346F6DA8,sceKernelUtilsSha1BlockUpdate
#endif
#ifdef F_UtilsForUser_0009
IMPORT_FUNC "UtilsForUser",0x585F1C09,sceKernelUtilsSha1BlockResult
#endif
#ifdef F_UtilsForUser_0010
IMPORT_FUNC "UtilsForUser",0xE860E75E,sceKernelUtilsMt19937Init
#endif
#ifdef F_UtilsForUser_0011
IMPORT_FUNC "UtilsForUser",0x06FB8A63,sceKernelUtilsMt19937UInt
#endif
#ifdef F_UtilsForUser_0012
IMPORT_FUNC "UtilsForUser",0x37FB5C42,sceKernelGetGPI
#endif
#ifdef F_UtilsForUser_0013
IMPORT_FUNC "UtilsForUser",0x6AD345D7,sceKernelSetGPO
#endif
#ifdef F_UtilsForUser_0014
IMPORT_FUNC "UtilsForUser",0x91E4F6A7,sceKernelLibcClock
#endif
#ifdef F_UtilsForUser_0015
IMPORT_FUNC "UtilsForUser",0x27CC57F0,sceKernelLibcTime
#endif
#ifdef F_UtilsForUser_0016
IMPORT_FUNC "UtilsForUser",0x71EC4271,sceKernelLibcGettimeofday
#endif
#ifdef F_UtilsForUser_0017
IMPORT_FUNC "UtilsForUser",0x79D1C3FA,sceKernelDcacheWritebackAll
#endif
#ifdef F_UtilsForUser_0018
IMPORT_FUNC "UtilsForUser",0xB435DEC5,sceKernelDcacheWritebackInvalidateAll
#endif
#ifdef F_UtilsForUser_0019
IMPORT_FUNC "UtilsForUser",0x3EE30821,sceKernelDcacheWritebackRange
#endif
#ifdef F_UtilsForUser_0020
IMPORT_FUNC "UtilsForUser",0x34B9FA9E,sceKernelDcacheWritebackInvalidateRange
#endif
#ifdef F_UtilsForUser_0021
IMPORT_FUNC "UtilsForUser",0x80001C4C,sceKernelDcacheProbe
#endif
#ifdef F_UtilsForUser_0022
IMPORT_FUNC "UtilsForUser",0x16641D70,sceKernelDcacheReadTag
#endif
#ifdef F_UtilsForUser_0023
IMPORT_FUNC "UtilsForUser",0x4FD31C9D,sceKernelIcacheProbe
#endif
#ifdef F_UtilsForUser_0024
IMPORT_FUNC "UtilsForUser",0xFB05FAD0,sceKernelIcacheReadTag
#endif

25
src/user/pspintrman.c Normal file
View File

@@ -0,0 +1,25 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspintrman.c - Interface to the system interupt manager.
*
* Copyright (c) 2005 James F. (tyranid@gmail.com)
* Copyright (c) 2005 Florin Sasu (...)
*
* $Id: pspintrman.c 1207 2005-10-23 05:50:29Z mrbrown $
*/
#include <pspintrman.h>
const char* PspInterruptNames[67] = {//67 interrupts
0, 0, 0, 0, "GPIO", "ATA_ATAPI", "UmdMan", "MScm0",
"Wlan", 0, "Audio", 0, "I2C", 0, "SIRCS_IrDA",
"Systimer0", "Systimer1", "Systimer2", "Systimer3",
"Thread0", "NAND", "DMACPLUS", "DMA0", "DMA1",
"Memlmd", "GE", 0, 0, 0, 0, "Display", "MeCodec", 0,
0, 0, 0, "HP_Remote", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "MScm1", "MScm2",
0, 0, 0, "Thread1", "Interrupt"
};

178
src/user/pspintrman.h Normal file
View File

@@ -0,0 +1,178 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspintrman.h - Interface to the system interrupt manager.
*
* Copyright (c) 2005 James F. (tyranid@gmail.com)
* Copyright (c) 2005 Florin Sasu (...)
*
* $Id: pspintrman.h 2433 2008-10-15 10:00:27Z iwn $
*/
#ifndef PSPINTRMAN_H
#define PSPINTRMAN_H
#include <pspkerneltypes.h>
/** @defgroup IntrMan Interrupt Manager
* This module contains routines to manage interrupts.
*/
/** @addtogroup IntrMan Interrupt Manager */
/*@{*/
#ifdef __cplusplus
extern "C" {
#endif
extern const char* PspInterruptNames[67];
enum PspInterrupts
{
PSP_GPIO_INT = 4,
PSP_ATA_INT = 5,
PSP_UMD_INT = 6,
PSP_MSCM0_INT = 7,
PSP_WLAN_INT = 8,
PSP_AUDIO_INT = 10,
PSP_I2C_INT = 12,
PSP_SIRCS_INT = 14,
PSP_SYSTIMER0_INT = 15,
PSP_SYSTIMER1_INT = 16,
PSP_SYSTIMER2_INT = 17,
PSP_SYSTIMER3_INT = 18,
PSP_THREAD0_INT = 19,
PSP_NAND_INT = 20,
PSP_DMACPLUS_INT = 21,
PSP_DMA0_INT = 22,
PSP_DMA1_INT = 23,
PSP_MEMLMD_INT = 24,
PSP_GE_INT = 25,
PSP_VBLANK_INT = 30,
PSP_MECODEC_INT = 31,
PSP_HPREMOTE_INT = 36,
PSP_MSCM1_INT = 60,
PSP_MSCM2_INT = 61,
PSP_THREAD1_INT = 65,
PSP_INTERRUPT_INT = 66
};
enum PspSubInterrupts
{
PSP_GPIO_SUBINT = PSP_GPIO_INT,
PSP_ATA_SUBINT = PSP_ATA_INT,
PSP_UMD_SUBINT = PSP_UMD_INT,
PSP_DMACPLUS_SUBINT = PSP_DMACPLUS_INT,
PSP_GE_SUBINT = PSP_GE_INT,
PSP_DISPLAY_SUBINT = PSP_VBLANK_INT
};
/**
* Suspend all interrupts.
*
* @return The current state of the interrupt controller, to be used with ::sceKernelCpuResumeIntr().
*/
unsigned int sceKernelCpuSuspendIntr(void);
/**
* Resume all interrupts.
*
* @param flags - The value returned from ::sceKernelCpuSuspendIntr().
*/
void sceKernelCpuResumeIntr(unsigned int flags);
/**
* Resume all interrupts (using sync instructions).
*
* @param flags - The value returned from ::sceKernelCpuSuspendIntr()
*/
void sceKernelCpuResumeIntrWithSync(unsigned int flags);
/**
* Determine if interrupts are suspended or active, based on the given flags.
*
* @param flags - The value returned from ::sceKernelCpuSuspendIntr().
*
* @return 1 if flags indicate that interrupts were not suspended, 0 otherwise.
*/
int sceKernelIsCpuIntrSuspended(unsigned int flags);
/**
* Determine if interrupts are enabled or disabled.
*
* @return 1 if interrupts are currently enabled.
*/
int sceKernelIsCpuIntrEnable(void);
/**
* Register a sub interrupt handler.
*
* @param intno - The interrupt number to register.
* @param no - The sub interrupt handler number (user controlled)
* @param handler - The interrupt handler
* @param arg - An argument passed to the interrupt handler
*
* @return < 0 on error.
*/
int sceKernelRegisterSubIntrHandler(int intno, int no, void *handler, void *arg);
/**
* Release a sub interrupt handler.
*
* @param intno - The interrupt number to register.
* @param no - The sub interrupt handler number
*
* @return < 0 on error.
*/
int sceKernelReleaseSubIntrHandler(int intno, int no);
/**
* Enable a sub interrupt.
*
* @param intno - The sub interrupt to enable.
* @param no - The sub interrupt handler number
*
* @return < 0 on error.
*/
int sceKernelEnableSubIntr(int intno, int no);
/**
* Disable a sub interrupt handler.
*
* @param intno - The sub interrupt to disable.
* @param no - The sub interrupt handler number
*
* @return < 0 on error.
*/
int sceKernelDisableSubIntr(int intno, int no);
typedef struct tag_IntrHandlerOptionParam{
int size; //+00
u32 entry; //+04
u32 common; //+08
u32 gp; //+0C
u16 intr_code; //+10
u16 sub_count; //+12
u16 intr_level; //+14
u16 enabled; //+16
u32 calls; //+18
u32 field_1C; //+1C
u32 total_clock_lo; //+20
u32 total_clock_hi; //+24
u32 min_clock_lo; //+28
u32 min_clock_hi; //+2C
u32 max_clock_lo; //+30
u32 max_clock_hi; //+34
} PspIntrHandlerOptionParam; //=38
int QueryIntrHandlerInfo(SceUID intr_code, SceUID sub_intr_code, PspIntrHandlerOptionParam *data);
#ifdef __cplusplus
}
#endif
/*@}*/
#endif /* PSPINTRMAN_H */

477
src/user/pspiofilemgr.h Normal file
View File

@@ -0,0 +1,477 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspiofilemgr.h - Prototypes for the sceIo library.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspiofilemgr.h 1884 2006-04-30 08:55:54Z chip $
*/
#ifndef __FILEIO_H__
#define __FILEIO_H__
#include <pspkerneltypes.h>
#include <pspiofilemgr_fcntl.h>
#include <pspiofilemgr_stat.h>
#include <pspiofilemgr_dirent.h>
/** @defgroup FileIO File IO Library
* This module contains the imports for the kernel's IO routines.
*/
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup FileIO File IO Library */
/*@{*/
/** Permission value for the sceIoAssign function */
enum IoAssignPerms
{
/** Assign the device read/write */
IOASSIGN_RDWR = 0,
/** Assign the device read only */
IOASSIGN_RDONLY = 1
};
/**
* Open or create a file for reading or writing
*
* @par Example1: Open a file for reading
* @code
* if(!(fd = sceIoOpen("device:/path/to/file", O_RDONLY, 0777)) {
* // error
* }
* @endcode
* @par Example2: Open a file for writing, creating it if it doesnt exist
* @code
* if(!(fd = sceIoOpen("device:/path/to/file", O_WRONLY|O_CREAT, 0777)) {
* // error
* }
* @endcode
*
* @param file - Pointer to a string holding the name of the file to open
* @param flags - Libc styled flags that are or'ed together
* @param mode - File access mode.
* @return A non-negative integer is a valid fd, anything else an error
*/
SceUID sceIoOpen(const char *file, int flags, SceMode mode);
/**
* Open or create a file for reading or writing (asynchronous)
*
* @param file - Pointer to a string holding the name of the file to open
* @param flags - Libc styled flags that are or'ed together
* @param mode - File access mode.
* @return A non-negative integer is a valid fd, anything else an error
*/
SceUID sceIoOpenAsync(const char *file, int flags, SceMode mode);
/**
* Delete a descriptor
*
* @code
* sceIoClose(fd);
* @endcode
*
* @param fd - File descriptor to close
* @return < 0 on error
*/
int sceIoClose(SceUID fd);
/**
* Delete a descriptor (asynchronous)
*
* @param fd - File descriptor to close
* @return < 0 on error
*/
int sceIoCloseAsync(SceUID fd);
/**
* Read input
*
* @par Example:
* @code
* bytes_read = sceIoRead(fd, data, 100);
* @endcode
*
* @param fd - Opened file descriptor to read from
* @param data - Pointer to the buffer where the read data will be placed
* @param size - Size of the read in bytes
*
* @return The number of bytes read
*/
int sceIoRead(SceUID fd, void *data, SceSize size);
/**
* Read input (asynchronous)
*
* @par Example:
* @code
* bytes_read = sceIoRead(fd, data, 100);
* @endcode
*
* @param fd - Opened file descriptor to read from
* @param data - Pointer to the buffer where the read data will be placed
* @param size - Size of the read in bytes
*
* @return < 0 on error.
*/
int sceIoReadAsync(SceUID fd, void *data, SceSize size);
/**
* Write output
*
* @par Example:
* @code
* bytes_written = sceIoWrite(fd, data, 100);
* @endcode
*
* @param fd - Opened file descriptor to write to
* @param data - Pointer to the data to write
* @param size - Size of data to write
*
* @return The number of bytes written
*/
int sceIoWrite(SceUID fd, const void *data, SceSize size);
/**
* Write output (asynchronous)
*
* @param fd - Opened file descriptor to write to
* @param data - Pointer to the data to write
* @param size - Size of data to write
*
* @return < 0 on error.
*/
int sceIoWriteAsync(SceUID fd, const void *data, SceSize size);
/**
* Reposition read/write file descriptor offset
*
* @par Example:
* @code
* pos = sceIoLseek(fd, -10, SEEK_END);
* @endcode
*
* @param fd - Opened file descriptor with which to seek
* @param offset - Relative offset from the start position given by whence
* @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
* seek from the current position and SEEK_END to seek from the end.
*
* @return The position in the file after the seek.
*/
SceOff sceIoLseek(SceUID fd, SceOff offset, int whence);
/**
* Reposition read/write file descriptor offset (asynchronous)
*
* @param fd - Opened file descriptor with which to seek
* @param offset - Relative offset from the start position given by whence
* @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
* seek from the current position and SEEK_END to seek from the end.
*
* @return < 0 on error. Actual value should be passed returned by the ::sceIoWaitAsync call.
*/
int sceIoLseekAsync(SceUID fd, SceOff offset, int whence);
/**
* Reposition read/write file descriptor offset (32bit mode)
*
* @par Example:
* @code
* pos = sceIoLseek32(fd, -10, SEEK_END);
* @endcode
*
* @param fd - Opened file descriptor with which to seek
* @param offset - Relative offset from the start position given by whence
* @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
* seek from the current position and SEEK_END to seek from the end.
*
* @return The position in the file after the seek.
*/
int sceIoLseek32(SceUID fd, int offset, int whence);
/**
* Reposition read/write file descriptor offset (32bit mode, asynchronous)
*
* @param fd - Opened file descriptor with which to seek
* @param offset - Relative offset from the start position given by whence
* @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
* seek from the current position and SEEK_END to seek from the end.
*
* @return < 0 on error.
*/
int sceIoLseek32Async(SceUID fd, int offset, int whence);
/**
* Remove directory entry
*
* @param file - Path to the file to remove
* @return < 0 on error
*/
int sceIoRemove(const char *file);
/**
* Make a directory file
*
* @param dir
* @param mode - Access mode.
* @return Returns the value 0 if its succesful otherwise -1
*/
int sceIoMkdir(const char *dir, SceMode mode);
/**
* Remove a directory file
*
* @param path - Removes a directory file pointed by the string path
* @return Returns the value 0 if its succesful otherwise -1
*/
int sceIoRmdir(const char *path);
/**
* Change the current directory.
*
* @param path - The path to change to.
* @return < 0 on error.
*/
int sceIoChdir(const char *path);
/**
* Change the name of a file
*
* @param oldname - The old filename
* @param newname - The new filename
* @return < 0 on error.
*/
int sceIoRename(const char *oldname, const char *newname);
/**
* Open a directory
*
* @par Example:
* @code
* int dfd;
* dfd = sceIoDopen("device:/");
* if(dfd >= 0)
* { Do something with the file descriptor }
* @endcode
* @param dirname - The directory to open for reading.
* @return If >= 0 then a valid file descriptor, otherwise a Sony error code.
*/
SceUID sceIoDopen(const char *dirname);
/**
* Reads an entry from an opened file descriptor.
*
* @param fd - Already opened file descriptor (using sceIoDopen)
* @param dir - Pointer to an io_dirent_t structure to hold the file information
*
* @return Read status
* - 0 - No more directory entries left
* - > 0 - More directory entired to go
* - < 0 - Error
*/
int sceIoDread(SceUID fd, SceIoDirent *dir);
/**
* Close an opened directory file descriptor
*
* @param fd - Already opened file descriptor (using sceIoDopen)
* @return < 0 on error
*/
int sceIoDclose(SceUID fd);
/**
* Send a devctl command to a device.
*
* @par Example: Sending a simple command to a device (not a real devctl)
* @code
* sceIoDevctl("ms0:", 0x200000, indata, 4, NULL, NULL);
* @endcode
*
* @param dev - String for the device to send the devctl to (e.g. "ms0:")
* @param cmd - The command to send to the device
* @param indata - A data block to send to the device, if NULL sends no data
* @param inlen - Length of indata, if 0 sends no data
* @param outdata - A data block to receive the result of a command, if NULL receives no data
* @param outlen - Length of outdata, if 0 receives no data
* @return 0 on success, < 0 on error
*/
int sceIoDevctl(const char *dev, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
/**
* Assigns one IO device to another (I guess)
* @param dev1 - The device name to assign.
* @param dev2 - The block device to assign from.
* @param dev3 - The filesystem device to mape the block device to dev1
* @param mode - Read/Write mode. One of IoAssignPerms.
* @param unk1 - Unknown, set to NULL.
* @param unk2 - Unknown, set to 0.
* @return < 0 on error.
*
* @par Example: Reassign flash0 in read/write mode.
* @code
* sceIoUnassign("flash0");
* sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
* @endcode
*
*/
int sceIoAssign(const char *dev1, const char *dev2, const char *dev3, int mode, void* unk1, long unk2);
/**
* Unassign an IO device.
* @param dev - The device to unassign.
* @return < 0 on error
*
* @par Example: See ::sceIoAssign
*/
int sceIoUnassign(const char *dev);
/**
* Get the status of a file.
*
* @param file - The path to the file.
* @param stat - A pointer to an io_stat_t structure.
*
* @return < 0 on error.
*/
int sceIoGetstat(const char *file, SceIoStat *stat);
/**
* Change the status of a file.
*
* @param file - The path to the file.
* @param stat - A pointer to an io_stat_t structure.
* @param bits - Bitmask defining which bits to change.
*
* @return < 0 on error.
*/
int sceIoChstat(const char *file, SceIoStat *stat, int bits);
/**
* Perform an ioctl on a device.
*
* @param fd - Opened file descriptor to ioctl to
* @param cmd - The command to send to the device
* @param indata - A data block to send to the device, if NULL sends no data
* @param inlen - Length of indata, if 0 sends no data
* @param outdata - A data block to receive the result of a command, if NULL receives no data
* @param outlen - Length of outdata, if 0 receives no data
* @return 0 on success, < 0 on error
*/
int sceIoIoctl(SceUID fd, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
/**
* Perform an ioctl on a device. (asynchronous)
*
* @param fd - Opened file descriptor to ioctl to
* @param cmd - The command to send to the device
* @param indata - A data block to send to the device, if NULL sends no data
* @param inlen - Length of indata, if 0 sends no data
* @param outdata - A data block to receive the result of a command, if NULL receives no data
* @param outlen - Length of outdata, if 0 receives no data
* @return 0 on success, < 0 on error
*/
int sceIoIoctlAsync(SceUID fd, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
/**
* Synchronise the file data on the device.
*
* @param device - The device to synchronise (e.g. msfat0:)
* @param unk - Unknown
*/
int sceIoSync(const char *device, unsigned int unk);
/**
* Wait for asyncronous completion.
*
* @param fd - The file descriptor which is current performing an asynchronous action.
* @param res - The result of the async action.
*
* @return < 0 on error.
*/
int sceIoWaitAsync(SceUID fd, SceInt64 *res);
/**
* Wait for asyncronous completion (with callbacks).
*
* @param fd - The file descriptor which is current performing an asynchronous action.
* @param res - The result of the async action.
*
* @return < 0 on error.
*/
int sceIoWaitAsyncCB(SceUID fd, SceInt64 *res);
/**
* Poll for asyncronous completion.
*
* @param fd - The file descriptor which is current performing an asynchronous action.
* @param res - The result of the async action.
*
* @return < 0 on error.
*/
int sceIoPollAsync(SceUID fd, SceInt64 *res);
/**
* Get the asyncronous completion status.
*
* @param fd - The file descriptor which is current performing an asynchronous action.
* @param poll - If 0 then waits for the status, otherwise it polls the fd.
* @param res - The result of the async action.
*
* @return < 0 on error.
*/
int sceIoGetAsyncStat(SceUID fd, int poll, SceInt64 *res);
/**
* Cancel an asynchronous operation on a file descriptor.
*
* @param fd - The file descriptor to perform cancel on.
*
* @return < 0 on error.
*/
int sceIoCancel(SceUID fd);
/**
* Get the device type of the currently opened file descriptor.
*
* @param fd - The opened file descriptor.
*
* @return < 0 on error. Otherwise the device type?
*/
int sceIoGetDevType(SceUID fd);
/**
* Change the priority of the asynchronous thread.
*
* @param fd - The opened fd on which the priority should be changed.
* @param pri - The priority of the thread.
*
* @return < 0 on error.
*/
int sceIoChangeAsyncPriority(SceUID fd, int pri);
/**
* Sets a callback for the asynchronous action.
*
* @param fd - The filedescriptor currently performing an asynchronous action.
* @param cb - The UID of the callback created with ::sceKernelCreateCallback
* @param argp - Pointer to an argument to pass to the callback.
*
* @return < 0 on error.
*/
int sceIoSetAsyncCallback(SceUID fd, SceUID cb, void *argp);
/*@}*/
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,35 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspiofilemgr_dirent.h - File attributes and directory entries.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspiofilemgr_dirent.h 1172 2005-10-20 09:08:04Z jim $
*/
/* Note: Some of the structures, types, and definitions in this file were
extrapolated from symbolic debugging information found in the Japanese
version of Puzzle Bobble. */
#ifndef PSPIOFILEMGR_DIRENT_H
#define PSPIOFILEMGR_DIRENT_H
#include <pspiofilemgr_stat.h>
/** Describes a single directory entry */
typedef struct SceIoDirent {
/** File status. */
SceIoStat d_stat;
/** File name. */
char d_name[256];
/** Device-specific data. */
void * d_private;
int dummy;
} SceIoDirent;
#endif /* PSPIOFILEMGR_DIRENT_H */

View File

@@ -0,0 +1,34 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspiofilemgr_fcntl.h - File control definitions.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspiofilemgr_fcntl.h 559 2005-07-09 08:47:52Z mrbrown $
*/
#ifndef PSPIOFILEMGR_FCNTL_H
#define PSPIOFILEMGR_FCNTL_H
/* Note: Not all of these sceIoOpen() flags are not compatible with the
open() flags found in sys/unistd.h. */
#define PSP_O_RDONLY 0x0001
#define PSP_O_WRONLY 0x0002
#define PSP_O_RDWR (PSP_O_RDONLY | PSP_O_WRONLY)
#define PSP_O_NBLOCK 0x0004
#define PSP_O_DIROPEN 0x0008 // Internal use for dopen
#define PSP_O_APPEND 0x0100
#define PSP_O_CREAT 0x0200
#define PSP_O_TRUNC 0x0400
#define PSP_O_EXCL 0x0800
#define PSP_O_NOWAIT 0x8000
#define PSP_SEEK_SET 0
#define PSP_SEEK_CUR 1
#define PSP_SEEK_END 2
#endif /* PSPIOFILEMGR_FCNTL_H */

View File

@@ -0,0 +1,118 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspiofilemgr_dirent.h - File attributes and directory entries.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspiofilemgr_stat.h 1095 2005-09-27 21:02:16Z jim $
*/
/* Note: Some of the structures, types, and definitions in this file were
extrapolated from symbolic debugging information found in the Japanese
version of Puzzle Bobble. */
#ifndef PSPIOFILEMGR_STAT_H
#define PSPIOFILEMGR_STAT_H
#include <psptypes.h>
#include <pspkerneltypes.h>
/** Access modes for st_mode in SceIoStat (confirm?). */
enum IOAccessModes
{
/** Format bits mask */
FIO_S_IFMT = 0xF000,
/** Symbolic link */
FIO_S_IFLNK = 0x4000,
/** Directory */
FIO_S_IFDIR = 0x1000,
/** Regular file */
FIO_S_IFREG = 0x2000,
/** Set UID */
FIO_S_ISUID = 0x0800,
/** Set GID */
FIO_S_ISGID = 0x0400,
/** Sticky */
FIO_S_ISVTX = 0x0200,
/** User access rights mask */
FIO_S_IRWXU = 0x01C0,
/** Read user permission */
FIO_S_IRUSR = 0x0100,
/** Write user permission */
FIO_S_IWUSR = 0x0080,
/** Execute user permission */
FIO_S_IXUSR = 0x0040,
/** Group access rights mask */
FIO_S_IRWXG = 0x0038,
/** Group read permission */
FIO_S_IRGRP = 0x0020,
/** Group write permission */
FIO_S_IWGRP = 0x0010,
/** Group execute permission */
FIO_S_IXGRP = 0x0008,
/** Others access rights mask */
FIO_S_IRWXO = 0x0007,
/** Others read permission */
FIO_S_IROTH = 0x0004,
/** Others write permission */
FIO_S_IWOTH = 0x0002,
/** Others execute permission */
FIO_S_IXOTH = 0x0001,
};
// File mode checking macros
#define FIO_S_ISLNK(m) (((m) & FIO_S_IFMT) == FIO_S_IFLNK)
#define FIO_S_ISREG(m) (((m) & FIO_S_IFMT) == FIO_S_IFREG)
#define FIO_S_ISDIR(m) (((m) & FIO_S_IFMT) == FIO_S_IFDIR)
/** File modes, used for the st_attr parameter in SceIoStat (confirm?). */
enum IOFileModes
{
/** Format mask */
FIO_SO_IFMT = 0x0038, // Format mask
/** Symlink */
FIO_SO_IFLNK = 0x0008, // Symbolic link
/** Directory */
FIO_SO_IFDIR = 0x0010, // Directory
/** Regular file */
FIO_SO_IFREG = 0x0020, // Regular file
/** Hidden read permission */
FIO_SO_IROTH = 0x0004, // read
/** Hidden write permission */
FIO_SO_IWOTH = 0x0002, // write
/** Hidden execute permission */
FIO_SO_IXOTH = 0x0001, // execute
};
// File mode checking macros
#define FIO_SO_ISLNK(m) (((m) & FIO_SO_IFMT) == FIO_SO_IFLNK)
#define FIO_SO_ISREG(m) (((m) & FIO_SO_IFMT) == FIO_SO_IFREG)
#define FIO_SO_ISDIR(m) (((m) & FIO_SO_IFMT) == FIO_SO_IFDIR)
/** Structure to hold the status information about a file */
typedef struct SceIoStat {
SceMode st_mode;
unsigned int st_attr;
/** Size of the file in bytes. */
SceOff st_size;
/** Creation time. */
ScePspDateTime st_ctime;
/** Access time. */
ScePspDateTime st_atime;
/** Modification time. */
ScePspDateTime st_mtime;
/** Device-specific data. */
unsigned int st_private[6];
} SceIoStat;
#endif /* PSPIOFILEMGR_STAT_H */

39
src/user/pspkerneltypes.h Normal file
View File

@@ -0,0 +1,39 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspkerneltypes.h - PSP kernel types and definitions.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspkerneltypes.h 1884 2006-04-30 08:55:54Z chip $
*/
/* Note: Some of the structures, types, and definitions in this file were
extrapolated from symbolic debugging information found in the Japanese
version of Puzzle Bobble. */
#ifndef PSPKERNELTYPES_H
#define PSPKERNELTYPES_H
#include <psptypes.h>
/** UIDs are used to describe many different kernel objects. */
typedef int SceUID;
/* Misc. kernel types. */
typedef unsigned int SceSize;
typedef int SceSSize;
typedef unsigned char SceUChar;
typedef unsigned int SceUInt;
/* File I/O types. */
typedef int SceMode;
typedef SceInt64 SceOff;
typedef SceInt64 SceIores;
#endif /* PSPKERNELTYPES_H */

221
src/user/pspkerror.h Normal file
View File

@@ -0,0 +1,221 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspkerror.h - Definitions for the kernel error codes
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspkerror.h 1095 2005-09-27 21:02:16Z jim $
*/
#ifndef PSPKERROR_H
#define PSPKERROR_H
/* Note: The error code enumerations in this file were extrapolated from
symbolic debugging information found in the Japanese version of Puzzle Bobble. */
enum PspKernelErrorCodes
{
SCE_KERNEL_ERROR_OK = 0,
SCE_KERNEL_ERROR_ERROR = 0x80020001,
SCE_KERNEL_ERROR_NOTIMP = 0x80020002,
SCE_KERNEL_ERROR_ILLEGAL_EXPCODE = 0x80020032,
SCE_KERNEL_ERROR_EXPHANDLER_NOUSE = 0x80020033,
SCE_KERNEL_ERROR_EXPHANDLER_USED = 0x80020034,
SCE_KERNEL_ERROR_SYCALLTABLE_NOUSED = 0x80020035,
SCE_KERNEL_ERROR_SYCALLTABLE_USED = 0x80020036,
SCE_KERNEL_ERROR_ILLEGAL_SYSCALLTABLE = 0x80020037,
SCE_KERNEL_ERROR_ILLEGAL_PRIMARY_SYSCALL_NUMBER = 0x80020038,
SCE_KERNEL_ERROR_PRIMARY_SYSCALL_NUMBER_INUSE = 0x80020039,
SCE_KERNEL_ERROR_ILLEGAL_CONTEXT = 0x80020064,
SCE_KERNEL_ERROR_ILLEGAL_INTRCODE = 0x80020065,
SCE_KERNEL_ERROR_CPUDI = 0x80020066,
SCE_KERNEL_ERROR_FOUND_HANDLER = 0x80020067,
SCE_KERNEL_ERROR_NOTFOUND_HANDLER = 0x80020068,
SCE_KERNEL_ERROR_ILLEGAL_INTRLEVEL = 0x80020069,
SCE_KERNEL_ERROR_ILLEGAL_ADDRESS = 0x8002006a,
SCE_KERNEL_ERROR_ILLEGAL_INTRPARAM = 0x8002006b,
SCE_KERNEL_ERROR_ILLEGAL_STACK_ADDRESS = 0x8002006c,
SCE_KERNEL_ERROR_ALREADY_STACK_SET = 0x8002006d,
SCE_KERNEL_ERROR_NO_TIMER = 0x80020096,
SCE_KERNEL_ERROR_ILLEGAL_TIMERID = 0x80020097,
SCE_KERNEL_ERROR_ILLEGAL_SOURCE = 0x80020098,
SCE_KERNEL_ERROR_ILLEGAL_PRESCALE = 0x80020099,
SCE_KERNEL_ERROR_TIMER_BUSY = 0x8002009a,
SCE_KERNEL_ERROR_TIMER_NOT_SETUP = 0x8002009b,
SCE_KERNEL_ERROR_TIMER_NOT_INUSE = 0x8002009c,
SCE_KERNEL_ERROR_UNIT_USED = 0x800200a0,
SCE_KERNEL_ERROR_UNIT_NOUSE = 0x800200a1,
SCE_KERNEL_ERROR_NO_ROMDIR = 0x800200a2,
SCE_KERNEL_ERROR_IDTYPE_EXIST = 0x800200c8,
SCE_KERNEL_ERROR_IDTYPE_NOT_EXIST = 0x800200c9,
SCE_KERNEL_ERROR_IDTYPE_NOT_EMPTY = 0x800200ca,
SCE_KERNEL_ERROR_UNKNOWN_UID = 0x800200cb,
SCE_KERNEL_ERROR_UNMATCH_UID_TYPE = 0x800200cc,
SCE_KERNEL_ERROR_ID_NOT_EXIST = 0x800200cd,
SCE_KERNEL_ERROR_NOT_FOUND_UIDFUNC = 0x800200ce,
SCE_KERNEL_ERROR_UID_ALREADY_HOLDER = 0x800200cf,
SCE_KERNEL_ERROR_UID_NOT_HOLDER = 0x800200d0,
SCE_KERNEL_ERROR_ILLEGAL_PERM = 0x800200d1,
SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT = 0x800200d2,
SCE_KERNEL_ERROR_ILLEGAL_ADDR = 0x800200d3,
SCE_KERNEL_ERROR_OUT_OF_RANGE = 0x800200d4,
SCE_KERNEL_ERROR_MEM_RANGE_OVERLAP = 0x800200d5,
SCE_KERNEL_ERROR_ILLEGAL_PARTITION = 0x800200d6,
SCE_KERNEL_ERROR_PARTITION_INUSE = 0x800200d7,
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCKTYPE = 0x800200d8,
SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED = 0x800200d9,
SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_LOCKED = 0x800200da,
SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_FAILED = 0x800200db,
SCE_KERNEL_ERROR_HEAPBLOCK_ALLOC_FAILED = 0x800200dc,
SCE_KERNEL_ERROR_HEAP_ALLOC_FAILED = 0x800200dd,
SCE_KERNEL_ERROR_ILLEGAL_CHUNK_ID = 0x800200de,
SCE_KERNEL_ERROR_NOCHUNK = 0x800200df,
SCE_KERNEL_ERROR_NO_FREECHUNK = 0x800200e0,
SCE_KERNEL_ERROR_LINKERR = 0x8002012c,
SCE_KERNEL_ERROR_ILLEGAL_OBJECT = 0x8002012d,
SCE_KERNEL_ERROR_UNKNOWN_MODULE = 0x8002012e,
SCE_KERNEL_ERROR_NOFILE = 0x8002012f,
SCE_KERNEL_ERROR_FILEERR = 0x80020130,
SCE_KERNEL_ERROR_MEMINUSE = 0x80020131,
SCE_KERNEL_ERROR_PARTITION_MISMATCH = 0x80020132,
SCE_KERNEL_ERROR_ALREADY_STARTED = 0x80020133,
SCE_KERNEL_ERROR_NOT_STARTED = 0x80020134,
SCE_KERNEL_ERROR_ALREADY_STOPPED = 0x80020135,
SCE_KERNEL_ERROR_CAN_NOT_STOP = 0x80020136,
SCE_KERNEL_ERROR_NOT_STOPPED = 0x80020137,
SCE_KERNEL_ERROR_NOT_REMOVABLE = 0x80020138,
SCE_KERNEL_ERROR_EXCLUSIVE_LOAD = 0x80020139,
SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED = 0x8002013a,
SCE_KERNEL_ERROR_LIBRARY_FOUND = 0x8002013b,
SCE_KERNEL_ERROR_LIBRARY_NOTFOUND = 0x8002013c,
SCE_KERNEL_ERROR_ILLEGAL_LIBRARY = 0x8002013d,
SCE_KERNEL_ERROR_LIBRARY_INUSE = 0x8002013e,
SCE_KERNEL_ERROR_ALREADY_STOPPING = 0x8002013f,
SCE_KERNEL_ERROR_ILLEGAL_OFFSET = 0x80020140,
SCE_KERNEL_ERROR_ILLEGAL_POSITION = 0x80020141,
SCE_KERNEL_ERROR_ILLEGAL_ACCESS = 0x80020142,
SCE_KERNEL_ERROR_MODULE_MGR_BUSY = 0x80020143,
SCE_KERNEL_ERROR_ILLEGAL_FLAG = 0x80020144,
SCE_KERNEL_ERROR_CANNOT_GET_MODULELIST = 0x80020145,
SCE_KERNEL_ERROR_PROHIBIT_LOADMODULE_DEVICE = 0x80020146,
SCE_KERNEL_ERROR_PROHIBIT_LOADEXEC_DEVICE = 0x80020147,
SCE_KERNEL_ERROR_UNSUPPORTED_PRX_TYPE = 0x80020148,
SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL = 0x80020149,
SCE_KERNEL_ERROR_CANNOT_GET_MODULE_INFORMATION = 0x8002014a,
SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_BUFFER = 0x8002014b,
SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_FILENAME = 0x8002014c,
SCE_KERNEL_ERROR_NO_EXIT_CALLBACK = 0x8002014d,
SCE_KERNEL_ERROR_NO_MEMORY = 0x80020190,
SCE_KERNEL_ERROR_ILLEGAL_ATTR = 0x80020191,
SCE_KERNEL_ERROR_ILLEGAL_ENTRY = 0x80020192,
SCE_KERNEL_ERROR_ILLEGAL_PRIORITY = 0x80020193,
SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE = 0x80020194,
SCE_KERNEL_ERROR_ILLEGAL_MODE = 0x80020195,
SCE_KERNEL_ERROR_ILLEGAL_MASK = 0x80020196,
SCE_KERNEL_ERROR_ILLEGAL_THID = 0x80020197,
SCE_KERNEL_ERROR_UNKNOWN_THID = 0x80020198,
SCE_KERNEL_ERROR_UNKNOWN_SEMID = 0x80020199,
SCE_KERNEL_ERROR_UNKNOWN_EVFID = 0x8002019a,
SCE_KERNEL_ERROR_UNKNOWN_MBXID = 0x8002019b,
SCE_KERNEL_ERROR_UNKNOWN_VPLID = 0x8002019c,
SCE_KERNEL_ERROR_UNKNOWN_FPLID = 0x8002019d,
SCE_KERNEL_ERROR_UNKNOWN_MPPID = 0x8002019e,
SCE_KERNEL_ERROR_UNKNOWN_ALMID = 0x8002019f,
SCE_KERNEL_ERROR_UNKNOWN_TEID = 0x800201a0,
SCE_KERNEL_ERROR_UNKNOWN_CBID = 0x800201a1,
SCE_KERNEL_ERROR_DORMANT = 0x800201a2,
SCE_KERNEL_ERROR_SUSPEND = 0x800201a3,
SCE_KERNEL_ERROR_NOT_DORMANT = 0x800201a4,
SCE_KERNEL_ERROR_NOT_SUSPEND = 0x800201a5,
SCE_KERNEL_ERROR_NOT_WAIT = 0x800201a6,
SCE_KERNEL_ERROR_CAN_NOT_WAIT = 0x800201a7,
SCE_KERNEL_ERROR_WAIT_TIMEOUT = 0x800201a8,
SCE_KERNEL_ERROR_WAIT_CANCEL = 0x800201a9,
SCE_KERNEL_ERROR_RELEASE_WAIT = 0x800201aa,
SCE_KERNEL_ERROR_NOTIFY_CALLBACK = 0x800201ab,
SCE_KERNEL_ERROR_THREAD_TERMINATED = 0x800201ac,
SCE_KERNEL_ERROR_SEMA_ZERO = 0x800201ad,
SCE_KERNEL_ERROR_SEMA_OVF = 0x800201ae,
SCE_KERNEL_ERROR_EVF_COND = 0x800201af,
SCE_KERNEL_ERROR_EVF_MULTI = 0x800201b0,
SCE_KERNEL_ERROR_EVF_ILPAT = 0x800201b1,
SCE_KERNEL_ERROR_MBOX_NOMSG = 0x800201b2,
SCE_KERNEL_ERROR_MPP_FULL = 0x800201b3,
SCE_KERNEL_ERROR_MPP_EMPTY = 0x800201b4,
SCE_KERNEL_ERROR_WAIT_DELETE = 0x800201b5,
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK = 0x800201b6,
SCE_KERNEL_ERROR_ILLEGAL_MEMSIZE = 0x800201b7,
SCE_KERNEL_ERROR_ILLEGAL_SPADADDR = 0x800201b8,
SCE_KERNEL_ERROR_SPAD_INUSE = 0x800201b9,
SCE_KERNEL_ERROR_SPAD_NOT_INUSE = 0x800201ba,
SCE_KERNEL_ERROR_ILLEGAL_TYPE = 0x800201bb,
SCE_KERNEL_ERROR_ILLEGAL_SIZE = 0x800201bc,
SCE_KERNEL_ERROR_ILLEGAL_COUNT = 0x800201bd,
SCE_KERNEL_ERROR_UNKNOWN_VTID = 0x800201be,
SCE_KERNEL_ERROR_ILLEGAL_VTID = 0x800201bf,
SCE_KERNEL_ERROR_ILLEGAL_KTLSID = 0x800201c0,
SCE_KERNEL_ERROR_KTLS_FULL = 0x800201c1,
SCE_KERNEL_ERROR_KTLS_BUSY = 0x800201c2,
SCE_KERNEL_ERROR_PM_INVALID_PRIORITY = 0x80020258,
SCE_KERNEL_ERROR_PM_INVALID_DEVNAME = 0x80020259,
SCE_KERNEL_ERROR_PM_UNKNOWN_DEVNAME = 0x8002025a,
SCE_KERNEL_ERROR_PM_PMINFO_REGISTERED = 0x8002025b,
SCE_KERNEL_ERROR_PM_PMINFO_UNREGISTERED = 0x8002025c,
SCE_KERNEL_ERROR_PM_INVALID_MAJOR_STATE = 0x8002025d,
SCE_KERNEL_ERROR_PM_INVALID_REQUEST = 0x8002025e,
SCE_KERNEL_ERROR_PM_UNKNOWN_REQUEST = 0x8002025f,
SCE_KERNEL_ERROR_PM_INVALID_UNIT = 0x80020260,
SCE_KERNEL_ERROR_PM_CANNOT_CANCEL = 0x80020261,
SCE_KERNEL_ERROR_PM_INVALID_PMINFO = 0x80020262,
SCE_KERNEL_ERROR_PM_INVALID_ARGUMENT = 0x80020263,
SCE_KERNEL_ERROR_PM_ALREADY_TARGET_PWRSTATE = 0x80020264,
SCE_KERNEL_ERROR_PM_CHANGE_PWRSTATE_FAILED = 0x80020265,
SCE_KERNEL_ERROR_PM_CANNOT_CHANGE_DEVPWR_STATE = 0x80020266,
SCE_KERNEL_ERROR_PM_NO_SUPPORT_DEVPWR_STATE = 0x80020267,
SCE_KERNEL_ERROR_DMAC_REQUEST_FAILED = 0x800202bc,
SCE_KERNEL_ERROR_DMAC_REQUEST_DENIED = 0x800202bd,
SCE_KERNEL_ERROR_DMAC_OP_QUEUED = 0x800202be,
SCE_KERNEL_ERROR_DMAC_OP_NOT_QUEUED = 0x800202bf,
SCE_KERNEL_ERROR_DMAC_OP_RUNNING = 0x800202c0,
SCE_KERNEL_ERROR_DMAC_OP_NOT_ASSIGNED = 0x800202c1,
SCE_KERNEL_ERROR_DMAC_OP_TIMEOUT = 0x800202c2,
SCE_KERNEL_ERROR_DMAC_OP_FREED = 0x800202c3,
SCE_KERNEL_ERROR_DMAC_OP_USED = 0x800202c4,
SCE_KERNEL_ERROR_DMAC_OP_EMPTY = 0x800202c5,
SCE_KERNEL_ERROR_DMAC_OP_ABORTED = 0x800202c6,
SCE_KERNEL_ERROR_DMAC_OP_ERROR = 0x800202c7,
SCE_KERNEL_ERROR_DMAC_CHANNEL_RESERVED = 0x800202c8,
SCE_KERNEL_ERROR_DMAC_CHANNEL_EXCLUDED = 0x800202c9,
SCE_KERNEL_ERROR_DMAC_PRIVILEGE_ADDRESS = 0x800202ca,
SCE_KERNEL_ERROR_DMAC_NO_ENOUGHSPACE = 0x800202cb,
SCE_KERNEL_ERROR_DMAC_CHANNEL_NOT_ASSIGNED = 0x800202cc,
SCE_KERNEL_ERROR_DMAC_CHILD_OPERATION = 0x800202cd,
SCE_KERNEL_ERROR_DMAC_TOO_MUCH_SIZE = 0x800202ce,
SCE_KERNEL_ERROR_DMAC_INVALID_ARGUMENT = 0x800202cf,
SCE_KERNEL_ERROR_MFILE = 0x80020320,
SCE_KERNEL_ERROR_NODEV = 0x80020321,
SCE_KERNEL_ERROR_XDEV = 0x80020322,
SCE_KERNEL_ERROR_BADF = 0x80020323,
SCE_KERNEL_ERROR_INVAL = 0x80020324,
SCE_KERNEL_ERROR_UNSUP = 0x80020325,
SCE_KERNEL_ERROR_ALIAS_USED = 0x80020326,
SCE_KERNEL_ERROR_CANNOT_MOUNT = 0x80020327,
SCE_KERNEL_ERROR_DRIVER_DELETED = 0x80020328,
SCE_KERNEL_ERROR_ASYNC_BUSY = 0x80020329,
SCE_KERNEL_ERROR_NOASYNC = 0x8002032a,
SCE_KERNEL_ERROR_REGDEV = 0x8002032b,
SCE_KERNEL_ERROR_NOCWD = 0x8002032c,
SCE_KERNEL_ERROR_NAMETOOLONG = 0x8002032d,
SCE_KERNEL_ERROR_NXIO = 0x800203e8,
SCE_KERNEL_ERROR_IO = 0x800203e9,
SCE_KERNEL_ERROR_NOMEM = 0x800203ea,
SCE_KERNEL_ERROR_STDIO_NOT_OPENED = 0x800203eb,
SCE_KERNEL_ERROR_CACHE_ALIGNMENT = 0x8002044c,
SCE_KERNEL_ERROR_ERRORMAX = 0x8002044d,
};
#endif /* PSPKERROR_H */

88
src/user/psploadexec.h Normal file
View File

@@ -0,0 +1,88 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* psploadexec.h - Process load and exit related functions.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: psploadexec.h 835 2005-08-09 05:41:25Z tyranid $
*/
/* Note: Some of the structures, types, and definitions in this file were
extrapolated from symbolic debugging information found in the Japanese
version of Puzzle Bobble. */
#ifndef __LOADEXEC_H__
#define __LOADEXEC_H__
/** @defgroup LoadExec LoadExec Library */
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup LoadExec */
/*@{*/
/**
* Register callback
*
* @note By installing the exit callback the home button becomes active. However if sceKernelExitGame
* is not called in the callback it is likely that the psp will just crash.
*
* @par Example:
* @code
* int exit_callback(void) { sceKernelExitGame(); }
*
* cbid = sceKernelCreateCallback("ExitCallback", exit_callback, NULL);
* sceKernelRegisterExitCallback(cbid);
* @endcode
*
* @param cbid Callback id
* @return < 0 on error
*/
int sceKernelRegisterExitCallback(int cbid);
/**
* Exit game and go back to the PSP browser.
*
* @note You need to be in a thread in order for this function to work
*
*/
void sceKernelExitGame(void);
/** Structure to pass to loadexec */
struct SceKernelLoadExecParam {
/** Size of the structure */
SceSize size;
/** Size of the arg string */
SceSize args;
/** Pointer to the arg string */
void * argp;
/** Encryption key ? */
const char * key;
};
/**
* Execute a new game executable, limited when not running in kernel mode.
*
* @param file - The file to execute.
* @param param - Pointer to a ::SceKernelLoadExecParam structure, or NULL.
*
* @return < 0 on error, probably.
*
*/
int sceKernelLoadExec(const char *file, struct SceKernelLoadExecParam *param);
#ifdef __cplusplus
}
#endif
/*@}*/
#endif

View File

@@ -0,0 +1,29 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspmoduleexport.h - Definitions for the .rodata.sceResident section.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspmoduleexport.h 1095 2005-09-27 21:02:16Z jim $
*/
#ifndef PSP_MODEXPORT_H_
#define PSP_MODEXPORT_H_
/** Structure to hold a single export entry */
struct _PspLibraryEntry {
const char * name;
unsigned short version;
unsigned short attribute;
unsigned char entLen;
unsigned char varCount;
unsigned short funcCount;
void * entrytable;
};
#endif

148
src/user/pspmoduleinfo.h Normal file
View File

@@ -0,0 +1,148 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspmoduleinfo.h - Definitions for the .rodata.sceModuleInfo ELF section.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspmoduleinfo.h 2434 2008-10-15 17:37:25Z iwn $
*/
#ifndef PSPMODULEINFO_H
#define PSPMODULEINFO_H
/* Note: Some of the structures and definitions in this file were extrapolated from
symbolic debugging information found in the Japanese version of Puzzle Bobble. */
/* Module info structure. Used to declare a module (library or executable). This structure
is required in all PSP executables. */
typedef struct _scemoduleinfo {
unsigned short modattribute;
unsigned char modversion[2];
char modname[27];
char terminal;
void * gp_value;
void * ent_top;
void * ent_end;
void * stub_top;
void * stub_end;
} _sceModuleInfo;
typedef const _sceModuleInfo SceModuleInfo;
extern char _gp[];
enum PspModuleInfoAttr
{
PSP_MODULE_USER = 0,
PSP_MODULE_NO_STOP = 0x0001,
PSP_MODULE_SINGLE_LOAD = 0x0002,
PSP_MODULE_SINGLE_START = 0x0004,
PSP_MODULE_KERNEL = 0x1000,
};
#ifdef __cplusplus
/* Declare a module. This must be specified in the source of a library or executable. */
#define PSP_MODULE_INFO(name, attributes, major_version, minor_version) \
__asm__ ( \
" .set push\n" \
" .section .lib.ent.top, \"a\", @progbits\n" \
" .align 2\n" \
" .word 0\n" \
"__lib_ent_top:\n" \
" .section .lib.ent.btm, \"a\", @progbits\n" \
" .align 2\n" \
"__lib_ent_bottom:\n" \
" .word 0\n" \
" .section .lib.stub.top, \"a\", @progbits\n" \
" .align 2\n" \
" .word 0\n" \
"__lib_stub_top:\n" \
" .section .lib.stub.btm, \"a\", @progbits\n" \
" .align 2\n" \
"__lib_stub_bottom:\n" \
" .word 0\n" \
" .set pop\n" \
" .text\n" \
); \
extern char __lib_ent_top[], __lib_ent_bottom[]; \
extern char __lib_stub_top[], __lib_stub_bottom[]; \
extern SceModuleInfo module_info \
__attribute__((section(".rodata.sceModuleInfo"), \
aligned(16), unused)) = { \
attributes, { minor_version, major_version }, #name, 0, _gp, \
__lib_ent_top, __lib_ent_bottom, \
__lib_stub_top, __lib_stub_bottom \
}
#else
/* Declare a module. This must be specified in the source of a library or executable. */
#define PSP_MODULE_INFO(name, attributes, major_version, minor_version) \
__asm__ ( \
" .set push\n" \
" .section .lib.ent.top, \"a\", @progbits\n" \
" .align 2\n" \
" .word 0\n" \
"__lib_ent_top:\n" \
" .section .lib.ent.btm, \"a\", @progbits\n" \
" .align 2\n" \
"__lib_ent_bottom:\n" \
" .word 0\n" \
" .section .lib.stub.top, \"a\", @progbits\n" \
" .align 2\n" \
" .word 0\n" \
"__lib_stub_top:\n" \
" .section .lib.stub.btm, \"a\", @progbits\n" \
" .align 2\n" \
"__lib_stub_bottom:\n" \
" .word 0\n" \
" .set pop\n" \
" .text\n" \
); \
extern char __lib_ent_top[], __lib_ent_bottom[]; \
extern char __lib_stub_top[], __lib_stub_bottom[]; \
SceModuleInfo module_info \
__attribute__((section(".rodata.sceModuleInfo"), \
aligned(16), unused)) = { \
attributes, { minor_version, major_version }, name, 0, _gp, \
__lib_ent_top, __lib_ent_bottom, \
__lib_stub_top, __lib_stub_bottom \
}
#endif
/* Define the main thread's initial priority. */
#define PSP_MAIN_THREAD_PRIORITY(priority) \
unsigned int sce_newlib_priority = (priority)
/* Define the main thread's stack size (in KB). */
#define PSP_MAIN_THREAD_STACK_SIZE_KB(size_kb) \
unsigned int sce_newlib_stack_kb_size = (size_kb)
/* Define the main thread's attributes. */
#define PSP_MAIN_THREAD_ATTR(attr) \
unsigned int sce_newlib_attribute = (attr)
#define PSP_MAIN_THREAD_ATTRIBUTE PSP_MAIN_THREAD_ATTR
/* Define all main thread parameters. */
#define PSP_MAIN_THREAD_PARAMS(priority, size_kb, attribute) \
PSP_MAIN_THREAD_PRIORITY(priority); \
PSP_MAIN_THREAD_STACK_SIZE_KB(size_kb); \
PSP_MAIN_THREAD_ATTR(attribute)
/* If declared, the runtime code won't create a main thread for the program. */
#define PSP_NO_CREATE_MAIN_THREAD() \
int sce_newlib_nocreate_thread_in_start = 1
/* Declare the size of the heap (in KB) that the program wants to allocate from. */
#define PSP_HEAP_SIZE_KB(size_kb) \
int sce_newlib_heap_kb_size = (size_kb)
/* Declare to allocate maximum heap area */
#define PSP_HEAP_SIZE_MAX() \
PSP_HEAP_SIZE_KB(-1)
/* Declare the name of the main thread */
#define PSP_MAIN_THREAD_NAME(s) const char* sce_newlib_main_thread_name = (s)
#endif /* PSPMODULEINFO_H */

218
src/user/pspmodulemgr.h Normal file
View File

@@ -0,0 +1,218 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspmodulemgr.h - Prototypes to manage modules.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspmodulemgr.h 2433 2008-10-15 10:00:27Z iwn $
*/
/* Note: Some of the structures, types, and definitions in this file were
extrapolated from symbolic debugging information found in the Japanese
version of Puzzle Bobble. */
#ifndef __MODLOAD_H__
#define __MODLOAD_H__
#include <pspkerneltypes.h>
/** @defgroup ModuleMgr Module Manager Library
* This module contains the imports for the kernel's module management routines.
*/
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup ModuleMgr Module Manager Library */
/*@{*/
#define PSP_MEMORY_PARTITION_KERNEL 1
#define PSP_MEMORY_PARTITION_USER 2
typedef struct SceKernelLMOption {
SceSize size;
SceUID mpidtext;
SceUID mpiddata;
unsigned int flags;
char position;
char access;
char creserved[2];
} SceKernelLMOption;
typedef struct SceKernelSMOption {
SceSize size;
SceUID mpidstack;
SceSize stacksize;
int priority;
unsigned int attribute;
} SceKernelSMOption;
/**
* Load a module.
* @note This function restricts where it can load from (such as from flash0)
* unless you call it in kernel mode. It also must be called from a thread.
*
* @param path - The path to the module to load.
* @param flags - Unused, always 0 .
* @param option - Pointer to a mod_param_t structure. Can be NULL.
*
* @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
*/
SceUID sceKernelLoadModule(const char *path, int flags, SceKernelLMOption *option);
/**
* Load a module from MS.
* @note This function restricts what it can load, e.g. it wont load plain executables.
*
* @param path - The path to the module to load.
* @param flags - Unused, set to 0.
* @param option - Pointer to a mod_param_t structure. Can be NULL.
*
* @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
*/
SceUID sceKernelLoadModuleMs(const char *path, int flags, SceKernelLMOption *option);
/**
* Load a module from the given file UID.
*
* @param fid - The module's file UID.
* @param flags - Unused, always 0.
* @param option - Pointer to an optional ::SceKernelLMOption structure.
*
* @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
*/
SceUID sceKernelLoadModuleByID(SceUID fid, int flags, SceKernelLMOption *option);
/**
* Load a module from a buffer using the USB/WLAN API.
*
* Can only be called from kernel mode, or from a thread that has attributes of 0xa0000000.
*
* @param bufsize - Size (in bytes) of the buffer pointed to by buf.
* @param buf - Pointer to a buffer containing the module to load. The buffer must reside at an
* address that is a multiple to 64 bytes.
* @param flags - Unused, always 0.
* @param option - Pointer to an optional ::SceKernelLMOption structure.
*
* @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
*/
SceUID sceKernelLoadModuleBufferUsbWlan(SceSize bufsize, void *buf, int flags, SceKernelLMOption *option);
/**
* Start a loaded module.
*
* @param modid - The ID of the module returned from LoadModule.
* @param argsize - Length of the args.
* @param argp - A pointer to the arguments to the module.
* @param status - Returns the status of the start.
* @param option - Pointer to an optional ::SceKernelSMOption structure.
*
* @return ??? on success, otherwise one of ::PspKernelErrorCodes.
*/
int sceKernelStartModule(SceUID modid, SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
/**
* Stop a running module.
*
* @param modid - The UID of the module to stop.
* @param argsize - The length of the arguments pointed to by argp.
* @param argp - Pointer to arguments to pass to the module's module_stop() routine.
* @param status - Return value of the module's module_stop() routine.
* @param option - Pointer to an optional ::SceKernelSMOption structure.
*
* @return ??? on success, otherwise one of ::PspKernelErrorCodes.
*/
int sceKernelStopModule(SceUID modid, SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
/**
* Unload a stopped module.
*
* @param modid - The UID of the module to unload.
*
* @return ??? on success, otherwise one of ::PspKernelErrorCodes.
*/
int sceKernelUnloadModule(SceUID modid);
/**
* Stop and unload the current module.
*
* @param unknown - Unknown (I've seen 1 passed).
* @param argsize - Size (in bytes) of the arguments that will be passed to module_stop().
* @param argp - Pointer to arguments that will be passed to module_stop().
*
* @return ??? on success, otherwise one of ::PspKernelErrorCodes.
*/
int sceKernelSelfStopUnloadModule(int unknown, SceSize argsize, void *argp);
/**
* Stop and unload the current module.
*
* @param argsize - Size (in bytes) of the arguments that will be passed to module_stop().
* @param argp - Poitner to arguments that will be passed to module_stop().
* @param status - Return value from module_stop().
* @param option - Pointer to an optional ::SceKernelSMOption structure.
*
* @return ??? on success, otherwise one of ::PspKernelErrorCodes.
*/
int sceKernelStopUnloadSelfModule(SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
typedef struct SceKernelModuleInfo {
SceSize size;
char nsegment;
char reserved[3];
int segmentaddr[4];
int segmentsize[4];
unsigned int entry_addr;
unsigned int gp_value;
unsigned int text_addr;
unsigned int text_size;
unsigned int data_size;
unsigned int bss_size;
/* The following is only available in the v1.5 firmware and above,
but as sceKernelQueryModuleInfo is broken in v1.0 is doesn't matter ;) */
unsigned short attribute;
unsigned char version[2];
char name[28];
} SceKernelModuleInfo;
/**
* Query the information about a loaded module from its UID.
* @note This fails on v1.0 firmware (and even it worked has a limited structure)
* so if you want to be compatible with both 1.5 and 1.0 (and you are running in
* kernel mode) then call this function first then ::pspSdkQueryModuleInfoV1
* if it fails, or make separate v1 and v1.5+ builds.
*
* @param modid - The UID of the loaded module.
* @param info - Pointer to a ::SceKernelModuleInfo structure.
*
* @return 0 on success, otherwise one of ::PspKernelErrorCodes.
*/
int sceKernelQueryModuleInfo(SceUID modid, SceKernelModuleInfo *info);
/**
* Get a list of module IDs. NOTE: This is only available on 1.5 firmware
* and above. For V1 use ::pspSdkGetModuleIdList.
*
* @param readbuf - Buffer to store the module list.
* @param readbufsize - Number of elements in the readbuffer.
* @param idcount - Returns the number of module ids
*
* @return >= 0 on success
*/
int sceKernelGetModuleIdList(SceUID *readbuf, int readbufsize, int *idcount);
/*@}*/
#ifdef __cplusplus
}
#endif
#endif

67
src/user/pspmscm.h Normal file
View File

@@ -0,0 +1,67 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspmscm.h - Memory stick utility functions
*
* Copyright (c) 2006 Adrahil
*
* $Id: pspmscm.h 2005 2006-09-17 21:36:52Z tyranid $
*/
#ifndef PSPMSCM_H
#define PSPMSCM_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* Returns whether a memory stick is current inserted
*
* @return 1 if memory stick inserted, 0 if not or if < 0 on error
*/
static __inline__ int MScmIsMediumInserted(void)
{
int status, ret;
ret = sceIoDevctl("mscmhc0:", 0x02025806, 0, 0, &status, sizeof(status));
if(ret < 0) return ret;
if(status != 1) return 0;
return 1;
}
/* Event which has occurred in the memory stick ejection callback, passed in arg2 */
#define MS_CB_EVENT_INSERTED 1
#define MS_CB_EVENT_EJECTED 2
/**
* Registers a memory stick ejection callback
*
* @param cbid - The uid of an allocated callback
*
* @return 0 on success, < 0 on error
*/
static __inline__ int MScmRegisterMSInsertEjectCallback(SceUID cbid)
{
return sceIoDevctl("fatms0:", 0x02415821, &cbid, sizeof(cbid), 0, 0);
}
/**
* Unregister a memory stick ejection callback
*
* @param cbid - The uid of an allocated callback
*
* @return 0 on success, < 0 on error
*/
static __inline__ int MScmUnregisterMSInsertEjectCallback(SceUID cbid)
{
return sceIoDevctl("fatms0:", 0x02415822, &cbid, sizeof(cbid), 0, 0);
}
#ifdef __cplusplus
}
#endif
#endif /* PSPMSCM_H */

57
src/user/pspstdio.h Normal file
View File

@@ -0,0 +1,57 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspstdio.h - Prototypes for the sceStdio library.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspstdio.h 1095 2005-09-27 21:02:16Z jim $
*/
#ifndef __PSPSTDIO_H__
#define __PSPSTDIO_H__
#include <pspkerneltypes.h>
/** @defgroup Stdio Stdio Library
* This module contains the imports for the kernel's stdio routines.
*/
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup Stdio Stdio Library */
/*@{*/
/**
* Function to get the current standard in file no
*
* @return The stdin fileno
*/
SceUID sceKernelStdin(void);
/**
* Function to get the current standard out file no
*
* @return The stdout fileno
*/
SceUID sceKernelStdout(void);
/**
* Function to get the current standard err file no
*
* @return The stderr fileno
*/
SceUID sceKernelStderr(void);
/*@}*/
#ifdef __cplusplus
}
#endif
#endif

57
src/user/pspsuspend.h Normal file
View File

@@ -0,0 +1,57 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspsuspend.h - User interface to the PSP suspend.
*
* Copyright (c) 2006 James F
*
* $Id
*/
#ifndef __PSPSUSPEND_H__
#define __PSPSUSPEND_H__
#include <psptypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Allocate the extra 4megs of RAM
*
* @param unk - No idea as it is never used, set to anything
* @param ptr - Pointer to a pointer to hold the address of the memory
* @param size - Pointer to an int which will hold the size of the memory
*
* @return 0 on success
*/
int sceKernelVolatileMemLock(int unk, void **ptr, int *size);
/**
* Try and allocate the extra 4megs of RAM, will return an error if
* something has already allocated it
*
* @param unk - No idea as it is never used, set to anything
* @param ptr - Pointer to a pointer to hold the address of the memory
* @param size - Pointer to an int which will hold the size of the memory
*
* @return 0 on success
*/
int sceKernelVolatileMemTryLock(int unk, void **ptr, int *size);
/**
* Deallocate the extra 4 megs of RAM
*
* @param unk - Set to 0, otherwise it fails in 3.52+, possibly earlier
* @return 0 on success
*/
int sceKernelVolatileMemUnlock(int unk);
#ifdef __cplusplus
}
#endif
#endif

124
src/user/pspsysmem.h Normal file
View File

@@ -0,0 +1,124 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspsysmem.h - Interface to the system memory manager.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
*
* $Id: pspsysmem.h 2433 2008-10-15 10:00:27Z iwn $
*/
/* Note: Some of the structures, types, and definitions in this file were
extrapolated from symbolic debugging information found in the Japanese
version of Puzzle Bobble. */
#ifndef PSPSYSMEM_H
#define PSPSYSMEM_H
#include <pspkerneltypes.h>
/** @defgroup SysMem System Memory Manager
* This module contains routines to manage heaps of memory.
*/
/** @addtogroup SysMem System Memory Manager */
/*@{*/
#ifdef __cplusplus
extern "C" {
#endif
/** Specifies the type of allocation used for memory blocks. */
enum PspSysMemBlockTypes {
/** Allocate from the lowest available address. */
PSP_SMEM_Low = 0,
/** Allocate from the highest available address. */
PSP_SMEM_High,
/** Allocate from the specified address. */
PSP_SMEM_Addr
};
typedef int SceKernelSysMemAlloc_t;
/**
* Allocate a memory block from a memory partition.
*
* @param partitionid - The UID of the partition to allocate from.
* @param name - Name assigned to the new block.
* @param type - Specifies how the block is allocated within the partition. One of ::PspSysMemBlockTypes.
* @param size - Size of the memory block, in bytes.
* @param addr - If type is PSP_SMEM_Addr, then addr specifies the lowest address allocate the block from.
*
* @return The UID of the new block, or if less than 0 an error.
*/
SceUID sceKernelAllocPartitionMemory(SceUID partitionid, const char *name, int type, SceSize size, void *addr);
/**
* Free a memory block allocated with ::sceKernelAllocPartitionMemory.
*
* @param blockid - UID of the block to free.
*
* @return ? on success, less than 0 on error.
*/
int sceKernelFreePartitionMemory(SceUID blockid);
/**
* Get the address of a memory block.
*
* @param blockid - UID of the memory block.
*
* @return The lowest address belonging to the memory block.
*/
void * sceKernelGetBlockHeadAddr(SceUID blockid);
/**
* Get the total amount of free memory.
*
* @return The total amount of free memory, in bytes.
*/
SceSize sceKernelTotalFreeMemSize(void);
/**
* Get the size of the largest free memory block.
*
* @return The size of the largest free memory block, in bytes.
*/
SceSize sceKernelMaxFreeMemSize(void);
/**
* Get the firmware version.
*
* @return The firmware version.
* 0x01000300 on v1.00 unit,
* 0x01050001 on v1.50 unit,
* 0x01050100 on v1.51 unit,
* 0x01050200 on v1.52 unit,
* 0x02000010 on v2.00/v2.01 unit,
* 0x02050010 on v2.50 unit,
* 0x02060010 on v2.60 unit,
* 0x02070010 on v2.70 unit,
* 0x02070110 on v2.71 unit.
*/
int sceKernelDevkitVersion(void);
#if _PSP_FW_VERSION >= 150
/**
* Kernel printf function.
*
* @param format - The format string.
* @param ... - Arguments for the format string.
*/
void sceKernelPrintf(const char *format, ...) __attribute__((format(printf, 1, 2)));
#endif
#ifdef __cplusplus
}
#endif
/*@}*/
#endif /* PSPSYSMEM_H */

1768
src/user/pspthreadman.h Normal file

File diff suppressed because it is too large Load Diff

31
src/user/pspuser.h Normal file
View File

@@ -0,0 +1,31 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspuser.h - Main include file for the user interface to the PSP kernel.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: pspuser.h 1207 2005-10-23 05:50:29Z mrbrown $
*/
#ifndef PSPUSER_H
#define PSPUSER_H
#include <psptypes.h>
#include <pspkerneltypes.h>
#include <pspiofilemgr.h>
#include <psploadexec.h>
#include <pspmoduleinfo.h>
#include <pspmodulemgr.h>
#include <pspsysmem.h>
#include <pspthreadman.h>
#include <psputils.h>
#include <pspkerror.h>
#include <pspstdio.h>
#include <pspintrman.h>
#endif /* PSPUSER_H */

230
src/user/psputils.h Normal file
View File

@@ -0,0 +1,230 @@
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* psputils.h - Prototypes for the sceUtils library.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
*
* $Id: psputils.h 1884 2006-04-30 08:55:54Z chip $
*/
#ifndef __UTILS_H__
#define __UTILS_H__
#include <psptypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Some of the structures and definitions in this file were extracted from the japanese
puzzle bobble main executable */
/** @defgroup Utils Utils Library */
/** @addtogroup Utils */
/*@{*/
#include <sys/time.h>
/**
* Get the time in seconds since the epoc (1st Jan 1970)
*
*/
time_t sceKernelLibcTime(time_t *t);
/**
* Get the processor clock used since the start of the process
*/
clock_t sceKernelLibcClock(void);
/**
* Get the current time of time and time zone information
*/
int sceKernelLibcGettimeofday(struct timeval *tp, struct timezone *tzp);
/**
* Write back the data cache to memory
*/
void sceKernelDcacheWritebackAll(void);
/**
* Write back and invalidate the data cache
*/
void sceKernelDcacheWritebackInvalidateAll(void);
/**
* Write back a range of addresses from data cache to memory
*/
void sceKernelDcacheWritebackRange(const void *p, unsigned int size);
/**
* Write back and invalidate a range of addresses in data cache
*/
void sceKernelDcacheWritebackInvalidateRange(const void *p, unsigned int size);
/**
* Invalidate a range of addresses in data cache
*/
void sceKernelDcacheInvalidateRange(const void *p, unsigned int size);
/** Structure for holding a mersenne twister context */
typedef struct _SceKernelUtilsMt19937Context {
unsigned int count;
unsigned int state[624];
} SceKernelUtilsMt19937Context;
/**
* Function to initialise a mersenne twister context.
*
* @param ctx - Pointer to a context
* @param seed - A seed for the random function.
*
* @par Example:
* @code
* SceKernelUtilsMt19937Context ctx;
* sceKernelUtilsMt19937Init(&ctx, time(NULL));
* u23 rand_val = sceKernelUtilsMt19937UInt(&ctx);
* @endcode
*
* @return < 0 on error.
*/
int sceKernelUtilsMt19937Init(SceKernelUtilsMt19937Context *ctx, u32 seed);
/**
* Function to return a new psuedo random number.
*
* @param ctx - Pointer to a pre-initialised context.
* @return A pseudo random number (between 0 and MAX_INT).
*/
u32 sceKernelUtilsMt19937UInt(SceKernelUtilsMt19937Context *ctx);
/** Structure to hold the MD5 context */
typedef struct _SceKernelUtilsMd5Context {
unsigned int h[4];
unsigned int pad;
SceUShort16 usRemains;
SceUShort16 usComputed;
SceULong64 ullTotalLen;
unsigned char buf[64];
} SceKernelUtilsMd5Context;
/**
* Function to perform an MD5 digest of a data block.
*
* @param data - Pointer to a data block to make a digest of.
* @param size - Size of the data block.
* @param digest - Pointer to a 16byte buffer to store the resulting digest
*
* @return < 0 on error.
*/
int sceKernelUtilsMd5Digest(u8 *data, u32 size, u8 *digest);
/**
* Function to initialise a MD5 digest context
*
* @param ctx - A context block to initialise
*
* @return < 0 on error.
* @par Example:
* @code
* SceKernelUtilsMd5Context ctx;
* u8 digest[16];
* sceKernelUtilsMd5BlockInit(&ctx);
* sceKernelUtilsMd5BlockUpdate(&ctx, (u8*) "Hello", 5);
* sceKernelUtilsMd5BlockResult(&ctx, digest);
* @endcode
*/
int sceKernelUtilsMd5BlockInit(SceKernelUtilsMd5Context *ctx);
/**
* Function to update the MD5 digest with a block of data.
*
* @param ctx - A filled in context block.
* @param data - The data block to hash.
* @param size - The size of the data to hash
*
* @return < 0 on error.
*/
int sceKernelUtilsMd5BlockUpdate(SceKernelUtilsMd5Context *ctx, u8 *data, u32 size);
/**
* Function to get the digest result of the MD5 hash.
*
* @param ctx - A filled in context block.
* @param digest - A 16 byte array to hold the digest.
*
* @return < 0 on error.
*/
int sceKernelUtilsMd5BlockResult(SceKernelUtilsMd5Context *ctx, u8 *digest);
/** Type to hold a sha1 context */
typedef struct _SceKernelUtilsSha1Context {
unsigned int h[5];
SceUShort16 usRemains;
SceUShort16 usComputed;
SceULong64 ullTotalLen;
unsigned char buf[64];
} SceKernelUtilsSha1Context;
/**
* Function to SHA1 hash a data block.
*
* @param data - The data to hash.
* @param size - The size of the data.
* @param digest - Pointer to a 20 byte array for storing the digest
*
* @return < 0 on error.
*/
int sceKernelUtilsSha1Digest(u8 *data, u32 size, u8 *digest);
/**
* Function to initialise a context for SHA1 hashing.
*
* @param ctx - Pointer to a context.
*
* @return < 0 on error.
*
* @par Example:
* @code
* SceKernelUtilsSha1Context ctx;
* u8 digest[20];
* sceKernelUtilsSha1BlockInit(&ctx);
* sceKernelUtilsSha1BlockUpdate(&ctx, (u8*) "Hello", 5);
* sceKernelUtilsSha1BlockResult(&ctx, digest);
* @endcode
*/
int sceKernelUtilsSha1BlockInit(SceKernelUtilsSha1Context *ctx);
/**
* Function to update the current hash.
*
* @param ctx - Pointer to a prefilled context.
* @param data - The data block to hash.
* @param size - The size of the data block
*
* @return < 0 on error.
*/
int sceKernelUtilsSha1BlockUpdate(SceKernelUtilsSha1Context *ctx, u8 *data, u32 size);
/**
* Function to get the result of the SHA1 hash.
*
* @param ctx - Pointer to a prefilled context.
* @param digest - A pointer to a 20 byte array to contain the digest.
*
* @return < 0 on error.
*/
int sceKernelUtilsSha1BlockResult(SceKernelUtilsSha1Context *ctx, u8 *digest);
/*@}*/
#ifdef __cplusplus
}
#endif
#endif

52
src/user/sceImpose.S Normal file
View File

@@ -0,0 +1,52 @@
.set noreorder
#include "pspimport.s"
#ifdef F_sceImpose_0000
IMPORT_START "sceImpose",0x40010011
#endif
#ifdef F_sceImpose_0001
IMPORT_FUNC "sceImpose",0x0F341BE4,sceImposeGetHomePopup
#endif
#ifdef F_sceImpose_0002
IMPORT_FUNC "sceImpose",0x24FD7BCF,sceImposeGetLanguageMode
#endif
#ifdef F_sceImpose_0003
IMPORT_FUNC "sceImpose",0x36AA6E91,sceImposeSetLanguageMode
#endif
#ifdef F_sceImpose_0004
IMPORT_FUNC "sceImpose",0x381BD9E7,sceImposeHomeButton
#endif
#ifdef F_sceImpose_0005
IMPORT_FUNC "sceImpose",0x5595A71A,sceImposeSetHomePopup
#endif
#ifdef F_sceImpose_0006
IMPORT_FUNC "sceImpose",0x72189C48,sceImposeSetUMDPopup
#endif
#ifdef F_sceImpose_0007
IMPORT_FUNC "sceImpose",0x8C943191,sceImposeBatteryIconStatus
#endif
#ifdef F_sceImpose_0008
IMPORT_FUNC "sceImpose",0x8F6E3518,sceImposeGetBacklightOffTime
#endif
#ifdef F_sceImpose_0009
IMPORT_FUNC "sceImpose",0x967F6D4A,sceImposeSetBacklightOffTime
#endif
#ifdef F_sceImpose_0010
IMPORT_FUNC "sceImpose",0x9BA61B49,sceImpose_9BA61B49
#endif
#ifdef F_sceImpose_0011
IMPORT_FUNC "sceImpose",0xA9884B00,sceImpose_A9884B00
#endif
#ifdef F_sceImpose_0012
IMPORT_FUNC "sceImpose",0xBB3F5DEC,sceImpose_BB3F5DEC
#endif
#ifdef F_sceImpose_0013
IMPORT_FUNC "sceImpose",0xE0887BC8,sceImposeGetUMDPopup
#endif
#ifdef F_sceImpose_0014
IMPORT_FUNC "sceImpose",0xFCD44963,sceImpose_FCD44963
#endif
#ifdef F_sceImpose_0015
IMPORT_FUNC "sceImpose",0xFF1A2F07,sceImpose_FF1A2F07
#endif

View File

@@ -0,0 +1,25 @@
.set noreorder
#include "pspimport.s"
#ifdef F_sceSuspendForUser_0000
IMPORT_START "sceSuspendForUser",0x40000000
#endif
#ifdef F_sceSuspendForUser_0001
IMPORT_FUNC "sceSuspendForUser",0xEADB1BD7,sceKernelPowerLock
#endif
#ifdef F_sceSuspendForUser_0002
IMPORT_FUNC "sceSuspendForUser",0x3AEE7261,sceKernelPowerUnlock
#endif
#ifdef F_sceSuspendForUser_0003
IMPORT_FUNC "sceSuspendForUser",0x090CCB3F,sceKernelPowerTick
#endif
#ifdef F_sceSuspendForUser_0004
IMPORT_FUNC "sceSuspendForUser",0x3E0271D3,sceKernelVolatileMemLock
#endif
#ifdef F_sceSuspendForUser_0005
IMPORT_FUNC "sceSuspendForUser",0xA14F40B2,sceKernelVolatileMemTryLock
#endif
#ifdef F_sceSuspendForUser_0006
IMPORT_FUNC "sceSuspendForUser",0xA569E425,sceKernelVolatileMemUnlock
#endif