xenomai 3.0.2 -任务切换《xnarch_switch_to》
2016-09-08 17:54
746 查看
1.xnarch_switch_to
void xnarch_switch_to(struct xnthread *out, struct xnthread *in) { struct xnarchtcb *out_tcb = &out->tcb, *in_tcb = &in->tcb; struct mm_struct *prev_mm, *next_mm; struct task_struct *next; next = in_tcb->core.host_task; prev_mm = out_tcb->core.active_mm; next_mm = in_tcb->core.mm; //首先,检查是否为内核线程还是用户进程 if (next_mm == NULL) { //kernel thread,copy mm from previous process. in_tcb->core.active_mm = prev_mm; enter_lazy_tlb(prev_mm, next); } else { ipipe_switch_mm_head(prev_mm, next_mm, next); /* * We might be switching back to the root thread, * which we preempted earlier, shortly after "current" * dropped its mm context in the do_exit() path * (next->mm == NULL). In that particular case, the * kernel expects a lazy TLB state for leaving the mm. */ if (next->mm == NULL) enter_lazy_tlb(prev_mm, next); } __asm_thread_s.witch(out_tcb->core.tip, in_tcb->core.tip); }
相关文章推荐
- How to create and compile a Xenomai helloworld program
- xenomai与普通linux进程之间通信——XDDP(nRT->RT)
- 构建Xenomai的Linux实时系统
- MINI2440移植xenomai记录
- Xenomai安装
- Life With Adeos
- Life with Adeos-xenomai(翻译官方文档)
- xenomai-GNU/Linux上的RTOS模拟架构实现
- Xenomai安装
- Xenomai安装方法
- 安装xenomai的记实
- xenomai安装
- Xneomai 简介
- Xenomai 2.6.5 on Ubuntu 14.04
- xenomai-3.0 初始化
- xenomai-ipipe机制简述
- xenomai 实时linux驱动编写实例
- xenomai 在ubuntu上的安装测试
- Xenomai3.0.5+Linux4.9.24安装及配置
- Beaglebone Black开发环境搭建(uboot、kernel、文件系统、Xenomai)