summaryrefslogtreecommitdiff
path: root/include/user/kernel/processmgr.h
blob: cef7251b261702884e4ff29e562cc335f4c420a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef _PSP2_KERNEL_PROCESSMGR_H_
#define _PSP2_KERNEL_PROCESSMGR_H_

#include <psp2/kernel/threadmgr.h>
#include <psp2/types.h>

#ifdef __cplusplus
extern "C" {
#endif

enum {
	SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_HIGH	= 32,
	SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_DEFAULT	= 96,
	SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_LOW		= 159
};

enum {
	SCE_KERNEL_PROCESS_PRIORITY_USER_HIGH		= 64,
	SCE_KERNEL_PROCESS_PRIORITY_USER_DEFAULT	= 96,
	SCE_KERNEL_PROCESS_PRIORITY_USER_LOW		= 127
};

enum {
	/** Cancel all timers */
	SCE_KERNEL_POWER_TICK_DEFAULT				= 0,
	/** Cancel automatic suspension timer */
	SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND	= 1,
	/** Cancel OLED-off timer */
	SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF		= 4,
	/** Cancel OLED dimming timer */
	SCE_KERNEL_POWER_TICK_DISABLE_OLED_DIMMING	= 6
};

/***
 * Exit current Process with specified return code
 *
 * @param[in] res - Exit code to return
 *
 * @return 0 on success, < 0 on error.
 * @note - If NULL is provided as FrameBuf pointer, output is blacked out.
*/
int sceKernelExitProcess(int res);

/***
 * Cancel specified idle timers to prevent entering in power save processing.
 *
 * @param[in] type - One of ::KernelPowerTickType
 *
 * @return 0
*/
int sceKernelPowerTick(int type);

/***
 * Get the process time of the current process.
 *
 * @param[out] type - Pointer to a ::SceKernelSysClock structure which will receive the process time.
 *
 * @return 0 on success, < 0 on error.
*/
int sceKernelGetProcessTime(SceKernelSysClock *pSysClock);

/***
 * Get the lower 32 bits part of process time of the current process.
 *
 * @return process time of the current process
*/
SceUInt32 sceKernelGetProcessTimeLow(void);

/***
 * Get the process time of the current process.
 *
 * @return process time of the current process
*/
SceUInt64 sceKernelGetProcessTimeWide(void);

/***
 * Get the process ID of the current process.
 *
 * @return process ID of the current process
*/
SceUID sceKernelGetProcessId(void);

#ifdef __cplusplus
}
#endif

#endif /* _PSP2_KERNEL_PROCESSMGR_H_ */