Changeset 1543932 in rtems


Ignore:
Timestamp:
Apr 24, 1996, 5:36:35 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
11532ca
Parents:
d2d6467
Message:

added comment regarding stack alignment issues to thread stack allocation
routine.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/src/thread.c

    rd2d6467 r1543932  
    319319   * routine can call the correct deallocation routine.
    320320   */
     321
    321322  if ( _CPU_Table.stack_allocate_hook )
    322323  {
    323324    stack_addr = (*_CPU_Table.stack_allocate_hook)( stack_size );
    324325  } else {
     326
     327    /*
     328     *  First pad the requested size so we allocate enough memory
     329     *  so the context initialization can align it properly.  The address
     330     *  returned the workspace allocate must be directly stored in the
     331     *  stack control block because it is later used in the free sequence.
     332     *
     333     *  Thus it is the responsibility of the CPU dependent code to
     334     *  get and keep the stack adjust factor, the stack alignment, and
     335     *  the context initialization sequence in sync.
     336     */
     337
    325338    stack_size = _Stack_Adjust_size( stack_size );
    326339    stack_addr = _Workspace_Allocate( stack_size );
     
    348361     * routine properly matches the allocation of the stack.
    349362     */
     363
    350364    if ( _CPU_Table.stack_free_hook )
    351365        (*_CPU_Table.stack_free_hook)( stack_addr );
  • cpukit/score/src/thread.c

    rd2d6467 r1543932  
    319319   * routine can call the correct deallocation routine.
    320320   */
     321
    321322  if ( _CPU_Table.stack_allocate_hook )
    322323  {
    323324    stack_addr = (*_CPU_Table.stack_allocate_hook)( stack_size );
    324325  } else {
     326
     327    /*
     328     *  First pad the requested size so we allocate enough memory
     329     *  so the context initialization can align it properly.  The address
     330     *  returned the workspace allocate must be directly stored in the
     331     *  stack control block because it is later used in the free sequence.
     332     *
     333     *  Thus it is the responsibility of the CPU dependent code to
     334     *  get and keep the stack adjust factor, the stack alignment, and
     335     *  the context initialization sequence in sync.
     336     */
     337
    325338    stack_size = _Stack_Adjust_size( stack_size );
    326339    stack_addr = _Workspace_Allocate( stack_size );
     
    348361     * routine properly matches the allocation of the stack.
    349362     */
     363
    350364    if ( _CPU_Table.stack_free_hook )
    351365        (*_CPU_Table.stack_free_hook)( stack_addr );
Note: See TracChangeset for help on using the changeset viewer.