source: rtems/cpukit/score/src/threadstackfree.c @ 4fc370e

4.115
Last change on this file since 4fc370e was e655f7e, checked in by Alex Ivanov <alexivanov97@…>, on 11/29/12 at 18:39:19

score misc: Score misc: Clean up Doxygen #5

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