You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The OSAL global state structure has two flags, one for "initialized" (set during OS_API_Init) and one for shutdown (set during OS_ApplicationShutdown). Although similar in purpose, they are defined and work differently.
Describe the solution you'd like
Should combine these into just one state variable, which should be 0 prior to initialization (i.e. such that the application loader provided by the OS will zero it before OSAL loads), then set to a nonzero value for normal runtime, and another special nonzero value for shutdown.
Additional context
Just a suggestion for cleaning up/simplifying what is already there...
* The console device ID used for OS_printf() calls
*/
osal_id_tPrintfConsoleId;
/*
* PrintfEnabled and ShutdownFlag are marked "volatile"
* because they are updated and read by different threads
*/
volatileboolPrintfEnabled;
volatileuint32ShutdownFlag;
uint32MicroSecPerTick;
uint32TicksPerSecond;
/*
* The event handler is an application-defined callback
* that gets invoked as resources are created/configured/deleted.
*/
OS_EventHandler_tEventHandler;
#ifdefOSAL_CONFIG_DEBUG_PRINTF
uint8DebugLevel;
#endif
};
.
Using a full 32 bit value with all bits - even though there are only a few states - provides protection in case of a random bit flip. At least in the case of an application shutdown, the entire system operation shouldn't be dependent on a single bit in memory. This is why the current "shutdown flag" is not just a simple 0/1. So this should be preserved, but it should be trivial to combine this with the "Initialized" field.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The OSAL global state structure has two flags, one for "initialized" (set during OS_API_Init) and one for shutdown (set during OS_ApplicationShutdown). Although similar in purpose, they are defined and work differently.
Describe the solution you'd like
Should combine these into just one state variable, which should be 0 prior to initialization (i.e. such that the application loader provided by the OS will zero it before OSAL loads), then set to a nonzero value for normal runtime, and another special nonzero value for shutdown.
Additional context
Just a suggestion for cleaning up/simplifying what is already there...
Structure defined here:
osal/src/os/shared/inc/os-shared-common.h
Lines 40 to 67 in 9407cdf
Using a full 32 bit value with all bits - even though there are only a few states - provides protection in case of a random bit flip. At least in the case of an application shutdown, the entire system operation shouldn't be dependent on a single bit in memory. This is why the current "shutdown flag" is not just a simple 0/1. So this should be preserved, but it should be trivial to combine this with the "Initialized" field.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: