Files

79 lines
2.5 KiB
Odin
Raw Permalink Normal View History

2024-05-11 23:24:13 +02:00
package kernel
import "core:c"
import sce "../common"
foreign import sysmem "system:SceSysmem_stub"
foreign sysmem {
2024-05-13 16:04:23 +02:00
sceKernelGetCpuId :: proc() -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Allocates a new memory block
*
* @param[in] name - Name for the memory block
* @param[in] type - Type of the memory to allocate. Use `SCE_KERNEL_MEMBLOCK_TYPE_USER_*`.
* @param[in] size - Size of the memory to allocate
* @param[in] opt - Memory block options?
*
* @return SceUID of the memory block on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceKernelAllocMemBlock :: proc(name: cstring, type: SceKernelMemBlockType, size: sce.Size, opt: ^SceKernelAllocMemBlockOpt) -> sce.UID ---
2024-05-11 23:24:13 +02:00
/**
* Frees new memory block
*
* @param[in] uid - SceUID of the memory block to free
*
* @return 0 on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceKernelFreeMemBlock :: proc(uid: sce.UID) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Gets the base address of a memory block
*
* @param[in] uid - SceUID of the memory block to free
* @param[out] base - Base address of the memory block identified by SceUID
*
* @return 0 on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceKernelGetMemBlockBase :: proc(uid: sce.UID, base: ^rawptr) -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceKernelFindMemBlockByAddr :: proc(addr: rawptr, size: sce.Size) -> sce.UID ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceKernelGetMemBlockInfoByAddr :: proc(base: rawptr, info: ^SceKernelMemBlockInfo) -> c.int ---
sceKernelGetMemBlockInfoByRange :: proc(base: rawptr, size: sce.Size, info: ^SceKernelMemBlockInfo) -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceKernelAllocMemBlockForVM :: proc(name: cstring, size: sce.Size) -> sce.UID ---
sceKernelSyncVMDomain :: proc(uid: sce.UID, data: rawptr, size: sce.Size) -> c.int ---
sceKernelOpenVMDomain :: proc() -> c.int ---
sceKernelCloseVMDomain :: proc() -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceKernelOpenMemBlock :: proc(name: cstring, flags: c.int) -> c.int ---
sceKernelCloseMemBlock :: proc(uid: sce.UID) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Get the model number of the device
*
* @return A value from SCE_KERNEL_MODEL
*/
2024-05-13 16:04:23 +02:00
sceKernelGetModelForCDialog :: proc() -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Get the model number of the device
*
* @return A value from SCE_KERNEL_MODEL
*/
2024-05-13 16:04:23 +02:00
sceKernelGetModel :: proc() -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Get free memory size in bytes
*
* @param[out] info - Returned free memory size for different kind of memory block types
* @return 0 on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceKernelGetFreeMemorySize :: proc(info: ^SceKernelFreeMemorySizeInfo) -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceKernelIsPSVitaTV :: proc() -> c.int ---
2024-05-11 23:24:13 +02:00
}