Пример #1
0
/* Create a new thread */
x86Thread_t *_ThreadInit(Addr_t EntryPoint)
{
	x86Thread_t *t;
	Cpu_t Cpu;

	/* Get cpu */
	Cpu = ApicGetCpu();

	/* Allocate a new thread structure */
	t = (x86Thread_t*)kmalloc(sizeof(x86Thread_t));

	/* Setup */
	t->Context = ContextCreate((Addr_t)EntryPoint);
	t->UserContext = NULL;
	t->Flags = 0;

	/* FPU */
	t->FpuBuffer = (Addr_t*)kmalloc_a(0x1000);

	/* Memset the buffer */
	memset(t->FpuBuffer, 0, 0x1000);

	/* Done */
	return t;
}
Пример #2
0
void ContextInit()
{
  Ts  ts;
  ContextCurrentDc = NULL;	/* todoTHREAD */
  ContextNextTopId = 1L;
  TsSetNow(&ts);
  ContextRoot = NULL;
  ContextRoot = ContextCreate(&ts, 0, NULL, NULL);
}
Пример #3
0
extern "C" jobject Java_com_rtmpd_CommandsInterface_ContextCreate(
		JNIEnv* pEnv, jobject thiz) {
	Variant result = ContextCreate();
	return VariantToJObject(result, pEnv);
}