From 1731baad8e5bb723680f92fd1d5a5f09df7035f6 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 26 Jun 2020 16:58:10 -0400 Subject: [PATCH] Fix #526, scrub OSAL stubs Ensure that: 1. All stub routines register their arguments in the context, so that the values will be available to hook functions. 2. Ensure that the argument names used in stubs match the name in the prototype/documentation so the value can be retrieved by name. --- src/ut-stubs/osapi-utstub-binsem.c | 22 ++++++++++ src/ut-stubs/osapi-utstub-clock.c | 6 ++- src/ut-stubs/osapi-utstub-common.c | 5 ++- src/ut-stubs/osapi-utstub-countsem.c | 20 +++++++++ src/ut-stubs/osapi-utstub-dir.c | 23 ++++++++++ src/ut-stubs/osapi-utstub-errors.c | 3 ++ src/ut-stubs/osapi-utstub-file.c | 61 +++++++++++++++++++++++++- src/ut-stubs/osapi-utstub-filesys.c | 43 +++++++++++++++++- src/ut-stubs/osapi-utstub-fpu.c | 12 +++++ src/ut-stubs/osapi-utstub-heap.c | 2 + src/ut-stubs/osapi-utstub-idmap.c | 32 ++++++++------ src/ut-stubs/osapi-utstub-interrupts.c | 24 +++++++--- src/ut-stubs/osapi-utstub-module.c | 19 ++++++-- src/ut-stubs/osapi-utstub-mutex.c | 16 +++++++ src/ut-stubs/osapi-utstub-network.c | 3 ++ src/ut-stubs/osapi-utstub-printf.c | 3 +- src/ut-stubs/osapi-utstub-queue.c | 27 +++++++++++- src/ut-stubs/osapi-utstub-select.c | 22 ++++++++-- src/ut-stubs/osapi-utstub-sockets.c | 55 ++++++++++++++++++++--- src/ut-stubs/osapi-utstub-task.c | 32 +++++++++++--- src/ut-stubs/osapi-utstub-time.c | 27 +++++++++++- src/ut-stubs/osapi-utstub-timebase.c | 21 +++++++++ 22 files changed, 431 insertions(+), 47 deletions(-) diff --git a/src/ut-stubs/osapi-utstub-binsem.c b/src/ut-stubs/osapi-utstub-binsem.c index 3a97cc1d9..ea0cccd42 100644 --- a/src/ut-stubs/osapi-utstub-binsem.c +++ b/src/ut-stubs/osapi-utstub-binsem.c @@ -55,6 +55,8 @@ UT_DEFAULT_STUB(OS_BinSemAPI_Init,(void)) ******************************************************************************/ int32 OS_BinSemTake(uint32 sem_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemTake), sem_id); + int32 status = OS_SUCCESS; status = UT_DEFAULT_IMPL(OS_BinSemTake); @@ -83,6 +85,8 @@ int32 OS_BinSemTake(uint32 sem_id) ******************************************************************************/ int32 OS_BinSemFlush(uint32 sem_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemFlush), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_BinSemFlush); @@ -116,6 +120,11 @@ int32 OS_BinSemFlush(uint32 sem_id) int32 OS_BinSemCreate(uint32 *sem_id, const char *sem_name, uint32 sem_initial_value, uint32 options) { + UT_Stub_RegisterContext(UT_KEY(OS_BinSemCreate), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_BinSemCreate), sem_name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemCreate), sem_initial_value); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemCreate), options); + int32 status; status = UT_DEFAULT_IMPL(OS_BinSemCreate); @@ -150,6 +159,8 @@ int32 OS_BinSemCreate(uint32 *sem_id, const char *sem_name, ******************************************************************************/ int32 OS_BinSemGive(uint32 sem_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemGive), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_BinSemGive); @@ -175,6 +186,9 @@ int32 OS_BinSemGive(uint32 sem_id) ******************************************************************************/ int32 OS_BinSemGetInfo(uint32 sem_id, OS_bin_sem_prop_t *bin_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemGetInfo), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_BinSemGetInfo), bin_prop); + int32 status; status = UT_DEFAULT_IMPL(OS_BinSemGetInfo); @@ -214,6 +228,8 @@ int32 OS_BinSemGetInfo(uint32 sem_id, OS_bin_sem_prop_t *bin_prop) ******************************************************************************/ int32 OS_BinSemDelete(uint32 sem_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemDelete), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_BinSemDelete); @@ -247,6 +263,9 @@ int32 OS_BinSemDelete(uint32 sem_id) ******************************************************************************/ int32 OS_BinSemTimedWait(uint32 sem_id, uint32 msecs) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemTimedWait), sem_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_BinSemTimedWait), msecs); + int32 status; status = UT_DEFAULT_IMPL(OS_BinSemTimedWait); @@ -261,6 +280,9 @@ int32 OS_BinSemTimedWait(uint32 sem_id, uint32 msecs) *****************************************************************************/ int32 OS_BinSemGetIdByName (uint32 *sem_id, const char *sem_name) { + UT_Stub_RegisterContext(UT_KEY(OS_BinSemGetIdByName), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_BinSemGetIdByName), sem_name); + int32 status; status = UT_DEFAULT_IMPL(OS_BinSemGetIdByName); diff --git a/src/ut-stubs/osapi-utstub-clock.c b/src/ut-stubs/osapi-utstub-clock.c index 9438cf237..871e71ecc 100644 --- a/src/ut-stubs/osapi-utstub-clock.c +++ b/src/ut-stubs/osapi-utstub-clock.c @@ -42,10 +42,11 @@ *****************************************************************************/ int32 OS_GetLocalTime(OS_time_t *time_struct) { + UT_Stub_RegisterContext(UT_KEY(OS_GetLocalTime), time_struct); + int32 status; uint32 count; - UT_Stub_RegisterContext(UT_KEY(OS_GetLocalTime), time_struct); status = UT_DEFAULT_IMPL(OS_GetLocalTime); if (status == OS_SUCCESS && @@ -67,9 +68,10 @@ int32 OS_GetLocalTime(OS_time_t *time_struct) *****************************************************************************/ int32 OS_SetLocalTime(OS_time_t *time_struct) { + UT_Stub_RegisterContext(UT_KEY(OS_SetLocalTime), time_struct); + int32 status; - UT_Stub_RegisterContext(UT_KEY(OS_SetLocalTime), time_struct); status = UT_DEFAULT_IMPL(OS_SetLocalTime); return status; diff --git a/src/ut-stubs/osapi-utstub-common.c b/src/ut-stubs/osapi-utstub-common.c index cf256b701..01d4d131a 100644 --- a/src/ut-stubs/osapi-utstub-common.c +++ b/src/ut-stubs/osapi-utstub-common.c @@ -57,6 +57,8 @@ int32 OS_API_Init(void) *****************************************************************************/ void OS_ApplicationExit(int32 Status) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ApplicationExit), Status); + /* just call the default so a hook can be attached */ UT_DEFAULT_IMPL(OS_ApplicationExit); } @@ -100,7 +102,8 @@ void OS_IdleLoop(void) *****************************************************************************/ void OS_ApplicationShutdown(uint8 flag) { - UT_Stub_RegisterContext(UT_KEY(OS_ApplicationShutdown), &flag); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ApplicationShutdown), flag); + UT_DEFAULT_IMPL(OS_ApplicationShutdown); } diff --git a/src/ut-stubs/osapi-utstub-countsem.c b/src/ut-stubs/osapi-utstub-countsem.c index a8ee84bed..b13485490 100644 --- a/src/ut-stubs/osapi-utstub-countsem.c +++ b/src/ut-stubs/osapi-utstub-countsem.c @@ -45,6 +45,11 @@ UT_DEFAULT_STUB(OS_CountSemAPI_Init,(void)) int32 OS_CountSemCreate(uint32 *sem_id, const char *sem_name, uint32 sem_initial_value, uint32 options) { + UT_Stub_RegisterContext(UT_KEY(OS_CountSemCreate), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_CountSemCreate), sem_name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_CountSemCreate), sem_initial_value); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_CountSemCreate), options); + int32 status; status = UT_DEFAULT_IMPL(OS_CountSemCreate); @@ -83,6 +88,8 @@ int32 OS_CountSemCreate(uint32 *sem_id, const char *sem_name, ******************************************************************************/ int32 OS_CountSemDelete(uint32 sem_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_CountSemDelete), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_CountSemDelete); @@ -103,6 +110,8 @@ int32 OS_CountSemDelete(uint32 sem_id) *****************************************************************************/ int32 OS_CountSemGive ( uint32 sem_id ) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_CountSemGive), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_CountSemGive); @@ -117,6 +126,8 @@ int32 OS_CountSemGive ( uint32 sem_id ) *****************************************************************************/ int32 OS_CountSemTake ( uint32 sem_id ) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_CountSemTake), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_CountSemTake); @@ -131,6 +142,9 @@ int32 OS_CountSemTake ( uint32 sem_id ) *****************************************************************************/ int32 OS_CountSemTimedWait ( uint32 sem_id, uint32 msecs ) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_CountSemTimedWait), sem_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_CountSemTimedWait), msecs); + int32 status; status = UT_DEFAULT_IMPL(OS_CountSemTimedWait); @@ -145,6 +159,9 @@ int32 OS_CountSemTimedWait ( uint32 sem_id, uint32 msecs ) *****************************************************************************/ int32 OS_CountSemGetIdByName (uint32 *sem_id, const char *sem_name) { + UT_Stub_RegisterContext(UT_KEY(OS_CountSemGetIdByName), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_CountSemGetIdByName), sem_name); + int32 status; status = UT_DEFAULT_IMPL(OS_CountSemGetIdByName); @@ -177,6 +194,9 @@ int32 OS_CountSemGetIdByName (uint32 *sem_id, const char *sem_name) ******************************************************************************/ int32 OS_CountSemGetInfo(uint32 sem_id, OS_count_sem_prop_t *count_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_CountSemGetInfo), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_CountSemGetInfo), count_prop); + int32 status; status = UT_DEFAULT_IMPL(OS_CountSemGetInfo); diff --git a/src/ut-stubs/osapi-utstub-dir.c b/src/ut-stubs/osapi-utstub-dir.c index e15e2a3ec..6f89b47f0 100644 --- a/src/ut-stubs/osapi-utstub-dir.c +++ b/src/ut-stubs/osapi-utstub-dir.c @@ -44,6 +44,9 @@ UT_DEFAULT_STUB(OS_DirAPI_Init,(void)) *****************************************************************************/ int32 OS_mkdir (const char *path, uint32 access) { + UT_Stub_RegisterContext(UT_KEY(OS_mkdir), path); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_mkdir), access); + int32 Status; Status = UT_DEFAULT_IMPL(OS_mkdir); @@ -58,6 +61,8 @@ int32 OS_mkdir (const char *path, uint32 access) *****************************************************************************/ int32 OS_rmdir (const char *path) { + UT_Stub_RegisterContext(UT_KEY(OS_rmdir), path); + int32 Status; Status = UT_DEFAULT_IMPL(OS_rmdir); @@ -74,6 +79,9 @@ int32 OS_rmdir (const char *path) *****************************************************************************/ int32 OS_DirectoryOpen(uint32 *dir_id, const char *path) { + UT_Stub_RegisterContext(UT_KEY(OS_DirectoryOpen), dir_id); + UT_Stub_RegisterContext(UT_KEY(OS_DirectoryOpen), path); + int32 Status; Status = UT_DEFAULT_IMPL(OS_DirectoryOpen); @@ -98,6 +106,8 @@ int32 OS_DirectoryOpen(uint32 *dir_id, const char *path) *****************************************************************************/ int32 OS_DirectoryClose(uint32 dir_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_DirectoryClose), dir_id); + int32 Status; Status = UT_DEFAULT_IMPL(OS_DirectoryClose); @@ -117,6 +127,8 @@ int32 OS_DirectoryClose(uint32 dir_id) *****************************************************************************/ int32 OS_DirectoryRewind(uint32 dir_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_DirectoryRewind), dir_id); + int32 Status; Status = UT_DEFAULT_IMPL(OS_DirectoryRewind); @@ -131,6 +143,9 @@ int32 OS_DirectoryRewind(uint32 dir_id) *****************************************************************************/ int32 OS_DirectoryRead(uint32 dir_id, os_dirent_t *dirent) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_DirectoryRead), dir_id); + UT_Stub_RegisterContext(UT_KEY(OS_DirectoryRead), dirent); + int32 Status; uint32 CopySize; @@ -159,6 +174,8 @@ int32 OS_DirectoryRead(uint32 dir_id, os_dirent_t *dirent) *****************************************************************************/ os_dirp_t OS_opendir (const char *path) { + UT_Stub_RegisterContext(UT_KEY(OS_opendir), path); + int32 Status; os_dirp_t Dirp; @@ -191,6 +208,8 @@ os_dirp_t OS_opendir (const char *path) *****************************************************************************/ int32 OS_closedir (os_dirp_t directory) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_closedir), directory); + int32 Status; Status = UT_DEFAULT_IMPL(OS_closedir); @@ -206,6 +225,8 @@ int32 OS_closedir (os_dirp_t directory) *****************************************************************************/ os_dirent_t * OS_readdir (os_dirp_t directory) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_readdir), directory); + static os_dirent_t DefaultEntry; os_dirent_t *DirentPtr; int32 Status; @@ -241,6 +262,8 @@ os_dirent_t * OS_readdir (os_dirp_t directory) *****************************************************************************/ void OS_rewinddir(os_dirp_t directory) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_rewinddir), directory); + /* Call the default impl so hooks will work */ UT_DEFAULT_IMPL(OS_rewinddir); } diff --git a/src/ut-stubs/osapi-utstub-errors.c b/src/ut-stubs/osapi-utstub-errors.c index 718906ba3..f3259ff99 100644 --- a/src/ut-stubs/osapi-utstub-errors.c +++ b/src/ut-stubs/osapi-utstub-errors.c @@ -36,6 +36,9 @@ int32 OS_GetErrorName(int32 error_num, os_err_name_t* err_name) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_GetErrorName), error_num); + UT_Stub_RegisterContext(UT_KEY(OS_GetErrorName), err_name); + int32 status; status = UT_DEFAULT_IMPL(OS_GetErrorName); diff --git a/src/ut-stubs/osapi-utstub-file.c b/src/ut-stubs/osapi-utstub-file.c index 20fda6864..719cec567 100644 --- a/src/ut-stubs/osapi-utstub-file.c +++ b/src/ut-stubs/osapi-utstub-file.c @@ -115,6 +115,9 @@ static int32 UT_GenericWriteStub(const char *fname, UT_EntryKey_t fkey, const vo *****************************************************************************/ int32 OS_creat(const char *path, int32 access) { + UT_Stub_RegisterContext(UT_KEY(OS_creat), path); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_creat), access); + int32 status; status = UT_DEFAULT_IMPL(OS_creat); @@ -134,6 +137,10 @@ int32 OS_creat(const char *path, int32 access) *****************************************************************************/ int32 OS_open(const char *path, int32 access, uint32 mode) { + UT_Stub_RegisterContext(UT_KEY(OS_open), path); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_open), access); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_open), mode); + int32 status; status = UT_DEFAULT_IMPL(OS_open); @@ -154,6 +161,8 @@ int32 OS_open(const char *path, int32 access, uint32 mode) *****************************************************************************/ int32 OS_close(uint32 filedes) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_close), filedes); + int32 status; status = UT_DEFAULT_IMPL(OS_close); @@ -193,6 +202,10 @@ int32 OS_StreamWrite(uint32 filedes, const void *buffer, uint32 nbytes, int32 t *****************************************************************************/ int32 OS_read(uint32 filedes, void *buffer, uint32 nbytes) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_read), filedes); + UT_Stub_RegisterContext(UT_KEY(OS_read), buffer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_read), nbytes); + return UT_GenericReadStub(__func__,UT_KEY(OS_read),buffer,nbytes); } @@ -203,6 +216,10 @@ int32 OS_read(uint32 filedes, void *buffer, uint32 nbytes) *****************************************************************************/ int32 OS_write(uint32 filedes, const void *buffer, uint32 nbytes) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_write), filedes); + UT_Stub_RegisterContext(UT_KEY(OS_write), buffer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_write), nbytes); + return UT_GenericWriteStub(__func__,UT_KEY(OS_write),buffer,nbytes); } @@ -213,6 +230,11 @@ int32 OS_write(uint32 filedes, const void *buffer, uint32 nbytes) *****************************************************************************/ int32 OS_TimedRead(uint32 filedes, void *buffer, uint32 nbytes, int32 timeout) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimedRead), filedes); + UT_Stub_RegisterContext(UT_KEY(OS_TimedRead), buffer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimedRead), nbytes); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimedRead), timeout); + return UT_GenericReadStub(__func__,UT_KEY(OS_TimedRead),buffer,nbytes); } @@ -223,6 +245,11 @@ int32 OS_TimedRead(uint32 filedes, void *buffer, uint32 nbytes, int32 timeout) *****************************************************************************/ int32 OS_TimedWrite(uint32 filedes, const void *buffer, uint32 nbytes, int32 timeout) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimedWrite), filedes); + UT_Stub_RegisterContext(UT_KEY(OS_TimedWrite), buffer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimedWrite), nbytes); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimedWrite), timeout); + return UT_GenericWriteStub(__func__,UT_KEY(OS_TimedWrite),buffer,nbytes); } @@ -234,6 +261,9 @@ int32 OS_TimedWrite(uint32 filedes, const void *buffer, uint32 nbytes, int32 ti *****************************************************************************/ int32 OS_chmod (const char *path, uint32 access) { + UT_Stub_RegisterContext(UT_KEY(OS_chmod), path); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_chmod), access); + int32 Status; Status = UT_DEFAULT_IMPL(OS_chmod); @@ -249,6 +279,9 @@ int32 OS_chmod (const char *path, uint32 access) *****************************************************************************/ int32 OS_stat (const char *path, os_fstat_t *filestats) { + UT_Stub_RegisterContext(UT_KEY(OS_stat), path); + UT_Stub_RegisterContext(UT_KEY(OS_stat), filestats); + int32 Status; Status = UT_DEFAULT_IMPL(OS_stat); @@ -267,6 +300,10 @@ int32 OS_stat (const char *path, os_fstat_t *filestats) *****************************************************************************/ int32 OS_lseek(uint32 filedes, int32 offset, uint32 whence) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_lseek), filedes); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_lseek), offset); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_lseek), whence); + int32 status; status = UT_DEFAULT_IMPL_RC(OS_lseek, offset); @@ -281,6 +318,8 @@ int32 OS_lseek(uint32 filedes, int32 offset, uint32 whence) *****************************************************************************/ int32 OS_remove (const char *path) { + UT_Stub_RegisterContext(UT_KEY(OS_remove), path); + int32 Status; Status = UT_DEFAULT_IMPL(OS_remove); @@ -293,8 +332,11 @@ int32 OS_remove (const char *path) * Stub function for OS_rename() * *****************************************************************************/ -int32 OS_rename (const char *old, const char *new) +int32 OS_rename (const char *old_filename, const char *new_filename) { + UT_Stub_RegisterContext(UT_KEY(OS_rename), old_filename); + UT_Stub_RegisterContext(UT_KEY(OS_rename), new_filename); + int32 Status; Status = UT_DEFAULT_IMPL(OS_rename); @@ -309,6 +351,9 @@ int32 OS_rename (const char *old, const char *new) *****************************************************************************/ int32 OS_cp (const char *src, const char *dest) { + UT_Stub_RegisterContext(UT_KEY(OS_cp), src); + UT_Stub_RegisterContext(UT_KEY(OS_cp), dest); + int32 Status; Status = UT_DEFAULT_IMPL(OS_cp); @@ -323,6 +368,9 @@ int32 OS_cp (const char *src, const char *dest) *****************************************************************************/ int32 OS_mv (const char *src, const char *dest) { + UT_Stub_RegisterContext(UT_KEY(OS_mv), src); + UT_Stub_RegisterContext(UT_KEY(OS_mv), dest); + int32 Status; Status = UT_DEFAULT_IMPL(OS_mv); @@ -338,6 +386,9 @@ int32 OS_mv (const char *src, const char *dest) *****************************************************************************/ int32 OS_FDGetInfo (uint32 filedes, OS_file_prop_t *fd_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FDGetInfo), filedes); + UT_Stub_RegisterContext(UT_KEY(OS_FDGetInfo), fd_prop); + int32 status; uint32 CopySize; @@ -367,6 +418,8 @@ int32 OS_FDGetInfo (uint32 filedes, OS_file_prop_t *fd_prop) *****************************************************************************/ int32 OS_FileOpenCheck(const char *Filename) { + UT_Stub_RegisterContext(UT_KEY(OS_FileOpenCheck), Filename); + int32 status; status = UT_DEFAULT_IMPL(OS_FileOpenCheck); @@ -381,6 +434,8 @@ int32 OS_FileOpenCheck(const char *Filename) *****************************************************************************/ int32 OS_CloseFileByName(const char *Filename) { + UT_Stub_RegisterContext(UT_KEY(OS_CloseFileByName), Filename); + int32 status; status = UT_DEFAULT_IMPL(OS_CloseFileByName); @@ -409,12 +464,14 @@ int32 OS_CloseAllFiles(void) *****************************************************************************/ int32 OS_ShellOutputToFile(const char* Cmd, uint32 filedes) { + UT_Stub_RegisterContext(UT_KEY(OS_ShellOutputToFile), Cmd); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ShellOutputToFile), filedes); + int32 status; /* * This allows a hook function to do something with the "Cmd" parameter */ - UT_Stub_RegisterContext(UT_KEY(OS_ShellOutputToFile),Cmd); status = UT_DEFAULT_IMPL(OS_ShellOutputToFile); diff --git a/src/ut-stubs/osapi-utstub-filesys.c b/src/ut-stubs/osapi-utstub-filesys.c index f21f4fa69..4e09777f5 100644 --- a/src/ut-stubs/osapi-utstub-filesys.c +++ b/src/ut-stubs/osapi-utstub-filesys.c @@ -46,6 +46,10 @@ UT_DEFAULT_STUB(OS_FileSysAPI_Init,(void)) int32 OS_FileSysAddFixedMap(uint32 *filesys_id, const char *phys_path, const char *virt_path) { + UT_Stub_RegisterContext(UT_KEY(OS_FileSysAddFixedMap), filesys_id); + UT_Stub_RegisterContext(UT_KEY(OS_FileSysAddFixedMap), phys_path); + UT_Stub_RegisterContext(UT_KEY(OS_FileSysAddFixedMap), virt_path); + int32 status; status = UT_DEFAULT_IMPL(OS_FileSysAddFixedMap); @@ -73,6 +77,12 @@ int32 OS_FileSysAddFixedMap(uint32 *filesys_id, const char *phys_path, int32 OS_mkfs(char *address, const char *devname, const char * volname, uint32 blocksize, uint32 numblocks) { + UT_Stub_RegisterContext(UT_KEY(OS_mkfs), address); + UT_Stub_RegisterContext(UT_KEY(OS_mkfs), devname); + UT_Stub_RegisterContext(UT_KEY(OS_mkfs), volname); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_mkfs), blocksize); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_mkfs), numblocks); + int32 status; status = UT_DEFAULT_IMPL(OS_mkfs); @@ -87,6 +97,8 @@ int32 OS_mkfs(char *address, const char *devname, const char * volname, uint32 b *****************************************************************************/ int32 OS_rmfs(const char *devname) { + UT_Stub_RegisterContext(UT_KEY(OS_rmfs), devname); + int32 status; status = UT_DEFAULT_IMPL(OS_rmfs); @@ -102,6 +114,12 @@ int32 OS_rmfs(const char *devname) int32 OS_initfs(char *address, const char *devname, const char *volname, uint32 blocksize, uint32 numblocks) { + UT_Stub_RegisterContext(UT_KEY(OS_initfs), address); + UT_Stub_RegisterContext(UT_KEY(OS_initfs), devname); + UT_Stub_RegisterContext(UT_KEY(OS_initfs), volname); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_initfs), blocksize); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_initfs), numblocks); + int32 status; status = UT_DEFAULT_IMPL(OS_initfs); @@ -116,6 +134,9 @@ int32 OS_initfs(char *address, const char *devname, const char *volname, *****************************************************************************/ int32 OS_mount(const char *devname, const char* mountpoint) { + UT_Stub_RegisterContext(UT_KEY(OS_mount), devname); + UT_Stub_RegisterContext(UT_KEY(OS_mount), mountpoint); + int32 status; status = UT_DEFAULT_IMPL(OS_mount); @@ -130,6 +151,8 @@ int32 OS_mount(const char *devname, const char* mountpoint) *****************************************************************************/ int32 OS_unmount(const char *mountpoint) { + UT_Stub_RegisterContext(UT_KEY(OS_unmount), mountpoint); + int32 status; status = UT_DEFAULT_IMPL(OS_unmount); @@ -144,6 +167,8 @@ int32 OS_unmount(const char *mountpoint) *****************************************************************************/ int32 OS_fsBlocksFree(const char *name) { + UT_Stub_RegisterContext(UT_KEY(OS_fsBlocksFree), name); + int32 status; status = UT_DEFAULT_IMPL_RC(OS_fsBlocksFree, 100); @@ -158,6 +183,9 @@ int32 OS_fsBlocksFree(const char *name) *****************************************************************************/ int32 OS_fsBytesFree(const char *name, uint64 *bytes_free) { + UT_Stub_RegisterContext(UT_KEY(OS_fsBytesFree), name); + UT_Stub_RegisterContext(UT_KEY(OS_fsBytesFree), bytes_free); + int32 status; status = UT_DEFAULT_IMPL(OS_fsBytesFree); @@ -178,6 +206,9 @@ int32 OS_fsBytesFree(const char *name, uint64 *bytes_free) *****************************************************************************/ int32 OS_chkfs(const char *name, bool repair) { + UT_Stub_RegisterContext(UT_KEY(OS_chkfs), name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_chkfs), repair); + int32 status; status = UT_DEFAULT_IMPL(OS_chkfs); @@ -192,6 +223,9 @@ int32 OS_chkfs(const char *name, bool repair) *****************************************************************************/ int32 OS_FS_GetPhysDriveName(char * PhysDriveName, const char * MountPoint) { + UT_Stub_RegisterContext(UT_KEY(OS_FS_GetPhysDriveName), PhysDriveName); + UT_Stub_RegisterContext(UT_KEY(OS_FS_GetPhysDriveName), MountPoint); + int32 status; status = UT_DEFAULT_IMPL(OS_FS_GetPhysDriveName); @@ -205,12 +239,14 @@ int32 OS_FS_GetPhysDriveName(char * PhysDriveName, const char * MountPoint) * Stub function for OS_GetFsInfo() * *****************************************************************************/ -int32 OS_GetFsInfo(os_fsinfo_t *FilesysInfo) +int32 OS_GetFsInfo(os_fsinfo_t *filesys_info) { + UT_Stub_RegisterContext(UT_KEY(OS_GetFsInfo), filesys_info); + int32 status; status = UT_DEFAULT_IMPL(OS_GetFsInfo); - memset(FilesysInfo, 0, sizeof (*FilesysInfo)); + memset(filesys_info, 0, sizeof (*filesys_info)); return status; } @@ -222,6 +258,9 @@ int32 OS_GetFsInfo(os_fsinfo_t *FilesysInfo) *****************************************************************************/ int32 OS_TranslatePath( const char *VirtualPath, char *LocalPath) { + UT_Stub_RegisterContext(UT_KEY(OS_TranslatePath), VirtualPath); + UT_Stub_RegisterContext(UT_KEY(OS_TranslatePath), LocalPath); + int32 status; status = UT_DEFAULT_IMPL(OS_TranslatePath); diff --git a/src/ut-stubs/osapi-utstub-fpu.c b/src/ut-stubs/osapi-utstub-fpu.c index 5e74cbca1..3b8952bcc 100644 --- a/src/ut-stubs/osapi-utstub-fpu.c +++ b/src/ut-stubs/osapi-utstub-fpu.c @@ -44,6 +44,10 @@ int32 OS_FPUExcAttachHandler (uint32 ExceptionNumber, osal_task_entry ExceptionHandler , int32 parameter) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcAttachHandler), ExceptionNumber); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcAttachHandler), ExceptionHandler); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcAttachHandler), parameter); + int32 status; status = UT_DEFAULT_IMPL_ARGS(OS_FPUExcAttachHandler, ExceptionNumber, ExceptionHandler, parameter); @@ -58,6 +62,8 @@ int32 OS_FPUExcAttachHandler (uint32 ExceptionNumber, osal_task_entry Exceptio *****************************************************************************/ int32 OS_FPUExcEnable (int32 ExceptionNumber) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcEnable), ExceptionNumber); + int32 status; status = UT_DEFAULT_IMPL(OS_FPUExcEnable); @@ -72,6 +78,8 @@ int32 OS_FPUExcEnable (int32 ExceptionNumber) *****************************************************************************/ int32 OS_FPUExcDisable (int32 ExceptionNumber) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcDisable), ExceptionNumber); + int32 status; status = UT_DEFAULT_IMPL(OS_FPUExcDisable); @@ -86,6 +94,8 @@ int32 OS_FPUExcDisable (int32 ExceptionNumber) *****************************************************************************/ int32 OS_FPUExcSetMask (uint32 mask) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_FPUExcSetMask), mask); + int32 status; status = UT_DEFAULT_IMPL(OS_FPUExcSetMask); @@ -100,6 +110,8 @@ int32 OS_FPUExcSetMask (uint32 mask) *****************************************************************************/ int32 OS_FPUExcGetMask (uint32 *mask) { + UT_Stub_RegisterContext(UT_KEY(OS_FPUExcGetMask), mask); + int32 status; status = UT_DEFAULT_IMPL(OS_FPUExcGetMask); diff --git a/src/ut-stubs/osapi-utstub-heap.c b/src/ut-stubs/osapi-utstub-heap.c index 08c2cd171..7803958eb 100644 --- a/src/ut-stubs/osapi-utstub-heap.c +++ b/src/ut-stubs/osapi-utstub-heap.c @@ -42,6 +42,8 @@ *****************************************************************************/ int32 OS_HeapGetInfo(OS_heap_prop_t *heap_prop) { + UT_Stub_RegisterContext(UT_KEY(OS_HeapGetInfo), heap_prop); + int32 status; status = UT_DEFAULT_IMPL(OS_HeapGetInfo); diff --git a/src/ut-stubs/osapi-utstub-idmap.c b/src/ut-stubs/osapi-utstub-idmap.c index 11b4cda79..2766d9402 100644 --- a/src/ut-stubs/osapi-utstub-idmap.c +++ b/src/ut-stubs/osapi-utstub-idmap.c @@ -158,7 +158,6 @@ int32 OS_ObjectIdToArrayIndex(uint32 idtype, uint32 id, uint32 *ArrayIndex) return Status; } - /***************************************************************************** * * Stub function for OS_ObjectIdFinalize() @@ -209,7 +208,6 @@ int32 OS_ObjectIdGetBySearch(OS_lock_mode_t lock_mode, uint32 idtype, OS_ObjectM return Status; } - /***************************************************************************** * * Stub function for OS_ObjectIdFindByName() @@ -419,8 +417,12 @@ int32 OS_ObjectIdAllocateNew(uint32 idtype, const char *name, uint32 *array_inde returns: status ---------------------------------------------------------------------------------------*/ -int32 OS_GetResourceName(uint32 id, char *buffer, uint32 buffer_size) +int32 OS_GetResourceName(uint32 object_id, char *buffer, uint32 buffer_size) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_GetResourceName), object_id); + UT_Stub_RegisterContext(UT_KEY(OS_GetResourceName), buffer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_GetResourceName), buffer_size); + int32 return_code; return_code = UT_DEFAULT_IMPL(OS_GetResourceName); @@ -450,6 +452,9 @@ int32 OS_GetResourceName(uint32 id, char *buffer, uint32 buffer_size) ---------------------------------------------------------------------------------------*/ int32 OS_ConvertToArrayIndex(uint32 object_id, uint32 *ArrayIndex) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ConvertToArrayIndex), object_id); + UT_Stub_RegisterContext(UT_KEY(OS_ConvertToArrayIndex), ArrayIndex); + int32 return_code; return_code = UT_DEFAULT_IMPL(OS_ConvertToArrayIndex); @@ -485,15 +490,15 @@ int32 OS_ConvertToArrayIndex(uint32 object_id, uint32 *ArrayIndex) ---------------------------------------------------------------------------------------*/ void OS_ForEachObjectOfType (uint32 objtype, uint32 creator_id, OS_ArgCallback_t callback_ptr, void *callback_arg) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ForEachObjectOfType), objtype); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ForEachObjectOfType), creator_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ForEachObjectOfType), callback_ptr); + UT_Stub_RegisterContext(UT_KEY(OS_ForEachObjectOfType), callback_arg); + uint32 NextId; uint32 IdSize; - OS_U32ValueWrapper_t wrapper; - - wrapper.arg_callback_func = callback_ptr; /* Although this is "void", Invoke the default impl to log it and invoke any hooks */ - UT_Stub_RegisterContext(UT_KEY(OS_ForEachObjectOfType), wrapper.opaque_arg); - UT_Stub_RegisterContext(UT_KEY(OS_ForEachObjectOfType), callback_arg); UT_DEFAULT_IMPL(OS_ForEachObjectOfType); while (1) @@ -517,15 +522,14 @@ void OS_ForEachObjectOfType (uint32 objtype, uint32 creator_id, OS_ArgCallba ---------------------------------------------------------------------------------------*/ void OS_ForEachObject (uint32 creator_id, OS_ArgCallback_t callback_ptr, void *callback_arg) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ForEachObject), creator_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ForEachObject), callback_ptr); + UT_Stub_RegisterContext(UT_KEY(OS_ForEachObject), callback_arg); + uint32 NextId; uint32 IdSize; - OS_U32ValueWrapper_t wrapper; - - wrapper.arg_callback_func = callback_ptr; /* Although this is "void", Invoke the default impl to log it and invoke any hooks */ - UT_Stub_RegisterContext(UT_KEY(OS_ForEachObject), wrapper.opaque_arg); - UT_Stub_RegisterContext(UT_KEY(OS_ForEachObject), callback_arg); UT_DEFAULT_IMPL(OS_ForEachObject); while (1) @@ -548,6 +552,8 @@ void OS_ForEachObject (uint32 creator_id, OS_ArgCallback_t callback_ptr, void *c ---------------------------------------------------------------------------------------*/ uint32 OS_IdentifyObject (uint32 object_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IdentifyObject), object_id); + int32 DefaultType; switch ((object_id >> 16) ^ 0x4000U) diff --git a/src/ut-stubs/osapi-utstub-interrupts.c b/src/ut-stubs/osapi-utstub-interrupts.c index db7aa0b08..6087ffbfe 100644 --- a/src/ut-stubs/osapi-utstub-interrupts.c +++ b/src/ut-stubs/osapi-utstub-interrupts.c @@ -42,8 +42,10 @@ *****************************************************************************/ int32 OS_IntAttachHandler (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter) { - UT_Stub_RegisterContext(UT_KEY(OS_IntAttachHandler), &InterruptHandler); - UT_Stub_RegisterContext(UT_KEY(OS_IntAttachHandler), ¶meter); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntAttachHandler), InterruptNumber); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntAttachHandler), InterruptHandler); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntAttachHandler), parameter); + return UT_DEFAULT_IMPL(OS_IntAttachHandler); } @@ -83,8 +85,10 @@ int32 OS_IntLock(void) ** Returns OS_SUCCESS. ** ******************************************************************************/ -int32 OS_IntUnlock(int32 IntFlags) +int32 OS_IntUnlock(int32 IntLevel) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntUnlock), IntLevel); + return UT_DEFAULT_IMPL(OS_IntUnlock); } @@ -95,6 +99,8 @@ int32 OS_IntUnlock(int32 IntFlags) *****************************************************************************/ int32 OS_IntEnable(int32 Level) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntEnable), Level); + return UT_DEFAULT_IMPL(OS_IntEnable); } @@ -105,6 +111,8 @@ int32 OS_IntEnable(int32 Level) *****************************************************************************/ int32 OS_IntDisable(int32 Level) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntDisable), Level); + return UT_DEFAULT_IMPL(OS_IntDisable); } @@ -113,9 +121,10 @@ int32 OS_IntDisable(int32 Level) * Stub function for OS_IntSetMask() * *****************************************************************************/ -int32 OS_IntSetMask ( uint32 MaskSetting ) +int32 OS_IntSetMask ( uint32 mask ) { - UT_Stub_RegisterContext(UT_KEY(OS_IntSetMask), &MaskSetting); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_IntSetMask), mask); + return UT_DEFAULT_IMPL(OS_IntSetMask); } @@ -124,9 +133,10 @@ int32 OS_IntSetMask ( uint32 MaskSetting ) * Stub function for OS_IntGetMask() * *****************************************************************************/ -int32 OS_IntGetMask ( uint32 * MaskSettingPtr ) +int32 OS_IntGetMask ( uint32 * mask ) { - UT_Stub_RegisterContext(UT_KEY(OS_IntGetMask), MaskSettingPtr); + UT_Stub_RegisterContext(UT_KEY(OS_IntGetMask), mask); + return UT_DEFAULT_IMPL(OS_IntGetMask); } diff --git a/src/ut-stubs/osapi-utstub-module.c b/src/ut-stubs/osapi-utstub-module.c index 5aea8e4b4..8112f9595 100644 --- a/src/ut-stubs/osapi-utstub-module.c +++ b/src/ut-stubs/osapi-utstub-module.c @@ -85,6 +85,10 @@ int32 dummy_function(void) ******************************************************************************/ int32 OS_ModuleLoad(uint32 *module_id, const char *module_name, const char *filename) { + UT_Stub_RegisterContext(UT_KEY(OS_ModuleLoad), module_id); + UT_Stub_RegisterContext(UT_KEY(OS_ModuleLoad), module_name); + UT_Stub_RegisterContext(UT_KEY(OS_ModuleLoad), filename); + int32 status; status = UT_DEFAULT_IMPL(OS_ModuleLoad); @@ -123,6 +127,8 @@ int32 OS_ModuleLoad(uint32 *module_id, const char *module_name, const char *file ******************************************************************************/ int32 OS_ModuleUnload(uint32 module_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ModuleUnload), module_id); + int32 status; status = UT_DEFAULT_IMPL(OS_ModuleUnload); @@ -157,6 +163,9 @@ int32 OS_ModuleUnload(uint32 module_id) ******************************************************************************/ int32 OS_ModuleInfo(uint32 module_id, OS_module_prop_t *module_info) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_ModuleInfo), module_id); + UT_Stub_RegisterContext(UT_KEY(OS_ModuleInfo), module_info); + int32 status; status = UT_DEFAULT_IMPL(OS_ModuleInfo); @@ -192,13 +201,14 @@ int32 OS_ModuleInfo(uint32 module_id, OS_module_prop_t *module_info) ******************************************************************************/ int32 OS_SymbolLookup(cpuaddr *symbol_address, const char *symbol_name) { + UT_Stub_RegisterContext(UT_KEY(OS_SymbolLookup), symbol_address); + UT_Stub_RegisterContext(UT_KEY(OS_SymbolLookup), symbol_name); + int32 status; /* * Register the context so a hook can do something with the parameters */ - UT_Stub_RegisterContext(UT_KEY(OS_SymbolLookup), symbol_address); - UT_Stub_RegisterContext(UT_KEY(OS_SymbolLookup), symbol_name); status = UT_DEFAULT_IMPL(OS_SymbolLookup); @@ -220,8 +230,11 @@ int32 OS_SymbolLookup(cpuaddr *symbol_address, const char *symbol_name) * Stub function for OS_SymbolTableDump() * *****************************************************************************/ -int32 OS_SymbolTableDump ( const char *filename, uint32 SizeLimit ) +int32 OS_SymbolTableDump ( const char *filename, uint32 size_limit ) { + UT_Stub_RegisterContext(UT_KEY(OS_SymbolTableDump), filename); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SymbolTableDump), size_limit); + int32 status; status = UT_DEFAULT_IMPL(OS_SymbolTableDump); diff --git a/src/ut-stubs/osapi-utstub-mutex.c b/src/ut-stubs/osapi-utstub-mutex.c index cd248afc1..c9a049a3c 100644 --- a/src/ut-stubs/osapi-utstub-mutex.c +++ b/src/ut-stubs/osapi-utstub-mutex.c @@ -61,6 +61,10 @@ UT_DEFAULT_STUB(OS_MutexAPI_Init,(void)) ******************************************************************************/ int32 OS_MutSemCreate(uint32 *sem_id, const char *sem_name, uint32 options) { + UT_Stub_RegisterContext(UT_KEY(OS_MutSemCreate), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_MutSemCreate), sem_name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_MutSemCreate), options); + int32 status; status = UT_DEFAULT_IMPL(OS_MutSemCreate); @@ -99,6 +103,8 @@ int32 OS_MutSemCreate(uint32 *sem_id, const char *sem_name, uint32 options) ******************************************************************************/ int32 OS_MutSemDelete(uint32 sem_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_MutSemDelete), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_MutSemDelete); @@ -133,6 +139,8 @@ int32 OS_MutSemDelete(uint32 sem_id) ******************************************************************************/ int32 OS_MutSemGive(uint32 sem_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_MutSemGive), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_MutSemGive); @@ -162,6 +170,8 @@ int32 OS_MutSemGive(uint32 sem_id) ******************************************************************************/ int32 OS_MutSemTake(uint32 sem_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_MutSemTake), sem_id); + int32 status; status = UT_DEFAULT_IMPL(OS_MutSemTake); @@ -176,6 +186,9 @@ int32 OS_MutSemTake(uint32 sem_id) *****************************************************************************/ int32 OS_MutSemGetIdByName (uint32 *sem_id, const char *sem_name) { + UT_Stub_RegisterContext(UT_KEY(OS_MutSemGetIdByName), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_MutSemGetIdByName), sem_name); + int32 status; status = UT_DEFAULT_IMPL(OS_MutSemGetIdByName); @@ -209,6 +222,9 @@ int32 OS_MutSemGetIdByName (uint32 *sem_id, const char *sem_name) ******************************************************************************/ int32 OS_MutSemGetInfo(uint32 sem_id, OS_mut_sem_prop_t *mut_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_MutSemGetInfo), sem_id); + UT_Stub_RegisterContext(UT_KEY(OS_MutSemGetInfo), mut_prop); + int32 status; status = UT_DEFAULT_IMPL(OS_MutSemGetInfo); diff --git a/src/ut-stubs/osapi-utstub-network.c b/src/ut-stubs/osapi-utstub-network.c index 1ae71a7c6..772cadaec 100644 --- a/src/ut-stubs/osapi-utstub-network.c +++ b/src/ut-stubs/osapi-utstub-network.c @@ -40,6 +40,9 @@ UT_DEFAULT_STUB(OS_NetworkAPI_Init,(void)) int32 OS_NetworkGetHostName(char *host_name, uint32 name_len) { + UT_Stub_RegisterContext(UT_KEY(OS_NetworkGetHostName), host_name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_NetworkGetHostName), name_len); + int32 status; status = UT_DEFAULT_IMPL(OS_NetworkGetHostName); diff --git a/src/ut-stubs/osapi-utstub-printf.c b/src/ut-stubs/osapi-utstub-printf.c index d37fe8fc2..04b7c49ba 100644 --- a/src/ut-stubs/osapi-utstub-printf.c +++ b/src/ut-stubs/osapi-utstub-printf.c @@ -58,13 +58,14 @@ int32 OS_ConsoleWrite(uint32 console_id, const char *Str) *****************************************************************************/ void OS_printf(const char *string, ...) { + UT_Stub_RegisterContext(UT_KEY(OS_printf), string); + int32 status; int32 length = strlen(string); va_list va; va_start(va,string); - UT_Stub_RegisterContext(UT_KEY(OS_printf), string); status = UT_DefaultStubImplWithArgs(__func__, UT_KEY(OS_printf), 0, va); if (status >= 0) diff --git a/src/ut-stubs/osapi-utstub-queue.c b/src/ut-stubs/osapi-utstub-queue.c index 875b2a250..4b8300950 100644 --- a/src/ut-stubs/osapi-utstub-queue.c +++ b/src/ut-stubs/osapi-utstub-queue.c @@ -68,6 +68,12 @@ int32 OS_QueueCreate(uint32 *queue_id, uint32 data_size, uint32 flags) { + UT_Stub_RegisterContext(UT_KEY(OS_QueueCreate), queue_id); + UT_Stub_RegisterContext(UT_KEY(OS_QueueCreate), queue_name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueueCreate), queue_depth); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueueCreate), data_size); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueueCreate), flags); + int32 status; status = UT_DEFAULT_IMPL(OS_QueueCreate); @@ -109,6 +115,8 @@ int32 OS_QueueCreate(uint32 *queue_id, ******************************************************************************/ int32 OS_QueueDelete(uint32 queue_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueueDelete), queue_id); + int32 status; status = UT_DEFAULT_IMPL(OS_QueueDelete); @@ -152,6 +160,12 @@ int32 OS_QueueGet(uint32 queue_id, uint32 *size_copied, int32 timeout) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueueGet), queue_id); + UT_Stub_RegisterContext(UT_KEY(OS_QueueGet), data); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueueGet), size); + UT_Stub_RegisterContext(UT_KEY(OS_QueueGet), size_copied); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueueGet), timeout); + int32 status; status = UT_DEFAULT_IMPL(OS_QueueGet); @@ -193,6 +207,11 @@ int32 OS_QueueGet(uint32 queue_id, ******************************************************************************/ int32 OS_QueuePut(uint32 queue_id, const void *data, uint32 size, uint32 flags) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueuePut), queue_id); + UT_Stub_RegisterContext(UT_KEY(OS_QueuePut), data); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueuePut), size); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueuePut), flags); + int32 status; status = UT_DEFAULT_IMPL(OS_QueuePut); @@ -212,6 +231,9 @@ int32 OS_QueuePut(uint32 queue_id, const void *data, uint32 size, uint32 flags) *****************************************************************************/ int32 OS_QueueGetIdByName (uint32 *queue_id, const char *queue_name) { + UT_Stub_RegisterContext(UT_KEY(OS_QueueGetIdByName), queue_id); + UT_Stub_RegisterContext(UT_KEY(OS_QueueGetIdByName), queue_name); + int32 status; status = UT_DEFAULT_IMPL(OS_QueueGetIdByName); @@ -242,8 +264,11 @@ int32 OS_QueueGetIdByName (uint32 *queue_id, const char *queue_name) ** Returns OS_SUCCESS. ** ******************************************************************************/ -int32 OS_QueueGetInfo(uint32 sem_id, OS_queue_prop_t *queue_prop) +int32 OS_QueueGetInfo(uint32 queue_id, OS_queue_prop_t *queue_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_QueueGetInfo), queue_id); + UT_Stub_RegisterContext(UT_KEY(OS_QueueGetInfo), queue_prop); + int32 status; status = UT_DEFAULT_IMPL(OS_QueueGetInfo); diff --git a/src/ut-stubs/osapi-utstub-select.c b/src/ut-stubs/osapi-utstub-select.c index 72754ab29..3e9e56731 100644 --- a/src/ut-stubs/osapi-utstub-select.c +++ b/src/ut-stubs/osapi-utstub-select.c @@ -40,9 +40,12 @@ *****************************************************************************/ int32 OS_SelectSingle(uint32 objid, uint32 *StateFlags, int32 msecs) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SelectSingle), objid); + UT_Stub_RegisterContext(UT_KEY(OS_SelectSingle), StateFlags); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SelectSingle), msecs); + int32 return_code; - UT_Stub_RegisterContext(UT_KEY(OS_SelectSingle), StateFlags); return_code = UT_DEFAULT_IMPL(OS_SelectSingle); return return_code; @@ -55,10 +58,12 @@ int32 OS_SelectSingle(uint32 objid, uint32 *StateFlags, int32 msecs) *****************************************************************************/ int32 OS_SelectMultiple(OS_FdSet *ReadSet, OS_FdSet *WriteSet, int32 msecs) { - int32 return_code; - UT_Stub_RegisterContext(UT_KEY(OS_SelectMultiple), ReadSet); UT_Stub_RegisterContext(UT_KEY(OS_SelectMultiple), WriteSet); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SelectMultiple), msecs); + + int32 return_code; + return_code = UT_DEFAULT_IMPL(OS_SelectMultiple); return return_code; @@ -71,6 +76,8 @@ int32 OS_SelectMultiple(OS_FdSet *ReadSet, OS_FdSet *WriteSet, int32 msecs) *****************************************************************************/ int32 OS_SelectFdZero(OS_FdSet *Set) { + UT_Stub_RegisterContext(UT_KEY(OS_SelectFdZero), Set); + int32 return_code; return_code = UT_DEFAULT_IMPL(OS_SelectFdZero); @@ -85,6 +92,9 @@ int32 OS_SelectFdZero(OS_FdSet *Set) *****************************************************************************/ int32 OS_SelectFdAdd(OS_FdSet *Set, uint32 objid) { + UT_Stub_RegisterContext(UT_KEY(OS_SelectFdAdd), Set); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SelectFdAdd), objid); + int32 return_code; return_code = UT_DEFAULT_IMPL(OS_SelectFdAdd); @@ -99,6 +109,9 @@ int32 OS_SelectFdAdd(OS_FdSet *Set, uint32 objid) *****************************************************************************/ int32 OS_SelectFdClear(OS_FdSet *Set, uint32 objid) { + UT_Stub_RegisterContext(UT_KEY(OS_SelectFdClear), Set); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SelectFdClear), objid); + int32 return_code; return_code = UT_DEFAULT_IMPL(OS_SelectFdClear); @@ -113,6 +126,9 @@ int32 OS_SelectFdClear(OS_FdSet *Set, uint32 objid) *****************************************************************************/ bool OS_SelectFdIsSet(OS_FdSet *Set, uint32 objid) { + UT_Stub_RegisterContext(UT_KEY(OS_SelectFdIsSet), Set); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SelectFdIsSet), objid); + int32 return_code; return_code = UT_DEFAULT_IMPL(OS_SelectFdIsSet); diff --git a/src/ut-stubs/osapi-utstub-sockets.c b/src/ut-stubs/osapi-utstub-sockets.c index 86929f6e6..f99e70b32 100644 --- a/src/ut-stubs/osapi-utstub-sockets.c +++ b/src/ut-stubs/osapi-utstub-sockets.c @@ -41,6 +41,10 @@ UT_DEFAULT_STUB(OS_SocketAPI_Init,(void)) *****************************************************************************/ int32 OS_SocketOpen(uint32 *sock_id, OS_SocketDomain_t Domain, OS_SocketType_t Type) { + UT_Stub_RegisterContext(UT_KEY(OS_SocketOpen), sock_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketOpen), Domain); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketOpen), Type); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketOpen); @@ -60,6 +64,9 @@ int32 OS_SocketOpen(uint32 *sock_id, OS_SocketDomain_t Domain, OS_SocketType_t T *****************************************************************************/ int32 OS_SocketBind(uint32 sock_id, const OS_SockAddr_t *Addr) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketBind), sock_id); + UT_Stub_RegisterContext(UT_KEY(OS_SocketBind), Addr); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketBind); @@ -73,6 +80,11 @@ int32 OS_SocketBind(uint32 sock_id, const OS_SockAddr_t *Addr) *****************************************************************************/ int32 OS_SocketAccept(uint32 sock_id, uint32 *connsock_id, OS_SockAddr_t *Addr, int32 timeout) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketAccept), sock_id); + UT_Stub_RegisterContext(UT_KEY(OS_SocketAccept), connsock_id); + UT_Stub_RegisterContext(UT_KEY(OS_SocketAccept), Addr); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketAccept), timeout); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketAccept); @@ -85,8 +97,12 @@ int32 OS_SocketAccept(uint32 sock_id, uint32 *connsock_id, OS_SockAddr_t *Addr, * Stub function for OS_SocketConnect() * *****************************************************************************/ -int32 OS_SocketConnect(uint32 sock_id, const OS_SockAddr_t *Addr, int32 Timeout) +int32 OS_SocketConnect(uint32 sock_id, const OS_SockAddr_t *Addr, int32 timeout) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketConnect), sock_id); + UT_Stub_RegisterContext(UT_KEY(OS_SocketConnect), Addr); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketConnect), timeout); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketConnect); @@ -101,11 +117,15 @@ int32 OS_SocketConnect(uint32 sock_id, const OS_SockAddr_t *Addr, int32 Timeout) *****************************************************************************/ int32 OS_SocketRecvFrom(uint32 sock_id, void *buffer, uint32 buflen, OS_SockAddr_t *RemoteAddr, int32 timeout) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketRecvFrom), sock_id); + UT_Stub_RegisterContext(UT_KEY(OS_SocketRecvFrom), buffer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketRecvFrom), buflen); + UT_Stub_RegisterContext(UT_KEY(OS_SocketRecvFrom), RemoteAddr); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketRecvFrom), timeout); + int32 status; uint32 CopySize; - UT_Stub_RegisterContext(UT_KEY(OS_SocketRecvFrom), RemoteAddr); - status = UT_DEFAULT_IMPL(OS_SocketRecvFrom); if (status == 0x7FFFFFFF) @@ -142,11 +162,14 @@ int32 OS_SocketRecvFrom(uint32 sock_id, void *buffer, uint32 buflen, OS_SockAddr *****************************************************************************/ int32 OS_SocketSendTo(uint32 sock_id, const void *buffer, uint32 buflen, const OS_SockAddr_t *RemoteAddr) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketSendTo), sock_id); + UT_Stub_RegisterContext(UT_KEY(OS_SocketSendTo), buffer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketSendTo), buflen); + UT_Stub_RegisterContext(UT_KEY(OS_SocketSendTo), RemoteAddr); + int32 status; uint32 CopySize; - UT_Stub_RegisterContext(UT_KEY(OS_SocketSendTo), RemoteAddr); - status = UT_DEFAULT_IMPL_RC(OS_SocketSendTo, 0x7FFFFFFF); if (status == 0x7FFFFFFF) @@ -177,6 +200,9 @@ int32 OS_SocketSendTo(uint32 sock_id, const void *buffer, uint32 buflen, const O *****************************************************************************/ int32 OS_SocketGetIdByName (uint32 *sock_id, const char *sock_name) { + UT_Stub_RegisterContext(UT_KEY(OS_SocketGetIdByName), sock_id); + UT_Stub_RegisterContext(UT_KEY(OS_SocketGetIdByName), sock_name); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketGetIdByName); @@ -198,6 +224,9 @@ int32 OS_SocketGetIdByName (uint32 *sock_id, const char *sock_name) *****************************************************************************/ int32 OS_SocketGetInfo (uint32 sock_id, OS_socket_prop_t *sock_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketGetInfo), sock_id); + UT_Stub_RegisterContext(UT_KEY(OS_SocketGetInfo), sock_prop); + int32 status; uint32 CopySize; @@ -221,6 +250,9 @@ int32 OS_SocketGetInfo (uint32 sock_id, OS_socket_prop_t *sock_prop) int32 OS_SocketAddrInit(OS_SockAddr_t *Addr, OS_SocketDomain_t Domain) { + UT_Stub_RegisterContext(UT_KEY(OS_SocketAddrInit), Addr); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketAddrInit), Domain); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketAddrInit); @@ -236,6 +268,10 @@ int32 OS_SocketAddrInit(OS_SockAddr_t *Addr, OS_SocketDomain_t Domain) int32 OS_SocketAddrToString(char *buffer, uint32 buflen, const OS_SockAddr_t *Addr) { + UT_Stub_RegisterContext(UT_KEY(OS_SocketAddrToString), buffer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketAddrToString), buflen); + UT_Stub_RegisterContext(UT_KEY(OS_SocketAddrToString), Addr); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketAddrToString); @@ -252,6 +288,9 @@ int32 OS_SocketAddrToString(char *buffer, uint32 buflen, const OS_SockAddr_t *Ad int32 OS_SocketAddrFromString(OS_SockAddr_t *Addr, const char *string) { + UT_Stub_RegisterContext(UT_KEY(OS_SocketAddrFromString), Addr); + UT_Stub_RegisterContext(UT_KEY(OS_SocketAddrFromString), string); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketAddrFromString); @@ -267,6 +306,9 @@ int32 OS_SocketAddrFromString(OS_SockAddr_t *Addr, const char *string) int32 OS_SocketAddrGetPort(uint16 *PortNum, const OS_SockAddr_t *Addr) { + UT_Stub_RegisterContext(UT_KEY(OS_SocketAddrGetPort), PortNum); + UT_Stub_RegisterContext(UT_KEY(OS_SocketAddrGetPort), Addr); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketAddrGetPort); @@ -282,6 +324,9 @@ int32 OS_SocketAddrGetPort(uint16 *PortNum, const OS_SockAddr_t *Addr) int32 OS_SocketAddrSetPort(OS_SockAddr_t *Addr, uint16 PortNum) { + UT_Stub_RegisterContext(UT_KEY(OS_SocketAddrSetPort), Addr); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_SocketAddrSetPort), PortNum); + int32 status; status = UT_DEFAULT_IMPL(OS_SocketAddrSetPort); diff --git a/src/ut-stubs/osapi-utstub-task.c b/src/ut-stubs/osapi-utstub-task.c index e855356fc..bd0819cc2 100644 --- a/src/ut-stubs/osapi-utstub-task.c +++ b/src/ut-stubs/osapi-utstub-task.c @@ -59,10 +59,15 @@ int32 OS_TaskCreate(uint32 *task_id, const char *task_name, uint32 stack_size, uint32 priority, uint32 flags) { - int32 status; - - UT_Stub_RegisterContext(UT_KEY(OS_TaskCreate), &function_pointer); + UT_Stub_RegisterContext(UT_KEY(OS_TaskCreate), task_id); + UT_Stub_RegisterContext(UT_KEY(OS_TaskCreate), task_name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskCreate), function_pointer); UT_Stub_RegisterContext(UT_KEY(OS_TaskCreate), stack_pointer); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskCreate), stack_size); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskCreate), priority); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskCreate), flags); + + int32 status; status = UT_DEFAULT_IMPL(OS_TaskCreate); @@ -97,6 +102,8 @@ int32 OS_TaskCreate(uint32 *task_id, const char *task_name, ******************************************************************************/ int32 OS_TaskDelete(uint32 task_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskDelete), task_id); + int32 status; status = UT_DEFAULT_IMPL(OS_TaskDelete); @@ -150,6 +157,8 @@ void OS_TaskExit() ******************************************************************************/ int32 OS_TaskDelay(uint32 millisecond) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskDelay), millisecond); + int32 status; status = UT_DEFAULT_IMPL(OS_TaskDelay); @@ -164,6 +173,9 @@ int32 OS_TaskDelay(uint32 millisecond) *****************************************************************************/ int32 OS_TaskSetPriority (uint32 task_id, uint32 new_priority) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskSetPriority), task_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskSetPriority), new_priority); + int32 status; status = UT_DEFAULT_IMPL(OS_TaskSetPriority); @@ -231,6 +243,9 @@ uint32 OS_TaskGetId(void) *****************************************************************************/ int32 OS_TaskGetIdByName (uint32 *task_id, const char *task_name) { + UT_Stub_RegisterContext(UT_KEY(OS_TaskGetIdByName), task_id); + UT_Stub_RegisterContext(UT_KEY(OS_TaskGetIdByName), task_name); + int32 status; status = UT_DEFAULT_IMPL(OS_TaskGetIdByName); @@ -265,6 +280,9 @@ int32 OS_TaskGetIdByName (uint32 *task_id, const char *task_name) ******************************************************************************/ int32 OS_TaskGetInfo(uint32 task_id, OS_task_prop_t *task_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskGetInfo), task_id); + UT_Stub_RegisterContext(UT_KEY(OS_TaskGetInfo), task_prop); + int32 status; status = UT_DEFAULT_IMPL(OS_TaskGetInfo); @@ -297,6 +315,10 @@ int32 OS_TaskGetInfo(uint32 task_id, OS_task_prop_t *task_prop) ******************************************************************************/ int32 OS_TaskFindIdBySystemData(uint32 *task_id, const void *sysdata, size_t sysdata_size) { + UT_Stub_RegisterContext(UT_KEY(OS_TaskFindIdBySystemData), task_id); + UT_Stub_RegisterContext(UT_KEY(OS_TaskFindIdBySystemData), sysdata); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskFindIdBySystemData), sysdata_size); + int32 status; status = UT_DEFAULT_IMPL(OS_TaskFindIdBySystemData); @@ -318,9 +340,9 @@ int32 OS_TaskFindIdBySystemData(uint32 *task_id, const void *sysdata, size_t sys *****************************************************************************/ int32 OS_TaskInstallDeleteHandler(osal_task_entry function_pointer) { - int32 status; + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TaskInstallDeleteHandler), function_pointer); - UT_Stub_RegisterContext(UT_KEY(OS_TaskInstallDeleteHandler), &function_pointer); + int32 status; status = UT_DEFAULT_IMPL(OS_TaskInstallDeleteHandler); diff --git a/src/ut-stubs/osapi-utstub-time.c b/src/ut-stubs/osapi-utstub-time.c index 462e67e67..356410eac 100644 --- a/src/ut-stubs/osapi-utstub-time.c +++ b/src/ut-stubs/osapi-utstub-time.c @@ -41,8 +41,14 @@ UT_DEFAULT_STUB(OS_TimerCbAPI_Init,(void)) * Stub function for OS_TimerAdd() * *****************************************************************************/ -int32 OS_TimerAdd(uint32 *timer_id, const char *timer_name, uint32 timebase_ref_id, OS_ArgCallback_t callback_ptr, void *callback_arg) +int32 OS_TimerAdd(uint32 *timer_id, const char *timer_name, uint32 timebase_id, OS_ArgCallback_t callback_ptr, void *callback_arg) { + UT_Stub_RegisterContext(UT_KEY(OS_TimerAdd), timer_id); + UT_Stub_RegisterContext(UT_KEY(OS_TimerAdd), timer_name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimerAdd), timebase_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimerAdd), callback_ptr); + UT_Stub_RegisterContext(UT_KEY(OS_TimerAdd), callback_arg); + int32 status; status = UT_DEFAULT_IMPL(OS_TimerAdd); @@ -64,8 +70,13 @@ int32 OS_TimerAdd(uint32 *timer_id, const char *timer_name, uint32 timebase_ref_ * Stub function for OS_TimerCreate() * *****************************************************************************/ -int32 OS_TimerCreate(uint32 *timer_id, const char *timer_name, uint32 *accuracy, OS_TimerCallback_t callback_ptr) +int32 OS_TimerCreate(uint32 *timer_id, const char *timer_name, uint32 *clock_accuracy, OS_TimerCallback_t callback_ptr) { + UT_Stub_RegisterContext(UT_KEY(OS_TimerCreate), timer_id); + UT_Stub_RegisterContext(UT_KEY(OS_TimerCreate), timer_name); + UT_Stub_RegisterContext(UT_KEY(OS_TimerCreate), clock_accuracy); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimerCreate), callback_ptr); + int32 status; status = UT_DEFAULT_IMPL(OS_TimerCreate); @@ -89,6 +100,10 @@ int32 OS_TimerCreate(uint32 *timer_id, const char *timer_name, uint32 *accuracy, *****************************************************************************/ int32 OS_TimerSet(uint32 timer_id, uint32 start_time, uint32 interval_time) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimerSet), timer_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimerSet), start_time); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimerSet), interval_time); + int32 status; status = UT_DEFAULT_IMPL(OS_TimerSet); @@ -114,6 +129,8 @@ int32 OS_TimerSet(uint32 timer_id, uint32 start_time, uint32 interval_time) ******************************************************************************/ int32 OS_TimerDelete(uint32 timer_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimerDelete), timer_id); + int32 status; status = UT_DEFAULT_IMPL(OS_TimerDelete); @@ -133,6 +150,9 @@ int32 OS_TimerDelete(uint32 timer_id) *****************************************************************************/ int32 OS_TimerGetIdByName (uint32 *timer_id, const char *timer_name) { + UT_Stub_RegisterContext(UT_KEY(OS_TimerGetIdByName), timer_id); + UT_Stub_RegisterContext(UT_KEY(OS_TimerGetIdByName), timer_name); + int32 status; status = UT_DEFAULT_IMPL(OS_TimerGetIdByName); @@ -168,6 +188,9 @@ int32 OS_TimerGetIdByName (uint32 *timer_id, const char *timer_name) ******************************************************************************/ int32 OS_TimerGetInfo(uint32 timer_id, OS_timer_prop_t *timer_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimerGetInfo), timer_id); + UT_Stub_RegisterContext(UT_KEY(OS_TimerGetInfo), timer_prop); + int32 status; status = UT_DEFAULT_IMPL(OS_TimerGetInfo); diff --git a/src/ut-stubs/osapi-utstub-timebase.c b/src/ut-stubs/osapi-utstub-timebase.c index 667b0cc0f..584515294 100644 --- a/src/ut-stubs/osapi-utstub-timebase.c +++ b/src/ut-stubs/osapi-utstub-timebase.c @@ -44,6 +44,10 @@ UT_DEFAULT_STUB(OS_TimeBaseAPI_Init,(void)) *****************************************************************************/ int32 OS_TimeBaseCreate(uint32 *timebase_id, const char *timebase_name, OS_TimerSync_t external_sync) { + UT_Stub_RegisterContext(UT_KEY(OS_TimeBaseCreate), timebase_id); + UT_Stub_RegisterContext(UT_KEY(OS_TimeBaseCreate), timebase_name); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimeBaseCreate), external_sync); + int32 status; status = UT_DEFAULT_IMPL(OS_TimeBaseCreate); @@ -68,6 +72,10 @@ int32 OS_TimeBaseCreate(uint32 *timebase_id, const char *timebase_name, OS_Timer *****************************************************************************/ int32 OS_TimeBaseSet(uint32 timebase_id, uint32 start_time, uint32 interval_time) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimeBaseSet), timebase_id); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimeBaseSet), start_time); + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimeBaseSet), interval_time); + int32 status; status = UT_DEFAULT_IMPL(OS_TimeBaseSet); @@ -83,6 +91,8 @@ int32 OS_TimeBaseSet(uint32 timebase_id, uint32 start_time, uint32 interval_time *****************************************************************************/ int32 OS_TimeBaseDelete(uint32 timebase_id) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimeBaseDelete), timebase_id); + int32 status; status = UT_DEFAULT_IMPL(OS_TimeBaseDelete); @@ -103,6 +113,9 @@ int32 OS_TimeBaseDelete(uint32 timebase_id) *****************************************************************************/ int32 OS_TimeBaseGetIdByName (uint32 *timebase_id, const char *timebase_name) { + UT_Stub_RegisterContext(UT_KEY(OS_TimeBaseGetIdByName), timebase_id); + UT_Stub_RegisterContext(UT_KEY(OS_TimeBaseGetIdByName), timebase_name); + int32 status; status = UT_DEFAULT_IMPL(OS_TimeBaseGetIdByName); @@ -125,6 +138,9 @@ int32 OS_TimeBaseGetIdByName (uint32 *timebase_id, const char *timebase_name) *****************************************************************************/ int32 OS_TimeBaseGetInfo (uint32 timebase_id, OS_timebase_prop_t *timebase_prop) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimeBaseGetInfo), timebase_id); + UT_Stub_RegisterContext(UT_KEY(OS_TimeBaseGetInfo), timebase_prop); + int32 status; status = UT_DEFAULT_IMPL(OS_TimeBaseGetInfo); @@ -149,6 +165,9 @@ int32 OS_TimeBaseGetInfo (uint32 timebase_id, OS_timebase_prop_t *timebase_prop) *****************************************************************************/ int32 OS_TimeBaseGetFreeRun (uint32 timebase_id, uint32 *freerun_val) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_TimeBaseGetFreeRun), timebase_id); + UT_Stub_RegisterContext(UT_KEY(OS_TimeBaseGetFreeRun), freerun_val); + int32 status; status = UT_DEFAULT_IMPL(OS_TimeBaseGetFreeRun); @@ -204,5 +223,7 @@ int32 OS_Tick2Micros (void) *****************************************************************************/ int32 OS_Milli2Ticks(uint32 milli_seconds) { + UT_Stub_RegisterContextGenericArg(UT_KEY(OS_Milli2Ticks), milli_seconds); + return UT_DEFAULT_IMPL_RC(OS_Milli2Ticks,100); }