Skip to content

Commit

Permalink
Fix nasa#366, Deprecated exception handling APIs
Browse files Browse the repository at this point in the history
Never fully implemented and more appropriate
in PSP layer due to platform dependencies
  • Loading branch information
skliper committed Apr 10, 2020
1 parent 7d9c4c8 commit fd76823
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 237 deletions.
4 changes: 2 additions & 2 deletions src/os/inc/osapi-os-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,8 @@ int32 OS_GetLocalTime (OS_time_t *time_struct);
int32 OS_SetLocalTime (OS_time_t *time_struct);
/**@}*/

#ifndef OSAL_OMIT_DEPRECATED

/**
* @defgroup OSAPIExc OSAL Exception APIs
*
Expand Down Expand Up @@ -1180,8 +1182,6 @@ int32 OS_FPUExcSetMask (uint32 mask);
int32 OS_FPUExcGetMask (uint32 *mask);
/**@}*/

#ifndef OSAL_OMIT_DEPRECATED

/** @defgroup OSAPIInterrupt OSAL Interrupt APIs
* @{
* @deprecated Platform dependencies
Expand Down
4 changes: 4 additions & 0 deletions src/os/posix/osapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2322,6 +2322,8 @@ static int OS_PriorityRemap(uint32 InputPri)
return OutputPri;
} /* end OS_PriorityRemap */

#ifndef OSAL_OMIT_DEPRECATED

/*----------------------------------------------------------------
*
* Function: OS_FPUExcAttachHandler_Impl
Expand Down Expand Up @@ -2406,6 +2408,8 @@ int32 OS_FPUExcGetMask_Impl(uint32 *mask)
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_FPUExcGetMask_Impl */

#endif /* OSAL_OMIT_DEPRECATED */

/********************************************************************/
/* CONSOLE OUTPUT */
/********************************************************************/
Expand Down
4 changes: 4 additions & 0 deletions src/os/rtems/osapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,8 @@ int32 OS_HeapGetInfo_Impl (OS_heap_prop_t *heap_prop)
return (OS_SUCCESS);
} /* end OS_HeapGetInfo_Impl */

#ifndef OSAL_OMIT_DEPRECATED

/*----------------------------------------------------------------
*
* Function: OS_FPUExcAttachHandler_Impl
Expand Down Expand Up @@ -1679,6 +1681,8 @@ int32 OS_FPUExcGetMask_Impl(uint32 *mask)
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_FPUExcGetMask_Impl */

#endif /* OSAL_OMIT_DEPRECATED */

/********************************************************************/
/* CONSOLE OUTPUT */
/********************************************************************/
Expand Down
4 changes: 1 addition & 3 deletions src/os/shared/os-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1867,8 +1867,6 @@ int32 OS_IntSetMask_Impl ( uint32 MaskSetting );
------------------------------------------------------------------*/
int32 OS_IntGetMask_Impl ( uint32 * MaskSettingPtr );

#endif /* OSAL_OMIT_DEPRECATED */

/****************************************************************************************
FLOATING POINT CONFIG/EXCEPTION API LOW-LEVEL IMPLEMENTATION FUNCTIONS
****************************************************************************************/
Expand Down Expand Up @@ -1900,7 +1898,7 @@ int32 OS_FPUExcSetMask_Impl(uint32 mask);
------------------------------------------------------------------*/
int32 OS_FPUExcGetMask_Impl(uint32 *mask);


#endif /* OSAL_OMIT_DEPRECATED */

/****************************************************************************************
MEMORY HEAP API LOW-LEVEL IMPLEMENTATION FUNCTIONS
Expand Down
3 changes: 2 additions & 1 deletion src/os/shared/osapi-fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>

#ifndef OSAL_OMIT_DEPRECATED

/*
* User defined include files
Expand Down Expand Up @@ -110,4 +111,4 @@ int32 OS_FPUExcDisable (int32 ExceptionNumber)
return OS_FPUExcDisable_Impl(ExceptionNumber);
} /* end OS_FPUExcDisable */


#endif /* OSAL_OMIT_DEPRECATED */
4 changes: 4 additions & 0 deletions src/os/vxworks/osapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,8 @@ int32 OS_HeapGetInfo_Impl (OS_heap_prop_t *heap_prop)

return (OS_SUCCESS);
} /* end OS_HeapGetInfo_Impl */

#ifndef OSAL_OMIT_DEPRECATED

/*----------------------------------------------------------------
*
Expand Down Expand Up @@ -1631,6 +1633,8 @@ int32 OS_FPUExcGetMask_Impl(uint32 *mask)
return Status;
} /* end OS_FPUExcGetMask_Impl */

#endif /* OSAL_OMIT_DEPRECATED */

/********************************************************************/
/* CONSOLE OUTPUT */
/********************************************************************/
Expand Down
46 changes: 0 additions & 46 deletions src/unit-test-coverage/posix/src/coveragetest-osapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,47 +408,6 @@ void Test_OS_CompAbsDelayTime(void)
*/
}

void Test_OS_FPUExcAttachHandler_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcAttachHandler_Impl(uint32 ExceptionNumber, void * ExceptionHandler,
* int32 parameter)
*/
}

void Test_OS_FPUExcEnable_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcEnable_Impl(int32 ExceptionNumber)
*/
}

void Test_OS_FPUExcDisable_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcDisable_Impl(int32 ExceptionNumber)
*/
}

void Test_OS_FPUExcSetMask_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcSetMask_Impl(uint32 mask)
*/
}

void Test_OS_FPUExcGetMask_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcGetMask_Impl(uint32 *mask)
*/
}

/* ------------------- End of test cases --------------------------------------*/

/* Osapi_Task_Setup
Expand Down Expand Up @@ -528,11 +487,6 @@ void UtTest_Setup(void)
ADD_TEST(OS_MutSemGetInfo_Impl);
ADD_TEST(OS_HeapGetInfo_Impl);
ADD_TEST(OS_CompAbsDelayTime);
ADD_TEST(OS_FPUExcAttachHandler_Impl);
ADD_TEST(OS_FPUExcEnable_Impl);
ADD_TEST(OS_FPUExcDisable_Impl);
ADD_TEST(OS_FPUExcSetMask_Impl);
ADD_TEST(OS_FPUExcGetMask_Impl);
}


134 changes: 0 additions & 134 deletions src/unit-test-coverage/shared/src/coveragetest-fpu.c

This file was deleted.

2 changes: 2 additions & 0 deletions src/unit-test-coverage/ut-stubs/src/osapi-base-impl-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ void OS_ApplicationExit_Impl(int32 Status)
*/
UT_DEFAULT_STUB(OS_HeapGetInfo_Impl,(OS_heap_prop_t *heap_prop))

#ifndef OSAL_OMIT_DEPRECATED
/*
* FPU API low-level handlers
*/
Expand All @@ -159,4 +160,5 @@ UT_DEFAULT_STUB(OS_FPUExcEnable_Impl,(int32 ExceptionNumber))
UT_DEFAULT_STUB(OS_FPUExcDisable_Impl,(int32 ExceptionNumber))
UT_DEFAULT_STUB(OS_FPUExcSetMask_Impl,(uint32 mask))
UT_DEFAULT_STUB(OS_FPUExcGetMask_Impl,(uint32 *mask))
#endif /* OSAL_OMIT_DEPRECATED */

51 changes: 0 additions & 51 deletions src/unit-test-coverage/vxworks/src/coveragetest-osapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,52 +589,6 @@ void Test_OS_HeapGetInfo_Impl(void)
OSAPI_TEST_FUNCTION_RC(OS_HeapGetInfo_Impl(&heap_prop), OS_ERROR);
}

void Test_OS_FPUExcAttachHandler_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcAttachHandler_Impl(uint32 ExceptionNumber, void * ExceptionHandler,
* int32 parameter)
*/
OSAPI_TEST_FUNCTION_RC(OS_FPUExcAttachHandler_Impl(0, NULL, 0), OS_ERR_NOT_IMPLEMENTED);
}

void Test_OS_FPUExcEnable_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcEnable_Impl(int32 ExceptionNumber)
*/
OSAPI_TEST_FUNCTION_RC(OS_FPUExcEnable_Impl(0), OS_SUCCESS);
}

void Test_OS_FPUExcDisable_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcDisable_Impl(int32 ExceptionNumber)
*/
OSAPI_TEST_FUNCTION_RC(OS_FPUExcDisable_Impl(0), OS_SUCCESS);
}

void Test_OS_FPUExcSetMask_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcSetMask_Impl(uint32 mask)
*/
OSAPI_TEST_FUNCTION_RC(OS_FPUExcSetMask_Impl(0), OS_ERR_NOT_IMPLEMENTED);
}

void Test_OS_FPUExcGetMask_Impl(void)
{
/*
* Test Case For:
* int32 OS_FPUExcGetMask_Impl(uint32 *mask)
*/
OSAPI_TEST_FUNCTION_RC(OS_FPUExcGetMask_Impl(0), OS_ERR_NOT_IMPLEMENTED);
}

/* ------------------- End of test cases --------------------------------------*/

/* Osapi_Task_Setup
Expand Down Expand Up @@ -710,11 +664,6 @@ void UtTest_Setup(void)
ADD_TEST(OS_MutSemTake_Impl);
ADD_TEST(OS_MutSemGetInfo_Impl);
ADD_TEST(OS_HeapGetInfo_Impl);
ADD_TEST(OS_FPUExcAttachHandler_Impl);
ADD_TEST(OS_FPUExcEnable_Impl);
ADD_TEST(OS_FPUExcDisable_Impl);
ADD_TEST(OS_FPUExcSetMask_Impl);
ADD_TEST(OS_FPUExcGetMask_Impl);
}


2 changes: 2 additions & 0 deletions src/ut-stubs/osapi-utstub-fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "utstub-helpers.h"

#ifndef OSAL_OMIT_DEPRECATED

/*****************************************************************************
*
Expand Down Expand Up @@ -97,3 +98,4 @@ int32 OS_FPUExcGetMask (uint32 *mask)
return status;
}

#endif /* OSAL_OMIT_DEPRECATED */

0 comments on commit fd76823

Please sign in to comment.