Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception/Interrupt API updates #317

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/os/posix/osapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ int32 OS_FPUExcSetMask_Impl(uint32 mask)
/*
** Not implemented in linux.
*/
return(OS_SUCCESS);
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_FPUExcSetMask_Impl */


Expand All @@ -2400,7 +2400,7 @@ int32 OS_FPUExcGetMask_Impl(uint32 *mask)
** Not implemented in linux.
*/
*mask = 0;
return(OS_SUCCESS);
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_FPUExcGetMask_Impl */

/********************************************************************/
Expand Down
35 changes: 23 additions & 12 deletions src/os/rtems/osapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,8 @@ int32 OS_IntAttachHandler_Impl (uint32 InterruptNumber, osal_task_entry Interru
*-----------------------------------------------------------------*/
int32 OS_IntUnlock_Impl (int32 IntLevel)
{
rtems_interrupt_enable ( (rtems_interrupt_level) IntLevel);
rtems_interrupt_level rtems_int_level = IntLevel;
rtems_interrupt_local_enable ( rtems_int_level );
return (OS_SUCCESS);

} /* end OS_IntUnlock_Impl */
Expand All @@ -1487,7 +1488,21 @@ int32 OS_IntLock_Impl (void)
{
rtems_interrupt_level rtems_int_level;

rtems_interrupt_disable(rtems_int_level) ;
/*
* NOTE: rtems_interrupt_local_disable() is a macro
* that sets the rtems_int_level value.
*
* This code assumes that the value is also storable
* in an int32.
*
* This uses the "local" version which operates on
* the current CPU in case of a multi-processor environment.
*
* This should be identical to rtems_interrupt_disable in
* a single-processor config, but that call is not
* implemented in multi-processor configs.
*/
rtems_interrupt_local_disable(rtems_int_level) ;
return ( (int32) rtems_int_level) ;

} /* end OS_IntLock_Impl */
Expand All @@ -1504,8 +1519,7 @@ int32 OS_IntLock_Impl (void)
*-----------------------------------------------------------------*/
int32 OS_IntEnable_Impl (int32 Level)
{
rtems_interrupt_enable ( (rtems_interrupt_level) Level);
return(OS_SUCCESS);
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_IntEnable_Impl */


Expand All @@ -1519,10 +1533,7 @@ int32 OS_IntEnable_Impl (int32 Level)
*-----------------------------------------------------------------*/
int32 OS_IntDisable_Impl (int32 Level)
{
rtems_interrupt_level rtems_int_level;

rtems_interrupt_disable(rtems_int_level) ;
return ( (int32) rtems_int_level) ;
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_IntDisable_Impl */


Expand Down Expand Up @@ -1612,7 +1623,7 @@ int32 OS_FPUExcEnable_Impl(int32 ExceptionNumber)
/*
** Not implemented in RTEMS.
*/
return(OS_SUCCESS);
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_FPUExcEnable_Impl */

/*----------------------------------------------------------------
Expand All @@ -1628,7 +1639,7 @@ int32 OS_FPUExcDisable_Impl(int32 ExceptionNumber)
/*
** Not implemented in RTEMS.
*/
return(OS_SUCCESS);
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_FPUExcDisable_Impl */


Expand All @@ -1645,7 +1656,7 @@ int32 OS_FPUExcSetMask_Impl(uint32 mask)
/*
** Not implemented in RTEMS.
*/
return(OS_SUCCESS);
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_FPUExcSetMask_Impl */


Expand All @@ -1662,7 +1673,7 @@ int32 OS_FPUExcGetMask_Impl(uint32 *mask)
/*
** Not implemented in RTEMS.
*/
return(OS_SUCCESS);
return(OS_ERR_NOT_IMPLEMENTED);
} /* end OS_FPUExcGetMask_Impl */

/********************************************************************/
Expand Down
5 changes: 5 additions & 0 deletions src/os/shared/osapi-fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ int32 OS_FPUExcSetMask(uint32 mask)
*-----------------------------------------------------------------*/
int32 OS_FPUExcGetMask(uint32 *mask)
{
if (mask == NULL)
{
return OS_INVALID_POINTER;
}

return OS_FPUExcGetMask_Impl(mask);
} /* end OS_FPUExcGetMask */

Expand Down