From d4a406f74d61c9625b1ed2dd9eb830f6f7981f50 Mon Sep 17 00:00:00 2001 From: Chris Knight Date: Thu, 19 Mar 2020 15:18:28 -0700 Subject: [PATCH 1/8] fix for #349 - OS_SocketAccept() fix --- src/os/shared/osapi-sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/shared/osapi-sockets.c b/src/os/shared/osapi-sockets.c index 6e1087f0c..06a7b8b0e 100644 --- a/src/os/shared/osapi-sockets.c +++ b/src/os/shared/osapi-sockets.c @@ -237,7 +237,7 @@ int32 OS_SocketAccept(uint32 sock_id, uint32 *connsock_id, OS_SockAddr_t *Addr, /* Socket must be of the STREAM variety */ return_code = OS_ERR_INCORRECT_OBJ_TYPE; } - else if (record->refcount != 0 || (OS_stream_table[local_id].stream_state & (OS_STREAM_STATE_BOUND | OS_STREAM_STATE_CONNECTED)) != OS_STREAM_STATE_BOUND) + else if ((OS_stream_table[local_id].stream_state & (OS_STREAM_STATE_BOUND | OS_STREAM_STATE_CONNECTED)) != OS_STREAM_STATE_BOUND) { /* Socket must be bound but not connected */ return_code = OS_ERR_INCORRECT_OBJ_STATE; From 2a5e9ca7857bf18abfaaa71e3d9144b5d1167404 Mon Sep 17 00:00:00 2001 From: dmknutsen Date: Wed, 25 Mar 2020 14:42:32 -0400 Subject: [PATCH 2/8] Fixes #259, updated osapi-filesys.c + ut_osfilesys_diskio_test to use desired return values --- src/os/shared/osapi-filesys.c | 27 +++------------- .../osfilesys-test/ut_osfilesys_diskio_test.c | 32 +++++++++---------- 2 files changed, 20 insertions(+), 39 deletions(-) diff --git a/src/os/shared/osapi-filesys.c b/src/os/shared/osapi-filesys.c index 252074ba2..21fca38bf 100644 --- a/src/os/shared/osapi-filesys.c +++ b/src/os/shared/osapi-filesys.c @@ -575,13 +575,7 @@ int32 OS_rmfs (const char *devname) } else { - /* - * Although OS_ERR_NAME_NOT_FOUND is more descriptive and a - * better indicator of the real failure, this preserves - * backward compatibility with unit tests that - * are checking specifically for the "OS_FS_ERROR" code. - */ - return_code = OS_FS_ERROR; + return_code = OS_ERR_NAME_NOT_FOUND; } return return_code; @@ -692,13 +686,7 @@ int32 OS_mount (const char *devname, const char* mountpoint) if (return_code != OS_SUCCESS) { - /* - * Although OS_ERR_NAME_NOT_FOUND is more descriptive and a - * better indicator of the real failure, this preserves - * backward compatibility with unit tests that - * are checking specifically for the "OS_FS_ERROR" code. - */ - return_code = OS_FS_ERROR; + return_code = OS_ERR_NAME_NOT_FOUND; } return return_code; @@ -777,13 +765,7 @@ int32 OS_unmount (const char *mountpoint) if (return_code != OS_SUCCESS) { - /* - * Although OS_ERR_NAME_NOT_FOUND is more descriptive and a - * better indicator of the real failure, this preserves - * backward compatibility with unit tests that - * are checking specifically for the "OS_FS_ERROR" code. - */ - return_code = OS_FS_ERROR; + return_code = OS_ERR_NAME_NOT_FOUND; } return return_code; @@ -991,8 +973,7 @@ int32 OS_FS_GetPhysDriveName(char * PhysDriveName, const char * MountPoint) } else { - /* preserves historical (vague) error code */ - return_code = OS_FS_ERROR; + return_code = OS_ERR_NAME_NOT_FOUND; } diff --git a/src/unit-tests/osfilesys-test/ut_osfilesys_diskio_test.c b/src/unit-tests/osfilesys-test/ut_osfilesys_diskio_test.c index f38cba3b7..4a8b097da 100644 --- a/src/unit-tests/osfilesys-test/ut_osfilesys_diskio_test.c +++ b/src/unit-tests/osfilesys-test/ut_osfilesys_diskio_test.c @@ -407,7 +407,7 @@ void UT_os_makefs_test() ** Purpose: Removes or un-maps the target file system ** Parameters: *devname - a pointer to the name of the "generic" drive ** Returns: OS_FS_ERR_INVALID_POINTER if any of the pointers passed in is NULL -** OS_FS_ERROR if the given device is not found in the Volume table +** OS_ERR_NAME_NOT_FOUND if the given device is not found in the Volume table ** OS_FS_SUCCESS if succeeded ** OS_ERR_NOT_IMPLEMENTED if not implemented ** ----------------------------------------------------- @@ -426,7 +426,7 @@ void UT_os_makefs_test() ** 1) Make sure no file system has been created previously ** 2) Call this routine with some device name as argument ** 3) Expect the returned value to be -** (a) OS_FS_ERROR +** (a) OS_ERR_NAME_NOT_FOUND ** ----------------------------------------------------- ** Test #3: Nominal condition ** 1) Call OS_mkfs to create a file system @@ -465,7 +465,7 @@ void UT_os_removefs_test() /*-----------------------------------------------------*/ testDesc = "#2 Invalid-device-arg"; - if (OS_rmfs(g_devNames[2]) == OS_FS_ERROR) + if (OS_rmfs(g_devNames[2]) == OS_ERR_NAME_NOT_FOUND) UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); else UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); @@ -500,7 +500,7 @@ void UT_os_removefs_test() ** Parameters: *devname - a pointer to the name of the drive to mount ** *mountpoint - a pointer to the name to call this disk from now on ** Returns: OS_FS_ERR_INVALID_POINTER if any of the pointers passed in is NULL -** OS_FS_ERROR if the given device is not found in the Volume table +** OS_ERR_NAME_NOT_FOUND if the given device is not found in the Volume table ** OS_FS_SUCCESS if succeeded ** OS_ERR_NOT_IMPLEMENTED if not implemented ** ----------------------------------------------------- @@ -520,7 +520,7 @@ void UT_os_removefs_test() ** 1) Make sure no file system has been created previously ** 2) Call this routine with some device name as argument ** 3) Expect the returned value to be -** (a) OS_FS_ERROR +** (a) OS_ERR_NAME_NOT_FOUND ** ----------------------------------------------------- ** Test #3: Nominal condition ** 1) Call OS_mkfs to create a file system @@ -531,7 +531,7 @@ void UT_os_removefs_test() ** (a) OS_FS_SUCCESS ** 5) Call this routine again exactly as in #3 ** 6) Expect the returned value to be -** (a) OS_FS_ERROR +** (a) OS_ERR_NAME_NOT_FOUND ** 7) Call OS_unmount with the mount-point used in #3 as argument ** 8) Expect the returned value to be ** (a) OS_FS_SUCCESS @@ -563,7 +563,7 @@ void UT_os_mount_test() /*-----------------------------------------------------*/ testDesc = "#2 Invalid-device-arg"; - if (OS_mount("ramdev0", g_mntNames[2]) == OS_FS_ERROR) + if (OS_mount("ramdev0", g_mntNames[2]) == OS_ERR_NAME_NOT_FOUND) UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); else UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); @@ -579,7 +579,7 @@ void UT_os_mount_test() } if ((OS_mount(g_devNames[3], g_mntNames[3]) == OS_FS_SUCCESS) && - (OS_mount(g_devNames[3], g_mntNames[3]) == OS_FS_ERROR)) + (OS_mount(g_devNames[3], g_mntNames[3]) == OS_ERR_NAME_NOT_FOUND)) UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); else UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); @@ -599,7 +599,7 @@ void UT_os_mount_test() ** Parameters: *mountpoint - a pointer to the name of the drive to unmount ** Returns: OS_FS_ERR_INVALID_POINTER if any of the pointers passed in is NULL ** OS_FS_ERR_PATH_TOO_LONG if the absolute path passed in is too long -** OS_FS_ERROR if the mount-point passed in is not found in the Volume table +** OS_ERR_NAME_NOT_FOUND if the mount-point passed in is not found in the Volume table ** OS_FS_SUCCESS if succeeded ** OS_ERR_NOT_IMPLEMENTED if not implemented ** ----------------------------------------------------- @@ -625,7 +625,7 @@ void UT_os_mount_test() ** 1) Make sure no file system has been created previously ** 2) Call this routine with some mount-point name as argument ** 3) Expect the returned value to be -** (a) OS_FS_ERROR +** (a) OS_ERR_NAME_NOT_FOUND ** ----------------------------------------------------- ** Test #4: Nominal condition ** 1) Call OS_mkfs to create a file system @@ -639,7 +639,7 @@ void UT_os_mount_test() ** (a) OS_FS_SUCCESS ** 7) Call this routine again exactly as in #5 ** 8) Expect the returned value to be -** (a) OS_FS_ERROR +** (a) OS_ERR_NAME_NOT_FOUND **--------------------------------------------------------------------------------*/ void UT_os_unmount_test() { @@ -675,7 +675,7 @@ void UT_os_unmount_test() /*-----------------------------------------------------*/ testDesc = "#3 Invalid-mount-point-arg"; - if (OS_unmount(g_mntNames[3]) == OS_FS_ERROR) + if (OS_unmount(g_mntNames[3]) == OS_ERR_NAME_NOT_FOUND) UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); else UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); @@ -692,7 +692,7 @@ void UT_os_unmount_test() if ((OS_mount(g_devNames[4], g_mntNames[4]) == OS_FS_SUCCESS) && (OS_unmount(g_mntNames[4]) == OS_FS_SUCCESS) && - (OS_unmount(g_mntNames[4]) == OS_FS_ERROR)) + (OS_unmount(g_mntNames[4]) == OS_ERR_NAME_NOT_FOUND)) UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); else UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); @@ -712,7 +712,7 @@ void UT_os_unmount_test() ** *MountPoint - a pointer to the name of the mount-point ** Returns: OS_FS_ERR_INVALID_POINTER if any of the pointers passed in is NULL ** OS_FS_ERR_PATH_TOO_LONG if the mount-point passed in is too long -** OS_FS_ERROR if the mount-point passed in is not found in the Volume table +** OS_ERR_NAME_NOT_FOUND if the mount-point passed in is not found in the Volume table ** OS_FS_SUCCESS if succeeded ** OS_ERR_NOT_IMPLEMENTED if not implemented ** ----------------------------------------------------- @@ -740,7 +740,7 @@ void UT_os_unmount_test() ** (a) OS_FS_SUCCESS ** 3) Call this routine ** 4) Expect the returned value to be -** (a) OS_FS_ERROR +** (a) OS_ERR_NAME_NOT_FOUND ** ----------------------------------------------------- ** Test #4: Nominal condition ** 1) Call OS_mkfs @@ -789,7 +789,7 @@ void UT_os_getphysdrivename_test() /*-----------------------------------------------------*/ testDesc = "#3 Invalid-mount-point-arg"; - if (OS_FS_GetPhysDriveName(physDevName, g_mntNames[3]) == OS_FS_ERROR) + if (OS_FS_GetPhysDriveName(physDevName, g_mntNames[3]) == OS_ERR_NAME_NOT_FOUND) UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); else UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); From 29594e16cd0b4e2e28bf069e9e4b28e97259ad40 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 26 Mar 2020 08:41:35 -0400 Subject: [PATCH 3/8] Fix #389, Resolve CI config warnings --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cff0ba693..7bf2b9177 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ +os: linux dist: bionic -sudo: required -language: - - c +language: c compiler: - gcc addons: From 07cd2a30c805304ba7998702cc0b59566e272dd9 Mon Sep 17 00:00:00 2001 From: dmknutsen Date: Wed, 25 Mar 2020 16:17:59 -0400 Subject: [PATCH 4/8] Fixes #347, replace task_1_work with correct variable names --- src/tests/bin-sem-flush-test/bin-sem-flush-test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/bin-sem-flush-test/bin-sem-flush-test.c b/src/tests/bin-sem-flush-test/bin-sem-flush-test.c index 0cc0e0ea4..e123ad481 100644 --- a/src/tests/bin-sem-flush-test/bin-sem-flush-test.c +++ b/src/tests/bin-sem-flush-test/bin-sem-flush-test.c @@ -226,8 +226,8 @@ void BinSemFlushCheck(void) /* At first, No task should have done any work yet (all blocked) */ UtAssert_True(task_1_work == 0, "Task 1 work = %u",(unsigned int)task_1_work); - UtAssert_True(task_2_work == 0, "Task 2 work = %u",(unsigned int)task_1_work); - UtAssert_True(task_3_work == 0, "Task 3 work = %u",(unsigned int)task_1_work); + UtAssert_True(task_2_work == 0, "Task 2 work = %u",(unsigned int)task_2_work); + UtAssert_True(task_3_work == 0, "Task 3 work = %u",(unsigned int)task_3_work); status = OS_BinSemFlush(bin_sem_id); UtAssert_True(status == OS_SUCCESS, "BinSem1 flush Rc=%d", (int)status); @@ -239,8 +239,8 @@ void BinSemFlushCheck(void) OS_TaskDelay(4000); UtAssert_True(task_1_work != 0, "Task 1 work = %u",(unsigned int)task_1_work); - UtAssert_True(task_2_work != 0, "Task 2 work = %u",(unsigned int)task_1_work); - UtAssert_True(task_3_work != 0, "Task 3 work = %u",(unsigned int)task_1_work); + UtAssert_True(task_2_work != 0, "Task 2 work = %u",(unsigned int)task_2_work); + UtAssert_True(task_3_work != 0, "Task 3 work = %u",(unsigned int)task_3_work); UtAssert_True(task_1_failures == 0, "Task 1 failures = %u",(unsigned int)task_1_failures); UtAssert_True(task_2_failures == 0, "Task 2 failures = %u",(unsigned int)task_2_failures); From 592328bc3f7afbec3284338c541627220e78422d Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 25 Mar 2020 11:16:52 -0400 Subject: [PATCH 5/8] Fix #18, Depreacate OS_ShMem* --- src/os/inc/osapi-os-core.h | 15 +++++++++------ .../ut-stubs/src/osapi-base-impl-stubs.c | 2 ++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/os/inc/osapi-os-core.h b/src/os/inc/osapi-os-core.h index d6d89d4b0..36e3f34d0 100644 --- a/src/os/inc/osapi-os-core.h +++ b/src/os/inc/osapi-os-core.h @@ -1294,6 +1294,7 @@ int32 OS_IntGetMask (uint32 *mask); int32 OS_IntAck (int32 InterruptNumber); /**@}*/ +#ifndef OSAL_OMIT_DEPRECATED /** * @defgroup OSAPIShMem OSAL Shared memory APIs * @deprecated Not in current implementations @@ -1302,42 +1303,44 @@ int32 OS_IntAck (int32 InterruptNumber); */ /*-------------------------------------------------------------------------------------*/ -/** @brief placeholder; not currently implemented +/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs * @deprecated Never implemented */ int32 OS_ShMemInit (void); /*-------------------------------------------------------------------------------------*/ -/** @brief placeholder; not currently implemented +/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs * @deprecated Never implemented */ int32 OS_ShMemCreate (uint32 *Id, uint32 NBytes, const char* SegName); /*-------------------------------------------------------------------------------------*/ -/** @brief placeholder; not currently implemented +/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs * @deprecated Never implemented */ int32 OS_ShMemSemTake (uint32 Id); /*-------------------------------------------------------------------------------------*/ -/** @brief placeholder; not currently implemented +/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs * @deprecated Never implemented */ int32 OS_ShMemSemGive (uint32 Id); /*-------------------------------------------------------------------------------------*/ -/** @brief placeholder; not currently implemented +/** @brief DEPRECATED - platform dependent, never implemented in framework OSALs * @deprecated Never implemented */ int32 OS_ShMemAttach (cpuaddr * Address, uint32 Id); /*-------------------------------------------------------------------------------------*/ -/** @brief placeholder; not currently implemented +/** @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/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c b/src/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c index cb660a5a0..504ae52e6 100644 --- a/src/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c @@ -123,6 +123,7 @@ void OS_ConsoleOutput_Impl(uint32 local_id) UT_DEFAULT_IMPL(OS_ConsoleOutput_Impl); } +#ifndef OSAL_OMIT_DEPRECATED /* ** Shared memory API */ @@ -132,6 +133,7 @@ UT_DEFAULT_STUB(OS_ShMemSemTake_Impl,(uint32 Id)) UT_DEFAULT_STUB(OS_ShMemSemGive_Impl,(uint32 Id)) UT_DEFAULT_STUB(OS_ShMemAttach_Impl,(uint32 * Address, uint32 Id)) UT_DEFAULT_STUB(OS_ShMemGetIdByName_Impl,(uint32 *ShMemId, const char *SegName )) +#endif /* OSAL_OMIT_DEPRECATED */ /* From 126d3191f00b1a8eff153dea24807c71919c2954 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Wed, 1 Apr 2020 10:33:54 -0400 Subject: [PATCH 6/8] Increase version to 5.0.10 and update ReadMe --- README.md | 3 ++- src/os/inc/osapi-version.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f60a302c..f0247b791 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ This distribution contains: Version Notes: ============== - +- 5.0.10: DEVELOPMENT + - Minor updates (see https://github.com/nasa/osal/pull/401) - 5.0.9: DEVELOPMENT - Documentation updates (see https://github.com/nasa/osal/pull/375) - 5.0.8: DEVELOPMENT diff --git a/src/os/inc/osapi-version.h b/src/os/inc/osapi-version.h index 52c073047..089fd587f 100644 --- a/src/os/inc/osapi-version.h +++ b/src/os/inc/osapi-version.h @@ -20,7 +20,7 @@ #define OS_MAJOR_VERSION 5 /**< @brief Major version number */ #define OS_MINOR_VERSION 0 /**< @brief Minor version number */ -#define OS_REVISION 9 /**< @brief Revision number */ +#define OS_REVISION 10 /**< @brief Revision number */ #define OS_MISSION_REV 0 /**< @brief Mission revision */ /** From 12499d649427df808a95a52ca5ed63c6f487dc1a Mon Sep 17 00:00:00 2001 From: skliper <47541139+skliper@users.noreply.github.com> Date: Mon, 6 Apr 2020 15:05:14 -0400 Subject: [PATCH 7/8] Fix #385, Deprecate interrupt related APIs (#396) Removes coverage test code completely Marks OS_Int* API's as deprecated and implementations removed if OSAL_OMIT_DEPRECATED defined Co-authored-by: Gerardo E. Cruz-Ortiz <59618057+astrogeco@users.noreply.github.com> --- src/os/inc/osapi-os-core.h | 37 +- src/os/posix/osapi.c | 34 +- src/os/rtems/osapi.c | 59 +-- src/os/shared/os-impl.h | 3 + src/os/shared/osapi-interrupts.c | 3 + src/os/vxworks/osapi.c | 57 +-- .../posix/src/coveragetest-osapi.c | 63 --- .../shared/src/coveragetest-interrupts.c | 164 ------- .../ut-stubs/src/osapi-base-impl-stubs.c | 11 - .../vxworks/src/coveragetest-osapi.c | 81 ---- src/unit-tests/oscore-test/CMakeLists.txt | 1 - .../oscore-test/ut_oscore_interrupt_test.c | 452 ------------------ src/unit-tests/oscore-test/ut_oscore_test.c | 6 - 13 files changed, 113 insertions(+), 858 deletions(-) delete mode 100644 src/unit-test-coverage/shared/src/coveragetest-interrupts.c delete mode 100644 src/unit-tests/oscore-test/ut_oscore_interrupt_test.c diff --git a/src/os/inc/osapi-os-core.h b/src/os/inc/osapi-os-core.h index 36e3f34d0..2378ed5f3 100644 --- a/src/os/inc/osapi-os-core.h +++ b/src/os/inc/osapi-os-core.h @@ -1180,13 +1180,18 @@ int32 OS_FPUExcSetMask (uint32 mask); int32 OS_FPUExcGetMask (uint32 *mask); /**@}*/ +#ifndef OSAL_OMIT_DEPRECATED + /** @defgroup OSAPIInterrupt OSAL Interrupt APIs * @{ + * @deprecated Platform dependencies */ /*-------------------------------------------------------------------------------------*/ /** - * @brief Associate an interrupt number to a specified handler routine + * @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 @@ -1205,7 +1210,9 @@ int32 OS_IntAttachHandler (uint32 InterruptNumber, osal_task_entry InterruptHan /*-------------------------------------------------------------------------------------*/ /** - * @brief Enable interrupts + * @brief DEPRECATED; Enable interrupts + * + * @deprecated platform dependencies, removing from OSAL * * @param[in] IntLevel value from previous call to OS_IntLock() * @@ -1217,7 +1224,9 @@ int32 OS_IntUnlock (int32 IntLevel); /*-------------------------------------------------------------------------------------*/ /** - * @brief Disable interrupts + * @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 @@ -1228,7 +1237,9 @@ int32 OS_IntLock (void); /*-------------------------------------------------------------------------------------*/ /** - * @brief Enables interrupts through Level + * @brief DEPRECATED; Enables interrupts through Level + * + * @deprecated platform dependencies, removing from OSAL * * @param[in] Level the interrupts to enable * @@ -1240,7 +1251,9 @@ int32 OS_IntEnable (int32 Level); /*-------------------------------------------------------------------------------------*/ /** - * @brief Disable interrupts through Level + * @brief DEPRECATED; Disable interrupts through Level + * + * @deprecated platform dependencies, removing from OSAL * * @param[in] Level the interrupts to disable * @@ -1252,7 +1265,9 @@ int32 OS_IntDisable (int32 Level); /*-------------------------------------------------------------------------------------*/ /** - * @brief Set the CPU interrupt mask register + * @brief DEPRECATED; Set the CPU interrupt mask register + * + * @deprecated platform dependencies, removing from OSAL * * @note The interrupt bits are architecture-specific. * @@ -1266,7 +1281,9 @@ int32 OS_IntSetMask (uint32 mask); /*-------------------------------------------------------------------------------------*/ /** - * @brief Get the CPU interrupt mask register + * @brief DEPRECATED; Get the CPU interrupt mask register + * + * @deprecated platform dependencies, removing from OSAL * * @note The interrupt bits are architecture-specific. * @@ -1280,7 +1297,9 @@ int32 OS_IntGetMask (uint32 *mask); /*-------------------------------------------------------------------------------------*/ /** - * @brief Acknowledge the corresponding interrupt number. + * @brief DEPRECATED; Acknowledge the corresponding interrupt number. + * + * @deprecated platform dependencies, removing from OSAL * * @note: placeholder; not currently implemented in sample implementations * @@ -1294,7 +1313,7 @@ int32 OS_IntGetMask (uint32 *mask); int32 OS_IntAck (int32 InterruptNumber); /**@}*/ -#ifndef OSAL_OMIT_DEPRECATED + /** * @defgroup OSAPIShMem OSAL Shared memory APIs * @deprecated Not in current implementations diff --git a/src/os/posix/osapi.c b/src/os/posix/osapi.c index a26b010b9..5a73f141e 100644 --- a/src/os/posix/osapi.c +++ b/src/os/posix/osapi.c @@ -2131,6 +2131,7 @@ int32 OS_MutSemGetInfo_Impl (uint32 sem_id, OS_mut_sem_prop_t *mut_prop) } /* end OS_MutSemGetInfo_Impl */ +#ifndef OSAL_OMIT_DEPRECATED /**************************************************************************************** INT API @@ -2208,48 +2209,49 @@ int32 OS_IntDisable_Impl(int32 Level) /*---------------------------------------------------------------- * - * Function: OS_HeapGetInfo_Impl + * Function: OS_IntSetMask_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_HeapGetInfo_Impl(OS_heap_prop_t *heap_prop) +int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) { - /* - ** Not implemented yet - */ - return (OS_ERR_NOT_IMPLEMENTED); -} /* end OS_HeapGetInfo_Impl */ + return(OS_ERR_NOT_IMPLEMENTED); +} /* end OS_IntSetMask_Impl */ /*---------------------------------------------------------------- * - * Function: OS_IntSetMask_Impl + * Function: OS_IntGetMask_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) +int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) { + *MaskSettingPtr = 0; return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntSetMask_Impl */ +} /* end OS_IntGetMask_Impl */ + +#endif /* OSAL_OMIT_DEPRECATED */ - /*---------------------------------------------------------------- * - * Function: OS_IntGetMask_Impl + * Function: OS_HeapGetInfo_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) +int32 OS_HeapGetInfo_Impl(OS_heap_prop_t *heap_prop) { - *MaskSettingPtr = 0; - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntGetMask_Impl */ + /* + ** Not implemented yet + */ + return (OS_ERR_NOT_IMPLEMENTED); +} /* end OS_HeapGetInfo_Impl */ /*---------------------------------------------------------------- * diff --git a/src/os/rtems/osapi.c b/src/os/rtems/osapi.c index 7e4be24f8..62b672c04 100644 --- a/src/os/rtems/osapi.c +++ b/src/os/rtems/osapi.c @@ -1410,6 +1410,8 @@ int32 OS_MutSemGetInfo_Impl (uint32 sem_id, OS_mut_sem_prop_t *mut_prop) TICK API ***************************************************************************************/ +#ifndef OSAL_OMIT_DEPRECATED + /**************************************************************************************** INT API ***************************************************************************************/ @@ -1539,60 +1541,61 @@ int32 OS_IntDisable_Impl (int32 Level) /*---------------------------------------------------------------- * - * Function: OS_HeapGetInfo_Impl + * Function: OS_IntSetMask_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_HeapGetInfo_Impl (OS_heap_prop_t *heap_prop) +int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) { - region_information_block info; - int status; - - status = malloc_info( &info ); - - if ( status != 0 ) - { - return(OS_ERROR); - } - - heap_prop->free_bytes = (uint32) info.Free.total; - heap_prop->free_blocks = (uint32) info.Free.number; - heap_prop->largest_free_block = (uint32) info.Free.largest; - - return (OS_SUCCESS); -} /* end OS_HeapGetInfo_Impl */ + return(OS_ERR_NOT_IMPLEMENTED); +} /* end OS_IntSetMask_Impl */ /*---------------------------------------------------------------- * - * Function: OS_IntSetMask_Impl + * Function: OS_IntGetMask_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) +int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) { + *MaskSettingPtr = 0; return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntSetMask_Impl */ +} /* end OS_IntGetMask_Impl */ + +#endif /* OSAL_OMIT_DEPRECATED */ - /*---------------------------------------------------------------- * - * Function: OS_IntGetMask_Impl + * Function: OS_HeapGetInfo_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) +int32 OS_HeapGetInfo_Impl (OS_heap_prop_t *heap_prop) { - *MaskSettingPtr = 0; - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntGetMask_Impl */ - + region_information_block info; + int status; + + status = malloc_info( &info ); + + if ( status != 0 ) + { + return(OS_ERROR); + } + + heap_prop->free_bytes = (uint32) info.Free.total; + heap_prop->free_blocks = (uint32) info.Free.number; + heap_prop->largest_free_block = (uint32) info.Free.largest; + + return (OS_SUCCESS); +} /* end OS_HeapGetInfo_Impl */ + /*---------------------------------------------------------------- * * Function: OS_FPUExcAttachHandler_Impl diff --git a/src/os/shared/os-impl.h b/src/os/shared/os-impl.h index aba3434d6..02cabb57b 100644 --- a/src/os/shared/os-impl.h +++ b/src/os/shared/os-impl.h @@ -1786,6 +1786,7 @@ int32 OS_SocketAddrGetPort_Impl(uint16 *PortNum, const OS_SockAddr_t *Addr); ------------------------------------------------------------------*/ int32 OS_SocketAddrSetPort_Impl(OS_SockAddr_t *Addr, uint16 PortNum); +#ifndef OSAL_OMIT_DEPRECATED /**************************************************************************************** INTERRUPT API LOW-LEVEL IMPLEMENTATION FUNCTIONS @@ -1866,6 +1867,8 @@ int32 OS_IntSetMask_Impl ( uint32 MaskSetting ); ------------------------------------------------------------------*/ int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ); +#endif /* OSAL_OMIT_DEPRECATED */ + /**************************************************************************************** FLOATING POINT CONFIG/EXCEPTION API LOW-LEVEL IMPLEMENTATION FUNCTIONS ****************************************************************************************/ diff --git a/src/os/shared/osapi-interrupts.c b/src/os/shared/osapi-interrupts.c index 86ce5080d..86d804580 100644 --- a/src/os/shared/osapi-interrupts.c +++ b/src/os/shared/osapi-interrupts.c @@ -32,6 +32,8 @@ #include "common_types.h" #include "os-impl.h" +#ifndef OSAL_OMIT_DEPRECATED /* Remove file and remove from build when deleted */ + /* Optionally remove from sources once source selection is in cmake options */ /*---------------------------------------------------------------- * @@ -135,3 +137,4 @@ int32 OS_IntGetMask ( uint32 * MaskSettingPtr ) return OS_IntGetMask_Impl(MaskSettingPtr); } /* end OS_IntGetMask */ +#endif /* OSAL_OMIT_DEPRECATED */ diff --git a/src/os/vxworks/osapi.c b/src/os/vxworks/osapi.c index 66eeacb9a..8bf49d6c2 100644 --- a/src/os/vxworks/osapi.c +++ b/src/os/vxworks/osapi.c @@ -1363,6 +1363,8 @@ int32 OS_MutSemGetInfo_Impl (uint32 sem_id, OS_mut_sem_prop_t *mut_prop) TICK API ****************************************************************************************/ +#ifndef OSAL_OMIT_DEPRECATED + /**************************************************************************************** INT API ****************************************************************************************/ @@ -1476,59 +1478,60 @@ int32 OS_IntDisable_Impl (int32 Level) /*---------------------------------------------------------------- * - * Function: OS_HeapGetInfo_Impl + * Function: OS_IntSetMask_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_HeapGetInfo_Impl (OS_heap_prop_t *heap_prop) +int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) { - MEM_PART_STATS stats; - STATUS status; - - status = memPartInfoGet(memSysPartId, &stats); - - if (status != OK) - { - return OS_ERROR; - } - - heap_prop->free_bytes = stats.numBytesFree; - heap_prop->free_blocks = stats.numBlocksFree; - heap_prop->largest_free_block = stats.maxBlockSizeFree; - - return (OS_SUCCESS); -} /* end OS_HeapGetInfo_Impl */ + return(OS_ERR_NOT_IMPLEMENTED); +} /* end OS_IntSetMask_Impl */ /*---------------------------------------------------------------- * - * Function: OS_IntSetMask_Impl + * Function: OS_IntGetMask_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) +int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) { + *MaskSettingPtr = 0; return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntSetMask_Impl */ +} /* end OS_IntGetMask_Impl */ + +#endif /* OSAL_OMIT_DEPRECATED */ - /*---------------------------------------------------------------- * - * Function: OS_IntGetMask_Impl + * Function: OS_HeapGetInfo_Impl * * Purpose: Implemented per internal OSAL API * See prototype in os-impl.h for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) +int32 OS_HeapGetInfo_Impl (OS_heap_prop_t *heap_prop) { - *MaskSettingPtr = 0; - return(OS_ERR_NOT_IMPLEMENTED); -} /* end OS_IntGetMask_Impl */ + MEM_PART_STATS stats; + STATUS status; + + status = memPartInfoGet(memSysPartId, &stats); + + if (status != OK) + { + return OS_ERROR; + } + + heap_prop->free_bytes = stats.numBytesFree; + heap_prop->free_blocks = stats.numBlocksFree; + heap_prop->largest_free_block = stats.maxBlockSizeFree; + + return (OS_SUCCESS); +} /* end OS_HeapGetInfo_Impl */ /*---------------------------------------------------------------- * diff --git a/src/unit-test-coverage/posix/src/coveragetest-osapi.c b/src/unit-test-coverage/posix/src/coveragetest-osapi.c index 50e8103e3..79f11c479 100644 --- a/src/unit-test-coverage/posix/src/coveragetest-osapi.c +++ b/src/unit-test-coverage/posix/src/coveragetest-osapi.c @@ -392,46 +392,6 @@ void Test_OS_MutSemGetInfo_Impl(void) */ } -void Test_OS_IntAttachHandler_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntAttachHandler_Impl (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) - */ -} - -void Test_OS_IntUnlock_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntUnlock_Impl (int32 IntLevel) - */ -} - -void Test_OS_IntLock_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntLock_Impl ( void ) - */ -} - -void Test_OS_IntEnable_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntEnable_Impl(int32 Level) - */ -} - -void Test_OS_IntDisable_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntDisable_Impl(int32 Level) - */ -} - void Test_OS_HeapGetInfo_Impl(void) { /* @@ -440,22 +400,6 @@ void Test_OS_HeapGetInfo_Impl(void) */ } -void Test_OS_IntSetMask_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) - */ -} - -void Test_OS_IntGetMask_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) - */ -} - void Test_OS_CompAbsDelayTime(void) { /* @@ -582,14 +526,7 @@ void UtTest_Setup(void) ADD_TEST(OS_MutSemGive_Impl); ADD_TEST(OS_MutSemTake_Impl); ADD_TEST(OS_MutSemGetInfo_Impl); - ADD_TEST(OS_IntAttachHandler_Impl); - ADD_TEST(OS_IntUnlock_Impl); - ADD_TEST(OS_IntLock_Impl); - ADD_TEST(OS_IntEnable_Impl); - ADD_TEST(OS_IntDisable_Impl); ADD_TEST(OS_HeapGetInfo_Impl); - ADD_TEST(OS_IntSetMask_Impl); - ADD_TEST(OS_IntGetMask_Impl); ADD_TEST(OS_CompAbsDelayTime); ADD_TEST(OS_FPUExcAttachHandler_Impl); ADD_TEST(OS_FPUExcEnable_Impl); diff --git a/src/unit-test-coverage/shared/src/coveragetest-interrupts.c b/src/unit-test-coverage/shared/src/coveragetest-interrupts.c deleted file mode 100644 index fe608bf76..000000000 --- a/src/unit-test-coverage/shared/src/coveragetest-interrupts.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Filename: osapi_testcase_common.c - * - * Purpose: This file contains unit test cases for items in the "osapi-common" file - * - * Notes: - * - */ - - -/* - * Includes - */ - -#include "os-shared-coveragetest.h" -#include "ut-osapi-interrupts.h" - -void dummy_inthandler(void) -{ -} - -/***************************************************************************** - * - * Test Case for OS_IntAttachHandler() - * int32 OS_IntAttachHandler (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) - * - *****************************************************************************/ -void Test_OS_IntAttachHandler (void) -{ - int32 expected = OS_SUCCESS; - int32 actual = OS_IntAttachHandler(0, &dummy_inthandler, 0); - - UtAssert_True(actual == expected, "OS_IntAttachHandler() (%ld) == OS_SUCCESS", (long)actual); - - expected = OS_INVALID_POINTER; - actual = OS_IntAttachHandler(0, NULL, 0); - UtAssert_True(actual == expected, "OS_IntAttachHandler() (%ld) == OS_INVALID_POINTER", (long)actual); -} - -/***************************************************************************** - * - * Test Case for Test_OS_IntLock() - * int32 OS_IntLock(void) - * - *****************************************************************************/ -void Test_OS_IntLock(void) -{ - int32 expected = OS_SUCCESS; - int32 actual = OS_IntLock(); - - UtAssert_True(actual == expected, "OS_IntLock() (%ld) == OS_SUCCESS", (long)actual); -} - -/***************************************************************************** - * - * Test Case for Test_OS_IntUnlock() - * int32 OS_IntUnlock(int32 IntFlags) - * - *****************************************************************************/ -void Test_OS_IntUnlock(void) -{ - int32 expected = OS_SUCCESS; - int32 actual = OS_IntUnlock(0); - - UtAssert_True(actual == expected, "OS_IntUnlock() (%ld) == OS_SUCCESS", (long)actual); -} - -/***************************************************************************** - * - * Test Case for: - * int32 OS_IntEnable(int32 Level) - * - *****************************************************************************/ -void Test_OS_IntEnable(void) -{ - int32 expected = OS_SUCCESS; - int32 actual = OS_IntEnable(1); - - UtAssert_True(actual == expected, "OS_IntEnable() (%ld) == OS_SUCCESS", (long)actual); -} - -/***************************************************************************** - * - * Test Case for: - * int32 OS_IntDisable(int32 Level) - * - *****************************************************************************/ -void Test_OS_IntDisable(void) -{ - int32 expected = OS_SUCCESS; - int32 actual = OS_IntDisable(1); - - UtAssert_True(actual == expected, "OS_IntDisable() (%ld) == OS_SUCCESS", (long)actual); -} - -/***************************************************************************** - * - * Test Case for: - * int32 OS_IntSetMask ( uint32 MaskSetting ) - * - *****************************************************************************/ -void Test_OS_IntSetMask (void) -{ - int32 expected = OS_SUCCESS; - int32 actual = OS_IntSetMask(0x10); - - UtAssert_True(actual == expected, "OS_IntSetMask() (%ld) == OS_SUCCESS", (long)actual); -} - -/***************************************************************************** - * - * Test Case for: - * int32 OS_IntGetMask ( uint32 * MaskSettingPtr ) - * - *****************************************************************************/ -void Test_OS_IntGetMask (void) -{ - uint32 mask; - int32 expected = OS_SUCCESS; - int32 actual = OS_IntGetMask(&mask); - - UtAssert_True(actual == expected, "OS_IntGetMask() (%ld) == OS_SUCCESS", (long)actual); -} - - -/* Osapi_Task_Setup - * - * Purpose: - * Called by the unit test tool to set up the app prior to each test - */ -void Osapi_Task_Setup(void) -{ - UT_ResetState(0); -} - -/* - * Osapi_TearDown - * - * Purpose: - * Called by the unit test tool to tear down the app after each test - */ -void Osapi_TearDown(void) -{ - -} - - -/* - * Register the test cases to execute with the unit test tool - */ -void UtTest_Setup(void) -{ - ADD_TEST(OS_IntAttachHandler); - ADD_TEST(OS_IntLock); - ADD_TEST(OS_IntUnlock); - ADD_TEST(OS_IntEnable); - ADD_TEST(OS_IntDisable); - ADD_TEST(OS_IntSetMask); - ADD_TEST(OS_IntGetMask); -} - - - - diff --git a/src/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c b/src/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c index 504ae52e6..4a89f2409 100644 --- a/src/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c @@ -146,17 +146,6 @@ void OS_ApplicationExit_Impl(int32 Status) UT_DEFAULT_IMPL(OS_ApplicationExit_Impl); } -/* - * Interrupt API low-level handlers - */ -UT_DEFAULT_STUB(OS_IntAttachHandler_Impl,(uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter)) -UT_DEFAULT_STUB(OS_IntUnlock_Impl,(int32 IntLevel)) -UT_DEFAULT_STUB(OS_IntLock_Impl,( void )) -UT_DEFAULT_STUB(OS_IntEnable_Impl,(int32 Level)) -UT_DEFAULT_STUB(OS_IntDisable_Impl,(int32 Level)) -UT_DEFAULT_STUB(OS_IntSetMask_Impl,( uint32 MaskSetting )) -UT_DEFAULT_STUB(OS_IntGetMask_Impl,( uint32 * MaskSettingPtr )) - /* * Heap API low-level handler */ diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-osapi.c b/src/unit-test-coverage/vxworks/src/coveragetest-osapi.c index d384b47af..e37cba1cd 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-osapi.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-osapi.c @@ -574,61 +574,6 @@ void Test_OS_MutSemGetInfo_Impl(void) OSAPI_TEST_FUNCTION_RC(OS_MutSemGetInfo_Impl(0,&mut_prop), OS_SUCCESS); } -void Test_OS_IntAttachHandler_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntAttachHandler_Impl (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) - */ - OSAPI_TEST_FUNCTION_RC(OS_IntAttachHandler_Impl(0,NULL,0), OS_SUCCESS); - - UT_SetForceFail(UT_KEY(OCS_intConnect), OCS_ERROR); - OSAPI_TEST_FUNCTION_RC(OS_IntAttachHandler_Impl(0,NULL,0), OS_ERROR); -} - -void Test_OS_IntUnlock_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntUnlock_Impl (int32 IntLevel) - */ - OSAPI_TEST_FUNCTION_RC(OS_IntUnlock_Impl(0), OS_SUCCESS); -} - -void Test_OS_IntLock_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntLock_Impl ( void ) - */ - UT_SetForceFail(UT_KEY(OCS_intLock), 0x1111); - OSAPI_TEST_FUNCTION_RC(OS_IntLock_Impl(), 0x1111); -} - -void Test_OS_IntEnable_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntEnable_Impl(int32 Level) - */ - OSAPI_TEST_FUNCTION_RC(OS_IntEnable_Impl(0), OS_SUCCESS); - - UT_SetForceFail(UT_KEY(OCS_intEnable), OCS_ERROR); - OSAPI_TEST_FUNCTION_RC(OS_IntEnable_Impl(0), OS_ERROR); -} - -void Test_OS_IntDisable_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntDisable_Impl(int32 Level) - */ - OSAPI_TEST_FUNCTION_RC(OS_IntDisable_Impl(0), OS_SUCCESS); - - UT_SetForceFail(UT_KEY(OCS_intDisable), OCS_ERROR); - OSAPI_TEST_FUNCTION_RC(OS_IntDisable_Impl(0), OS_ERROR); -} - void Test_OS_HeapGetInfo_Impl(void) { /* @@ -644,25 +589,6 @@ void Test_OS_HeapGetInfo_Impl(void) OSAPI_TEST_FUNCTION_RC(OS_HeapGetInfo_Impl(&heap_prop), OS_ERROR); } -void Test_OS_IntSetMask_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntSetMask_Impl ( uint32 MaskSetting ) - */ - OSAPI_TEST_FUNCTION_RC(OS_IntSetMask_Impl(0x1111), OS_ERR_NOT_IMPLEMENTED); -} - -void Test_OS_IntGetMask_Impl(void) -{ - /* - * Test Case For: - * int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr ) - */ - uint32 Mask = 0x1111; - OSAPI_TEST_FUNCTION_RC(OS_IntGetMask_Impl(&Mask), OS_ERR_NOT_IMPLEMENTED); -} - void Test_OS_FPUExcAttachHandler_Impl(void) { /* @@ -783,14 +709,7 @@ void UtTest_Setup(void) ADD_TEST(OS_MutSemGive_Impl); ADD_TEST(OS_MutSemTake_Impl); ADD_TEST(OS_MutSemGetInfo_Impl); - ADD_TEST(OS_IntAttachHandler_Impl); - ADD_TEST(OS_IntUnlock_Impl); - ADD_TEST(OS_IntLock_Impl); - ADD_TEST(OS_IntEnable_Impl); - ADD_TEST(OS_IntDisable_Impl); ADD_TEST(OS_HeapGetInfo_Impl); - ADD_TEST(OS_IntSetMask_Impl); - ADD_TEST(OS_IntGetMask_Impl); ADD_TEST(OS_FPUExcAttachHandler_Impl); ADD_TEST(OS_FPUExcEnable_Impl); ADD_TEST(OS_FPUExcDisable_Impl); diff --git a/src/unit-tests/oscore-test/CMakeLists.txt b/src/unit-tests/oscore-test/CMakeLists.txt index 0ed5ba38b..b4252d9c0 100644 --- a/src/unit-tests/oscore-test/CMakeLists.txt +++ b/src/unit-tests/oscore-test/CMakeLists.txt @@ -7,7 +7,6 @@ set(TEST_MODULE_FILES ut_oscore_countsem_test.c ut_oscore_mutex_test.c ut_oscore_task_test.c - ut_oscore_interrupt_test.c ut_oscore_exception_test.c ut_oscore_test.c ) diff --git a/src/unit-tests/oscore-test/ut_oscore_interrupt_test.c b/src/unit-tests/oscore-test/ut_oscore_interrupt_test.c deleted file mode 100644 index 489c7ecbc..000000000 --- a/src/unit-tests/oscore-test/ut_oscore_interrupt_test.c +++ /dev/null @@ -1,452 +0,0 @@ -/*================================================================================* -** File: ut_oscore_interrupt_test.c -** Owner: Tam Ngo -** Date: June 2015 -**================================================================================*/ - -/*--------------------------------------------------------------------------------* -** Includes -**--------------------------------------------------------------------------------*/ - -#include "ut_oscore_interrupt_test.h" - -/*--------------------------------------------------------------------------------* -** Macros -**--------------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------------* -** Data types -**--------------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------------* -** External global variables -**--------------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------------* -** Global variables -**--------------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------------* -** Local function prototypes -**--------------------------------------------------------------------------------*/ - -void UT_myInterruptFunc(void); - -/*--------------------------------------------------------------------------------* -** Local function definitions -**--------------------------------------------------------------------------------*/ - -/* Test code template for testing a single OSAL API with multiple test cases */ - -#if 0 -void UT_os_sample_test() -{ - /* Must declare these variables for each function. They can be renamed. - * They're referenced in the macros used to track test cases and their results. */ - int32 idx = 0; - const char* testDesc; - - /*-----------------------------------------------------* - * For each test case, - * 1. Assign testDesc a brief description of the test - * 2. Setup the test environment, if necessary - * 3. Run the test - * 4. Log result by calling UT_OS_SET_TEST_RESULT_MACRO - * 4. Reset the test environment, if neccessary - * - * NOTE: "Not implemented" is always checked first but not - * being included as a test case. - * "Nominal" test case is always the last test case. - *-----------------------------------------------------*/ - - /*-----------------------------------------------------*/ - testDesc = "API not implemented"; - - /* TODO: Setup the test environment, if necessary */ - - if (OS_xxx() == OS_ERR_NOT_IMPLEMENTED) - { - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_NA); - goto UT_os_sample_test_exit_tag; - } - - /* TODO: Reset the test environment here, if necessary */ - - /*-----------------------------------------------------*/ - testDesc = "#1 Null-pointer-arg"; - - /* TODO: Setup the test environment here, if necessary */ - - if (OS_xxx(NULL,...) == OS_INVALID_POINTER) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - - /* TODO: Reset the test environment here, if necessary */ - - /*-----------------------------------------------------*/ - testDesc = "#2 Name-too-long-arg"; - - /* TODO: Setup the test environment here, if necessary */ - - if (OS_xxx(aVeryLoooooongName) == OS_ERR_NAME_TOO_LONG) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - - /* TODO: Reset the test environment here, if necessary */ - - /*-----------------------------------------------------*/ - testDesc = "#3 Nominal"; - - /* TODO: Setup the test environment here, if necessary */ - - if (OS_xxx(...) != OS_SUCCESS) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - - /* TODO: Reset the test environment here, if necessary */ - -UT_os_sample_test_exit_tag: - /* Call these macros at the very end of the function to close out the test variables - * and get it added to the global list being tracked. */ - return; - -} -#endif - -/*--------------------------------------------------------------------------------*/ - -void UT_myInterruptFunc(void) -{ - static int32 iCounter=0; - - iCounter++; -} - -/*--------------------------------------------------------------------------------* -** Syntax: int32 OS_IntAttachHandler(uint32 InterruptNumber, -** osal_task_entry InterruptHandler, int32 parameter) -** Purpose: Associates a specified C routine to a specified interrupt number. -** Upon occurring of the InterruptNumber, the InterruptHandler routine - will be called and passed the parameter. -** Parameters: InterruptNumber - interrupt number that will cause the start of ISR -** InterruptHandler - the ISR associated with this interrupt -** parameter - the parameter that is passed to the ISR -** Returns: OS_INVALID_POINTER if passing in null pointer -** OS_ERROR if OS call failed -** OS_SUCCESS if succeeded -**-------------------------------------------------------------------------------- -** Test #0: Not-implemented condition -** 1) Call this routine -** 2) If the returned value is OS_ERR_NOT_IMPLEMENTED, then exit test -** 3) Otherwise, continue -** ----------------------------------------------------- -** Test #1: Null-pointer-argument condition -** 1) Call this routine with a null-pointer argument -** 2) Expect the returned value to be -** (a) OS_INVALID_POINTER -** ----------------------------------------------------- -** Test #2: OS-call-failure condition -** 1) Setup test to cause the OS call to fail inside this routine -** 2) Call this routine -** 3) Expect the returned value to be -** (a) OS_ERROR -** ----------------------------------------------------- -** Test #3: Nominal condition -** 1) Call this routine with valid argument -** 2) Expect the returned value to be -** (a) OS_SUCCESS -**--------------------------------------------------------------------------------*/ -void UT_os_int_attachhandler_test() -{ - int32 res = 0; - const char* testDesc; - - /*-----------------------------------------------------*/ - testDesc = "API not implemented"; - - res = OS_IntAttachHandler(1, UT_myInterruptFunc, 100); - if (res == OS_ERR_NOT_IMPLEMENTED) - { - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_NA); - goto UT_os_int_attachhandler_exit_tag; - } - - /*-----------------------------------------------------*/ - testDesc = "#1 Null-pointer-arg"; - - res = OS_IntAttachHandler(1, NULL, 0); - if (res == OS_INVALID_POINTER) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - - /*-----------------------------------------------------*/ - testDesc = "#2 OS-call-failure"; - - res = OS_IntAttachHandler(100, UT_myInterruptFunc, 0); - if (res == OS_ERROR) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - - /*-----------------------------------------------------*/ - testDesc = "#3 Nominal"; - - res = OS_IntAttachHandler(1, UT_myInterruptFunc, 0); - if (res == OS_SUCCESS) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - - -UT_os_int_attachhandler_exit_tag: - return; - -} - -/*--------------------------------------------------------------------------------* -** Syntax: int32 OS_IntEnable(int32 Level) -** Purpose: Enables interrupt -** Parameters: Level - the interrupt vectors to be enabled -** Returns: OS_ERROR if OS call failed -** OS_SUCCESS if succeeded -**-------------------------------------------------------------------------------- -** Test #0: Not-implemented condition -** 1) Call this routine -** 2) If the returned value is OS_ERR_NOT_IMPLEMENTED, then exit test -** 3) Otherwise, continue -** ----------------------------------------------------- -** Test #1: OS-call-failure condition -** 1) Setup test to cause the OS call to fail inside this routine -** 2) Call this routine -** 3) Expect the returned value to be -** (a) OS_ERROR -** ----------------------------------------------------- -** Test #2: Nominal condition -** 1) Call this routine with valid argument -** 2) Expect the returned value to be -** (a) OS_SUCCESS -**--------------------------------------------------------------------------------*/ -void UT_os_int_enable_test() -{ - int32 res = 0; - const char* testDesc; - - /*-----------------------------------------------------*/ - testDesc = "API not implemented"; - - res = OS_IntEnable(1); - if (res == OS_ERR_NOT_IMPLEMENTED) - { - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_NA); - goto UT_os_int_enable_exit_tag; - } - - /* Reset test environment */ - OS_IntDisable(1); - - /*-----------------------------------------------------*/ - testDesc = "#1 OS-call-failure"; - - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_INFO); - - /*-----------------------------------------------------*/ - testDesc = "#2 Nominal"; - - res = OS_IntEnable(1); - if (res == OS_SUCCESS) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - - /* Reset test environment */ - OS_IntDisable(1); - -UT_os_int_enable_exit_tag: - return; - -} - -/*--------------------------------------------------------------------------------* -** Syntax: int32 OS_IntDisable(int32 Level) -** Purpose: Disables interrupt -** Parameters: Level - the interrupt vectors to be disabled -** Returns: OS_ERROR if OS call failed -** OS_SUCCESS if succeeded -**-------------------------------------------------------------------------------- -** Test #0: Not-implemented condition -** 1) Call this routine -** 2) If the returned value is OS_ERR_NOT_IMPLEMENTED, then exit test -** 3) Otherwise, continue -** ----------------------------------------------------- -** Test #1: OS-call-failure condition -** 1) Setup test to cause the OS call to fail inside this routine -** 2) Call this routine -** 3) Expect the returned value to be -** (a) OS_ERROR -** ----------------------------------------------------- -** Test #2: Nominal condition -** 1) Call this routine with valid argument -** 2) Expect the returned value to be -** (a) OS_SUCCESS -**--------------------------------------------------------------------------------*/ -void UT_os_int_disable_test() -{ - int32 res = 0; - const char* testDesc; - - /*-----------------------------------------------------*/ - testDesc = "API not implemented"; - - res = OS_IntDisable(1); - if (res == OS_ERR_NOT_IMPLEMENTED) - { - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_NA); - goto UT_os_int_disable_exit_tag; - } - - /*-----------------------------------------------------*/ - testDesc = "#1 OS-call-failure"; - - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_INFO); - - /*-----------------------------------------------------*/ - testDesc = "#2 Nominal"; - - if (OS_IntEnable(1) == OS_SUCCESS) - { - res = OS_IntDisable(1); - if (res == OS_SUCCESS) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - } - else - { - testDesc = "#2 Nominal - Interrupt-Enable failed"; - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_TSF); - } - -UT_os_int_disable_exit_tag: - return; - -} - -/*--------------------------------------------------------------------------------* -** Syntax: int32 OS_IntLock(void) -** Purpose: Locks out all interrupts -** Parameters: none -** Returns: Interrupt level before OS_IntLock() call -**-------------------------------------------------------------------------------- -** Test #0: Not-implemented condition -** 1) Call this routine -** 2) If the returned value is OS_ERR_NOT_IMPLEMENTED, then exit test -** 3) Otherwise, continue -** ----------------------------------------------------- -** Test #1: OS-call-failure condition -** 1) Setup test to cause the OS call to fail inside this routine -** 2) Call this routine -** 3) Expect the returned value to be -** (a) OS_ERROR -** ----------------------------------------------------- -** Test #2: Nominal condition -** 1) Call this routine with valid argument -** 2) Expect the returned value to be -** (a) OS_SUCCESS -**--------------------------------------------------------------------------------*/ -void UT_os_int_lock_test() -{ - int32 res = 0; - const char* testDesc; - - /*-----------------------------------------------------*/ - testDesc = "API not implemented"; - - if (OS_IntLock() == OS_ERR_NOT_IMPLEMENTED) - { - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_NA); - goto UT_os_int_lock_exit_tag; - } - - /*-----------------------------------------------------*/ - testDesc = "#1 OS-call-failure"; - - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_INFO); - - /*-----------------------------------------------------*/ - testDesc = "#2 Nominal"; - - res = OS_IntLock(); - /* Note: Could check for more evidence here; only checking API for now. */ - if (OS_IntUnlock(res) == OS_SUCCESS) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - -UT_os_int_lock_exit_tag: - return; - -} - -/*--------------------------------------------------------------------------------* -** Syntax: int32 OS_IntUnlock(int32 IntLevel) -** Purpose: Enable all interrupts -** Parameters: IntLevel - interrupt vectors to be unlocked -** Returns: OS_ERROR if call to OS system call failed -** OS_SUCCESS if succeeded -**-------------------------------------------------------------------------------- -** Test #0: Not-implemented condition -** 1) Call this routine -** 2) If the returned value is OS_ERR_NOT_IMPLEMENTED, then exit test -** 3) Otherwise, continue -** ----------------------------------------------------- -** Test #1: OS-call-failure condition -** 1) Setup test to cause the OS call to fail inside this routine -** 2) Call this routine -** 3) Expect the returned value to be -** (a) OS_ERROR -** ----------------------------------------------------- -** Test #2: Nominal condition -** 1) Call this routine with valid argument -** 2) Expect the returned value to be -** (a) OS_SUCCESS -**--------------------------------------------------------------------------------*/ -void UT_os_int_unlock_test() -{ - int32 res = 0; - const char* testDesc; - - /*-----------------------------------------------------*/ - testDesc = "API not implemented"; - - if (OS_IntUnlock(0) == OS_ERR_NOT_IMPLEMENTED) - { - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_NA); - goto UT_os_int_unlock_exit_tag; - } - - /*-----------------------------------------------------*/ - testDesc = "#1 OS-call-failure"; - - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_INFO); - - /*-----------------------------------------------------*/ - testDesc = "#2 Nominal"; - - res = OS_IntLock(); - if (OS_IntUnlock(res) == OS_SUCCESS) - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); - else - UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); - -UT_os_int_unlock_exit_tag: - return; - -} - -/*================================================================================* -** End of File: ut_oscore_interrupt_test.c -**================================================================================*/ diff --git a/src/unit-tests/oscore-test/ut_oscore_test.c b/src/unit-tests/oscore-test/ut_oscore_test.c index 6b7b75ae7..de57cefea 100644 --- a/src/unit-tests/oscore-test/ut_oscore_test.c +++ b/src/unit-tests/oscore-test/ut_oscore_test.c @@ -271,12 +271,6 @@ void UtTest_Setup(void) UtTest_Add(UT_os_heapgetinfo_test, NULL, NULL, "OS_HeapGetInfo"); - UtTest_Add(UT_os_int_attachhandler_test, NULL, NULL, "OS_IntAttachHandler"); - UtTest_Add(UT_os_int_enable_test, NULL, NULL, "OS_IntEnable"); - UtTest_Add(UT_os_int_disable_test, NULL, NULL, "OS_IntDisable"); - UtTest_Add(UT_os_int_lock_test, NULL, NULL, "OS_IntLock"); - UtTest_Add(UT_os_int_unlock_test, NULL, NULL, "OS_IntUnlock"); - UtTest_Add(UT_os_fpuexc_setmask_test, NULL, NULL, "OS_FPUExcSetMask"); UtTest_Add(UT_os_fpuexc_getmask_test, NULL, NULL, "OS_FPUExcGetMask"); From 21ea6798bcfb64134405e6d764b193f8c438999b Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Thu, 9 Apr 2020 19:17:51 -0400 Subject: [PATCH 8/8] Increase version to 5.0.11 and update Readme --- README.md | 8 ++++++-- src/os/inc/osapi-version.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f0247b791..7157b9d88 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,12 @@ This distribution contains: 2. Tests and example applications 3. A directory structure and makefiles to manage it all. -Version Notes: -============== +## Version Notes: + +- 5.0.11: DEVELOPMENT + - The more descriptive return value OS_ERR_NAME_NOT_FOUND (instead of OS_FS_ERROR) will now be returned from the following functions (): OS_rmfs, OS_mount, OS_unmount, OS_FS_GetPhysDriveName + - Wraps OS_ShMem* prototype and unit test wrapper additions in OSAL_OMIT_DEPRECATED + - Minor updates (see https://github.com/nasa/osal/pull/408) - 5.0.10: DEVELOPMENT - Minor updates (see https://github.com/nasa/osal/pull/401) - 5.0.9: DEVELOPMENT diff --git a/src/os/inc/osapi-version.h b/src/os/inc/osapi-version.h index 089fd587f..8d1f61507 100644 --- a/src/os/inc/osapi-version.h +++ b/src/os/inc/osapi-version.h @@ -20,7 +20,7 @@ #define OS_MAJOR_VERSION 5 /**< @brief Major version number */ #define OS_MINOR_VERSION 0 /**< @brief Minor version number */ -#define OS_REVISION 10 /**< @brief Revision number */ +#define OS_REVISION 11 /**< @brief Revision number */ #define OS_MISSION_REV 0 /**< @brief Mission revision */ /**