Example #1
0
/*
 * Library initialization
 */
EXPORT void _InitLibtk( void )
{
	INT	rng;

	if ( libtk_init_done ) {
		return;  /* Initialized */
	}

	/* Kernel utility initialization */
	KnlInit();

	/* Lowest protection level where system calls can be issued */
	if ( tk_get_cfn((UB*)"TSVCLimit", &rng, 1) < 1 ) {
		rng = 2;
	}
	rng <<= 8;

	/* Create exclusive control lock for library sharing */
	_init_liblock();

	/* malloc initialization */
	_tkm_init((UINT)rng, &_Kmacb);			/* Kmalloc init */
	_tkm_init((UINT)rng|TA_NORESIDENT, &_Vmacb);	/* Vmalloc init */
	_tkm_init(TA_RNG3|TA_NORESIDENT, &_Smacb);	/* Smalloc init */

	libtk_init_done = TRUE;  /* Initialization complete */
}
Example #2
0
/*
 * Library initialization
 */
EXPORT void _InitLibtk( void )
{
	INT	rng;

	if ( libtk_init_done ) {
		return;  /* Initialized */
	}
	/* Kernel utility initialization */
	KnlInit();

#ifdef T2EX
	/* T2EX API protected level */
	if ( tk_get_cfn("TSVCLimit", &t2ex_call_limit, 1) < 1 ) {
		t2ex_call_limit = 2;
	}

	/* Kmalloc/Vmalloc memory protection level */
	if ( tk_get_cfn("TKmallocLvl", &rng, 1) < 1 ) {
		rng = t2ex_call_limit;
	}
#else
	/* Lowest protection level where system calls can be issued */
	if ( tk_get_cfn("TSVCLimit", &rng, 1) < 1 ) {
		rng = 2;
	}
#endif
	rng <<= 8;

	/* Create exclusive control lock for library sharing */
	_init_liblock();
#ifdef T2EX_MM
	CreateULock(&_SmacbLock, "ultk");
#endif

	/* malloc initialization */
	_tkm_init((UINT)rng, &_Kmacb);			/* Kmalloc init */
	_tkm_init((UINT)rng|TA_NORESIDENT, &_Vmacb);	/* Vmalloc init */
	_tkm_init(TA_RNG3|TA_NORESIDENT, &_Smacb);	/* Smalloc init */

	libtk_init_done = TRUE;  /* Initialization complete */
}