include replacements host/windows/rtems

This commit is contained in:
Robin Müller 2021-07-14 10:50:44 +02:00
parent 3c4289335e
commit 704193eeaf
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
29 changed files with 103 additions and 171 deletions

View File

@ -1,7 +1,7 @@
#ifndef FSFW_OSAL_WINDOWS_TCPIPHELPERS_H_ #ifndef FSFW_OSAL_WINDOWS_TCPIPHELPERS_H_
#define FSFW_OSAL_WINDOWS_TCPIPHELPERS_H_ #define FSFW_OSAL_WINDOWS_TCPIPHELPERS_H_
#include "../../timemanager/clockDefinitions.h" #include "fsfw/timemanager/clockDefinitions.h"
#include "tcpipCommon.h" #include "tcpipCommon.h"
namespace tcpip { namespace tcpip {

View File

@ -1,7 +1,7 @@
#ifndef FSFW_OSAL_HOSTED_MUTEX_H_ #ifndef FSFW_OSAL_HOSTED_MUTEX_H_
#define FSFW_OSAL_HOSTED_MUTEX_H_ #define FSFW_OSAL_HOSTED_MUTEX_H_
#include "../../ipc/MutexIF.h" #include "fsfw/ipc/MutexIF.h"
#include <mutex> #include <mutex>

View File

@ -1,8 +1,8 @@
#ifndef CPUUSAGE_H_ #ifndef CPUUSAGE_H_
#define CPUUSAGE_H_ #define CPUUSAGE_H_
#include "../../container/FixedArrayList.h" #include "fsfw/container/FixedArrayList.h"
#include "../../serialize/SerializeIF.h" #include "fsfw/serialize/SerializeIF.h"
#include <stdarg.h> #include <stdarg.h>
class CpuUsage : public SerializeIF { class CpuUsage : public SerializeIF {

View File

@ -1,7 +1,7 @@
#ifndef FSFW_OSAL_RTEMS_RTEMSBASIC_H_ #ifndef FSFW_OSAL_RTEMS_RTEMSBASIC_H_
#define FSFW_OSAL_RTEMS_RTEMSBASIC_H_ #define FSFW_OSAL_RTEMS_RTEMSBASIC_H_
#include "../../returnvalues/HasReturnvaluesIF.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include <rtems.h> #include <rtems.h>
#include <rtems/libio.h> #include <rtems/libio.h>

View File

@ -1,6 +1,6 @@
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "../../timemanager/Clock.h" #include "fsfw/timemanager/Clock.h"
#include "../../platform.h" #include "fsfw/platform.h"
#include <chrono> #include <chrono>

View File

@ -1,20 +1,20 @@
#include "taskHelpers.h" #include "fsfw/osal/host/taskHelpers.h"
#include "fsfw/osal/host/FixedTimeslotTask.h"
#include "fsfw/osal/host/FixedTimeslotTask.h"
#include "../../platform.h" #include "fsfw/platform.h"
#include "../../osal/host/FixedTimeslotTask.h" #include "fsfw/ipc/MutexFactory.h"
#include "../../ipc/MutexFactory.h" #include "fsfw/osal/host/Mutex.h"
#include "../../osal/host/Mutex.h" #include "fsfw/objectmanager/ObjectManager.h"
#include "../../osal/host/FixedTimeslotTask.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "../../objectmanager/ObjectManager.h" #include "fsfw/tasks/ExecutableObjectIF.h"
#include "../../serviceinterface/ServiceInterface.h"
#include "../../tasks/ExecutableObjectIF.h"
#include <thread> #include <thread>
#include <chrono> #include <chrono>
#if defined(PLATFORM_WIN) #if defined(PLATFORM_WIN)
#include <windows.h> #include <windows.h>
#include "../windows/winTaskHelpers.h" #include "fsfw/osal/windows/winTaskHelpers.h"
#elif defined(PLATFORM_UNIX) #elif defined(PLATFORM_UNIX)
#include <pthread.h> #include <pthread.h>
#endif #endif

View File

@ -1,10 +1,10 @@
#include "MessageQueue.h" #include "fsfw/osal/host/MessageQueue.h"
#include "QueueMapManager.h" #include "fsfw/osal/host/QueueMapManager.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "../../objectmanager/ObjectManager.h" #include "fsfw/objectmanager/ObjectManager.h"
#include "../../ipc/MutexFactory.h" #include "fsfw/ipc/MutexFactory.h"
#include "../../ipc/MutexGuard.h" #include "fsfw/ipc/MutexGuard.h"
#include <cstring> #include <cstring>

View File

@ -1,5 +1,5 @@
#include "../../ipc/MutexFactory.h" #include "fsfw/osal/host/Mutex.h"
#include "../../osal/host/Mutex.h" #include "fsfw/ipc/MutexFactory.h"
//TODO: Different variant than the lazy loading in QueueFactory. //TODO: Different variant than the lazy loading in QueueFactory.
//What's better and why? -> one is on heap the other on bss/data //What's better and why? -> one is on heap the other on bss/data

View File

@ -1,19 +1,19 @@
#include "Mutex.h" #include "fsfw/osal/host/Mutex.h"
#include "PeriodicTask.h" #include "fsfw/osal/host/PeriodicTask.h"
#include "taskHelpers.h" #include "fsfw/osal/host/taskHelpers.h"
#include "../../platform.h" #include "fsfw/platform.h"
#include "../../ipc/MutexFactory.h" #include "fsfw/ipc/MutexFactory.h"
#include "../../objectmanager/ObjectManager.h" #include "fsfw/objectmanager/ObjectManager.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "../../tasks/ExecutableObjectIF.h" #include "fsfw/tasks/ExecutableObjectIF.h"
#include <thread> #include <thread>
#include <chrono> #include <chrono>
#if defined(PLATFORM_WIN) #if defined(PLATFORM_WIN)
#include <processthreadsapi.h> #include <processthreadsapi.h>
#include <fsfw/osal/windows/winTaskHelpers.h> #include "fsfw/osal/windows/winTaskHelpers.h"
#elif defined(PLATFORM_UNIX) #elif defined(PLATFORM_UNIX)
#include <pthread.h> #include <pthread.h>
#endif #endif

View File

@ -1,10 +1,9 @@
#include "fsfw/osal/host/MessageQueue.h"
#include "MessageQueue.h" #include "fsfw/ipc/MessageQueueSenderIF.h"
#include "fsfw/ipc/MessageQueueMessageIF.h"
#include "../../ipc/MessageQueueSenderIF.h" #include "fsfw/ipc/QueueFactory.h"
#include "../../ipc/MessageQueueMessageIF.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "../../ipc/QueueFactory.h"
#include "../../serviceinterface/ServiceInterfaceStream.h"
#include <cstring> #include <cstring>

View File

@ -1,8 +1,8 @@
#include "QueueMapManager.h" #include "fsfw/osal/host/QueueMapManager.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "../../ipc/MutexFactory.h" #include "fsfw/ipc/MutexFactory.h"
#include "../../ipc/MutexGuard.h" #include "fsfw/ipc/MutexGuard.h"
QueueMapManager* QueueMapManager::mqManagerInstance = nullptr; QueueMapManager* QueueMapManager::mqManagerInstance = nullptr;

View File

@ -1,5 +1,5 @@
#include "../../tasks/SemaphoreFactory.h" #include "fsfw/tasks/SemaphoreFactory.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr; SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr;

View File

@ -1,10 +1,11 @@
#include "taskHelpers.h" #include "fsfw/osal/host/FixedTimeslotTask.h"
#include "../../tasks/TaskFactory.h" #include "fsfw/osal/host/PeriodicTask.h"
#include "../../osal/host/FixedTimeslotTask.h" #include "fsfw/osal/host/taskHelpers.h"
#include "../../osal/host/PeriodicTask.h"
#include "../../returnvalues/HasReturnvaluesIF.h" #include "fsfw/tasks/TaskFactory.h"
#include "../../tasks/PeriodicTaskIF.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/tasks/PeriodicTaskIF.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include <chrono> #include <chrono>

View File

@ -1,4 +1,4 @@
#include "taskHelpers.h" #include "fsfw/osal/host/taskHelpers.h"
#include <map> #include <map>
#include <mutex> #include <mutex>

View File

@ -1,7 +1,7 @@
#include "RtemsBasic.h" #include "fsfw/osal/rtems/RtemsBasic.h"
#include "../../timemanager/Clock.h" #include "fsfw/timemanager/Clock.h"
#include "../../ipc/MutexGuard.h" #include "fsfw/ipc/MutexGuard.h"
#include <rtems/score/todimpl.h> #include <rtems/score/todimpl.h>
#include <rtems/rtems/clockimpl.h> #include <rtems/rtems/clockimpl.h>

View File

@ -1,6 +1,6 @@
#include "CpuUsage.h" #include "fsfw/osal/rtems/CpuUsage.h"
#include "../../serialize/SerialArrayListAdapter.h" #include "fsfw/serialize/SerialArrayListAdapter.h"
#include "../../serialize/SerializeAdapter.h" #include "fsfw/serialize/SerializeAdapter.h"
#include <string.h> #include <string.h>
extern "C" { extern "C" {

View File

@ -1,11 +1,11 @@
#include "FixedTimeslotTask.h" #include "fsfw/osal/rtems/FixedTimeslotTask.h"
#include "RtemsBasic.h" #include "fsfw/osal/rtems/RtemsBasic.h"
#include "../../tasks/FixedSequenceSlot.h" #include "fsfw/tasks/FixedSequenceSlot.h"
#include "../../objectmanager/SystemObjectIF.h" #include "fsfw/objectmanager/SystemObjectIF.h"
#include "../../objectmanager/ObjectManager.h" #include "fsfw/objectmanager/ObjectManager.h"
#include "../../returnvalues/HasReturnvaluesIF.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include <rtems/bspIo.h> #include <rtems/bspIo.h>
#include <rtems/io.h> #include <rtems/io.h>

View File

@ -1,5 +1,5 @@
#include "InitTask.h" #include "fsfw/osal/rtems/InitTask.h"
#include "RtemsBasic.h" #include "fsfw/osal/rtems/RtemsBasic.h"

View File

@ -1,4 +1,4 @@
#include "../../osal/InternalErrorCodes.h" #include "fsfw/osal/InternalErrorCodes.h"
#include <rtems/score/interr.h> #include <rtems/score/interr.h>
ReturnValue_t InternalErrorCodes::translate(uint8_t code) { ReturnValue_t InternalErrorCodes::translate(uint8_t code) {

View File

@ -1,8 +1,8 @@
#include "MessageQueue.h" #include "fsfw/osal/rtems/MessageQueue.h"
#include "RtemsBasic.h" #include "fsfw/osal/rtems/RtemsBasic.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "../../objectmanager/ObjectManager.h" #include "fsfw/objectmanager/ObjectManager.h"
#include <cstring> #include <cstring>

View File

@ -1,5 +1,5 @@
#include "Mutex.h" #include "fsfw/osal/rtems/Mutex.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
uint8_t Mutex::count = 0; uint8_t Mutex::count = 0;

View File

@ -1,6 +1,6 @@
#include "Mutex.h" #include "fsfw/osal/rtems/Mutex.h"
#include "../../ipc/MutexFactory.h" #include "fsfw/ipc/MutexFactory.h"
MutexFactory* MutexFactory::factoryInstance = new MutexFactory(); MutexFactory* MutexFactory::factoryInstance = new MutexFactory();

View File

@ -1,8 +1,8 @@
#include "PeriodicTask.h" #include "fsfw/osal/rtems/PeriodicTask.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "../../objectmanager/ObjectManager.h" #include "fsfw/objectmanager/ObjectManager.h"
#include "../../tasks/ExecutableObjectIF.h" #include "fsfw/tasks/ExecutableObjectIF.h"
PeriodicTask::PeriodicTask(const char *name, rtems_task_priority setPriority, PeriodicTask::PeriodicTask(const char *name, rtems_task_priority setPriority,
size_t setStack, rtems_interval setPeriod, void (*setDeadlineMissedFunc)()) : size_t setStack, rtems_interval setPeriod, void (*setDeadlineMissedFunc)()) :

View File

@ -1,7 +1,8 @@
#include "../../ipc/QueueFactory.h" #include "fsfw/osal/rtems/MessageQueue.h"
#include "../../ipc/MessageQueueSenderIF.h" #include "fsfw/osal/rtems/RtemsBasic.h"
#include "MessageQueue.h"
#include "RtemsBasic.h" #include "fsfw/ipc/QueueFactory.h"
#include "fsfw/ipc/MessageQueueSenderIF.h"
QueueFactory* QueueFactory::factoryInstance = nullptr; QueueFactory* QueueFactory::factoryInstance = nullptr;

View File

@ -1,5 +1,5 @@
#include "RTEMSTaskBase.h" #include "fsfw/osal/rtems/RTEMSTaskBase.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
const size_t PeriodicTaskIF::MINIMUM_STACK_SIZE = RTEMS_MINIMUM_STACK_SIZE; const size_t PeriodicTaskIF::MINIMUM_STACK_SIZE = RTEMS_MINIMUM_STACK_SIZE;

View File

@ -1,71 +1 @@
#include "RtemsBasic.h" #include "fsfw/osal/rtems/RtemsBasic.h"
// TODO: Can this be removed?
//ReturnValue_t RtemsBasic::convertReturnCode(rtems_status_code inValue) {
// if (inValue == RTEMS_SUCCESSFUL) {
// return HasReturnvaluesIF::RETURN_OK;
// } else {
// switch(inValue){
// case RTEMS_SUCCESSFUL:
// return OperatingSystemIF::SUCCESSFUL;
// case RTEMS_TASK_EXITTED:
// return OperatingSystemIF::TASK_EXITTED;
// case RTEMS_MP_NOT_CONFIGURED:
// return OperatingSystemIF::MP_NOT_CONFIGURED;
// case RTEMS_INVALID_NAME:
// return OperatingSystemIF::INVALID_NAME;
// case RTEMS_INVALID_ID:
// return OperatingSystemIF::INVALID_ID;
// case RTEMS_TOO_MANY:
// return OperatingSystemIF::TOO_MANY;
// case RTEMS_TIMEOUT:
// return OperatingSystemIF::TIMEOUT;
// case RTEMS_OBJECT_WAS_DELETED:
// return OperatingSystemIF::OBJECT_WAS_DELETED;
// case RTEMS_INVALID_SIZE:
// return OperatingSystemIF::INVALID_SIZE;
// case RTEMS_INVALID_ADDRESS:
// return OperatingSystemIF::INVALID_ADDRESS;
// case RTEMS_INVALID_NUMBER:
// return OperatingSystemIF::INVALID_NUMBER;
// case RTEMS_NOT_DEFINED:
// return OperatingSystemIF::NOT_DEFINED;
// case RTEMS_RESOURCE_IN_USE:
// return OperatingSystemIF::RESOURCE_IN_USE;
// //TODO RTEMS_UNSATISFIED is double mapped for FLP so it will only return Queue_empty and not unsatisfied
// case RTEMS_UNSATISFIED:
// return OperatingSystemIF::QUEUE_EMPTY;
// case RTEMS_INCORRECT_STATE:
// return OperatingSystemIF::INCORRECT_STATE;
// case RTEMS_ALREADY_SUSPENDED:
// return OperatingSystemIF::ALREADY_SUSPENDED;
// case RTEMS_ILLEGAL_ON_SELF:
// return OperatingSystemIF::ILLEGAL_ON_SELF;
// case RTEMS_ILLEGAL_ON_REMOTE_OBJECT:
// return OperatingSystemIF::ILLEGAL_ON_REMOTE_OBJECT;
// case RTEMS_CALLED_FROM_ISR:
// return OperatingSystemIF::CALLED_FROM_ISR;
// case RTEMS_INVALID_PRIORITY:
// return OperatingSystemIF::INVALID_PRIORITY;
// case RTEMS_INVALID_CLOCK:
// return OperatingSystemIF::INVALID_CLOCK;
// case RTEMS_INVALID_NODE:
// return OperatingSystemIF::INVALID_NODE;
// case RTEMS_NOT_CONFIGURED:
// return OperatingSystemIF::NOT_CONFIGURED;
// case RTEMS_NOT_OWNER_OF_RESOURCE:
// return OperatingSystemIF::NOT_OWNER_OF_RESOURCE;
// case RTEMS_NOT_IMPLEMENTED:
// return OperatingSystemIF::NOT_IMPLEMENTED;
// case RTEMS_INTERNAL_ERROR:
// return OperatingSystemIF::INTERNAL_ERROR;
// case RTEMS_NO_MEMORY:
// return OperatingSystemIF::NO_MEMORY;
// case RTEMS_IO_ERROR:
// return OperatingSystemIF::IO_ERROR;
// default:
// return HasReturnvaluesIF::RETURN_FAILED;
// }
// }
//}

View File

@ -1,10 +1,10 @@
#include "FixedTimeslotTask.h" #include "fsfw/osal/rtems/FixedTimeslotTask.h"
#include "PeriodicTask.h" #include "fsfw/osal/rtems/PeriodicTask.h"
#include "InitTask.h" #include "fsfw/osal/rtems/InitTask.h"
#include "RtemsBasic.h" #include "fsfw/osal/rtems/RtemsBasic.h"
#include "../../tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#include "../../returnvalues/HasReturnvaluesIF.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h"
//TODO: Different variant than the lazy loading in QueueFactory. What's better and why? //TODO: Different variant than the lazy loading in QueueFactory. What's better and why?
TaskFactory* TaskFactory::factoryInstance = new TaskFactory(); TaskFactory* TaskFactory::factoryInstance = new TaskFactory();

View File

@ -1,8 +1,8 @@
#include "../common/tcpipHelpers.h" #include "fsfw/FSFW.h"
#include <FSFWConfig.h> #include "fsfw/osal/common/tcpipHelpers.h"
#include "../../tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#include "../../serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include <winsock2.h> #include <winsock2.h>

View File

@ -1,4 +1,5 @@
#include <fsfw/osal/windows/winTaskHelpers.h> #include "fsfw/osal/windows/winTaskHelpers.h"
#include <mutex> #include <mutex>
TaskPriority tasks::makeWinPriority(PriorityClass prioClass, PriorityNumber prioNumber) { TaskPriority tasks::makeWinPriority(PriorityClass prioClass, PriorityNumber prioNumber) {