source: rtems/cpukit/score/src/threadstackfree.c @ 632e4306

4.104.115
Last change on this file since 632e4306 was aac75d3b, checked in by Joel Sherrill <joel.sherrill@…>, on 12/15/08 at 19:21:01

2008-12-15 Joel Sherrill <joel.sherrill@…>

  • itron/include/rtems/itron/itronapi.h, libmisc/capture/capture.c, libmisc/monitor/mon-config.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-itask.c, libmisc/monitor/mon-mpci.c, posix/include/rtems/posix/config.h, posix/include/rtems/posix/posixapi.h, rtems/include/rtems/rtems/config.h, rtems/include/rtems/rtems/rtemsapi.h, rtems/src/taskinitusers.c, sapi/include/confdefs.h, sapi/include/rtems/config.h, sapi/include/rtems/init.h, sapi/src/exinit.c, sapi/src/itronapi.c, sapi/src/posixapi.c, sapi/src/rtemsapi.c, score/src/isr.c, score/src/thread.c, score/src/threadcreateidle.c, score/src/threadstackallocate.c, score/src/threadstackfree.c, score/src/wkspace.c: Eliminate pointers to API configuration tables in the main configuration table. Reference the main configuration table and the API configuration tables directly using the confdefs.h version rather than obtaining a pointer to it. This eliminated some variables, a potential fatal error, some unnecessary default configuration structures. Overall, about a 4.5% reduction in the code size for minimum and hello on the SPARC.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  Thread Handler
3 *
4 *
5 *  COPYRIGHT (c) 1989-2008.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/score/apiext.h>
21#include <rtems/score/context.h>
22#include <rtems/score/interr.h>
23#include <rtems/score/isr.h>
24#include <rtems/score/object.h>
25#include <rtems/score/priority.h>
26#include <rtems/score/states.h>
27#include <rtems/score/sysstate.h>
28#include <rtems/score/thread.h>
29#include <rtems/score/threadq.h>
30#include <rtems/score/userext.h>
31#include <rtems/score/wkspace.h>
32#include <rtems/config.h>
33
34/*
35 *  _Thread_Stack_Free
36 *
37 *  Deallocate the Thread's stack.
38 */
39
40void _Thread_Stack_Free(
41  Thread_Control *the_thread
42)
43{
44    /*
45     *  If the API provided the stack space, then don't free it.
46     */
47
48    if ( !the_thread->Start.core_allocated_stack )
49      return;
50
51    /*
52     * Call ONLY the CPU table stack free hook, or the
53     * the RTEMS workspace free.  This is so the free
54     * routine properly matches the allocation of the stack.
55     */
56
57    if ( Configuration.stack_free_hook )
58      (*Configuration.stack_free_hook)(
59        the_thread->Start.Initial_stack.area
60      );
61    else
62        _Workspace_Free( the_thread->Start.Initial_stack.area );
63}
Note: See TracBrowser for help on using the repository browser.