From 1f0903d525e535e744165e859c0146101f7ae7b6 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 18 Aug 2020 13:13:02 -0400 Subject: [PATCH] Fix #561, remove all deprecated code In the next major OSAL release, this code will be no longer supported at all. It should be removed early in the cycle to avoid needing to maintain this compatibility code. --- CMakeLists.txt | 16 - src/bsp/shared/inc/bsp-impl.h | 8 - src/bsp/shared/src/bsp_default_voltab.c | 74 ----- src/os/inc/common_types.h | 38 --- src/os/inc/osapi-os-core.h | 304 ------------------ src/os/inc/osapi-os-filesys.h | 111 ------- src/os/inc/osapi-os-loader.h | 15 - src/os/posix/CMakeLists.txt | 10 - src/os/posix/src/os-impl-fpu.c | 124 ------- src/os/posix/src/os-impl-interrupts.c | 136 -------- src/os/posix/src/os-impl-tasks.c | 25 -- src/os/rtems/CMakeLists.txt | 11 - src/os/rtems/src/os-impl-fpu.c | 122 ------- src/os/rtems/src/os-impl-interrupts.c | 189 ----------- src/os/rtems/src/os-impl-tasks.c | 3 - src/os/shared/inc/os-shared-dir.h | 3 - src/os/shared/inc/os-shared-filesys.h | 5 - src/os/shared/inc/os-shared-fpu.h | 70 ---- src/os/shared/inc/os-shared-interrupts.h | 119 ------- src/os/shared/src/osapi-dir.c | 103 ------ src/os/shared/src/osapi-filesys.c | 217 ------------- src/os/shared/src/osapi-fpu.c | 123 ------- src/os/shared/src/osapi-interrupts.c | 149 --------- src/os/vxworks/CMakeLists.txt | 11 - src/os/vxworks/src/os-impl-fpu.c | 136 -------- src/os/vxworks/src/os-impl-interrupts.c | 175 ---------- src/os/vxworks/src/os-impl-tasks.c | 17 - src/tests/file-api-test/file-api-test.c | 25 -- .../shared/src/coveragetest-dir.c | 65 ---- .../ut-stubs/CMakeLists.txt | 1 - .../ut-stubs/src/osapi-fpu-impl-stubs.c | 45 --- src/ut-stubs/CMakeLists.txt | 2 - src/ut-stubs/osapi-utstub-dir.c | 105 ------ src/ut-stubs/osapi-utstub-fpu.c | 123 ------- src/ut-stubs/osapi-utstub-interrupts.c | 143 -------- 35 files changed, 2823 deletions(-) delete mode 100644 src/bsp/shared/src/bsp_default_voltab.c delete mode 100644 src/os/posix/src/os-impl-fpu.c delete mode 100644 src/os/posix/src/os-impl-interrupts.c delete mode 100644 src/os/rtems/src/os-impl-fpu.c delete mode 100644 src/os/rtems/src/os-impl-interrupts.c delete mode 100644 src/os/shared/inc/os-shared-fpu.h delete mode 100644 src/os/shared/inc/os-shared-interrupts.h delete mode 100644 src/os/shared/src/osapi-fpu.c delete mode 100644 src/os/shared/src/osapi-interrupts.c delete mode 100644 src/os/vxworks/src/os-impl-fpu.c delete mode 100644 src/os/vxworks/src/os-impl-interrupts.c delete mode 100644 src/unit-test-coverage/ut-stubs/src/osapi-fpu-impl-stubs.c delete mode 100644 src/ut-stubs/osapi-utstub-fpu.c delete mode 100644 src/ut-stubs/osapi-utstub-interrupts.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 70bbc8ee1..a9cfbd8e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,12 +177,6 @@ set(BSP_SRCLIST src/bsp/shared/src/bsp_default_symtab.c ) -if (NOT OMIT_DEPRECATED) - list(APPEND BSP_SRCLIST - src/bsp/shared/src/bsp_default_voltab.c - ) -endif (NOT OMIT_DEPRECATED) - # Define the external "osal_bsp" static library target add_library(osal_bsp STATIC ${BSP_SRCLIST} @@ -264,16 +258,6 @@ if (OSAL_CONFIG_DEBUG_PRINTF) endif (OSAL_CONFIG_DEBUG_PRINTF) -# The FPU and interrupt modules are deprecated. -# If the "OMIT_DEPRECATED" switch is set, then these are not built. -if (NOT OMIT_DEPRECATED) - list(APPEND OSAL_SRCLIST - src/os/shared/src/osapi-fpu.c - src/os/shared/src/osapi-interrupts.c - ) -endif (NOT OMIT_DEPRECATED) - - # Define the external "osal" static library target # This is a combination of the generic parts with the low level # system-specific parts diff --git a/src/bsp/shared/inc/bsp-impl.h b/src/bsp/shared/inc/bsp-impl.h index eb1678e90..3497d1269 100644 --- a/src/bsp/shared/inc/bsp-impl.h +++ b/src/bsp/shared/inc/bsp-impl.h @@ -101,14 +101,6 @@ typedef struct */ extern OS_BSP_GlobalData_t OS_BSP_Global; -#ifndef OSAL_OMIT_DEPRECATED -/* - * Volume Table declaration (supplied by BSP; typically defined in bsp_voltab.c) - * @deprecated Use OS File System API to register volumes. - */ -extern OS_VolumeInfo_t OS_VolumeTable[OS_MAX_FILE_SYSTEMS]; -#endif - /********************************************************************/ /* INTERNAL BSP IMPLEMENTATION FUNCTIONS */ /********************************************************************/ diff --git a/src/bsp/shared/src/bsp_default_voltab.c b/src/bsp/shared/src/bsp_default_voltab.c deleted file mode 100644 index 5246c3521..000000000 --- a/src/bsp/shared/src/bsp_default_voltab.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * File : bsp_voltab.c - * - * BSP Volume table for file systems - * - * Define a default OS volume table, which has no valid entries in it. - * This is a deprecated structure in the process of being phased out. - * - * This source file should only be compiled and included in "osal_bsp" when - * OSAL_OMIT_DEPRECATED is false/unset. - * - * This serves to decouple the PSP changes and the OSAL_OMIT_DEPRECATED setting - - * allowing a PSP to be updated to use only the recommended API and remove the - * OS_VolumeTable, while still allowing code to build and link when OSAL_OMIT_DEPRECATED - * is not set. - * - * If a classic PSP is still providing this symbol, then the PSP-provided symbol will - * be used, and this one will be ignored, preserving old behavior. - * - * If an updated PSP has removed this symbol, then this will be used to satisfy linking - * requirements when building without OSAL_OMIT_DEPRECATED. - * - */ - -/**************************************************************************************** - INCLUDE FILES -****************************************************************************************/ -#include "common_types.h" -#include "osapi.h" - -OS_VolumeInfo_t OS_VolumeTable [OS_MAX_FILE_SYSTEMS] = -{ - /* Dev Name Phys Dev Vol Type Volatile? Free? IsMounted? Volname MountPt BlockSz */ - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - {"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 } - -}; - - - diff --git a/src/os/inc/common_types.h b/src/os/inc/common_types.h index dde79112d..64c8c9a8d 100644 --- a/src/os/inc/common_types.h +++ b/src/os/inc/common_types.h @@ -96,44 +96,6 @@ typedef size_t cpusize; typedef ptrdiff_t cpudiff; -#ifndef OSAL_OMIT_DEPRECATED - -/* - * Define the "osalbool" type for backward compatibility. - * This will be removed in a future release. - */ -typedef bool osalbool; /**< @deprecated Use bool */ - -/* - * Boolean type for compatibility -- - * - * Note it is a bad idea to typedef "bool" or "boolean" -- MANY other projects - * and libraries also define a boolean type due to the lack of a standard bool in C89. - * But calling it simply "bool" or "boolean" almost guarantees a namespace conflict - * if trying to use OSAL with one of those other existing projects. - * - * RTEMS 4.11 no longer defines boolean type by default (deprecated) probably also - * due to the high likelihood of name conflicts. - * - * In order to preserve compatibility for apps written against prior versions of - * OSAL, the name "boolean" is typedefed as well, but this may be turned off - * in a future version whenever appropriate. - */ - -#if (!defined(_USING_RTEMS_INCLUDES_) || !defined(RTEMS_DEPRECATED_TYPES)) - typedef osalbool boolean; /**< @deprecated Use bool */ -#endif - -#ifndef TRUE /* Boolean true */ -#define TRUE true /**< @deprecated Use true */ -#endif - -#ifndef FALSE /* Boolean false */ -#define FALSE false /**< @deprecated Use false */ -#endif - - -#endif /* OSAL_OMIT_DEPRECATED */ #ifndef NULL /* pointer to nothing */ diff --git a/src/os/inc/osapi-os-core.h b/src/os/inc/osapi-os-core.h index a073ac12d..40da37028 100644 --- a/src/os/inc/osapi-os-core.h +++ b/src/os/inc/osapi-os-core.h @@ -91,9 +91,6 @@ typedef struct uint32 creator; uint32 stack_size; uint32 priority; -#ifndef OSAL_OMIT_DEPRECATED - uint32 OStask_id; /**< @deprecated */ -#endif }OS_task_prop_t; /** @brief OSAL queue properties */ @@ -1155,307 +1152,6 @@ int32 OS_GetLocalTime (OS_time_t *time_struct); int32 OS_SetLocalTime (OS_time_t *time_struct); /**@}*/ -#ifndef OSAL_OMIT_DEPRECATED - -/** - * @defgroup OSAPIExc OSAL Exception APIs - * - * @note Not implemented in current OSAL version - * - * @deprecated Planning move to PSP due to platform dependencies - * - * @{ - */ - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief placeholder; not currently implemented - * @deprecated Planning move to PSP due to platform dependencies - */ -int32 OS_ExcAttachHandler (uint32 ExceptionNumber, - void (*ExceptionHandler)(uint32, const void *,uint32), - int32 parameter); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief placeholder; not currently implemented - * @deprecated Planning move to PSP due to platform dependencies - */ -int32 OS_ExcEnable (int32 ExceptionNumber); - -/*-------------------------------------------------------------------------------------*/ -/** @brief placeholder; not currently implemented - * @deprecated Planning move to PSP due to platform dependencies - */ -int32 OS_ExcDisable (int32 ExceptionNumber); -/**@}*/ - -/** @defgroup OSAPIFPUExc OSAL Floating Point Unit Exception APIs - * @deprecated Planning move to PSP due to platform dependencies - * @{ - */ - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief Set an FPU exception handler function - * - * The call associates a specified C routine to a specified FPU exception number. - * When the specified FPU Exception occurs , the ExceptionHandler routine will be - * called and passed the parameter. - * - * @deprecated Planning move to PSP due to platform dependencies - * - * @param[in] ExceptionNumber The exception number to attach to - * @param[in] ExceptionHandler Pointer to handler function - * @param[in] parameter Argument to pass to handler - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_FPUExcAttachHandler (uint32 ExceptionNumber, osal_task_entry ExceptionHandler, - int32 parameter); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief Enable FPU exceptions - * - * @deprecated Planning move to PSP due to platform dependencies - * - * @param[in] ExceptionNumber The exception number to enable - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_FPUExcEnable (int32 ExceptionNumber); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief Disable FPU exceptions - * - * @deprecated Planning move to PSP due to platform dependencies - * - * @param[in] ExceptionNumber The exception number to disable - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_FPUExcDisable (int32 ExceptionNumber); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief Sets the FPU exception mask - * - * @deprecated Planning move to PSP due to platform dependencies - * - * This function sets the FPU exception mask - * - * @note The exception environment is local to each task Therefore this must be - * called for each task that that wants to do floating point and catch exceptions. - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_FPUExcSetMask (uint32 mask); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief Gets the FPU exception mask - * - * @deprecated Planning move to PSP due to platform dependencies - * - * This function gets the FPU exception mask - * - * @note The exception environment is local to each task Therefore this must be - * called for each task that that wants to do floating point and catch exceptions. - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_FPUExcGetMask (uint32 *mask); -/**@}*/ - -/** @defgroup OSAPIInterrupt OSAL Interrupt APIs - * @{ - * @deprecated Platform dependencies - */ - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief DEPRECATED; Associate an interrupt number to a specified handler routine - * - * @deprecated platform dependencies, removing from OSAL - * - * The call associates a specified C routine to a specified interrupt - * number. Upon occurring of the InterruptNumber, the InerruptHandler - * routine will be called and passed the parameter. - * - * @param[in] InterruptNumber The Interrupt Number that will cause the start of the ISR - * @param[in] InterruptHandler The ISR associated with this interrupt - * @param[in] parameter Argument that is passed to the ISR - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_INVALID_POINTER The Interrupt handler pointer is NULL - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_IntAttachHandler (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief DEPRECATED; Enable interrupts - * - * @deprecated platform dependencies, removing from OSAL - * - * @param[in] IntLevel value from previous call to OS_IntLock() - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_IntUnlock (int32 IntLevel); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief DEPRECATED; Disable interrupts - * - * @deprecated platform dependencies, removing from OSAL - * - * @return An key value to be passed to OS_IntUnlock() to restore interrupts or error - * status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_IntLock (void); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief DEPRECATED; Enables interrupts through Level - * - * @deprecated platform dependencies, removing from OSAL - * - * @param[in] Level the interrupts to enable - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_IntEnable (int32 Level); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief DEPRECATED; Disable interrupts through Level - * - * @deprecated platform dependencies, removing from OSAL - * - * @param[in] Level the interrupts to disable - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_IntDisable (int32 Level); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief DEPRECATED; Set the CPU interrupt mask register - * - * @deprecated platform dependencies, removing from OSAL - * - * @note The interrupt bits are architecture-specific. - * - * @param[in] mask The value to set in the register - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_IntSetMask (uint32 mask); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief DEPRECATED; Get the CPU interrupt mask register - * - * @deprecated platform dependencies, removing from OSAL - * - * @note The interrupt bits are architecture-specific. - * - * @param[out] mask The register value will be stored to this location - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_IntGetMask (uint32 *mask); - -/*-------------------------------------------------------------------------------------*/ -/** - * @brief DEPRECATED; Acknowledge the corresponding interrupt number. - * - * @deprecated platform dependencies, removing from OSAL - * - * @note: placeholder; not currently implemented in sample implementations - * - * @param[in] InterruptNumber The interrupt number to be acknowledged. - * - * @return Execution status, see @ref OSReturnCodes - * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_INVALID_INT_NUM @copybrief OS_INVALID_INT_NUM - * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED - */ -int32 OS_IntAck (int32 InterruptNumber); -/**@}*/ - - -/** - * @defgroup OSAPIShMem OSAL Shared memory APIs - * @deprecated Not in current implementations - * - * @{ - */ - -/*-------------------------------------------------------------------------------------*/ -/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs - * @deprecated Never implemented - */ -int32 OS_ShMemInit (void); - -/*-------------------------------------------------------------------------------------*/ -/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs - * @deprecated Never implemented - */ -int32 OS_ShMemCreate (uint32 *Id, uint32 NBytes, const char* SegName); - -/*-------------------------------------------------------------------------------------*/ -/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs - * @deprecated Never implemented - */ -int32 OS_ShMemSemTake (uint32 Id); - -/*-------------------------------------------------------------------------------------*/ -/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs - * @deprecated Never implemented - */ -int32 OS_ShMemSemGive (uint32 Id); - -/*-------------------------------------------------------------------------------------*/ -/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs - * @deprecated Never implemented - */ -int32 OS_ShMemAttach (cpuaddr * Address, uint32 Id); - -/*-------------------------------------------------------------------------------------*/ -/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs - * @deprecated Never implemented - */ -int32 OS_ShMemGetIdByName (uint32 *ShMemId, const char *SegName ); -/**@}*/ - -#endif /* OSAL_OMIT_DEPRECATED */ /** @defgroup OSAPIHeap OSAL Heap APIs * @{ diff --git a/src/os/inc/osapi-os-filesys.h b/src/os/inc/osapi-os-filesys.h index c1226c299..4ee3e6a87 100644 --- a/src/os/inc/osapi-os-filesys.h +++ b/src/os/inc/osapi-os-filesys.h @@ -49,24 +49,6 @@ #define OS_CHK_ONLY 0 /**< Unused, API takes bool */ #define OS_REPAIR 1 /**< Unused, API takes bool */ -#ifndef OSAL_OMIT_DEPRECATED - -/** @defgroup OSVolType OSAL Volume Type Defines - * @{ - */ -#define FS_BASED 0 /**< @deprecated Volume type FS based */ -#define RAM_DISK 1 /**< @deprecated Volume type RAM disk */ -#define EEPROM_DISK 2 /**< @deprecated Volume type EEPROM disk */ -#define ATA_DISK 3 /**< @deprecated Volume type ATA disk */ -/**@}*/ - -/** - * @brief Number of entries in the internal volume table - * @deprecated - */ -#define NUM_FILE_SYSTEMS OS_MAX_FILE_SYSTEMS - -#endif /* ** Length of a Device and Volume name */ @@ -100,57 +82,8 @@ #define OS_FS_ERR_DEVICE_NOT_FREE (-107) /**< @brief FS device not free */ #define OS_FS_ERR_PATH_INVALID (-108) /**< @brief FS path invalid */ -#ifndef OSAL_OMIT_DEPRECATED -/* - * Map some codes used by the file API back to the generic counterparts - * where there is overlap between them. Do not duplicate error codes. - */ -#define OS_FS_SUCCESS OS_SUCCESS /**< @deprecated Successful execution */ -#define OS_FS_ERROR OS_ERROR /**< @deprecated Failed execution */ -#define OS_FS_ERR_INVALID_POINTER OS_INVALID_POINTER /**< @deprecated Invalid pointer */ -#define OS_FS_ERR_NO_FREE_FDS OS_ERR_NO_FREE_IDS /**< @deprecated No free IDs */ -#define OS_FS_ERR_INVALID_FD OS_ERR_INVALID_ID /**< @deprecated Invalid ID */ -#define OS_FS_UNIMPLEMENTED OS_ERR_NOT_IMPLEMENTED /**< @deprecated Not implemented */ -#endif /**@}*/ -#ifndef OSAL_OMIT_DEPRECATED -/* This typedef is for OS_FS_GetErrorName(), to ensure - * everyone is making an array of the same length - * - * Implementation note for developers: - * - * os_fs_err_name_t is now equivalent to the OSAL "os_err_name_t" typedef, - * to preserve source code compatibility with anything using the OS_FS_GetErrorName api - * - * The sizes of strings in OSAL functions are built with os_fs_err_name_t's - * limits in mind. Always check the uses of os_fs_err_name_t when changing - * os_err_name_t. - */ -typedef os_err_name_t os_fs_err_name_t; - -/** - * @brief Internal structure of the OS volume table for - * mounted file systems and path translation - * - * @deprecated Use the OSAL file system API to register volumes - */ -typedef struct -{ - char DeviceName [OS_FS_DEV_NAME_LEN]; - char PhysDevName [OS_FS_PHYS_NAME_LEN]; - uint32 VolumeType; - uint8 VolatileFlag; - uint8 FreeFlag; - uint8 IsMounted; - char VolumeName [OS_FS_VOL_NAME_LEN]; - char MountPoint [OS_MAX_PATH_LEN]; - uint32 BlockSize; - -} OS_VolumeInfo_t; - -#endif - /** @brief OSAL file system info */ typedef struct @@ -221,26 +154,9 @@ typedef struct char FileName[OS_MAX_FILE_NAME]; } os_dirent_t; -#ifndef OSAL_OMIT_DEPRECATED -/* - * Preserve the old type names for compatibility; - * but instead of DIR* it is now just a void* - */ -/* Provide something to implement os_dirp_t */ -typedef void * os_dirp_t; /**< @deprecated */ -#endif - /** @brief Access filename part of the dirent structure */ #define OS_DIRENTRY_NAME(x) ((x).FileName) -#ifndef OSAL_OMIT_DEPRECATED -/* - * Several old type names can be aliases for compatibility - */ -typedef int32 os_fshealth_t; /**< @deprecated type no longer used */ -typedef OS_file_prop_t OS_FDTableEntry; /**< @deprecated Use OS_file_prop_t */ -#endif - /* * Exported Functions */ @@ -642,33 +558,6 @@ int32 OS_CloseFileByName(const char *Filename); * @{ */ -#ifndef OSAL_OMIT_DEPRECATED -/** - * @brief Opens a directory for searching - * @deprecated Replaced by OS_DirectoryOpen() - */ -os_dirp_t OS_opendir (const char *path); - -/* - * @brief Closes an open directory - * @deprecated Replaced by OS_DirectoryClose() - */ -int32 OS_closedir(os_dirp_t directory); - -/* - * @brief Rewinds an open directory - * @deprecated Replaced by OS_DirectoryRewind() - */ -void OS_rewinddir(os_dirp_t directory); - -/* - * @brief Reads the next object in the directory - * @deprecated Replaced by OS_DirectoryRead() - */ -os_dirent_t * OS_readdir (os_dirp_t directory); - -#endif - /*-------------------------------------------------------------------------------------*/ /** * @brief Opens a directory diff --git a/src/os/inc/osapi-os-loader.h b/src/os/inc/osapi-os-loader.h index 3b3536e96..38c8de213 100644 --- a/src/os/inc/osapi-os-loader.h +++ b/src/os/inc/osapi-os-loader.h @@ -82,21 +82,6 @@ typedef const struct const char *Module; } OS_static_symbol_record_t; -#ifndef OSAL_OMIT_DEPRECATED -/* - * Define the former "OS_module_record_t" type as equivalent - * to the OS_module_prop_t. This is what the OS_ModuleInfo() - * will output. It used to be the same as the internal record - * just without all the fields filled in. This has been changed - * to make it a separate structure, which will allow the internal - * implementation to change without further changing the API. - * - * Ideally OS_module_record_t type should be removed to avoid confusion, - * but this would break existing code that calls OS_ModuleInfo(). - */ -typedef OS_module_prop_t OS_module_record_t; /**< @deprecated Use OS_module_prop_t */ -#endif - /** @defgroup OSAPILoader OSAL Dynamic Loader and Symbol APIs * @{ */ diff --git a/src/os/posix/CMakeLists.txt b/src/os/posix/CMakeLists.txt index 81d8a2117..156052c4f 100644 --- a/src/os/posix/CMakeLists.txt +++ b/src/os/posix/CMakeLists.txt @@ -25,16 +25,6 @@ set(POSIX_BASE_SRCLIST src/os-impl-timebase.c ) -# The FPU and interrupt modules are deprecated. -# If the "OMIT_DEPRECATED" switch is set, then these are not built. -if (NOT OMIT_DEPRECATED) - list(APPEND POSIX_BASE_SRCLIST - src/os-impl-fpu.c - src/os-impl-interrupts.c - ) -endif (NOT OMIT_DEPRECATED) - - # Use portable blocks for basic I/O set(POSIX_IMPL_SRCLIST diff --git a/src/os/posix/src/os-impl-fpu.c b/src/os/posix/src/os-impl-fpu.c deleted file mode 100644 index e306c94ce..000000000 --- a/src/os/posix/src/os-impl-fpu.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file os-impl-fpu.c - * \ingroup posix - * \author joseph.p.hickey@nasa.gov - * - */ - -/**************************************************************************************** - INCLUDE FILES - ***************************************************************************************/ - -#include "os-posix.h" -#include "bsp-impl.h" -#include "os-shared-fpu.h" - -/**************************************************************************************** - FPU API (deprecated) - ***************************************************************************************/ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcAttachHandler_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcAttachHandler_Impl(uint32 ExceptionNumber, osal_task_entry ExceptionHandler, - int32 parameter) -{ - /* - ** Not implemented in linux. - */ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcAttachHandler_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcEnable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcEnable_Impl(int32 ExceptionNumber) -{ - /* - ** Not implemented in linux. - */ - return(OS_SUCCESS); -} /* end OS_FPUExcEnable_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcDisable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcDisable_Impl(int32 ExceptionNumber) -{ - /* - ** Not implemented in linux. - */ - return(OS_SUCCESS); -} /* end OS_FPUExcDisable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcSetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcSetMask_Impl(uint32 mask) -{ - /* - ** Not implemented in linux. - */ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcSetMask_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcGetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcGetMask_Impl(uint32 *mask) -{ - /* - ** Not implemented in linux. - */ - *mask = 0; - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcGetMask_Impl */ - diff --git a/src/os/posix/src/os-impl-interrupts.c b/src/os/posix/src/os-impl-interrupts.c deleted file mode 100644 index 74044d118..000000000 --- a/src/os/posix/src/os-impl-interrupts.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file os-impl-interrupts.c - * \ingroup posix - * \author joseph.p.hickey@nasa.gov - * - */ - -/**************************************************************************************** - INCLUDE FILES - ***************************************************************************************/ - -#include "os-posix.h" -#include "os-shared-interrupts.h" - -/**************************************************************************************** - INT API (deprecated) - ***************************************************************************************/ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntAttachHandler_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntAttachHandler_Impl (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntAttachHandler_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntUnlock_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntUnlock_Impl (int32 IntLevel) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntUnlock_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntLock_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntLock_Impl ( void ) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntLock_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_IntEnable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntEnable_Impl(int32 Level) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntEnable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntDisable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntDisable_Impl(int32 Level) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntDisable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntSetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntSetMask_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntGetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) -{ - *MaskSettingPtr = 0; - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntGetMask_Impl */ - diff --git a/src/os/posix/src/os-impl-tasks.c b/src/os/posix/src/os-impl-tasks.c index 2e313e9dd..16f77271d 100644 --- a/src/os/posix/src/os-impl-tasks.c +++ b/src/os/posix/src/os-impl-tasks.c @@ -781,31 +781,6 @@ uint32 OS_TaskGetId_Impl (void) *-----------------------------------------------------------------*/ int32 OS_TaskGetInfo_Impl (uint32 task_id, OS_task_prop_t *task_prop) { -#ifndef OSAL_OMIT_DEPRECATED - size_t copy_sz; - - /* - * NOTE - this is not really valid, as you can't officially - * cast a pthread_t to an integer - * (in fact this fails on cygwin where pthread_t is NOT an integral type) - * - * This is just a hack to fill the value with something. - * To be portable, the application should _NOT_ be using OStask_id for anything. - */ - task_prop->OStask_id = 0; - - if (sizeof(pthread_t) < sizeof(task_prop->OStask_id)) - { - copy_sz = sizeof(pthread_t); - } - else - { - copy_sz = sizeof(task_prop->OStask_id); - } - - memcpy(&task_prop->OStask_id, &OS_impl_task_table[task_id].id, copy_sz); -#endif - return OS_SUCCESS; } /* end OS_TaskGetInfo_Impl */ diff --git a/src/os/rtems/CMakeLists.txt b/src/os/rtems/CMakeLists.txt index 7303b1ca8..812ccaf6a 100644 --- a/src/os/rtems/CMakeLists.txt +++ b/src/os/rtems/CMakeLists.txt @@ -25,17 +25,6 @@ set(RTEMS_BASE_SRCLIST src/os-impl-timebase.c ) -# The FPU and interrupt modules are deprecated. -# If the "OMIT_DEPRECATED" switch is set, then these are not built. -if (NOT OMIT_DEPRECATED) - list(APPEND RTEMS_BASE_SRCLIST - src/os-impl-fpu.c - src/os-impl-interrupts.c - ) -endif (NOT OMIT_DEPRECATED) - - - # Use portable blocks for basic I/O set(RTEMS_IMPL_SRCLIST diff --git a/src/os/rtems/src/os-impl-fpu.c b/src/os/rtems/src/os-impl-fpu.c deleted file mode 100644 index b105d3dde..000000000 --- a/src/os/rtems/src/os-impl-fpu.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file os-impl-fpu.c - * \ingroup rtems - * \author joseph.p.hickey@nasa.gov - * - */ - -/**************************************************************************************** - INCLUDE FILES - ***************************************************************************************/ - -#include "os-rtems.h" -#include "os-shared-fpu.h" - -/**************************************************************************************** - FPU API (deprecated) - ***************************************************************************************/ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcAttachHandler_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcAttachHandler_Impl(uint32 ExceptionNumber, osal_task_entry ExceptionHandler, - int32 parameter) -{ - /* - ** Not implemented in RTEMS. - */ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcAttachHandler_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcEnable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcEnable_Impl(int32 ExceptionNumber) -{ - /* - ** Not implemented in RTEMS. - */ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcEnable_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcDisable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcDisable_Impl(int32 ExceptionNumber) -{ - /* - ** Not implemented in RTEMS. - */ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcDisable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcSetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcSetMask_Impl(uint32 mask) -{ - /* - ** Not implemented in RTEMS. - */ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcSetMask_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcGetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcGetMask_Impl(uint32 *mask) -{ - /* - ** Not implemented in RTEMS. - */ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcGetMask_Impl */ - diff --git a/src/os/rtems/src/os-impl-interrupts.c b/src/os/rtems/src/os-impl-interrupts.c deleted file mode 100644 index 3a48d8020..000000000 --- a/src/os/rtems/src/os-impl-interrupts.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file os-impl-interrupts.c - * \ingroup rtems - * \author joseph.p.hickey@nasa.gov - * - */ - -/**************************************************************************************** - INCLUDE FILES - ***************************************************************************************/ - -#include "os-rtems.h" -#include "os-shared-interrupts.h" - -/**************************************************************************************** - INT API (deprecated) - ***************************************************************************************/ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntAttachHandler_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntAttachHandler_Impl (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) -{ -#if (CPU_SIMPLE_VECTORED_INTERRUPTS == false) - return OS_ERR_NOT_IMPLEMENTED; -#else - rtems_status_code ret_status; - uint32 status ; - rtems_isr_entry old_handler; - - ret_status = rtems_interrupt_catch( - (rtems_isr_entry)InterruptHandler, - (rtems_vector_number)InterruptNumber, - &old_handler); - - switch (ret_status) - { - case RTEMS_SUCCESSFUL : - status = OS_SUCCESS; - break ; - - case RTEMS_INVALID_NUMBER : - status = OS_INVALID_INT_NUM; - break ; - - case RTEMS_INVALID_ADDRESS : - status = OS_INVALID_POINTER; - break ; - - default : - status = OS_ERROR; - break ; - } - return(status) ; -#endif -} /* end OS_IntAttachHandler_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_IntUnlock_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntUnlock_Impl (int32 IntLevel) -{ - rtems_interrupt_level rtems_int_level = IntLevel; - rtems_interrupt_local_enable ( rtems_int_level ); - return (OS_SUCCESS); - -} /* end OS_IntUnlock_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntLock_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntLock_Impl (void) -{ - rtems_interrupt_level rtems_int_level; - - /* - * NOTE: rtems_interrupt_local_disable() is a macro - * that sets the rtems_int_level value. - * - * This code assumes that the value is also storable - * in an int32. - * - * This uses the "local" version which operates on - * the current CPU in case of a multi-processor environment. - * - * This should be identical to rtems_interrupt_disable in - * a single-processor config, but that call is not - * implemented in multi-processor configs. - */ - rtems_interrupt_local_disable(rtems_int_level) ; - return ( (int32) rtems_int_level) ; - -} /* end OS_IntLock_Impl */ - - - -/*---------------------------------------------------------------- - * - * Function: OS_IntEnable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntEnable_Impl (int32 Level) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntEnable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntDisable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntDisable_Impl (int32 Level) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntDisable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntSetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntSetMask_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntGetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) -{ - *MaskSettingPtr = 0; - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntGetMask_Impl */ - diff --git a/src/os/rtems/src/os-impl-tasks.c b/src/os/rtems/src/os-impl-tasks.c index f01b1e2b4..6b4c83a02 100644 --- a/src/os/rtems/src/os-impl-tasks.c +++ b/src/os/rtems/src/os-impl-tasks.c @@ -335,9 +335,6 @@ uint32 OS_TaskGetId_Impl (void) *-----------------------------------------------------------------*/ int32 OS_TaskGetInfo_Impl (uint32 task_id, OS_task_prop_t *task_prop) { -#ifndef OSAL_OMIT_DEPRECATED - task_prop->OStask_id = (uint32) OS_impl_task_table[task_id].id; -#endif return OS_SUCCESS; } /* end OS_TaskGetInfo_Impl */ diff --git a/src/os/shared/inc/os-shared-dir.h b/src/os/shared/inc/os-shared-dir.h index 2c8982e51..0ab885ffd 100644 --- a/src/os/shared/inc/os-shared-dir.h +++ b/src/os/shared/inc/os-shared-dir.h @@ -34,9 +34,6 @@ typedef struct { char dir_name[OS_MAX_PATH_LEN]; -#ifndef OSAL_OMIT_DEPRECATED - os_dirent_t dirent_object; -#endif } OS_dir_internal_record_t; diff --git a/src/os/shared/inc/os-shared-filesys.h b/src/os/shared/inc/os-shared-filesys.h index cd4259740..6e74a00d5 100644 --- a/src/os/shared/inc/os-shared-filesys.h +++ b/src/os/shared/inc/os-shared-filesys.h @@ -207,13 +207,8 @@ int32 OS_FileSysUnmountVolume_Impl (uint32 filesys_id); */ bool OS_FileSys_FindVirtMountPoint(void *ref, uint32 local_id, const OS_common_record_t *obj); -int32 OS_FileSys_SetupInitialParamsForDevice(const char *devname, OS_filesys_internal_record_t *local); int32 OS_FileSys_Initialize(char *address, const char *fsdevname, const char * fsvolname, uint32 blocksize, uint32 numblocks, bool should_format); -#ifndef OSAL_OMIT_DEPRECATED -int32 OS_FileSys_InitLocalFromVolTable(OS_filesys_internal_record_t *local, const OS_VolumeInfo_t *Vol); -#endif - #endif /* INCLUDE_OS_SHARED_FILESYS_H_ */ diff --git a/src/os/shared/inc/os-shared-fpu.h b/src/os/shared/inc/os-shared-fpu.h deleted file mode 100644 index 6d9a0b61d..000000000 --- a/src/os/shared/inc/os-shared-fpu.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file os-shared-fpu.h - * \ingroup shared - * \author joseph.p.hickey@nasa.gov - * - */ - -#ifndef INCLUDE_OS_SHARED_FPU_H_ -#define INCLUDE_OS_SHARED_FPU_H_ - -#include - -#ifndef OSAL_OMIT_DEPRECATED - - -/**************************************************************************************** - FLOATING POINT CONFIG/EXCEPTION API LOW-LEVEL IMPLEMENTATION FUNCTIONS - ****************************************************************************************/ - -/* - * FPU API low-level handlers - * These may also not be implementable on some platforms - */ -int32 OS_FPUExcAttachHandler_Impl(uint32 ExceptionNumber, osal_task_entry ExceptionHandler, - int32 parameter); -int32 OS_FPUExcEnable_Impl(int32 ExceptionNumber); -int32 OS_FPUExcDisable_Impl(int32 ExceptionNumber); - -/*---------------------------------------------------------------- - Function: OS_FPUExcSetMask_Impl - - Purpose: This function sets the FPU exception mask - - Returns: OS_SUCCESS on success, or relevant error code - ------------------------------------------------------------------*/ -int32 OS_FPUExcSetMask_Impl(uint32 mask); - -/*---------------------------------------------------------------- - Function: OS_FPUExcGetMask_Impl - - Purpose: This function gets the FPU exception mask - - Returns: OS_SUCCESS on success, or relevant error code - ------------------------------------------------------------------*/ -int32 OS_FPUExcGetMask_Impl(uint32 *mask); - -#endif - -#endif /* INCLUDE_OS_SHARED_FPU_H_ */ - diff --git a/src/os/shared/inc/os-shared-interrupts.h b/src/os/shared/inc/os-shared-interrupts.h deleted file mode 100644 index 33b732d80..000000000 --- a/src/os/shared/inc/os-shared-interrupts.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file os-shared-interrupts.h - * \ingroup shared - * \author joseph.p.hickey@nasa.gov - * - */ - -#ifndef INCLUDE_OS_SHARED_INTERRUPTS_H_ -#define INCLUDE_OS_SHARED_INTERRUPTS_H_ - -#include - - -#ifndef OSAL_OMIT_DEPRECATED - -/**************************************************************************************** - INTERRUPT API LOW-LEVEL IMPLEMENTATION FUNCTIONS - ****************************************************************************************/ - -/* - * Interrupt API low-level handlers - * - * These are defined for completeness but may not be implementable on - * multi-user platforms where interrupts are handled exclusively at the - * kernel level. They may work on single-user RTOS's like - * VxWorks or RTEMS, but not Linux. As such they should not be - * relied upon. - */ - -/*---------------------------------------------------------------- - Function: OS_IntAttachHandler_Impl - - Purpose: The call associates a specified C routine to a specified interrupt - number.Upon occurring of the InterruptNumber the InerruptHandler - routine will be called and passed the parameter. - - Returns: OS_SUCCESS on success, or relevant error code - ------------------------------------------------------------------*/ -int32 OS_IntAttachHandler_Impl (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter); - -/*---------------------------------------------------------------- - Function: OS_IntUnlock_Impl - - Purpose: Enable previous state of interrupts - - Returns: OS_SUCCESS on success, or relevant error code - ------------------------------------------------------------------*/ -int32 OS_IntUnlock_Impl (int32 IntLevel); - -/*---------------------------------------------------------------- - Function: OS_IntLock_Impl - - Purpose: Disable interrupts - - Returns: A key value that can be used to restore interrupts - ------------------------------------------------------------------*/ -int32 OS_IntLock_Impl ( void ); - -/*---------------------------------------------------------------- - Function: OS_IntEnable_Impl - - Purpose: Enable previous state of interrupts - - Returns: OS_SUCCESS on success, or relevant error code - ------------------------------------------------------------------*/ -int32 OS_IntEnable_Impl(int32 Level); - -/*---------------------------------------------------------------- - Function: OS_IntDisable_Impl - - Purpose: Disable the corresponding interrupt number. - - Returns: OS_SUCCESS on success, or relevant error code - ------------------------------------------------------------------*/ -int32 OS_IntDisable_Impl(int32 Level); - -/*---------------------------------------------------------------- - Function: OS_IntSetMask_Impl - - Purpose: Set the cpu mask register for interrupts - - Returns: OS_SUCCESS on success, or relevant error code - ------------------------------------------------------------------*/ -int32 OS_IntSetMask_Impl ( uint32 MaskSetting ); - -/*---------------------------------------------------------------- - Function: OS_IntGetMask_Impl - - Purpose: Read and output the setting of the cpu mask register - - Returns: OS_SUCCESS on success, or relevant error code - ------------------------------------------------------------------*/ -int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ); - -#endif /* OSAL_OMIT_DEPRECATED */ - - -#endif /* INCLUDE_OS_SHARED_INTERRUPTS_H_ */ - diff --git a/src/os/shared/src/osapi-dir.c b/src/os/shared/src/osapi-dir.c index e17b9b6c5..2f81ec304 100644 --- a/src/os/shared/src/osapi-dir.c +++ b/src/os/shared/src/osapi-dir.c @@ -64,20 +64,6 @@ enum OS_dir_internal_record_t OS_dir_table [LOCAL_NUM_OBJECTS]; -#ifndef OSAL_OMIT_DEPRECATED -/* - * A type safe(-ish) way of encoding the 32-bit dir ID inside a pointer. - * This is because the old API used a DIR* object directly and this is intended - * to retain compatibility with code written against that API. - */ -typedef union -{ - os_dirp_t dirp; - uint32 dir_id; -} OS_Dirp_Xltr_t; - -#endif - /**************************************************************************************** DIRECTORY API @@ -292,92 +278,3 @@ int32 OS_rmdir (const char *path) } /* end OS_rmdir */ -/* - * Compatibility layers for old-style API - */ -#ifndef OSAL_OMIT_DEPRECATED - -/*---------------------------------------------------------------- - - * Function: OS_opendir - * - * Purpose: Open a directory. Deprecated function. - * - *-----------------------------------------------------------------*/ -os_dirp_t OS_opendir (const char *path) -{ - OS_Dirp_Xltr_t dirdescptr; - - dirdescptr.dirp = NULL; - OS_DirectoryOpen(&dirdescptr.dir_id, path); - - return dirdescptr.dirp; -} /* end OS_opendir */ - - -/*---------------------------------------------------------------- - * - * Function: OS_closedir - * - * Purpose: closes a directory. Deprecated function. - * - *-----------------------------------------------------------------*/ -int32 OS_closedir (os_dirp_t directory) -{ - OS_Dirp_Xltr_t dirdescptr; - - if (directory == NULL) - { - return OS_INVALID_POINTER; - } - dirdescptr.dirp = directory; - - return (OS_DirectoryClose(dirdescptr.dir_id)); -} /* end OS_closedir */ - -/*---------------------------------------------------------------- - * - * Function: OS_readdir - * - * Purpose: read a directory. Deprecated function. - * - * NOTE: this function is not thread-safe, and it cannot ever be thread-safe, - * which is one reason why this is deprecated. - * - *-----------------------------------------------------------------*/ -os_dirent_t *OS_readdir (os_dirp_t directory) -{ - OS_Dirp_Xltr_t dirdescptr; - uint32 array_idx; - os_dirent_t *tempptr; - - dirdescptr.dirp = directory; - OS_ConvertToArrayIndex(dirdescptr.dir_id, &array_idx); - - tempptr = &OS_dir_table[array_idx].dirent_object; - if (OS_DirectoryRead(dirdescptr.dir_id, tempptr) != OS_SUCCESS) - { - tempptr = NULL; - } - - return tempptr; -} /* end OS_readdir */ - -/*---------------------------------------------------------------- - * - * Function: OS_rewinddir - * - * Purpose: Rewinds the directory pointer. Deprecated Function. - * - *-----------------------------------------------------------------*/ -void OS_rewinddir (os_dirp_t directory ) -{ - OS_Dirp_Xltr_t dirdescptr; - - dirdescptr.dirp = directory; - - OS_DirectoryRewind(dirdescptr.dir_id); -} /* end OS_rewinddir */ - -#endif - diff --git a/src/os/shared/src/osapi-filesys.c b/src/os/shared/src/osapi-filesys.c index 10f734d1d..627ebe33e 100644 --- a/src/os/shared/src/osapi-filesys.c +++ b/src/os/shared/src/osapi-filesys.c @@ -55,20 +55,6 @@ enum */ OS_filesys_internal_record_t OS_filesys_table[LOCAL_NUM_OBJECTS]; -#ifndef OSAL_OMIT_DEPRECATED - -/* - * This is the volume table reference. It is defined in the BSP/startup code for the board - * In this implementation it is treated as a "const" -- any dynamic updates such as runtime - * mount points are handled with an internal table. - * - * Use of the static volume table is deprecated. New applications should register the file - * system mappings via runtime API calls instead (e.g. OS_FileSysAddFixedMap). - */ -extern const OS_VolumeInfo_t OS_VolumeTable[]; - -#endif - /* * A string that should be the prefix of RAM disk volume names, which * provides a hint that the file system refers to a RAM disk. @@ -106,152 +92,6 @@ bool OS_FileSys_FindVirtMountPoint(void *ref, uint32 local_id, const OS_common_r } /* end OS_FileSys_FindVirtMountPoint */ -/*---------------------------------------------------------------- - * - * Function: OS_FileSys_InitLocalFromVolTable - * - * Purpose: Local helper routine, not part of OSAL API. - * Pre-populates a local filesys table entry from the classic OS_VolumeTable - * This provides backward compatibility with existing PSP/BSP implementations. - * - * This helper is not necessary when not using the OS_VolumeTable and therefore - * can be compiled-out when OSAL_OMIT_DEPRECATED is set. - * - * Returns: OS_SUCCESS on success or appropriate error code. - * - *-----------------------------------------------------------------*/ -#ifndef OSAL_OMIT_DEPRECATED -int32 OS_FileSys_InitLocalFromVolTable(OS_filesys_internal_record_t *local, const OS_VolumeInfo_t *Vol) -{ - int32 return_code = OS_SUCCESS; - - if (isgraph((int)Vol->VolumeName[0]) && - strcmp(Vol->DeviceName,"unused") != 0) - { - strncpy(local->volume_name, Vol->VolumeName, sizeof(local->volume_name)-1); - local->volume_name[sizeof(local->volume_name)-1] = 0; - } - - if (isgraph((int)Vol->PhysDevName[0]) && - strcmp(Vol->PhysDevName,"unused") != 0) - { - strncpy(local->system_mountpt, Vol->PhysDevName, sizeof(local->system_mountpt)-1); - local->system_mountpt[sizeof(local->system_mountpt)-1] = 0; - } - - if (isgraph((int)Vol->MountPoint[0]) && - strcmp(Vol->MountPoint,"unused") != 0) - { - strncpy(local->virtual_mountpt, Vol->MountPoint, sizeof(local->virtual_mountpt)-1); - local->virtual_mountpt[sizeof(local->virtual_mountpt)-1] = 0; - } - - /* - * For filesystems marked as "FS_BASED" in the classic volume table, these - * must be mounted and accessible prior to starting OSAL. OSAL does - * not directly manage these. The "FIXED" flag is used to indicate this. - * - * For other filesystem types, set the "fstype" field within the local - * record which serves as a hint or guidance to the implementation - * as to the proper filesystem to use when mounting or initializing the device. - * - * Note that the implementation may choose to ignore this guidance entirely, - * and instead use a system-specific method (such as an /etc/fstab file) which - * is fine. - */ - if (Vol->VolumeType == FS_BASED) - { - local->fstype = OS_FILESYS_TYPE_FS_BASED; - local->flags |= OS_FILESYS_FLAG_IS_FIXED; - } - else if (Vol->VolumeType == RAM_DISK || Vol->VolatileFlag) - { - local->fstype = OS_FILESYS_TYPE_VOLATILE_DISK; - } - else if (Vol->VolumeType == ATA_DISK) - { - local->fstype = OS_FILESYS_TYPE_NORMAL_DISK; - } - else if (Vol->VolumeType == EEPROM_DISK) - { - local->fstype = OS_FILESYS_TYPE_MTD; - } - - if (!Vol->FreeFlag) - { - local->flags |= OS_FILESYS_FLAG_IS_READY; - } - - if (Vol->IsMounted) - { - local->flags |= OS_FILESYS_FLAG_IS_MOUNTED_VIRTUAL | OS_FILESYS_FLAG_IS_MOUNTED_SYSTEM; - } - - /* sanity check on mount points. - * Issue a warning and drop the entry if it does not check out. */ - if ((local->flags & OS_FILESYS_FLAG_IS_READY) != 0 && - local->volume_name[0] == 0) - { - OS_DEBUG("WARNING: Filesystem %s has invalid volume name\n", local->device_name); - return_code = OS_ERROR; - } - - if ((local->flags & OS_FILESYS_FLAG_IS_MOUNTED_SYSTEM) != 0 && - local->system_mountpt[0] == 0) - { - OS_DEBUG("WARNING: Filesystem %s has invalid system mount point\n", local->device_name); - return_code = OS_ERROR; - } - - if ((local->flags & OS_FILESYS_FLAG_IS_MOUNTED_VIRTUAL) != 0 && - local->virtual_mountpt[0] == 0) - { - OS_DEBUG("WARNING: Filesystem %s has invalid virtual mount point\n", local->device_name); - return_code = OS_ERROR; - } - - return return_code; -} /* end OS_FileSys_InitLocalFromVolTable */ -#endif /* OSAL_OMIT_DEPRECATED */ - -/*---------------------------------------------------------------- - * - * Function: OS_FileSys_SetupInitialParamsForDevice - * - * Purpose: Local helper routine, not part of OSAL API. - * Pre-populates a local filesys table entry from the classic OS_VolumeTable - * This provides backward compatibility with existing PSP/BSP implementations. - * - * This function is a no-op when OSAL_OMIT_DEPRECATED is set. - * - * Returns: OS_SUCCESS on success or appropriate error code. - * - *-----------------------------------------------------------------*/ -int32 OS_FileSys_SetupInitialParamsForDevice(const char *devname, OS_filesys_internal_record_t *local) -{ - int32 return_code = OS_ERR_NAME_NOT_FOUND; - -#ifndef OSAL_OMIT_DEPRECATED - const OS_VolumeInfo_t *Vol; - uint32 i; - - Vol = OS_VolumeTable; - for (i = 0; i < OS_MAX_FILE_SYSTEMS; i++) - { - if (strcmp(Vol->DeviceName, devname) == 0) - { - return_code = OS_FileSys_InitLocalFromVolTable(local, Vol); - break; - } - - ++Vol; - } -#endif /* OSAL_OMIT_DEPRECATED */ - - return return_code; -} /* end OS_FileSys_SetupInitialParamsForDevice */ - - /*---------------------------------------------------------------- * * Function: OS_FileSys_Initialize @@ -301,10 +141,6 @@ int32 OS_FileSys_Initialize(char *address, const char *fsdevname, const char * f global->name_entry = local->device_name; strcpy(local->device_name, fsdevname); - /* Get the initial settings from the classic volume table. - * If this fails, that is OK - because passed-in values get preference anyway */ - OS_FileSys_SetupInitialParamsForDevice(fsdevname, local); - /* populate the VolumeName and BlockSize ahead of the Impl call, * so the implementation can reference this info if necessary */ local->blocksize = blocksize; @@ -380,59 +216,6 @@ int32 OS_FileSysAPI_Init(void) memset(OS_filesys_table, 0, sizeof(OS_filesys_table)); -#ifndef OSAL_OMIT_DEPRECATED - uint32 i; - uint32 local_id; - OS_common_record_t *global; - OS_filesys_internal_record_t *local; - const OS_VolumeInfo_t *Vol; - - /* - * For compatibility, migrate active entries of the BSP-provided OS_VolumeTable - * into the local filesystem table. In this implementation, the OS_VolumeTable - * is not actually used at runtime, but it is referenced during this init - * to initially populate the tables. This allows existing PSP/BSP packages - * to continue to work with their existing OS_VolumeTable definition. - * - * HOWEVER --- this table definition is problematic in regards to - * identify a valid/used entry vs. an unused entry. - * - * a) Checking "Free" flag is insufficient. Old implementations would - * consider (at least) the "DeviceName" as always valid and use this value, - * regardless of the state of the "Free" flag. - * b) If an entry is all zero (i.e. from a memset() or an array index that was - * not explicitly initialized), the "Free" flag becomes false and the - * VolumeType field becomes "FS_BASED", so it aliases a valid entry. - * c) Checking for an empty string in various fields will not work either, as - * many existing BSPs initialize the strings in unused fields to a string - * such as "unused" or " " (a space). - * - * Most existing PSP packages seem to set the device name in unused entries - * to the special string "unused", whereas a valid entry starts with a slash (/). - */ - Vol = OS_VolumeTable; - for (i = 0; i < OS_MAX_FILE_SYSTEMS && return_code == OS_SUCCESS; i++) - { - if (Vol->DeviceName[0] == '/' && Vol->FreeFlag == false) - { - OS_DEBUG("OSAL: Registering VolumeTable map for %s on %s\n", Vol->PhysDevName, Vol->MountPoint); - return_code = OS_ObjectIdAllocateNew(LOCAL_OBJID_TYPE, Vol->DeviceName, &local_id, &global); - if (return_code == OS_SUCCESS) - { - local = &OS_filesys_table[local_id]; - - strncpy(local->device_name, Vol->DeviceName, sizeof(local->device_name)-1); - global->name_entry = OS_filesys_table[local_id].device_name; - - return_code = OS_FileSys_InitLocalFromVolTable(&OS_filesys_table[local_id], Vol); - - return_code = OS_ObjectIdFinalizeNew(return_code, global, NULL); - } - } - ++Vol; - } -#endif - return return_code; } /* end OS_FileSysAPI_Init */ diff --git a/src/os/shared/src/osapi-fpu.c b/src/os/shared/src/osapi-fpu.c deleted file mode 100644 index e41468e5e..000000000 --- a/src/os/shared/src/osapi-fpu.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file osapi-fpu.c - * \ingroup shared - * \author joseph.p.hickey@nasa.gov - * - * Contains the code related to floating point mode setting. - * Implementation of these are mostly in the lower layer; however - * a wrapper must exist at this level which allows for unit testing. - */ - -/**************************************************************************************** - INCLUDE FILES - ***************************************************************************************/ -#include -#include -#include - -#ifndef OSAL_OMIT_DEPRECATED - -/* - * User defined include files - */ -#include "os-shared-fpu.h" - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcAttachHandler - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcAttachHandler (uint32 ExceptionNumber, osal_task_entry ExceptionHandler , - int32 parameter) -{ - if (ExceptionHandler == NULL) - { - return OS_INVALID_POINTER; - } - - return OS_FPUExcAttachHandler_Impl(ExceptionNumber, ExceptionHandler, parameter); -} /* end OS_FPUExcAttachHandler */ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcSetMask - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcSetMask(uint32 mask) -{ - return OS_FPUExcSetMask_Impl(mask); -} /* end OS_FPUExcSetMask */ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcGetMask - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcGetMask(uint32 *mask) -{ - if (mask == NULL) - { - return OS_INVALID_POINTER; - } - - return OS_FPUExcGetMask_Impl(mask); -} /* end OS_FPUExcGetMask */ - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcEnable - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcEnable (int32 ExceptionNumber) -{ - return OS_FPUExcEnable_Impl(ExceptionNumber); -} /* end OS_FPUExcEnable */ - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcDisable - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcDisable (int32 ExceptionNumber) -{ - return OS_FPUExcDisable_Impl(ExceptionNumber); -} /* end OS_FPUExcDisable */ - -#endif /* OSAL_OMIT_DEPRECATED */ diff --git a/src/os/shared/src/osapi-interrupts.c b/src/os/shared/src/osapi-interrupts.c deleted file mode 100644 index 370cf70ab..000000000 --- a/src/os/shared/src/osapi-interrupts.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file osapi-interrupts.c - * \ingroup shared - * \author joseph.p.hickey@nasa.gov - * - * Contains the code related to interrupt handling. - * Implementation of these are mostly in the lower layer; however - * a wrapper must exist at this level which allows for unit testing. - */ - -/**************************************************************************************** - INCLUDE FILES - ***************************************************************************************/ -#include -#include -#include - - -/* - * User defined include files - */ -#include "os-shared-interrupts.h" - -#ifndef OSAL_OMIT_DEPRECATED /* Remove file and remove from build when deleted */ - /* Optionally remove from sources once source selection is in cmake options */ - -/*---------------------------------------------------------------- - * - * Function: OS_IntAttachHandler - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntAttachHandler (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) -{ - if (InterruptHandler == NULL) - { - return OS_INVALID_POINTER; - } - - return OS_IntAttachHandler_Impl(InterruptNumber, InterruptHandler, parameter); -} /* end OS_IntAttachHandler */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntUnlock - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntUnlock (int32 IntFlags) -{ - return OS_IntUnlock_Impl(IntFlags); -} /* end OS_IntUnlock */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntLock - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntLock ( void ) -{ - return OS_IntLock_Impl(); -} /* end OS_IntLock */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntEnable - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntEnable(int32 Level) -{ - return OS_IntEnable_Impl(Level); -} /* end OS_IntEnable */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntDisable - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntDisable(int32 Level) -{ - return OS_IntDisable_Impl(Level); -} /* end OS_IntDisable */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntSetMask - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntSetMask ( uint32 MaskSetting ) -{ - return OS_IntSetMask_Impl(MaskSetting); -} /* end OS_IntSetMask */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntGetMask - * - * Purpose: Implemented per public OSAL API - * See description in API and header file for detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntGetMask ( uint32 * MaskSettingPtr ) -{ - return OS_IntGetMask_Impl(MaskSettingPtr); -} /* end OS_IntGetMask */ - -#endif /* OSAL_OMIT_DEPRECATED */ diff --git a/src/os/vxworks/CMakeLists.txt b/src/os/vxworks/CMakeLists.txt index 09b01fe8e..9a510d041 100644 --- a/src/os/vxworks/CMakeLists.txt +++ b/src/os/vxworks/CMakeLists.txt @@ -25,17 +25,6 @@ set(VXWORKS_BASE_SRCLIST src/os-impl-timebase.c ) -# The FPU and interrupt modules are deprecated. -# If the "OMIT_DEPRECATED" switch is set, then these are not built. -if (NOT OMIT_DEPRECATED) - list(APPEND VXWORKS_BASE_SRCLIST - src/os-impl-fpu.c - src/os-impl-interrupts.c - ) -endif (NOT OMIT_DEPRECATED) - - - # Use portable blocks for basic I/O set(VXWORKS_IMPL_SRCLIST diff --git a/src/os/vxworks/src/os-impl-fpu.c b/src/os/vxworks/src/os-impl-fpu.c deleted file mode 100644 index e79d33db8..000000000 --- a/src/os/vxworks/src/os-impl-fpu.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file os-impl-fpu.c - * \ingroup vxworks - * \author joseph.p.hickey@nasa.gov - * - */ -/**************************************************************************************** - INCLUDE FILES -****************************************************************************************/ - -#include "os-vxworks.h" -#include "os-shared-fpu.h" - -/**************************************************************************************** - FPU API (deprecated) -****************************************************************************************/ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcAttachHandler_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcAttachHandler_Impl(uint32 ExceptionNumber, osal_task_entry ExceptionHandler, - int32 parameter) -{ - /* - ** Not implemented in VxWorks. - */ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_FPUExcAttachHandler_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcEnable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcEnable_Impl(int32 ExceptionNumber) -{ - /* - ** Not implemented in VxWorks. - */ - return(OS_SUCCESS); -} /* end OS_FPUExcEnable_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcDisable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcDisable_Impl(int32 ExceptionNumber) -{ - /* - ** Not implemented in VxWorks. - */ - return(OS_SUCCESS); -} /* end OS_FPUExcDisable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcSetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcSetMask_Impl(uint32 mask) -{ - int32 Status; - - /* - * only implemented on ppc except ppc440 - * carry-over from previous vxworks osal - */ -#if defined(_PPC_) && CPU != PPC440 - vxFpscrSet( mask); - Status = OS_SUCCESS; -#else - Status = OS_ERR_NOT_IMPLEMENTED; -#endif - - return Status; -} /* end OS_FPUExcSetMask_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_FPUExcGetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_FPUExcGetMask_Impl(uint32 *mask) -{ - int32 Status; - -#if defined(_PPC_) && CPU != PPC440 - *mask = vxFpscrGet(); - Status = OS_SUCCESS; -#else - Status = OS_ERR_NOT_IMPLEMENTED; -#endif - return Status; -} /* end OS_FPUExcGetMask_Impl */ - diff --git a/src/os/vxworks/src/os-impl-interrupts.c b/src/os/vxworks/src/os-impl-interrupts.c deleted file mode 100644 index 735cf4e93..000000000 --- a/src/os/vxworks/src/os-impl-interrupts.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file os-impl-interrupts.c - * \ingroup vxworks - * \author joseph.p.hickey@nasa.gov - * - */ -/**************************************************************************************** - INCLUDE FILES -****************************************************************************************/ - -#include -#include - -#include "os-vxworks.h" -#include "os-shared-interrupts.h" - -/**************************************************************************************** - INT API (deprecated) -****************************************************************************************/ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntAttachHandler_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntAttachHandler_Impl (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) -{ - /* The Xenomai-VxWorks emulation layer does not support interrupt control */ - if(intConnect(INUM_TO_IVEC(InterruptNumber), - (VOIDFUNCPTR)InterruptHandler, parameter) != OK) - { - return OS_ERROR; - } - - return OS_SUCCESS; -} /* end OS_IntAttachHandler_Impl */ - -/*---------------------------------------------------------------- - * - * Function: OS_IntUnlock_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntUnlock_Impl (int32 IntLevel) -{ - intUnlock(IntLevel); - return(OS_SUCCESS); -} /* end OS_IntUnlock_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntLock_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntLock_Impl (void) -{ - return (int32)intLock(); -} /* end OS_IntLock_Impl */ - - - -/*---------------------------------------------------------------- - * - * Function: OS_IntEnable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntEnable_Impl (int32 Level) -{ - int32 RetCode; - int Status; - - Status = intEnable(Level); - - if(Status == OK) - { - RetCode = OS_SUCCESS; - } - else - { - RetCode = OS_ERROR; - } - - return RetCode; -} /* end OS_IntEnable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntDisable_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntDisable_Impl (int32 Level) -{ - int32 RetCode; - int Status; - - Status = intDisable(Level); - - if(Status == OK) - { - RetCode = OS_SUCCESS; - } - else - { - RetCode = OS_ERROR; - } - - return RetCode; -} /* end OS_IntDisable_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntSetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) -{ - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntSetMask_Impl */ - - -/*---------------------------------------------------------------- - * - * Function: OS_IntGetMask_Impl - * - * Purpose: Implemented per internal OSAL API - * See prototype for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) -{ - *MaskSettingPtr = 0; - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntGetMask_Impl */ - diff --git a/src/os/vxworks/src/os-impl-tasks.c b/src/os/vxworks/src/os-impl-tasks.c index d8dff4746..a764e5423 100644 --- a/src/os/vxworks/src/os-impl-tasks.c +++ b/src/os/vxworks/src/os-impl-tasks.c @@ -427,23 +427,6 @@ uint32 OS_TaskGetId_Impl (void) *-----------------------------------------------------------------*/ int32 OS_TaskGetInfo_Impl (uint32 task_id, OS_task_prop_t *task_prop) { -#ifndef OSAL_OMIT_DEPRECATED - union - { - TASK_ID vxid; - uint32 value; - } u; - - /* - * The "OStask_id" is a broken concept and only included for backward compatibility. - * On 32 bit platforms this should produce a backward-compatible result. - * But on 64 bit platforms this value should never be used..... - * using a union defeats a (valid) warning on 64-bit. - */ - u.vxid = OS_impl_task_table[task_id].vxid; - task_prop->OStask_id = u.value; -#endif - return OS_SUCCESS; } /* end OS_TaskGetInfo_Impl */ diff --git a/src/tests/file-api-test/file-api-test.c b/src/tests/file-api-test/file-api-test.c index 8784c6951..385c0b513 100644 --- a/src/tests/file-api-test/file-api-test.c +++ b/src/tests/file-api-test/file-api-test.c @@ -500,10 +500,6 @@ void TestOpenReadCloseDir(void) int size; int fd1; int fd2; -#if !defined(OSAL_OMIT_DEPRECATED) - os_dirp_t dirp0; - os_dirent_t *dirent_ptr0; -#endif uint32 dirh; os_dirent_t dirent; @@ -619,27 +615,6 @@ void TestOpenReadCloseDir(void) UtAssert_True(status >= OS_SUCCESS, "OS_DirectoryClose Rc=%d",(int)status); - /* use the deprecated API to read again (replaces test 3) */ - /* - * Note the only test really does is to call readdir() until it returns NULL, - * this is already done in test 1 when using the abstraction API - */ -#if !defined(OSAL_OMIT_DEPRECATED) - dirp0 = OS_opendir(dir0); - UtAssert_True(dirp0 != NULL, "OS_opendir not null"); - - dirent_ptr0 = OS_readdir (dirp0); - UtAssert_True(dirent_ptr0 != NULL, "OS_readdir not null"); - while (dirent_ptr0 != NULL) - { - dirent_ptr0 = OS_readdir(dirp0); - } - - status = OS_closedir(dirp0); - UtAssert_True(status >= OS_SUCCESS, "OS_closedir Rc=%d",(int)status); - -#endif /* !defined(OSAL_OMIT_DEPRECATED) */ - /* Now test the open/ read close for one of the sub directories */ /* New version of test 4 - uses full abstraction API */ diff --git a/src/unit-test-coverage/shared/src/coveragetest-dir.c b/src/unit-test-coverage/shared/src/coveragetest-dir.c index d8a48614c..1d57d4a27 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-dir.c +++ b/src/unit-test-coverage/shared/src/coveragetest-dir.c @@ -133,65 +133,6 @@ void Test_OS_rmdir(void) -/* - * Compatibility layers for old-style API - */ -#ifndef OSAL_OMIT_DEPRECATED - -void Test_OS_opendir(void) -{ - /* - * Test Case For: - * os_dirp_t OS_opendir (const char *path) - */ - os_dirp_t dirp = OS_opendir("Dir"); - - UtAssert_True(dirp != NULL, "OS_opendir() (%p) != NULL", dirp); -} - - -void Test_OS_closedir(void) -{ - /* - * Test Case For: - * int32 OS_closedir (os_dirp_t directory) - */ - int32 expected = OS_SUCCESS; - os_dirp_t dirp = OS_opendir("Dir"); - int32 actual = OS_closedir(dirp); - - UtAssert_True(actual == expected, "OS_closedir() (%ld) == OS_SUCCESS", (long)actual); -} - - -void Test_OS_readdir(void) -{ - /* - * Test Case For: - * os_dirent_t *OS_readdir (os_dirp_t directory) - */ - os_dirp_t dirp = OS_opendir("Dir"); - os_dirent_t *dirent = OS_readdir(dirp); - - UtAssert_True(dirent != NULL, "OS_readdir() (%p) != NULL", (void*)dirent); -} - - -void Test_OS_rewinddir(void) -{ - /* - * Test Case For: - * void OS_rewinddir (os_dirp_t directory ) - */ - os_dirp_t dirp = OS_opendir("Dir"); - OS_rewinddir(dirp); -} - - -#endif - - - /* Osapi_Test_Setup * * Purpose: @@ -226,12 +167,6 @@ void UtTest_Setup(void) ADD_TEST(OS_DirectoryRead); ADD_TEST(OS_DirectoryRewind); ADD_TEST(OS_rmdir); -#ifndef OSAL_OMIT_DEPRECATED - ADD_TEST(OS_opendir); - ADD_TEST(OS_closedir); - ADD_TEST(OS_readdir); - ADD_TEST(OS_rewinddir); -#endif } diff --git a/src/unit-test-coverage/ut-stubs/CMakeLists.txt b/src/unit-test-coverage/ut-stubs/CMakeLists.txt index f24b703e6..ccc6bcc18 100644 --- a/src/unit-test-coverage/ut-stubs/CMakeLists.txt +++ b/src/unit-test-coverage/ut-stubs/CMakeLists.txt @@ -88,7 +88,6 @@ add_library(ut_osapi_impl_stubs STATIC EXCLUDE_FROM_ALL src/osapi-error-impl-stubs.c src/osapi-file-impl-stubs.c src/osapi-filesys-impl-stubs.c - src/osapi-fpu-impl-stubs.c src/osapi-heap-impl-stubs.c src/osapi-idmap-impl-stubs.c src/osapi-loader-impl-stubs.c diff --git a/src/unit-test-coverage/ut-stubs/src/osapi-fpu-impl-stubs.c b/src/unit-test-coverage/ut-stubs/src/osapi-fpu-impl-stubs.c deleted file mode 100644 index e9c403902..000000000 --- a/src/unit-test-coverage/ut-stubs/src/osapi-fpu-impl-stubs.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file osapi-fpu-impl-stubs.c - * \ingroup ut-stubs - * \author joseph.p.hickey@nasa.gov - * - */ - -#include -#include -#include -#include - -#include "utstubs.h" - -#include "os-shared-fpu.h" - -/* - * FPU API low-level handlers - */ -UT_DEFAULT_STUB(OS_FPUExcAttachHandler_Impl,(uint32 ExceptionNumber, osal_task_entry ExceptionHandler,int32 parameter)) -UT_DEFAULT_STUB(OS_FPUExcEnable_Impl,(int32 ExceptionNumber)) -UT_DEFAULT_STUB(OS_FPUExcDisable_Impl,(int32 ExceptionNumber)) -UT_DEFAULT_STUB(OS_FPUExcSetMask_Impl,(uint32 mask)) -UT_DEFAULT_STUB(OS_FPUExcGetMask_Impl,(uint32 *mask)) - diff --git a/src/ut-stubs/CMakeLists.txt b/src/ut-stubs/CMakeLists.txt index 2fb4ae703..52ec4d5d2 100644 --- a/src/ut-stubs/CMakeLists.txt +++ b/src/ut-stubs/CMakeLists.txt @@ -23,10 +23,8 @@ add_library(ut_osapi_stubs STATIC osapi-utstub-errors.c osapi-utstub-file.c osapi-utstub-filesys.c - osapi-utstub-fpu.c osapi-utstub-heap.c osapi-utstub-idmap.c - osapi-utstub-interrupts.c osapi-utstub-module.c osapi-utstub-mutex.c osapi-utstub-network.c diff --git a/src/ut-stubs/osapi-utstub-dir.c b/src/ut-stubs/osapi-utstub-dir.c index 6f89b47f0..e4dc958dc 100644 --- a/src/ut-stubs/osapi-utstub-dir.c +++ b/src/ut-stubs/osapi-utstub-dir.c @@ -164,108 +164,3 @@ int32 OS_DirectoryRead(uint32 dir_id, os_dirent_t *dirent) } -#ifndef OSAL_OMIT_DEPRECATED - -/***************************************************************************** - * - * Stub for OS_opendir() function - * Should be removed in the next version of OSAL - * - *****************************************************************************/ -os_dirp_t OS_opendir (const char *path) -{ - UT_Stub_RegisterContext(UT_KEY(OS_opendir), path); - - int32 Status; - os_dirp_t Dirp; - - Status = UT_DEFAULT_IMPL(OS_opendir); - - if (Status == OS_SUCCESS) - { - /* Create a non-null value. Note that if the test code actually dereferences - * this, it'll crash, but it should ONLY call other stubs which do not dereference it. - * - * This API will be replaced by an alternate API that can return status codes - * just like the rest of OSAL. - */ - Dirp = (os_dirp_t)(0xDEADBEEFU); - } - else - { - /* The OS_opendir API does not have a method to return error codes, just NULL */ - Dirp = NULL; - } - - return Dirp; -} - -/***************************************************************************** - * - * Stub for OS_closedir() function - * Should be removed in the next version of OSAL - * - *****************************************************************************/ -int32 OS_closedir (os_dirp_t directory) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_closedir), directory); - - int32 Status; - - Status = UT_DEFAULT_IMPL(OS_closedir); - - return Status; -} - -/***************************************************************************** - * - * Stub for OS_readdir() function - * Should be removed in the next version of OSAL - * - *****************************************************************************/ -os_dirent_t * OS_readdir (os_dirp_t directory) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_readdir), directory); - - static os_dirent_t DefaultEntry; - os_dirent_t *DirentPtr; - int32 Status; - uint32 CopySize; - - Status = UT_DEFAULT_IMPL(OS_readdir); - - if (Status == OS_SUCCESS) - { - /* The test code may register pointers to return as os_dirent_t* values */ - CopySize = UT_Stub_CopyToLocal(UT_KEY(OS_readdir), &DirentPtr, sizeof(DirentPtr)); - if (CopySize < sizeof(DirentPtr)) - { - memset(&DefaultEntry, 0, sizeof(DefaultEntry)); - DirentPtr = &DefaultEntry; - } - } - else - { - /* The OS_readdir API does not have a method to return error codes, just NULL */ - DirentPtr = NULL; - } - - - return DirentPtr; -} - -/***************************************************************************** - * - * Stub for OS_rewinddir() function - * Should be removed in the next version of OSAL - * - *****************************************************************************/ -void OS_rewinddir(os_dirp_t directory) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_rewinddir), directory); - - /* Call the default impl so hooks will work */ - UT_DEFAULT_IMPL(OS_rewinddir); -} -#endif - diff --git a/src/ut-stubs/osapi-utstub-fpu.c b/src/ut-stubs/osapi-utstub-fpu.c deleted file mode 100644 index 3b8952bcc..000000000 --- a/src/ut-stubs/osapi-utstub-fpu.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file osapi_stubs.c - * - * Created on: Feb 25, 2015 - * Author: joseph.p.hickey@nasa.gov - * - * Stub implementations for the functions defined in the OSAL API - * - * The stub implementation can be used for unit testing applications built - * on top of OSAL. The stubs do not do any real function, but allow - * the return code to be crafted such that error paths in the application - * can be executed. - */ - -#include "utstub-helpers.h" - -#ifndef OSAL_OMIT_DEPRECATED - -/***************************************************************************** - * - * Stub function for OS_FPUExcAttachHandler() - * - *****************************************************************************/ -int32 OS_FPUExcAttachHandler (uint32 ExceptionNumber, osal_task_entry ExceptionHandler , - int32 parameter) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcAttachHandler), ExceptionNumber); - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcAttachHandler), ExceptionHandler); - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcAttachHandler), parameter); - - int32 status; - - status = UT_DEFAULT_IMPL_ARGS(OS_FPUExcAttachHandler, ExceptionNumber, ExceptionHandler, parameter); - - return status; -} - -/***************************************************************************** - * - * Stub function for OS_FPUExcEnable() - * - *****************************************************************************/ -int32 OS_FPUExcEnable (int32 ExceptionNumber) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcEnable), ExceptionNumber); - - int32 status; - - status = UT_DEFAULT_IMPL(OS_FPUExcEnable); - - return status; -} - -/***************************************************************************** - * - * Stub function for OS_FPUExcDisable() - * - *****************************************************************************/ -int32 OS_FPUExcDisable (int32 ExceptionNumber) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcDisable), ExceptionNumber); - - int32 status; - - status = UT_DEFAULT_IMPL(OS_FPUExcDisable); - - return status; -} - -/***************************************************************************** - * - * Stub function for OS_FPUExcSetMask() - * - *****************************************************************************/ -int32 OS_FPUExcSetMask (uint32 mask) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcSetMask), mask); - - int32 status; - - status = UT_DEFAULT_IMPL(OS_FPUExcSetMask); - - return status; -} - -/***************************************************************************** - * - * Stub function for OS_FPUExcGetMask() - * - *****************************************************************************/ -int32 OS_FPUExcGetMask (uint32 *mask) -{ - UT_Stub_RegisterContext(UT_KEY(OS_FPUExcGetMask), mask); - - int32 status; - - status = UT_DEFAULT_IMPL(OS_FPUExcGetMask); - *mask = 0x55aa55aa; - - return status; -} - -#endif /* OSAL_OMIT_DEPRECATED */ diff --git a/src/ut-stubs/osapi-utstub-interrupts.c b/src/ut-stubs/osapi-utstub-interrupts.c deleted file mode 100644 index 6087ffbfe..000000000 --- a/src/ut-stubs/osapi-utstub-interrupts.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" - * - * Copyright (c) 2019 United States Government as represented by - * the Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * \file osapi_stubs.c - * - * Created on: Feb 25, 2015 - * Author: joseph.p.hickey@nasa.gov - * - * Stub implementations for the functions defined in the OSAL API - * - * The stub implementation can be used for unit testing applications built - * on top of OSAL. The stubs do not do any real function, but allow - * the return code to be crafted such that error paths in the application - * can be executed. - */ - -#include "utstub-helpers.h" - - -/***************************************************************************** - * - * Stub function for OS_IntAttachHandler() - * - *****************************************************************************/ -int32 OS_IntAttachHandler (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntAttachHandler), InterruptNumber); - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntAttachHandler), InterruptHandler); - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntAttachHandler), parameter); - - return UT_DEFAULT_IMPL(OS_IntAttachHandler); -} - - -/*****************************************************************************/ -/** -** \brief OS_IntLock stub function -** -** \par Description -** This function is used to mimic the response of the OS API function -** OS_IntLock. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns OS_SUCCESS. -** -******************************************************************************/ -int32 OS_IntLock(void) -{ - return UT_DEFAULT_IMPL(OS_IntLock); -} - -/*****************************************************************************/ -/** -** \brief OS_IntUnlock stub function -** -** \par Description -** This function is used to mimic the response of the OS API function -** OS_IntUnlock. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns OS_SUCCESS. -** -******************************************************************************/ -int32 OS_IntUnlock(int32 IntLevel) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntUnlock), IntLevel); - - return UT_DEFAULT_IMPL(OS_IntUnlock); -} - -/***************************************************************************** - * - * Stub function for OS_IntEnable() - * - *****************************************************************************/ -int32 OS_IntEnable(int32 Level) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntEnable), Level); - - return UT_DEFAULT_IMPL(OS_IntEnable); -} - -/***************************************************************************** - * - * Stub function for OS_IntDisable() - * - *****************************************************************************/ -int32 OS_IntDisable(int32 Level) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntDisable), Level); - - return UT_DEFAULT_IMPL(OS_IntDisable); -} - -/***************************************************************************** - * - * Stub function for OS_IntSetMask() - * - *****************************************************************************/ -int32 OS_IntSetMask ( uint32 mask ) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntSetMask), mask); - - return UT_DEFAULT_IMPL(OS_IntSetMask); -} - -/***************************************************************************** - * - * Stub function for OS_IntGetMask() - * - *****************************************************************************/ -int32 OS_IntGetMask ( uint32 * mask ) -{ - UT_Stub_RegisterContext(UT_KEY(OS_IntGetMask), mask); - - return UT_DEFAULT_IMPL(OS_IntGetMask); -} - -