source: rtems/cpukit/score/src/threadstackallocate.c @ 6c7caa1a

4.115
Last change on this file since 6c7caa1a was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 949 bytes
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.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/score/threadimpl.h>
23#include <rtems/score/stackimpl.h>
24#include <rtems/config.h>
25
26size_t _Thread_Stack_Allocate(
27  Thread_Control *the_thread,
28  size_t          stack_size
29)
30{
31  void *stack_addr = 0;
32  size_t the_stack_size;
33  rtems_stack_allocate_hook stack_allocate_hook =
34    rtems_configuration_get_stack_allocate_hook();
35
36  the_stack_size = _Stack_Ensure_minimum( stack_size );
37
38  stack_addr = (*stack_allocate_hook)( the_stack_size );
39
40  if ( !stack_addr )
41    the_stack_size = 0;
42
43  the_thread->Start.stack = stack_addr;
44
45  return the_stack_size;
46}
Note: See TracBrowser for help on using the repository browser.