μC/OS-II的移植需要满足以下要求:处理器的C编译器可以产生可重入代码;可以使用C调用进入和退出Critical Code(临界区代码);处理器必须支持硬件中断,并且需要一个定时中断源;处理器需要能够容纳一定数据的硬件堆栈;处理器需要有能够在CPU寄存器与内存...
基于76个网页-相关网页
讨论了临界区代码保护、任务切换以及2407的软堆栈等问题。
The problem of the protection for critical code, task switch and the software stack of the 2407 are discussed.
锁保护的临界区:经lock - UNLOCK对不能实现完全的内存屏障的功能,但是,它们也的确会影响内存访问顺序,参考下面的示例代码。
LOCK-Based Critical Sections: Although a LOCK-UNLOCK pair does not act as a full memory barrier, these operations do affect memory ordering. Consider the following code.
临界区用来确保代码的某些部分同一时间只能由一个线程执行。
A critical section is an object used to make sure, that some part of the code is executed only by one thread at a time.
应用推荐