pspsdk-1.0+beta2
pspthreadman_kernel.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * pspthreadman_kernel.h - Interface to the kernel side of threadman
7  *
8  * Copyright (c) 2005 James F.
9  *
10  * $Id: pspthreadman_kernel.h 2131 2007-01-15 21:42:22Z tyranid $
11  */
12 
13 #ifndef PSPTHREADMANKERNEL_H
14 #define PSPTHREADMANKERNEL_H
15 
16 #include <pspkerneltypes.h>
17 #include <pspthreadman.h>
18 
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
36 
43 
49 int sceKernelGetUserLevel(void);
50 
56 unsigned int sceKernelGetSyscallRA(void);
57 
66 
73 
83 int sceKernelExtendKernelStack(int type, void (*cb)(void*), void *arg);
84 
90 unsigned int sceKernelGetSystemStatusFlag(void);
91 
101 int sceKernelAllocateKTLS(int id, int (*cb)(unsigned int *size, void *arg), void *arg);
102 
110 int sceKernelFreeKTLS(int id);
111 
119 void *sceKernelGetKTLS(int id);
120 
130 void *sceKernelGetThreadKTLS(int id, SceUID thid, int mode);
131 
135  unsigned int type;
136  unsigned int gpr[31];
137  unsigned int fpr[32];
138  unsigned int fc31;
139  unsigned int hi;
140  unsigned int lo;
141  unsigned int SR;
142  unsigned int EPC;
143  unsigned int field_114;
144  unsigned int field_118;
145 };
146 
148 {
149  unsigned int status;
150  unsigned int epc;
151  unsigned int sp;
152  unsigned int ra;
153  unsigned int k1;
154  unsigned int unk[3];
155 };
156 
160 typedef struct SceKernelThreadKInfo {
164  char name[32];
168  int status;
172  void * stack;
176  void * kstack;
178  void * kstackSize;
180  void * gpReg;
184  void * argp;
190  int waitType;
197 #if _PSP_FW_VERSION >= 200
198  SceUInt unk3; /* Unknown extra field on later firmwares */
199 #endif
200 
209  float * vfpuContext;
211  void * retAddr;
217 
227 
228 #ifdef __cplusplus
229 }
230 #endif
231 
234 #endif /* PSPTHREADMANKERNEL_H */