FreeRTOS-Plus-POSIX
适用于 FreeRTOS 的可移植操作系统接口( POSIX 线程包装器)
本页面包含:
- 简介
- 预配置示例项目
- 支持的功能
- FreeRTOS-Plus-POSIX 源代码组织
- 依赖项
- 开发者参考和 API 文档
- 移植
- 代码大小
可移植操作系统接口 (POSIX) 是 IEEE 计算机学会为维护操作系统之间的兼容性而指定的一系列标准。FreeRTOS-Plus-POSIX 可实现
POSIX 线程 API 的小子集。借助此子集,熟悉 POSIX API 的应用程序开发者可使用类似线程原语的 POSIX 开发 FreeRTOS 应用程序。FreeRTOS-Plus-POSIX 仅实现了约 20% 的 POSIX API。因此,无法仅使用此包装器将现有的 POSIX 兼容应用程序或 POSIX 兼容库移植到 FreeRTOS 内核上运行。
与 FreeRTOS 库一起使用时 FreeRTOS-Plus-POSIX 的位置
预配置示例项目
FreeRTOS-Plus-POSIX 预配置示例在单独的 zip 文件下载中提供。
当前支持的功能
FreeRTOS-Plus-POSIX 实现了部分 IEEE Std 1003.1-2017 版《开放组技术标准基础规范》,第 7 期。FreeRTOS-Plus-POSIX 包括以下 POSIX 线程标头文件的实现,请参阅 FreeRTOS-Plus-POSIX API 文档详细了解每个标头文件中支持的功能:
- errno.h
- fcntl.h
- mqueue.h
- pthread.h
- sched.h
- semaphore.h
|
- signal.h
- sys/types.h
- time.h
- unistd.h
- utils.h
|
FreeRTOS-Plus-POSIX 源代码组织
移植相关标头和实现源代码
/lib/FreeRTOS-Plus-POSIX
|-- include
| |
| +- FreeRTOS_POSIX.h
| +- FreeRTOS_POSIX_internal.h
| +- FreeRTOS_POSIX_types.h
| +- portable
| |
| +- [target]
| | |
| | +- [development board]
| | |
| | +- FreeRTOS_POSIX_portable.h
| |
| +- FreeRTOS_POSIX_portable_default.h
|
+- source
+- FreeRTOS_POSIX_clock.c
+- FreeRTOS_POSIX_mqueue.c
+- FreeRTOS_POSIX_pthread_barrier.c
+- FreeRTOS_POSIX_pthread.c
+- FreeRTOS_POSIX_pthread_cond.c
+- FreeRTOS_POSIX_pthread_mutex.c
+- FreeRTOS_POSIX_sched.c
+- FreeRTOS_POSIX_semaphore.c
+- FreeRTOS_POSIX_timer.c
+- FreeRTOS_POSIX_unistd.c
+- FreeRTOS_POSIX_utils.c
FreeRTOS-Plus-POSIX 标头
/lib/include/FreeRTOS_POSIX
+- errno.h
+- fcntl.h
+- mqueue.h
+- pthread.h
+- sched.h
+- semaphore.h
+- signal.h
+- sys
| |
| +- types.h
|
+- time.h
+- unistd.h
+- utils.h
依赖
在 FreeRTOSConfig.h 中,configUSE_POSIX_ERRNO 和 configUSE_APPLICATION_TASK_TAG 均须设置为 1。
开发者参考和 API 文档
请参阅参考材料(链接到 Doxygen 输出)。
移植
移植相关头文件
FreeRTOS 平台特定的 POSIX 配置
|
高级描述
|
/lib/FreeRTOS-Plus-POSIX/include/FreeRTOS_POSIX.h |
此标头文件包含 FreeRTOS-Plus-POSIX 所需的依赖项。此文件必须在所有其他 FreeRTOS-Plus-POSIX 之前包含。 |
/lib/FreeRTOS-Plus-POSIX/include/FreeRTOS_POSIX_internal.h |
FreeRTOS-Plus-POSIX 的内部结构体和初始化器。建议用户不要更改此文件。 |
/lib/FreeRTOS-Plus-POSIX/include/FreeRTOS_POSIX_portable_default.h |
FreeRTOS-Plus-POSIX 移植特定配置默认值。 |
/lib/FreeRTOS-Plus-POSIX/include/portable/[vendor-directory]/FreeRTOS_POSIX_portable.h |
FreeRTOS-Plus-POSIX 移植特定配置覆写。例如,/lib/FreeRTOS-Plus-POSIX/include/portable/pc/windows/FreeRTOS_POSIX_portable.h , Windows 模拟器使用默认值,因此不需要覆写任何内容。 |
FreeRTOS-Plus-POSIX 包含路径
/lib/FreeRTOS-Plus-POSIX/include |
/lib/FreeRTOS-Plus-POSIX/source |
/lib/include/FreeRTOS_POSIX/ |
请注意,项目只需要来自此路径 /lib/FreeRTOS -Plus-POSIX/include/portable
的平台特定标头。
代码大小
代码大小(使用 ARM 代码生成工具 (CGT) 编译 --silicon_version 7M4 ) |
文件
|
优化关闭,以字节为单位
|
优化开启,以字节为单位
(--opt_level 0 --opt_for_speed 0)
|
FreeRTOS_POSIX_clock.c
|
412
|
296
|
FreeRTOS_POSIX_mqueue.c
|
2016
|
1612
|
FreeRTOS_POSIX_pthread_barrier.c
|
294
|
200
|
FreeRTOS_POSIX_pthread.c
|
980
|
660
|
FreeRTOS_POSIX_pthread_cond.c
|
696
|
496
|
FreeRTOS_POSIX_pthread_mutex.c
|
848
|
608
|
FreeRTOS_POSIX_sched.c
|
48
|
32
|
FreeRTOS_POSIX_semaphore.c
|
540
|
380
|
FreeRTOS_POSIX_timer.c
|
972
|
788
|
FreeRTOS_POSIX_unistd.c
|
92
|
68
|
FreeRTOS_POSIX_utils.c
|
1152
|
768
|
合计
|
8050
|
5908
|
|
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.