From da4fa3dc1194afc5f2d6b3ef0a48c4095fef0b9c Mon Sep 17 00:00:00 2001 From: Sam Price Date: Thu, 9 Sep 2021 09:09:03 -0400 Subject: [PATCH 1/6] Remove softsleep, as a dead store. --- src/os/posix/inc/os-impl-timebase.h | 1 - src/os/posix/src/os-impl-timebase.c | 1 - src/os/rtems/inc/os-impl-timebase.h | 1 - 3 files changed, 3 deletions(-) diff --git a/src/os/posix/inc/os-impl-timebase.h b/src/os/posix/inc/os-impl-timebase.h index c9810e7bc..64b417063 100644 --- a/src/os/posix/inc/os-impl-timebase.h +++ b/src/os/posix/inc/os-impl-timebase.h @@ -38,7 +38,6 @@ typedef struct int assigned_signal; sigset_t sigset; sig_atomic_t reset_flag; - struct timespec softsleep; } OS_impl_timebase_internal_record_t; /**************************************************************************************** diff --git a/src/os/posix/src/os-impl-timebase.c b/src/os/posix/src/os-impl-timebase.c index 0edfd34d0..96ce6603a 100644 --- a/src/os/posix/src/os-impl-timebase.c +++ b/src/os/posix/src/os-impl-timebase.c @@ -355,7 +355,6 @@ int32 OS_TimeBaseCreate_Impl(const OS_object_token_t *token) } local->assigned_signal = 0; - clock_gettime(OS_PREFERRED_CLOCK, &local->softsleep); /* * Set up the necessary OS constructs diff --git a/src/os/rtems/inc/os-impl-timebase.h b/src/os/rtems/inc/os-impl-timebase.h index a47853f2c..b034af37c 100644 --- a/src/os/rtems/inc/os-impl-timebase.h +++ b/src/os/rtems/inc/os-impl-timebase.h @@ -38,7 +38,6 @@ typedef struct int assigned_signal; sigset_t sigset; sig_atomic_t reset_flag; - struct timespec softsleep; } OS_impl_timebase_internal_record_t; /**************************************************************************************** From 373130e057a5085afa4329f0d8a8b28cf62b65cd Mon Sep 17 00:00:00 2001 From: Avi Date: Wed, 25 Jan 2023 13:26:57 +1000 Subject: [PATCH 2/6] Fix #1356, Remove stray remaining 'goto' in OSAL test code --- src/unit-tests/osfile-test/ut_osfile_test.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/unit-tests/osfile-test/ut_osfile_test.c b/src/unit-tests/osfile-test/ut_osfile_test.c index 0cdcac10e..d5231b780 100644 --- a/src/unit-tests/osfile-test/ut_osfile_test.c +++ b/src/unit-tests/osfile-test/ut_osfile_test.c @@ -78,18 +78,17 @@ int32 UT_os_setup_fs() if (res != OS_SUCCESS) { UtPrintf("OS_mkfs() returns %d\n", (int)res); - goto UT_os_setup_fs_exit_tag; } - - res = OS_mount(g_devName, g_mntName); - if (res != OS_SUCCESS) + else { - UtPrintf("OS_mount() returns %d\n", (int)res); - OS_rmfs(g_devName); - goto UT_os_setup_fs_exit_tag; + res = OS_mount(g_devName, g_mntName); + if (res != OS_SUCCESS) + { + UtPrintf("OS_mount() returns %d\n", (int)res); + OS_rmfs(g_devName); + } } -UT_os_setup_fs_exit_tag: return res; } From a92b2b7344a51abe8eb476ab5fe88813bc06cfd5 Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 23 Jan 2023 10:47:16 +1000 Subject: [PATCH 3/6] Fix #1353, Align mismatched function prototype/implementation parameter names --- src/os/inc/osapi-file.h | 2 +- src/os/inc/osapi-module.h | 2 +- src/os/inc/osapi-timer.h | 2 +- src/os/portable/os-impl-no-symtab.c | 2 +- src/os/portable/os-impl-posix-dl-symtab.c | 2 +- src/os/portable/os-impl-posix-files.c | 14 +++++------ src/os/posix/src/os-impl-idmap.c | 4 ++-- src/os/rtems/src/os-impl-idmap.c | 6 ++--- src/os/shared/src/osapi-file.c | 10 ++++---- src/os/shared/src/osapi-idmap.c | 4 ++-- src/os/shared/src/osapi-module.c | 24 +++++++++---------- src/os/shared/src/osapi-time.c | 11 +++++---- src/os/shared/src/osapi-timebase.c | 20 ++++++++-------- src/os/vxworks/src/os-impl-idmap.c | 6 ++--- .../time-base-api-test/time-base-api-test.c | 8 +++---- .../timer-add-api-test/timer-add-api-test.c | 2 +- .../portable/src/coveragetest-posix-files.c | 2 +- .../shared/src/coveragetest-file.c | 2 +- .../shared/src/coveragetest-module.c | 4 ++-- .../shared/src/coveragetest-time.c | 5 ++-- .../shared/src/coveragetest-timebase.c | 8 +++---- .../vxworks/src/coveragetest-idmap.c | 2 +- .../vxworks/src/coveragetest-symtab.c | 2 +- .../osfile-test/ut_osfile_fileio_test.c | 6 ++--- .../ostimer-test/ut_ostimer_timerio_test.c | 2 +- 25 files changed, 77 insertions(+), 75 deletions(-) diff --git a/src/os/inc/osapi-file.h b/src/os/inc/osapi-file.h index 512157fb5..41dc10bbc 100644 --- a/src/os/inc/osapi-file.h +++ b/src/os/inc/osapi-file.h @@ -377,7 +377,7 @@ int32 OS_remove(const char *path); * @return Execution status, see @ref OSReturnCodes * @retval #OS_SUCCESS @copybrief OS_SUCCESS * @retval #OS_ERROR if the file could not be opened or renamed. - * @retval #OS_INVALID_POINTER if old or new are NULL + * @retval #OS_INVALID_POINTER if old_filename or new_filename are NULL * @retval #OS_FS_ERR_PATH_INVALID if path cannot be parsed * @retval #OS_FS_ERR_PATH_TOO_LONG if the paths given are too long to be stored locally * @retval #OS_FS_ERR_NAME_TOO_LONG if the new name is too long to be stored locally diff --git a/src/os/inc/osapi-module.h b/src/os/inc/osapi-module.h index 82ce0843a..34b4c527b 100644 --- a/src/os/inc/osapi-module.h +++ b/src/os/inc/osapi-module.h @@ -170,7 +170,7 @@ int32 OS_ModuleSymbolLookup(osal_id_t module_id, cpuaddr *symbol_address, const * module subsystem does not provide a facility to iterate through the * symbol table, then the #OS_ERR_NOT_IMPLEMENTED status code is returned. * - * @param[in] filename File to write to @nonnull + * @param[in] filename File to write to @nonnull * @param[in] size_limit Maximum number of bytes to write * * @return Execution status, see @ref OSReturnCodes diff --git a/src/os/inc/osapi-timer.h b/src/os/inc/osapi-timer.h index 6c30c5a65..eea4c5510 100644 --- a/src/os/inc/osapi-timer.h +++ b/src/os/inc/osapi-timer.h @@ -61,7 +61,7 @@ typedef struct * The callback function should be declared according to the OS_TimerCallback_t * function pointer type. The timer_id value is passed to the callback function. * - * @note clock_accuracy comes from the underlying OS tick value. The nearest integer + * @note clock_accuracy comes from the underlying OS tick value. The nearest integer * microsecond value is returned, so may not be exact. * * @note This configuration API must not be used from the context of a timer callback. diff --git a/src/os/portable/os-impl-no-symtab.c b/src/os/portable/os-impl-no-symtab.c index 868d8e508..b6d45912a 100644 --- a/src/os/portable/os-impl-no-symtab.c +++ b/src/os/portable/os-impl-no-symtab.c @@ -53,7 +53,7 @@ int32 OS_ModuleSymbolLookup_Impl(const OS_object_token_t *token, cpuaddr *Symbol * * See prototype for argument/return detail *-----------------------------------------------------------------*/ -int32 OS_SymbolTableDump_Impl(const char *filename, size_t SizeLimit) +int32 OS_SymbolTableDump_Impl(const char *filename, size_t size_limit) { return OS_ERR_NOT_IMPLEMENTED; } diff --git a/src/os/portable/os-impl-posix-dl-symtab.c b/src/os/portable/os-impl-posix-dl-symtab.c index 1a67ec19f..4722a416f 100644 --- a/src/os/portable/os-impl-posix-dl-symtab.c +++ b/src/os/portable/os-impl-posix-dl-symtab.c @@ -188,7 +188,7 @@ int32 OS_ModuleSymbolLookup_Impl(const OS_object_token_t *token, cpuaddr *Symbol * POSIX DL does not provide * *-----------------------------------------------------------------*/ -int32 OS_SymbolTableDump_Impl(const char *filename, size_t SizeLimit) +int32 OS_SymbolTableDump_Impl(const char *filename, size_t size_limit) { /* * Limiting strictly to POSIX-defined API means there is no defined diff --git a/src/os/portable/os-impl-posix-files.c b/src/os/portable/os-impl-posix-files.c index 326b27ea2..98b323b3d 100644 --- a/src/os/portable/os-impl-posix-files.c +++ b/src/os/portable/os-impl-posix-files.c @@ -126,7 +126,7 @@ int32 OS_FileOpen_Impl(const OS_object_token_t *token, const char *local_path, i * See prototype for argument/return detail * *-----------------------------------------------------------------*/ -int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats) +int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *filestat) { struct stat st; mode_t readbits; @@ -139,7 +139,7 @@ int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats) return OS_ERROR; } - FileStats->FileSize = st.st_size; + filestat->FileSize = st.st_size; /* * NOTE: Traditional timestamps are only a whole number of seconds (time_t) @@ -164,12 +164,12 @@ int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats) filetime.tv_nsec = 0; #endif - FileStats->FileTime = OS_TimeAssembleFromNanoseconds(filetime.tv_sec, filetime.tv_nsec); + filestat->FileTime = OS_TimeAssembleFromNanoseconds(filetime.tv_sec, filetime.tv_nsec); /* note that the "fst_mode" member is already zeroed by the caller */ if (S_ISDIR(st.st_mode)) { - FileStats->FileModeBits |= OS_FILESTAT_MODE_DIR; + filestat->FileModeBits |= OS_FILESTAT_MODE_DIR; } /* always check world bits */ @@ -195,15 +195,15 @@ int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats) if (st.st_mode & readbits) { - FileStats->FileModeBits |= OS_FILESTAT_MODE_READ; + filestat->FileModeBits |= OS_FILESTAT_MODE_READ; } if (st.st_mode & writebits) { - FileStats->FileModeBits |= OS_FILESTAT_MODE_WRITE; + filestat->FileModeBits |= OS_FILESTAT_MODE_WRITE; } if (st.st_mode & execbits) { - FileStats->FileModeBits |= OS_FILESTAT_MODE_EXEC; + filestat->FileModeBits |= OS_FILESTAT_MODE_EXEC; } return OS_SUCCESS; diff --git a/src/os/posix/src/os-impl-idmap.c b/src/os/posix/src/os-impl-idmap.c index b253f5f92..bf5ca1b4f 100644 --- a/src/os/posix/src/os-impl-idmap.c +++ b/src/os/posix/src/os-impl-idmap.c @@ -134,12 +134,12 @@ void OS_Unlock_Global_Impl(osal_objtype_t idtype) * See prototype for argument/return detail * *-----------------------------------------------------------------*/ -void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts) +void OS_WaitForStateChange_Impl(osal_objtype_t objtype, uint32 attempts) { OS_impl_objtype_lock_t *impl; struct timespec ts; - impl = OS_impl_objtype_lock_table[idtype]; + impl = OS_impl_objtype_lock_table[objtype]; /* * because pthread_cond_timedwait() is also a cancellation point, diff --git a/src/os/rtems/src/os-impl-idmap.c b/src/os/rtems/src/os-impl-idmap.c index 565c615d5..004fa7e73 100644 --- a/src/os/rtems/src/os-impl-idmap.c +++ b/src/os/rtems/src/os-impl-idmap.c @@ -126,7 +126,7 @@ void OS_Unlock_Global_Impl(osal_objtype_t idtype) * See prototype for argument/return detail * *-----------------------------------------------------------------*/ -void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts) +void OS_WaitForStateChange_Impl(osal_objtype_t objtype, uint32 attempts) { rtems_interval wait_ticks; @@ -139,9 +139,9 @@ void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts) wait_ticks = 100; } - OS_Unlock_Global_Impl(idtype); + OS_Unlock_Global_Impl(objtype); rtems_task_wake_after(wait_ticks); - OS_Lock_Global_Impl(idtype); + OS_Lock_Global_Impl(objtype); } /**************************************************************************************** diff --git a/src/os/shared/src/osapi-file.c b/src/os/shared/src/osapi-file.c index ebe77b98a..da5eb7a05 100644 --- a/src/os/shared/src/osapi-file.c +++ b/src/os/shared/src/osapi-file.c @@ -342,7 +342,7 @@ int32 OS_remove(const char *path) * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_rename(const char *old, const char *new) +int32 OS_rename(const char *old_filename, const char *new_filename) { OS_object_iter_t iter; OS_stream_internal_record_t *stream; @@ -350,10 +350,10 @@ int32 OS_rename(const char *old, const char *new) char old_path[OS_MAX_LOCAL_PATH_LEN]; char new_path[OS_MAX_LOCAL_PATH_LEN]; - return_code = OS_TranslatePath(old, old_path); + return_code = OS_TranslatePath(old_filename, old_path); if (return_code == OS_SUCCESS) { - return_code = OS_TranslatePath(new, new_path); + return_code = OS_TranslatePath(new_filename, new_path); } if (return_code == OS_SUCCESS) @@ -369,9 +369,9 @@ int32 OS_rename(const char *old, const char *new) { stream = OS_OBJECT_TABLE_GET(OS_stream_table, iter.token); - if (stream->socket_domain == OS_SocketDomain_INVALID && strcmp(stream->stream_name, old) == 0) + if (stream->socket_domain == OS_SocketDomain_INVALID && strcmp(stream->stream_name, old_filename) == 0) { - strncpy(stream->stream_name, new, sizeof(stream->stream_name) - 1); + strncpy(stream->stream_name, new_filename, sizeof(stream->stream_name) - 1); stream->stream_name[sizeof(stream->stream_name) - 1] = 0; } } diff --git a/src/os/shared/src/osapi-idmap.c b/src/os/shared/src/osapi-idmap.c index 142875992..207886fd1 100644 --- a/src/os/shared/src/osapi-idmap.c +++ b/src/os/shared/src/osapi-idmap.c @@ -1359,7 +1359,7 @@ void OS_ForEachObject(osal_id_t creator_id, OS_ArgCallback_t callback_ptr, void * See description in API and header file for detail * *-----------------------------------------------------------------*/ -void OS_ForEachObjectOfType(osal_objtype_t idtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr, +void OS_ForEachObjectOfType(osal_objtype_t objtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr, void *callback_arg) { OS_object_iter_t iter; @@ -1369,7 +1369,7 @@ void OS_ForEachObjectOfType(osal_objtype_t idtype, osal_id_t creator_id, OS_ArgC filter.user_callback = callback_ptr; filter.user_arg = callback_arg; - if (OS_ObjectIdIteratorInit(OS_ForEachFilterCreator, &filter, idtype, &iter) == OS_SUCCESS) + if (OS_ObjectIdIteratorInit(OS_ForEachFilterCreator, &filter, objtype, &iter) == OS_SUCCESS) { while (OS_ObjectIdIteratorGetNext(&iter)) { diff --git a/src/os/shared/src/osapi-module.c b/src/os/shared/src/osapi-module.c index 34aec122b..2c320d207 100644 --- a/src/os/shared/src/osapi-module.c +++ b/src/os/shared/src/osapi-module.c @@ -296,7 +296,7 @@ int32 OS_ModuleUnload(osal_id_t module_id) * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_prop) +int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_info) { OS_common_record_t * record; OS_module_internal_record_t *module; @@ -304,9 +304,9 @@ int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_prop) OS_object_token_t token; /* Check parameters */ - OS_CHECK_POINTER(module_prop); + OS_CHECK_POINTER(module_info); - memset(module_prop, 0, sizeof(OS_module_prop_t)); + memset(module_info, 0, sizeof(OS_module_prop_t)); return_code = OS_ObjectIdGetById(OS_LOCK_MODE_GLOBAL, LOCAL_OBJID_TYPE, module_id, &token); if (return_code == OS_SUCCESS) @@ -314,10 +314,10 @@ int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_prop) record = OS_OBJECT_TABLE_GET(OS_global_module_table, token); module = OS_OBJECT_TABLE_GET(OS_module_table, token); - strncpy(module_prop->name, record->name_entry, sizeof(module_prop->name) - 1); - strncpy(module_prop->filename, module->file_name, sizeof(module_prop->filename) - 1); + strncpy(module_info->name, record->name_entry, sizeof(module_info->name) - 1); + strncpy(module_info->filename, module->file_name, sizeof(module_info->filename) - 1); - return_code = OS_ModuleGetInfo_Impl(&token, module_prop); + return_code = OS_ModuleGetInfo_Impl(&token, module_info); OS_ObjectIdRelease(&token); } @@ -331,7 +331,7 @@ int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_prop) * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_SymbolLookup(cpuaddr *SymbolAddress, const char *SymbolName) +int32 OS_SymbolLookup(cpuaddr *symbol_address, const char *SymbolName) { int32 return_code; int32 staticsym_status; @@ -339,13 +339,13 @@ int32 OS_SymbolLookup(cpuaddr *SymbolAddress, const char *SymbolName) /* ** Check parameters */ - OS_CHECK_POINTER(SymbolAddress); + OS_CHECK_POINTER(symbol_address); OS_CHECK_POINTER(SymbolName); /* * attempt to find the symbol in the symbol table */ - return_code = OS_SymbolLookup_Impl(SymbolAddress, SymbolName); + return_code = OS_SymbolLookup_Impl(symbol_address, SymbolName); /* * If the OS call did not find the symbol or the loader is @@ -353,7 +353,7 @@ int32 OS_SymbolLookup(cpuaddr *SymbolAddress, const char *SymbolName) */ if (return_code != OS_SUCCESS) { - staticsym_status = OS_SymbolLookup_Static(SymbolAddress, SymbolName, NULL); + staticsym_status = OS_SymbolLookup_Static(symbol_address, SymbolName, NULL); /* * Only overwrite the return code if static lookup was successful. @@ -420,7 +420,7 @@ int32 OS_ModuleSymbolLookup(osal_id_t module_id, cpuaddr *symbol_address, const * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_SymbolTableDump(const char *filename, size_t SizeLimit) +int32 OS_SymbolTableDump(const char *filename, size_t size_limit) { int32 return_code; char translated_path[OS_MAX_LOCAL_PATH_LEN]; @@ -453,7 +453,7 @@ int32 OS_SymbolTableDump(const char *filename, size_t SizeLimit) return return_code; } - return_code = OS_SymbolTableDump_Impl(translated_path, SizeLimit); + return_code = OS_SymbolTableDump_Impl(translated_path, size_limit); OS_ObjectIdTransactionCancel(&token); diff --git a/src/os/shared/src/osapi-time.c b/src/os/shared/src/osapi-time.c index c9dd57bf0..65f02255c 100644 --- a/src/os/shared/src/osapi-time.c +++ b/src/os/shared/src/osapi-time.c @@ -197,10 +197,10 @@ static int32 OS_DoTimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_ * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebase_ref_id, OS_ArgCallback_t callback_ptr, +int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebase_id, OS_ArgCallback_t callback_ptr, void *callback_arg) { - return (OS_DoTimerAdd(timer_id, timer_name, timebase_ref_id, callback_ptr, callback_arg, 0)); + return (OS_DoTimerAdd(timer_id, timer_name, timebase_id, callback_ptr, callback_arg, 0)); } /*---------------------------------------------------------------- @@ -226,7 +226,8 @@ static void OS_Timer_NoArgCallback(osal_id_t objid, void *arg) * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *accuracy, OS_TimerCallback_t callback_ptr) +int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *clock_accuracy, + OS_TimerCallback_t callback_ptr) { int32 return_code; osal_id_t timebase_ref_id; @@ -239,7 +240,7 @@ int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *accura */ OS_CHECK_POINTER(timer_id); OS_CHECK_APINAME(timer_name); - OS_CHECK_POINTER(accuracy); + OS_CHECK_POINTER(clock_accuracy); OS_CHECK_POINTER(callback_ptr); /* @@ -277,7 +278,7 @@ int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *accura } else { - *accuracy = OS_SharedGlobalVars.MicroSecPerTick; + *clock_accuracy = OS_SharedGlobalVars.MicroSecPerTick; } return return_code; diff --git a/src/os/shared/src/osapi-timebase.c b/src/os/shared/src/osapi-timebase.c index 810cb61c9..28cb096e2 100644 --- a/src/os/shared/src/osapi-timebase.c +++ b/src/os/shared/src/osapi-timebase.c @@ -90,7 +90,7 @@ int32 OS_TimeBaseAPI_Init(void) * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_TimeBaseCreate(osal_id_t *timer_id, const char *timebase_name, OS_TimerSync_t external_sync) +int32 OS_TimeBaseCreate(osal_id_t *timebase_id, const char *timebase_name, OS_TimerSync_t external_sync) { int32 return_code; osal_objtype_t objtype; @@ -105,7 +105,7 @@ int32 OS_TimeBaseCreate(osal_id_t *timer_id, const char *timebase_name, OS_Timer /* ** Check Parameters */ - OS_CHECK_POINTER(timer_id); + OS_CHECK_POINTER(timebase_id); OS_CHECK_APINAME(timebase_name); /* @@ -141,7 +141,7 @@ int32 OS_TimeBaseCreate(osal_id_t *timer_id, const char *timebase_name, OS_Timer return_code = OS_TimeBaseCreate_Impl(&token); /* Check result, finalize record, and unlock global table. */ - return_code = OS_ObjectIdFinalizeNew(return_code, &token, timer_id); + return_code = OS_ObjectIdFinalizeNew(return_code, &token, timebase_id); } return return_code; @@ -153,7 +153,7 @@ int32 OS_TimeBaseCreate(osal_id_t *timer_id, const char *timebase_name, OS_Timer * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_TimeBaseSet(osal_id_t timer_id, uint32 start_time, uint32 interval_time) +int32 OS_TimeBaseSet(osal_id_t timebase_id, uint32 start_time, uint32 interval_time) { int32 return_code; osal_objtype_t objtype; @@ -181,7 +181,7 @@ int32 OS_TimeBaseSet(osal_id_t timer_id, uint32 start_time, uint32 interval_time return OS_ERR_INCORRECT_OBJ_STATE; } - return_code = OS_ObjectIdGetById(OS_LOCK_MODE_GLOBAL, OS_OBJECT_TYPE_OS_TIMEBASE, timer_id, &token); + return_code = OS_ObjectIdGetById(OS_LOCK_MODE_GLOBAL, OS_OBJECT_TYPE_OS_TIMEBASE, timebase_id, &token); if (return_code == OS_SUCCESS) { timebase = OS_OBJECT_TABLE_GET(OS_timebase_table, token); @@ -212,7 +212,7 @@ int32 OS_TimeBaseSet(osal_id_t timer_id, uint32 start_time, uint32 interval_time * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_TimeBaseDelete(osal_id_t timer_id) +int32 OS_TimeBaseDelete(osal_id_t timebase_id) { int32 return_code; osal_objtype_t objtype; @@ -228,7 +228,7 @@ int32 OS_TimeBaseDelete(osal_id_t timer_id) return OS_ERR_INCORRECT_OBJ_STATE; } - return_code = OS_ObjectIdGetById(OS_LOCK_MODE_EXCLUSIVE, OS_OBJECT_TYPE_OS_TIMEBASE, timer_id, &token); + return_code = OS_ObjectIdGetById(OS_LOCK_MODE_EXCLUSIVE, OS_OBJECT_TYPE_OS_TIMEBASE, timebase_id, &token); if (return_code == OS_SUCCESS) { return_code = OS_TimeBaseDelete_Impl(&token); @@ -246,13 +246,13 @@ int32 OS_TimeBaseDelete(osal_id_t timer_id) * See description in API and header file for detail * *-----------------------------------------------------------------*/ -int32 OS_TimeBaseGetIdByName(osal_id_t *timer_id, const char *timebase_name) +int32 OS_TimeBaseGetIdByName(osal_id_t *timebase_id, const char *timebase_name) { int32 return_code; osal_objtype_t objtype; /* Check parameters */ - OS_CHECK_POINTER(timer_id); + OS_CHECK_POINTER(timebase_id); OS_CHECK_APINAME(timebase_name); /* @@ -265,7 +265,7 @@ int32 OS_TimeBaseGetIdByName(osal_id_t *timer_id, const char *timebase_name) return OS_ERR_INCORRECT_OBJ_STATE; } - return_code = OS_ObjectIdFindByName(OS_OBJECT_TYPE_OS_TIMEBASE, timebase_name, timer_id); + return_code = OS_ObjectIdFindByName(OS_OBJECT_TYPE_OS_TIMEBASE, timebase_name, timebase_id); return return_code; } diff --git a/src/os/vxworks/src/os-impl-idmap.c b/src/os/vxworks/src/os-impl-idmap.c index 5d0895e96..ffdd8dfef 100644 --- a/src/os/vxworks/src/os-impl-idmap.c +++ b/src/os/vxworks/src/os-impl-idmap.c @@ -137,7 +137,7 @@ void OS_Unlock_Global_Impl(osal_objtype_t idtype) * See prototype for argument/return detail * *-----------------------------------------------------------------*/ -void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts) +void OS_WaitForStateChange_Impl(osal_objtype_t objtype, uint32 attempts) { int wait_ticks; @@ -150,9 +150,9 @@ void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts) wait_ticks = 100; } - OS_Unlock_Global_Impl(idtype); + OS_Unlock_Global_Impl(objtype); taskDelay(wait_ticks); - OS_Lock_Global_Impl(idtype); + OS_Lock_Global_Impl(objtype); } /**************************************************************************************** diff --git a/src/tests/time-base-api-test/time-base-api-test.c b/src/tests/time-base-api-test/time-base-api-test.c index 6ce05160a..29946751a 100644 --- a/src/tests/time-base-api-test/time-base-api-test.c +++ b/src/tests/time-base-api-test/time-base-api-test.c @@ -77,7 +77,7 @@ void TestTimeBaseApi(void) /* * Test Case For: - * int32 OS_TimeBaseCreate(uint32 *timer_id, const char *timebase_name, OS_TimerSync_t external_sync) + * int32 OS_TimeBaseCreate(osal_id_t *timebase_id, const char *timebase_name, OS_TimerSync_t external_sync) */ /* Test for invalid inputs */ @@ -123,7 +123,7 @@ void TestTimeBaseApi(void) /* * Test Case For: - * int32 OS_TimeBaseSet(uint32 timer_id, uint32 start_time, uint32 interval_time) + * int32 OS_TimeBaseSet(osal_id_t timebase_id, uint32 start_time, uint32 interval_time) */ /* Test for nominal inputs */ @@ -144,7 +144,7 @@ void TestTimeBaseApi(void) /* * Test Case For: - * int32 OS_TimeBaseDelete(uint32 timer_id) + * int32 OS_TimeBaseDelete(osal_id_t timebase_id) */ /* Test for nominal inputs */ @@ -156,7 +156,7 @@ void TestTimeBaseApi(void) /* * Test Case For: - * int32 OS_TimeBaseGetIdByName (uint32 *timer_id, const char *timebase_name) + * int32 OS_TimeBaseGetIdByName(osal_id_t *timebase_id, const char *timebase_name) */ /* Test for nominal inputs */ diff --git a/src/tests/timer-add-api-test/timer-add-api-test.c b/src/tests/timer-add-api-test/timer-add-api-test.c index 6f34f01bd..e9005912e 100644 --- a/src/tests/timer-add-api-test/timer-add-api-test.c +++ b/src/tests/timer-add-api-test/timer-add-api-test.c @@ -59,7 +59,7 @@ void TestTimerAddApi(void) { /* * Test Case For: - * int32 OS_TimerAdd(uint32 *timer_id, const char *timer_name, uint32 timebase_ref_id, OS_ArgCallback_t + * int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebase_id, OS_ArgCallback_t * callback_ptr, void *callback_arg) */ diff --git a/src/unit-test-coverage/portable/src/coveragetest-posix-files.c b/src/unit-test-coverage/portable/src/coveragetest-posix-files.c index c515fe414..70a1f707b 100644 --- a/src/unit-test-coverage/portable/src/coveragetest-posix-files.c +++ b/src/unit-test-coverage/portable/src/coveragetest-posix-files.c @@ -59,7 +59,7 @@ void Test_OS_FileStat_Impl(void) { /* * Test Case For: - * int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats) + * int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *filestat) */ os_fstat_t FileStats; struct OCS_stat RefStat; diff --git a/src/unit-test-coverage/shared/src/coveragetest-file.c b/src/unit-test-coverage/shared/src/coveragetest-file.c index 96bf1eb53..54ce227c0 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-file.c +++ b/src/unit-test-coverage/shared/src/coveragetest-file.c @@ -235,7 +235,7 @@ void Test_OS_rename(void) { /* * Test Case For: - * int32 OS_rename (const char *old, const char *new) + * int32 OS_rename(const char *old_filename, const char *new_filename) */ OS_UT_SetupIterator(OS_OBJECT_TYPE_OS_STREAM, UT_INDEX_1, 3); strncpy(OS_stream_table[1].stream_name, "/cf/file1", sizeof(OS_stream_table[1].stream_name)); diff --git a/src/unit-test-coverage/shared/src/coveragetest-module.c b/src/unit-test-coverage/shared/src/coveragetest-module.c index a50c47a90..da0a52570 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-module.c +++ b/src/unit-test-coverage/shared/src/coveragetest-module.c @@ -124,7 +124,7 @@ void Test_OS_SymbolLookup(void) { /* * Test Case For: - * int32 OS_SymbolLookup(cpuaddr *SymbolAddress, const char *SymbolName) + * int32 OS_SymbolLookup(cpuaddr *symbol_address, const char *SymbolName) */ int32 expected = OS_SUCCESS; int32 actual = ~OS_SUCCESS; @@ -264,7 +264,7 @@ void Test_OS_ModuleGetInfo(void) { /* * Test Case For: - * int32 OS_ModuleInfo ( uint32 module_id, OS_module_prop_t *module_prop ) + * int32 OS_ModuleInfo(uint32 module_id, OS_module_prop_t *module_info) */ OS_module_prop_t module_prop; diff --git a/src/unit-test-coverage/shared/src/coveragetest-time.c b/src/unit-test-coverage/shared/src/coveragetest-time.c index a1e30255c..017dcc9ca 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-time.c +++ b/src/unit-test-coverage/shared/src/coveragetest-time.c @@ -61,7 +61,7 @@ void Test_OS_TimerAdd(void) { /* * Test Case For: - * int32 OS_TimerAdd(uint32 *timer_id, const char *timer_name, uint32 timebase_ref_id, OS_ArgCallback_t + * int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebase_id, OS_ArgCallback_t * callback_ptr, void *callback_arg) */ osal_id_t objid = OS_OBJECT_ID_UNDEFINED; @@ -99,7 +99,8 @@ void Test_OS_TimerCreate(void) { /* * Test Case For: - * int32 OS_TimerCreate(uint32 *timer_id, const char *timer_name, uint32 *accuracy, OS_TimerCallback_t callback_ptr) + * int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *clock_accuracy, OS_TimerCallback_t + * callback_ptr) */ osal_id_t objid = OS_OBJECT_ID_UNDEFINED; osal_index_t local_id = OSAL_INDEX_C(0); diff --git a/src/unit-test-coverage/shared/src/coveragetest-timebase.c b/src/unit-test-coverage/shared/src/coveragetest-timebase.c index d25cbd88e..fb1596ab1 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-timebase.c +++ b/src/unit-test-coverage/shared/src/coveragetest-timebase.c @@ -77,7 +77,7 @@ void Test_OS_TimeBaseCreate(void) { /* * Test Case For: - * int32 OS_TimeBaseCreate(uint32 *timer_id, const char *timebase_name, OS_TimerSync_t external_sync) + * int32 OS_TimeBaseCreate(osal_id_t *timebase_id, const char *timebase_name, OS_TimerSync_t external_sync) */ osal_id_t objid; @@ -103,7 +103,7 @@ void Test_OS_TimeBaseSet(void) { /* * Test Case For: - * int32 OS_TimeBaseSet(uint32 timer_id, uint32 start_time, uint32 interval_time) + * int32 OS_TimeBaseSet(osal_id_t timebase_id, uint32 start_time, uint32 interval_time) */ OSAPI_TEST_FUNCTION_RC(OS_TimeBaseSet(UT_OBJID_1, 1000, 1000), OS_SUCCESS); @@ -126,7 +126,7 @@ void Test_OS_TimeBaseDelete(void) { /* * Test Case For: - * int32 OS_TimeBaseDelete(uint32 timer_id) + * int32 OS_TimeBaseDelete(osal_id_t timebase_id) */ OSAPI_TEST_FUNCTION_RC(OS_TimeBaseDelete(UT_OBJID_1), OS_SUCCESS); @@ -142,7 +142,7 @@ void Test_OS_TimeBaseGetIdByName(void) { /* * Test Case For: - * int32 OS_TimeBaseGetIdByName (uint32 *timer_id, const char *timebase_name) + * int32 OS_TimeBaseGetIdByName(osal_id_t *timebase_id, const char *timebase_name) */ osal_id_t objid = OS_OBJECT_ID_UNDEFINED; diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-idmap.c b/src/unit-test-coverage/vxworks/src/coveragetest-idmap.c index 31edfd31f..688051fe7 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-idmap.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-idmap.c @@ -88,7 +88,7 @@ void Test_OS_WaitForStateChange_Impl(void) { /* * Test Case For: - * void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts) + * void OS_WaitForStateChange_Impl(osal_objtype_t objtype, uint32 attempts) */ /* diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-symtab.c b/src/unit-test-coverage/vxworks/src/coveragetest-symtab.c index b181c9147..4da5f8c43 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-symtab.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-symtab.c @@ -98,7 +98,7 @@ static int32 UT_symEachHook(void *UserObj, int32 StubRetcode, uint32 CallCount, void Test_OS_SymbolTableDump_Impl(void) { /* Test Case For: - * int32 OS_SymbolTableDump_Impl ( const char *filename, uint32 SizeLimit ) + * int32 OS_SymbolTableDump_Impl(const char *filename, uint32 size_limit) */ /* With no action in symEach(), this will yield an empty file, which is an error */ diff --git a/src/unit-tests/osfile-test/ut_osfile_fileio_test.c b/src/unit-tests/osfile-test/ut_osfile_fileio_test.c index e11baed56..9a8050228 100644 --- a/src/unit-tests/osfile-test/ut_osfile_fileio_test.c +++ b/src/unit-tests/osfile-test/ut_osfile_fileio_test.c @@ -1024,10 +1024,10 @@ void UT_os_removefile_test() } /*--------------------------------------------------------------------------------* -** Syntax: int32 OS_rename(const char *old, const char *new) +** Syntax: int32 OS_rename(const char *old_filename, const char *new_filename) ** Purpose: Renames the given file name to the new file name -** Parameters: *old - pointer to the path/name of the file to be renamed -** *new - pointer to the new path/name of the file +** Parameters: *old_filename - pointer to the path/name of the file to be renamed +** *new_filename - pointer to the new path/name of the file ** Returns: OS_INVALID_POINTER if any of the pointers passed in is null ** OS_FS_ERR_PATH_TOO_LONG if the path name is too long ** OS_FS_ERR_NAME_TOO_LONG if the name is too long diff --git a/src/unit-tests/ostimer-test/ut_ostimer_timerio_test.c b/src/unit-tests/ostimer-test/ut_ostimer_timerio_test.c index c52c87ac8..a6bea2528 100644 --- a/src/unit-tests/ostimer-test/ut_ostimer_timerio_test.c +++ b/src/unit-tests/ostimer-test/ut_ostimer_timerio_test.c @@ -94,7 +94,7 @@ void UT_os_reconftimercallback(osal_id_t timerId, void *arg) } /*--------------------------------------------------------------------------------* -** Syntax: int32 OS_TimerCreate(uint32 *timer_id, const char *timer_name, uint32 *clock_accuracy, OS_TimerCallback_t +** Syntax: int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *clock_accuracy, OS_TimerCallback_t *callback_ptr) ** Purpose: Creates a new timer and associates it with a callback routine ** Parameters: *timer_id - a pointer that will hold the timer id From 6e0f5412dc69d0a89265646d78d1bf879113e5b5 Mon Sep 17 00:00:00 2001 From: Avi Date: Sun, 13 Nov 2022 08:51:52 +1000 Subject: [PATCH 4/6] Fix #1330, Move variables declared mid-function to the top --- src/tests/time-base-api-test/time-base-api-test.c | 3 ++- src/unit-test-coverage/shared/src/coveragetest-idmap.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tests/time-base-api-test/time-base-api-test.c b/src/tests/time-base-api-test/time-base-api-test.c index 6ce05160a..5322a808f 100644 --- a/src/tests/time-base-api-test/time-base-api-test.c +++ b/src/tests/time-base-api-test/time-base-api-test.c @@ -74,6 +74,7 @@ void TestTimeBaseApi(void) osal_id_t tb_id[OS_MAX_TIMEBASES]; char timebase_name[OS_MAX_API_NAME + 5]; OS_timebase_prop_t timebase_prop; + int i; /* * Test Case For: @@ -89,7 +90,7 @@ void TestTimeBaseApi(void) UtAssert_INT32_EQ(OS_TimeBaseCreate(&time_base_id, timebase_name, 0), OS_ERR_NAME_TOO_LONG); /* Checking for OS_MAX_TIMEBASES */ - for (int i = 0; i < OS_MAX_TIMEBASES; i++) + for (i = 0; i < OS_MAX_TIMEBASES; i++) { /* On the final setup pass, while there is still one free slot, * check attempting to create a duplicate name (index 0) - this diff --git a/src/unit-test-coverage/shared/src/coveragetest-idmap.c b/src/unit-test-coverage/shared/src/coveragetest-idmap.c index 053931283..1b8f8ea8a 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-idmap.c +++ b/src/unit-test-coverage/shared/src/coveragetest-idmap.c @@ -1157,6 +1157,8 @@ void Test_OS_ObjectIDInteger(void) int32 recordscount = 0; osal_objtype_t idtype; char str[OS_MAX_API_NAME]; + int i; + int j; memset(&token, 0, sizeof(token)); @@ -1181,11 +1183,11 @@ void Test_OS_ObjectIDInteger(void) UtAssert_True(recordscount < OS_MAX_TOTAL_RECORDS, "All Id types checked"); - for (int i = 0; i < recordscount; i++) + for (i = 0; i < recordscount; i++) { UtAssert_True(OS_ObjectIdDefined(typesI[i]), "%lu Is defined", OS_ObjectIdToInteger(typesI[i])); - for (int j = 0; j < recordscount; j++) + for (j = 0; j < recordscount; j++) { if (i == j) { From b3cdc13d7a298ff09d1840f0bb5ef5c683c33b5c Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 14 Feb 2024 11:51:53 -0500 Subject: [PATCH 5/6] Fix #1433, use virtual path as name for FS_BASED maps Use the "virtual_path" instead of "device_name" as the name record for FS_BASED entries. This should allow duplicate detection to work as expected. The device_name on mappings made via this method will now be an empty string. It is not relevant because this type of map is used for devices that are already mounted. --- src/os/rtems/src/os-impl-filesys.c | 7 +++--- src/os/shared/src/osapi-filesys.c | 24 ++----------------- src/os/vxworks/src/os-impl-filesys.c | 6 +++++ .../file-sys-add-fixed-map-api-test.c | 4 ---- .../shared/src/coveragetest-filesys.c | 6 ----- .../vxworks/src/coveragetest-filesys.c | 5 ++++ 6 files changed, 17 insertions(+), 35 deletions(-) diff --git a/src/os/rtems/src/os-impl-filesys.c b/src/os/rtems/src/os-impl-filesys.c index 177266a17..345ea7806 100644 --- a/src/os/rtems/src/os-impl-filesys.c +++ b/src/os/rtems/src/os-impl-filesys.c @@ -187,11 +187,12 @@ int32 OS_FileSysStartVolume_Impl(const OS_object_token_t *token) * * The path will be simply / */ - if (return_code == OS_SUCCESS && local->system_mountpt[0] == 0) + if (return_code == OS_SUCCESS && local->system_mountpt[0] == 0 && local->volume_name[0] != 0) { - local->system_mountpt[0] = '/'; - local->system_mountpt[sizeof(local->system_mountpt) - 1] = 0; + local->system_mountpt[0] = '/'; strncpy(&local->system_mountpt[1], local->volume_name, sizeof(local->system_mountpt) - 2); + local->system_mountpt[sizeof(local->system_mountpt) - 1] = 0; + OS_DEBUG("OSAL: using mount point %s for %s\n", local->system_mountpt, local->volume_name); } diff --git a/src/os/shared/src/osapi-filesys.c b/src/os/shared/src/osapi-filesys.c index 3817f5a9c..6872bfba4 100644 --- a/src/os/shared/src/osapi-filesys.c +++ b/src/os/shared/src/osapi-filesys.c @@ -243,7 +243,6 @@ int32 OS_FileSysAddFixedMap(osal_id_t *filesys_id, const char *phys_path, const OS_filesys_internal_record_t *filesys; int32 return_code; OS_object_token_t token; - const char * dev_name; /* * Validate inputs @@ -252,33 +251,14 @@ int32 OS_FileSysAddFixedMap(osal_id_t *filesys_id, const char *phys_path, const OS_CHECK_STRING(phys_path, sizeof(filesys->system_mountpt), OS_FS_ERR_PATH_TOO_LONG); OS_CHECK_PATHNAME(virt_path); - /* - * Generate a dev name by taking the basename of the phys_path. - */ - dev_name = strrchr(phys_path, '/'); - if (dev_name == NULL) - { - dev_name = phys_path; - } - else - { - ++dev_name; - } - - if (memchr(dev_name, 0, sizeof(filesys->volume_name)) == NULL) - { - return OS_ERR_NAME_TOO_LONG; - } - - return_code = OS_ObjectIdAllocateNew(LOCAL_OBJID_TYPE, dev_name, &token); + return_code = OS_ObjectIdAllocateNew(LOCAL_OBJID_TYPE, virt_path, &token); if (return_code == OS_SUCCESS) { filesys = OS_OBJECT_TABLE_GET(OS_filesys_table, token); /* Reset the table entry and save the name */ - OS_OBJECT_INIT(token, filesys, device_name, dev_name); + OS_OBJECT_INIT(token, filesys, virtual_mountpt, virt_path); - strncpy(filesys->volume_name, dev_name, sizeof(filesys->volume_name) - 1); strncpy(filesys->system_mountpt, phys_path, sizeof(filesys->system_mountpt) - 1); strncpy(filesys->virtual_mountpt, virt_path, sizeof(filesys->virtual_mountpt) - 1); diff --git a/src/os/vxworks/src/os-impl-filesys.c b/src/os/vxworks/src/os-impl-filesys.c index 2bdb9c40d..2c03e31c5 100644 --- a/src/os/vxworks/src/os-impl-filesys.c +++ b/src/os/vxworks/src/os-impl-filesys.c @@ -140,6 +140,12 @@ int32 OS_FileSysStartVolume_Impl(const OS_object_token_t *token) OS_DEBUG("OSAL: Error creating low level block device\n"); return_code = OS_FS_ERR_DRIVE_NOT_CREATED; } + else if (local->volume_name[0] == 0) + { + /* this requires that the user has specified the volume name to mount */ + OS_DEBUG("OSAL: No volume name specified to mount\n"); + return_code = OS_FS_ERR_DRIVE_NOT_CREATED; + } else { /* diff --git a/src/tests/file-sys-add-fixed-map-api-test/file-sys-add-fixed-map-api-test.c b/src/tests/file-sys-add-fixed-map-api-test/file-sys-add-fixed-map-api-test.c index a05216b83..127311771 100644 --- a/src/tests/file-sys-add-fixed-map-api-test/file-sys-add-fixed-map-api-test.c +++ b/src/tests/file-sys-add-fixed-map-api-test/file-sys-add-fixed-map-api-test.c @@ -67,10 +67,6 @@ void TestFileSysAddFixedMapApi(void) UtAssert_INT32_EQ(OS_FileSysAddFixedMap(&fs_id, "./test", long_path), OS_FS_ERR_PATH_TOO_LONG); UtAssert_INT32_EQ(OS_FileSysAddFixedMap(&fs_id, translated_path, "/test"), OS_FS_ERR_PATH_TOO_LONG); - - /* create a path where only the "name" part is too long, but the overall path length is within limit */ - translated_path[OS_MAX_LOCAL_PATH_LEN - 1] = 0; - UtAssert_INT32_EQ(OS_FileSysAddFixedMap(&fs_id, translated_path, "/test"), OS_ERR_NAME_TOO_LONG); } void UtTest_Setup(void) diff --git a/src/unit-test-coverage/shared/src/coveragetest-filesys.c b/src/unit-test-coverage/shared/src/coveragetest-filesys.c index 1952788af..551b00fd0 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-filesys.c +++ b/src/unit-test-coverage/shared/src/coveragetest-filesys.c @@ -63,12 +63,6 @@ void Test_OS_FileSysAddFixedMap(void) UT_SetDeferredRetcode(UT_KEY(OCS_memchr), 2, OS_ERROR); OSAPI_TEST_FUNCTION_RC(OS_FileSysAddFixedMap(&id, "/phys", "/virt"), OS_FS_ERR_PATH_TOO_LONG); - UT_SetDefaultReturnValue(UT_KEY(OCS_strrchr), -1); - UT_SetDeferredRetcode(UT_KEY(OCS_memchr), 3, OS_ERROR); - OSAPI_TEST_FUNCTION_RC(OS_FileSysAddFixedMap(&id, "/phys", "/virt"), OS_ERR_NAME_TOO_LONG); - UT_ResetState(UT_KEY(OCS_memchr)); - UT_ResetState(UT_KEY(OCS_strrchr)); - UT_SetDeferredRetcode(UT_KEY(OS_ObjectIdAllocateNew), 1, OS_ERR_NO_FREE_IDS); OSAPI_TEST_FUNCTION_RC(OS_FileSysAddFixedMap(&id, "/phys", "/virt"), OS_ERR_NO_FREE_IDS); UT_SetDeferredRetcode(UT_KEY(OS_FileSysStartVolume_Impl), 1, OS_ERROR); diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-filesys.c b/src/unit-test-coverage/vxworks/src/coveragetest-filesys.c index 81d97f71e..4dffba503 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-filesys.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-filesys.c @@ -57,8 +57,13 @@ void Test_OS_FileSysStartVolume_Impl(void) OSAPI_TEST_FUNCTION_RC(OS_FileSysStartVolume_Impl(&token), OS_SUCCESS); /* Emulate a VOLATILE_DISK entry (ramdisk) */ + /* Without a volumne name specified, this should fail */ OS_filesys_table[1].fstype = OS_FILESYS_TYPE_VOLATILE_DISK; token.obj_idx = UT_INDEX_1; + OSAPI_TEST_FUNCTION_RC(OS_FileSysStartVolume_Impl(&token), OS_FS_ERR_DRIVE_NOT_CREATED); + + /* Filling the volume name should permit success (nominal) */ + strncpy(OS_filesys_table[1].volume_name, "UT", sizeof(OS_filesys_table[1].volume_name)); OSAPI_TEST_FUNCTION_RC(OS_FileSysStartVolume_Impl(&token), OS_SUCCESS); /* Emulate a NORMAL_DISK entry (ATA) */ From 2484176ac851102d2538433710496be9418e4d47 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 23 Feb 2024 07:49:59 -0500 Subject: [PATCH 6/6] Updating documentation and version numbers for equuleus-rc1+dev53 --- CHANGELOG.md | 8 ++++++++ src/os/inc/osapi-version.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d474548d..7ab70b676 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Development Build: equuleus-rc1+dev53 +- use virtual path as name for FS_BASED maps +- Remove softsleep, as a dead store. +- Remove stray remaining 'goto' in OSAL test code +- Align mismatched function prototype/implem. parameter names +- Move variables declared mid-function to the top +- See , , , , and + ## Development Build: equuleus-rc1+dev41 - Remove unreachable branch (superfluous if condition) - See diff --git a/src/os/inc/osapi-version.h b/src/os/inc/osapi-version.h index 8fb218689..900eebd3d 100644 --- a/src/os/inc/osapi-version.h +++ b/src/os/inc/osapi-version.h @@ -34,7 +34,7 @@ /* * Development Build Macro Definitions */ -#define OS_BUILD_NUMBER 41 +#define OS_BUILD_NUMBER 53 #define OS_BUILD_BASELINE "equuleus-rc1" #define OS_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */ #define OS_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */