⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setspc.c

📁 日本著名的的嵌入式实时操作系统T-Kernel的源码及用户手册。
💻 C
字号:
/* *---------------------------------------------------------------------- *    T-Kernel * *    Copyright (C) 2004 by Ken Sakamura. All rights reserved. *    T-Kernel is distributed under the T-License. *---------------------------------------------------------------------- * *    Version:   1.01.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2004/6/28. * *---------------------------------------------------------------------- *//* *	@(#)setspc.c (libtk/VR4131) * *	Address space control  */#include <basic.h>#include <tk/tkernel.h>#include <tk/sysdef.h>#include "getsvcenv.h"/* * Set task address space  */EXPORT ER SetTaskSpace( ID taskid ){	UW	taskmode;	ER	er;	if ( taskid == TSK_SELF ) {		/* Set current CPL in PPL */		taskmode = getsvcenv();		SCInfo.taskmode ^= (taskmode ^ (taskmode << 16)) & TMF_PPL(3);	} else {		T_EIT		r_eit;		T_CREGS		r_cregs;		T_TSKSPC	tskspc;		/* Get logical space/taskmode for taskid tasks */		er = tk_get_reg(taskid, NULL, &r_eit, &r_cregs);		if ( er < E_OK ) goto err_ret;		/* Change to logical space for nominated tasks */		tskspc.uatb = r_cregs.uatb;		tskspc.lsid = r_cregs.lsid;		er = tk_set_tsp(TSK_SELF, &tskspc);		if ( er < E_OK ) goto err_ret;		/* Change to PPL for nominated tasks */		taskmode = getsvcenv();		SCInfo.taskmode ^= (taskmode ^ r_eit.taskmode) & TMF_PPL(3);	}	return E_OK;err_ret:	return er;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -