source: rtems/cpukit/score/src/threadstackallocate.c @ a936aa49

4.115
Last change on this file since a936aa49 was bf54252, checked in by Alexandre Devienne <deviennealexandre@…>, on 11/28/12 at 20:14:50

Score misc: Clean up Doxygen #4 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/7985215

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 *
4 * @brief Stack Allocate Helper
5 * @ingroup ScoreThread
6 */
7
8
9/*
10 *  COPYRIGHT (c) 1989-2010.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/system.h>
23#include <rtems/score/apiext.h>
24#include <rtems/score/context.h>
25#include <rtems/score/interr.h>
26#include <rtems/score/isr.h>
27#include <rtems/score/object.h>
28#include <rtems/score/priority.h>
29#include <rtems/score/states.h>
30#include <rtems/score/sysstate.h>
31#include <rtems/score/thread.h>
32#include <rtems/score/threadq.h>
33#include <rtems/score/wkspace.h>
34#include <rtems/config.h>
35
36size_t _Thread_Stack_Allocate(
37  Thread_Control *the_thread,
38  size_t          stack_size
39)
40{
41  void *stack_addr = 0;
42  size_t the_stack_size;
43  rtems_stack_allocate_hook stack_allocate_hook =
44    rtems_configuration_get_stack_allocate_hook();
45
46  the_stack_size = _Stack_Ensure_minimum( stack_size );
47
48  stack_addr = (*stack_allocate_hook)( the_stack_size );
49
50  if ( !stack_addr )
51    the_stack_size = 0;
52
53  the_thread->Start.stack = stack_addr;
54
55  return the_stack_size;
56}
Note: See TracBrowser for help on using the repository browser.