Change thread entry function and timer expiration function prototypes…#227
Change thread entry function and timer expiration function prototypes…#227phuerta79 wants to merge 1 commit intoeclipse-threadx:masterfrom
Conversation
… to use an ALIGN_TYPE param instead of an ULONG param , to allow passing pointers to void (or pointers to whatever) in 64 bit architectures.
|
@phuerta79 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
@microsoft-github-policy-service agree company="Hubbell Inc" |
|
Hi @phuerta79 - I would like to make this change, but we are discussing this internally. In the meantime, you can use these extensions to pass 64-bit values to threads: https://github.com/azure-rtos/threadx/blob/master/common/inc/tx_api.h#L234-L259 |
|
Hi @goldscott , |
These functions have an ULONG type param, so if you want to pass a pointer to something you can cast it and it will fit in the ULONG param in 32 bit machines. But in 64 bit machines the pointer will not fit, so I propose to change this param to ALIGN_TYPE type.
For example, the following code will work in 32 bit machines, but it will not work on 64 bit machines:
With the changes proposed, the code will turn into:
And it will work ok both in 32 and 64 bit systems.