RTEMS 移植指南

RTEMS 移植指南

porting.RTEMS移植指南.双语.V20131224.pdf
RTEMS 的porting文档的原创翻译。

目录

前言 11
1  开发工具 13
2 源代码组织 15
2.1  简介 15
3  CPU型号变种 17
3.1  RTEMS可移植性概述 17
3.1.1  处理器家族 17
3.1.2  主板 20
3.1.3  应用程序 20
3.2  编码问题 21
4  CPU初始化 23
4.1  简介 23
4.2  初始化CPU 23
5  中断 25
5.1  简介 25
5.2  中断级 25
5.2.1  中断级掩码 25
5.2.2  获取当前中断级 26
5.2.3  设置中断级 26
5.2.4  禁用中断 27
5.2.5  启用中断 28
5.2.6  临时中断 28
5.3  中断堆栈管理 29
5.3.1  硬件或软件管理的中断堆栈 29
5.3.2  中断堆栈内存的分配 30
5.3.3  安装中断堆栈 31
5.4  ISR安装 32
5.4.1  安装原始的中断处理程序 32
5.4.2  中断上下文 32
5.4.3  向量的最大数量 32
5.4.4 安装RTEMS中断处理程序 33
5.5  中断处理 34
5.5.1  中断帧数据结构 34
5.5.2  中断分发 34
5.5.3  使用帧指针调用的ISR 37
5.5.4  指向_Thread_Dispatch例程的指针 37
6  任务上下文管理 39
6.1  简介 39
6.2  任务栈 39
6.2.1  栈生长的方向 39
6.2.2  最小任务栈大小 39
6.2.3  栈对齐要求 40
6.3  任务上下文 41
6.3.1  基本上下文数据结构 42
6.3.2  初始化上下文 43
6.3.3  执行上下文切换 44
6.3.4  恢复上下文 46
6.3.5  重启当前执行的任务 46
6.4  浮点上下文 47
6.4.1  CPU_HAS_FPU宏定义 47
6.4.2  CPU_ALL_TASKS_ARE_FP宏设置 49
6.4.3  CPU_USE_DEFERRED_FP_SWITCH宏设置 50
6.4.4  浮点上下文数据结构 52
6.4.5  浮点上下文大小的宏 52
6.4.6  浮点上下文区域开始的宏 53
6.4.7  初始化浮点上下文 54
6.4.8  保存浮点上下文 55
6.4.9  恢复浮点上下文 55
7  空闲线程 57
7.1  空闲线程有浮点上下文吗? 57
7.2  CPU依赖的空闲线程体 58
7.2.1  CPU_PROVIDES_IDLE_THREAD_BODY宏设置 58
7.2.2  空闲线程体 59
8  优先级位图操纵 61
8.1  简介 61
8.2  _Priority_bit_map_Control类型 62
8.3  查找第一个位的例程 62
8.4  建立位段掩码 65
8.5  位扫描支持 66
9  代码调整参数 67
9.1  内联Thread_Enable_dispatch 67
9.2  内联Thread_queue_Enqueue_priority 68
9.3  结构对齐优化 68
9.4  数据对齐要求 70
9.4.1  数据元素对齐 70
9.4.2  堆元素对齐 70
9.4.3  分区元素对齐 71
10  杂项 73
10.1  致命错误默认处理程序 73
10.2  CPU上下文验证 73
10.3  处理器字节序 74
10.3.1  指定处理器字节序 75
10.3.2  无符号整数的字节序交换 75
命令和变量索引 79
概念索引 81

1  Development Tools
1  开发工具

When porting RTEMS to a new CPU architecture, one will have to have a development environment including compiler, assembler, linker, and debugger. The GNU development tool suite used by RTEMS supports most modern CPU families. Often all that is required is to add RTEMS configurations for the target CPU family. RTEMS targets for the GNU tools usually start life as little more than aliases for existing embedded configurations. At this point in time, ELF is supported on most of the CPU families with a tool target of the form CPU-elf. If this target is not supported by all of the GNU tools, then it will be necessary to determine the configuration that makes the best starting point regardless of the target object format.
当移植RTEMS到新CPU架构时,你必须有一个开发环境,包括编译器、汇编器、链接器和调试器。RTEMS所使用的GNU开发工具套件支持最现代的CPU家族。通常所需的一切只是增加目标CPU家族的RTEMS配置。GNU工具的RTEMS目标通常开始生活于比现有的嵌入式配置的别名更多一点。在这个时候,在具有格式CPU-elf的工具目标的大多数CPU家族上支持ELF。如果所有的GNU工具不支持此目标,则必要的是确定忽略目标对象格式、获得最佳起始点的配置。

Porting and retargetting the GNU tools is beyond the scope of this manual. The best advice that can be offered is to look at the existing RTEMS targets in the tool source and use that as a guideline.
移植和重指定GNU工具超出了本指南的范围。可以提供的最好的建议是看看工具源中的现有的RTEMS目标,使用它作为指南。

全文下载地址:http://download.csdn.net/detail/zhumaill/7019633

你可能感兴趣的:(翻译,porting,rtems)