Hi all !
I'm using embOS with M16C environment and with the Tasking compiler. But I'm not sure to understand why I can't use the OS_malloc function to allocate the stack of a task.
A small example of my problem :
int main( void )
{
OS_TASK * TCB;
void * stack;
OS_InitKern(); /* initialize OS */
OS_InitHW(); /* initialize Hardware for OS */
TCB = (OS_TASK*)OS_malloc(sizeof(OS_TASK));
stack = OS_malloc(1000);
OS_CREATETASK( TCB, "test", process1, 1, stack );
OS_Start(); /* Start multitasking */
return 0;
}
I know that some CPU requires alignment of stack. So I would like to know if it's possible to define the stack of the task without an array declaration ?
Thanks !
I'm using embOS with M16C environment and with the Tasking compiler. But I'm not sure to understand why I can't use the OS_malloc function to allocate the stack of a task.
A small example of my problem :
int main( void )
{
OS_TASK * TCB;
void * stack;
OS_InitKern(); /* initialize OS */
OS_InitHW(); /* initialize Hardware for OS */
TCB = (OS_TASK*)OS_malloc(sizeof(OS_TASK));
stack = OS_malloc(1000);
OS_CREATETASK( TCB, "test", process1, 1, stack );
OS_Start(); /* Start multitasking */
return 0;
}
I know that some CPU requires alignment of stack. So I would like to know if it's possible to define the stack of the task without an array declaration ?
Thanks !