source: rtems/cpukit/score/src/threadstackfree.c @ b568ccb

4.104.114.84.95
Last change on this file since b568ccb was 05df0a8, checked in by Joel Sherrill <joel.sherrill@…>, on 05/17/99 at 20:41:13

Thread Handler split into multiple files. Eventually, as RTEMS is
split into one function per file, this will decrease the size of executables.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  Thread Handler
3 *
4 *
5 *  COPYRIGHT (c) 1989-1998.
6 *  On-Line Applications Research Corporation (OAR).
7 *  Copyright assigned to U.S. Government, 1994.
8 *
9 *  The license and distribution terms for this file may be
10 *  found in found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#include <rtems/system.h>
17#include <rtems/score/apiext.h>
18#include <rtems/score/context.h>
19#include <rtems/score/interr.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/object.h>
22#include <rtems/score/priority.h>
23#include <rtems/score/states.h>
24#include <rtems/score/sysstate.h>
25#include <rtems/score/thread.h>
26#include <rtems/score/threadq.h>
27#include <rtems/score/userext.h>
28#include <rtems/score/wkspace.h>
29
30/*
31 *  _Thread_Stack_Free
32 *
33 *  Deallocate the Thread's stack.
34 */
35
36void _Thread_Stack_Free(
37  Thread_Control *the_thread
38)
39{
40    /*
41     *  If the API provided the stack space, then don't free it.
42     */
43
44    if ( !the_thread->Start.core_allocated_stack )
45      return;
46
47    /*
48     * Call ONLY the CPU table stack free hook, or the
49     * the RTEMS workspace free.  This is so the free
50     * routine properly matches the allocation of the stack.
51     */
52
53    if ( _CPU_Table.stack_free_hook )
54        (*_CPU_Table.stack_free_hook)( the_thread->Start.Initial_stack.area );
55    else
56        _Workspace_Free( the_thread->Start.Initial_stack.area );
57}
Note: See TracBrowser for help on using the repository browser.