git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16732 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
Platfrom: armv7-M STM32H745
This included the recent changes about renaming stkalign_t in stkline_t
Code: Select all
Renamed stkalign_t in stkline_t, the type is no more related to stack alignment enforcement. Reviewed TCB alignment in working areas for legacy thread creation functions.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16720 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
A stack created by
Code: Select all
chThdCreateFromHeap(NULL, THD_WORKING_AREA_SIZE(thdWaSize), "name", PRIO, thread, (void *)arg);
does fail the test
Code: Select all
MEM_IS_ALIGNED(tdp->wend, PORT_STACK_ALIGN)
in chThdCreateSuspendedI now.
With the recent changes I understand that the stkline_t is no longer meant to be used for alignment. And the macros like PORT_STACK_ALIGN should be used for the job.
As I understand my platform is using 8 byte for stkline_t, and the alignments macros are all now setup for 32 bytes instead of sizeof(stkline_t).
However the current macros for THD_WORKING_AREA still use stkline_t for alignment as far as I can see.
Since this is a very recent change this might just be an in development feature and not done yet. But I also saw a mention of legacy thread creation functions. Am I just using an old API here and that's why it fails alignment? Or is this really just too new to be used at the moment?
Currently statically allocated threads still start even if the working area is setup with the macro THD_WORKING_AREA(_SIZE), this seems to be because chThdCreateStatic does not actually check for
Code: Select all
MEM_IS_ALIGNED(tdp->wend, PORT_STACK_ALIGN)
like chThdCreateSuspendedI does.