backport of Issue: Fix stack aligment. #812

pull/1118/head
Dmitry Bogdanov 2015-05-05 21:27:39 +04:00
parent c064a71ca7
commit d41b74e898
1 changed files with 2 additions and 2 deletions

View File

@ -243,7 +243,7 @@ typedef struct os_thread_def {
os_pthread pthread; ///< start address of thread function
osPriority tpriority; ///< initial thread priority
uint32_t stacksize; ///< stack size requirements in bytes
unsigned char *stack_pointer; ///< pointer to the stack memory block
uint32_t *stack_pointer; ///< pointer to the stack memory block
struct OS_TCB tcb;
} osThreadDef_t;
@ -337,7 +337,7 @@ int32_t osKernelRunning(void);
extern osThreadDef_t os_thread_def_##name
#else // define the object
#define osThreadDef(name, priority, stacksz) \
unsigned char os_thread_def_stack_##name [stacksz] __attribute__((aligned (4))); \
uint32_t os_thread_def_stack_##name [stacksz / sizeof(uint32_t)]; \
osThreadDef_t os_thread_def_##name = \
{ (name), (priority), (stacksz), (os_thread_def_stack_##name)}
#endif