Update README.md for camera example
[ps4-sdk.git] / source / kernel.c
blob13107447d28bb50b66d041ccf2f322648efd841b
1 #include "module.h"
2 #include "syscall.h"
4 #include "kernel.h"
6 int (*sceKernelAllocateDirectMemory)(off_t searchStart, off_t searchEnd, size_t length, size_t alignment, int type, off_t *physicalAddressDestination);
7 int (*sceKernelMapDirectMemory)(void **addr, size_t length, int protection, int flags, off_t start, size_t alignment);
9 unsigned int (*sceKernelSleep)(unsigned int seconds);
10 int (*sceKernelUsleep)(unsigned int microseconds);
11 int (*sceKernelGettimeofday)(SceKernelTimeval *tp);
12 uint64_t (*sceKernelGetProcessTime)(void);
13 int (*sceKernelGetCurrentCpu)(void);
15 int kill(int pid, int signum) {
16 return syscall(37, pid, signum);
19 void initKernel(void) {
20 int libkernel;
21 loadModule("libkernel.sprx", &libkernel);
23 RESOLVE(libkernel, sceKernelAllocateDirectMemory);
24 RESOLVE(libkernel, sceKernelMapDirectMemory);
26 RESOLVE(libkernel, sceKernelSleep);
27 RESOLVE(libkernel, sceKernelUsleep);
28 RESOLVE(libkernel, sceKernelGettimeofday);
29 RESOLVE(libkernel, sceKernelGetProcessTime);
30 RESOLVE(libkernel, sceKernelGetCurrentCpu);