惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
O
OpenAI News
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
C
Check Point Blog
Vercel News
Vercel News
小众软件
小众软件
The Register - Security
The Register - Security
N
News and Events Feed by Topic
腾讯CDC
S
SegmentFault 最新的问题
H
Heimdal Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
Secure Thoughts
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Schneier on Security
Schneier on Security
G
GRAHAM CLULEY
云风的 BLOG
云风的 BLOG
S
Schneier on Security
J
Java Code Geeks
L
LINUX DO - 最新话题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Privacy & Cybersecurity Law Blog
Forbes - Security
Forbes - Security
Cisco Talos Blog
Cisco Talos Blog
L
LINUX DO - 热门话题
Scott Helme
Scott Helme
爱范儿
爱范儿
GbyAI
GbyAI
Simon Willison's Weblog
Simon Willison's Weblog
L
Lohrmann on Cybersecurity
Cloudbric
Cloudbric
W
WeLiveSecurity
The Hacker News
The Hacker News
V
V2EX
Last Week in AI
Last Week in AI
Hacker News: Ask HN
Hacker News: Ask HN
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
Cyberwarzone
Cyberwarzone
Google Online Security Blog
Google Online Security Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
S
Security @ Cisco Blogs
P
Proofpoint News Feed
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
U
Unit 42
Webroot Blog
Webroot Blog
Martin Fowler
Martin Fowler
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed

博客园 - Jeff

4个月 C++ 有限状态机 POJ1019 POJ1035 POJ1007 POJ1005 ONLINE_JUDGE Linux shell定时器 怪异的grep结果 URL2FILE C primer笔记 Vxworks增加system call C语言常用宏定义技巧 分苹果 Socket 为什么选择SMP而不是AMP RTP memory in Vxworks Windriver的项目类型 Symmetric multiprocessing (SMP)
RTP affinity
Jeff · 2011-08-24 · via 博客园 - Jeff

2011-08-24 12:59  Jeff  阅读(664)  评论()    收藏  举报

以下代码证明: RTP affinity inherits from the task that created it. 创建一个RTP,代码:

 
#include "taskLib.h"
int main()
{
   while(1){
	   taskDelay(1);
   }
	taskSuspend(taskIdSelf());
}

创建一个VIP,在usrAppInit.c中调用myroot(). myroot函数定义在文件taskcreate.c中,具体代码如下方法:

 
#include 
#if defined(PRJ_BUILD)
#include "prjParams.h"
#endif /* defined PRJ_BUILD */
#include 
#include 
#include "taskLib.h"
int task_parent;
RTP_ID rtpdemoid;
int entrycl();
char *argv1;
int result;
void myroot (void)
    {
	char * argv1[] = {"/romfs/demo_rtp.vxe","0",NULL};
	 cpuset_t affinity;
	 printf("1");
	 task_parent = taskCreate("jeffchen",60,0,200,&entrycl,0,0,
         0,0,0,0,0,0,0,0);
	 printf("2");
	 if (task_parent == NULL)
	 return (ERROR);	 		 	
	 CPUSET_ZERO (affinity);
	 CPUSET_SET (affinity, 2);	   
	 printf("8");
	 if (taskCpuAffinitySet (task_parent, affinity) == ERROR)
	 {
	 printf("30");
	 return (ERROR);
	 }
	 printf("4");
	 result =taskActivate (task_parent);
	 printf("%d", result);
	 printf("5");
    }

int entrycl(){
	
    char * argv1[] = {"/romfs/demo_rtp.vxe","0",NULL};
    printf("6");
    if((rtpdemoid=rtpSpawn(argv1[0], argv1, NULL, 96, 0x5000, 0, 0))==
 NULL){
	};
	
	printf("7");
	while(1){
		taskDelay(100);
	}
return 0;
}