The relevant code in the Thread Initialization is at cpukit/score/src/threadinitialize.c:<br> 87 /*<br> 88 * Allocate and Initialize the stack for this thread.<br> 89 */<br> 90 #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)<br>
91 actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );<br> 92 if ( !actual_stack_size || actual_stack_size < stack_size )<br> 93 return false; /* stack allocation failed */<br>
94 <br> 95 stack = the_thread->Start.stack;<br> 96 #else<br> 97 if ( !stack_area ) {<br> 98 actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );<br> 99 if ( !actual_stack_size || actual_stack_size < stack_size )<br>
100 return false; /* stack allocation failed */<br>101 <br>102 stack = the_thread->Start.stack;<br>103 the_thread->Start.core_allocated_stack = true;<br>104 } else {<br>105 stack = stack_area;<br>
106 actual_stack_size = stack_size;<br>107 the_thread->Start.core_allocated_stack = false;<br>108 }<br>109 #endif<br><br><br><div class="gmail_quote">On Wed, Nov 17, 2010 at 3:06 PM, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@gwmail.gwu.edu">gedare@gwmail.gwu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I think this can be done with the User_extensions_thread_create_extension. How you do it I'm not sure exactly.<br>
<br>With the Class API task create, I don't think that it can be done directly. However, the functionality is certainly supported from some other interfaces.<br>
cpukit/rtems/src/taskcreate.c<br>174 status = _Thread_Initialize(<br>175 &_RTEMS_tasks_Information,<br>176 the_thread,<br>177 NULL,<br>178 stack_size,<br>179 is_fp,<br>180 core_priority,<br>
181 _Modes_Is_preempt(initial_modes) ? true : false,<br>
182 _Modes_Is_timeslice(initial_modes) ?<br>183 THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE :<br>184 THREAD_CPU_BUDGET_ALGORITHM_NONE,<br>185 NULL, /* no budget algorithm callout */<br>186 _Modes_Get_interrupt_level(initial_modes),<br>
187 (Objects_Name) name<br>188 );<br><br>The third argument to _Thread_Initialize is interpreted as an initial stack location, but the classic API does not use the field (POSIX does I believe).<br><font color="#888888"><br>
-Gedare</font><div><div></div><div class="h5"><br><br>
<div class="gmail_quote">On Wed, Nov 17, 2010 at 2:23 PM, Cudmore, Alan P. (GSFC-5820) <span dir="ltr"><<a href="mailto:alan.p.cudmore@nasa.gov" target="_blank">alan.p.cudmore@nasa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
When creating a task, can the stack be allocated from an absolute address rather than having RTEMS allocate it from the workspace?<br>
<br>
Thanks,<br>
Alan<br>
<br>
<br>
_______________________________________________<br>
rtems-users mailing list<br>
<a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>