Example #1
0
/* get the current chaining state */
PTErr_t
	getChainState (chainState_p	FAR * cS)
{

	*cS = (chainState_p) KpThreadMemFind (&theRootID, KPTHREADMEM);
	if (*cS == NULL) {
		*cS = KpThreadMemCreate (&theRootID, KPTHREADMEM, sizeof(chainState_t));
		if (*cS == NULL) {
			return KCP_NO_THREAD_GLOBAL_MEM;
		}

		KpMemSet (*cS, 0, sizeof (chainState_t));
	}

	return KCP_SUCCESS;
}
Example #2
0
/* set up the globals for each application */
KpInt32_t
	KCPappSetup (KpGenericPtr_t theIGPtr)
{
processGlobals_p	pGP;

	if (theIGPtr) {}

	/* set up the process globals */
	pGP = KpThreadMemCreate (&theRootID, KPPROCMEM, sizeof(processGlobals_t));
	if (pGP == NULL) {
		return (KCMS_FAIL);
	}	

	KpMemSet (pGP, 0, sizeof (processGlobals_t));	/* set them all to 0 */

	unloadProcessGlobals ();	/* Unlock this app's Globals */

	return KCMS_SUCCESS;
}