source: rtems/cpukit/score/src/threadstackallocate.c @ 5618c37a

4.115
Last change on this file since 5618c37a was 5618c37a, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 13:14:48

score: Create thread implementation header

Move implementation specific parts of thread.h and thread.inl into new
header file threadimpl.h. The thread.h contains now only the
application visible API.

Remove superfluous header file includes from various files.

  • 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.com/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.