diff --git a/Drv/SocketIpDriver/SocketIpDriverComponentImpl.cpp b/Drv/SocketIpDriver/SocketIpDriverComponentImpl.cpp index d0850272f3..3a4625c6e6 100644 --- a/Drv/SocketIpDriver/SocketIpDriverComponentImpl.cpp +++ b/Drv/SocketIpDriver/SocketIpDriverComponentImpl.cpp @@ -19,7 +19,7 @@ #include #include #include -#elif defined TGT_OS_TYPE_LINUX || TGT_OS_TYPE_DARWIN +#elif defined TGT_OS_TYPE_LINUX || TGT_OS_TYPE_DARWIN || TGT_OS_TYPE_RTEMS #include #include #include diff --git a/Drv/SocketIpDriver/SocketIpDriverComponentImpl.hpp b/Drv/SocketIpDriver/SocketIpDriverComponentImpl.hpp index 6b86b48779..f1c2de08bb 100644 --- a/Drv/SocketIpDriver/SocketIpDriverComponentImpl.hpp +++ b/Drv/SocketIpDriver/SocketIpDriverComponentImpl.hpp @@ -21,6 +21,9 @@ #include #elif defined TGT_OS_TYPE_LINUX || TGT_OS_TYPE_DARWIN #include +#elif TGT_OS_TYPE_RTEMS + #include + #include #else #error OS not supported for IP Socket Communications #endif diff --git a/Os/CMakeLists.txt b/Os/CMakeLists.txt index 6d527b0bde..d12a164470 100644 --- a/Os/CMakeLists.txt +++ b/Os/CMakeLists.txt @@ -130,6 +130,33 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "arm-linux-gnueabihf") "${CMAKE_CURRENT_LIST_DIR}/ValidatedFile.cpp" "${CMAKE_CURRENT_LIST_DIR}/FileCommon.cpp" ) +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "RTEMS5") + set(SOURCE_FILES + "${CMAKE_CURRENT_LIST_DIR}/Pthreads/Queue.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Pthreads/BufferQueueCommon.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Pthreads/PriorityBufferQueue.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Pthreads/MaxHeap/MaxHeap.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Linux/File.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Posix/Task.cpp" + "${CMAKE_CURRENT_LIST_DIR}/LogPrintf.cpp" + "${CMAKE_CURRENT_LIST_DIR}/LogDefault.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Linux/InterruptLock.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Linux/WatchdogTimer.cpp" + "${CMAKE_CURRENT_LIST_DIR}/X86/IntervalTimer.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Linux/IntervalTimer.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Posix/Mutex.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Linux/FileSystem.cpp" + "${CMAKE_CURRENT_LIST_DIR}/TaskString.cpp" + "${CMAKE_CURRENT_LIST_DIR}/TaskCommon.cpp" + "${CMAKE_CURRENT_LIST_DIR}/QueueCommon.cpp" + "${CMAKE_CURRENT_LIST_DIR}/QueueString.cpp" + "${CMAKE_CURRENT_LIST_DIR}/IPCQueueCommon.cpp" + "${CMAKE_CURRENT_LIST_DIR}/SimpleQueueRegistry.cpp" + "${CMAKE_CURRENT_LIST_DIR}/MemCommon.cpp" + "${CMAKE_CURRENT_LIST_DIR}/ValidateFileCommon.cpp" + "${CMAKE_CURRENT_LIST_DIR}/ValidatedFile.cpp" + "${CMAKE_CURRENT_LIST_DIR}/FileCommon.cpp" + ) else() # Default Linux set(SOURCE_FILES diff --git a/Os/Linux/File.cpp b/Os/Linux/File.cpp index 926af3f36f..53cc074712 100644 --- a/Os/Linux/File.cpp +++ b/Os/Linux/File.cpp @@ -51,6 +51,7 @@ namespace Os { case OPEN_SYNC_WRITE: flags = O_WRONLY | O_CREAT | O_SYNC; break; +#ifndef TGT_OS_TYPE_RTEMS case OPEN_SYNC_DIRECT_WRITE: flags = O_WRONLY | O_CREAT | O_DSYNC #ifdef __linux__ @@ -59,6 +60,7 @@ namespace Os { ; #endif break; +#endif case OPEN_CREATE: flags = O_WRONLY | O_CREAT | O_TRUNC; break; diff --git a/Svc/LinuxTimer/CMakeLists.txt b/Svc/LinuxTimer/CMakeLists.txt index 1cd192188e..95b55dfc9d 100644 --- a/Svc/LinuxTimer/CMakeLists.txt +++ b/Svc/LinuxTimer/CMakeLists.txt @@ -31,6 +31,12 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "arm-linux-gnueabihf") "${CMAKE_CURRENT_LIST_DIR}/LinuxTimerComponentImplTimerFd.cpp" "${CMAKE_CURRENT_LIST_DIR}/LinuxTimerComponentImplCommon.cpp" ) +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "RTEMS5") + set(SOURCE_FILES + "${CMAKE_CURRENT_LIST_DIR}/LinuxTimerComponentAi.xml" + "${CMAKE_CURRENT_LIST_DIR}/LinuxTimerComponentImplTaskDelay.cpp" + "${CMAKE_CURRENT_LIST_DIR}/LinuxTimerComponentImplCommon.cpp" + ) else() set(SOURCE_FILES "${CMAKE_CURRENT_LIST_DIR}/LinuxTimerComponentAi.xml" diff --git a/cmake/platform/rtems5.cmake b/cmake/platform/rtems5.cmake new file mode 100644 index 0000000000..407ecc25cb --- /dev/null +++ b/cmake/platform/rtems5.cmake @@ -0,0 +1,19 @@ +add_definitions(-DTGT_OS_TYPE_RTEMS) + +# Add Linux specific headers into the system +include_directories(SYSTEM "${FPRIME_CORE_DIR}/Fw/Types/Linux") + +include_directories(SYSTEM + ${RTEMS_INCLUDE_DIRS} + ${RTEMS_BSP_INCLUDE_DIRS} + ${RTEMS_SOURCE_DIR}/testsuites/support/include +) + +add_compile_options(${RTEMS_C_FLAGS}) + +add_link_options(${RTEMS_LINK_FLAGS}) + +add_compile_definitions( + __rtems__ + _POSIX_THREADS +) \ No newline at end of file