-
Notifications
You must be signed in to change notification settings - Fork 253
Description
Is your feature request related to a problem? Please describe.
The VxWorks task create implementation calculates a stack base address which involves adjustment such as rounding and accounting for whether the stack grows up or down (per VxWorks requirements of taskInit().
This does the calculation as integers, and currently uses the long type.
The risk is that if the address happens to lie in the negative range of this type, then the rounding/adjustments may need to go in the opposite direction.
Describe the solution you'd like
The address calculations should use unsigned long instead of long just to ensure that all rounding and base address adjustments behave the same way in the event that the addresses lie in the upper half of memory (i.e. start with a 1 bit) which would put it in the negative range of a long type.
Additional context
This is really just a suspicion of a possible issue - can't really confirm/test because we don't have direct control of where these stack buffers get allocated in memory.
But either way using unsigned would be more correct anyway - and would simply avoid the possibility that the operation works differently depending on its value.
It probably used long in the first place only because that is what the arguments to taskInit() are declared as.
Requester Info
Joseph Hickey, Vantage Systems, Inc.