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 , |
|
Hi @phuerta79. I am closing older PRs submitted before Microsoft contributed Azure RTOS to the Eclipse Foundation. The codebase has changed since 2023, and our opinion on specific matters could differ from Microsoft's. If you still want this change to be merged into Eclipse ThreadX, please create a new pull request against the Before doing so, you must sign the Eclipse Contributor Agreement (ECA). The purpose of the ECA is to provide a written record that you have agreed to provide your code and documentation contributions under the licenses used by the Eclipse ThreadX project. It also makes it clear that you are promising that what you are contributing to Eclipse is code you wrote, and you have the necessary rights to contribute it to our projects. And finally, it documents a commitment from you that your open source contributions will be permanently on the public record. Signing the ECA requires an Eclipse Foundation account if you do not already have one. You can create one for free at https://accounts.eclipse.org. Be sure to use the same email address when you register for the account that you intend to use on Git commit records. Also, please add your GitHub ID to your Eclipse account. This enables synchronisation between Eclipse-owned infrastructure and GitHub. Here is the link to sign the ECA: |
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.