source: rtems-schedsim/schedsim/rtems/wkspace.c @ 957ce33

Last change on this file since 957ce33 was 957ce33, checked in by Joel Sherrill <joel.sherrill@…>, on 05/01/13 at 00:06:22

schedsim/rtems/wkspace.c: Update to match current prototype

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[abb18dc]1/*
2 *  BASED UPON SOURCE IN RTEMS, MODIFIED FOR SIMULATOR
3 *
4 *  Workspace Handler
5 *
6 *  COPYRIGHT (c) 1989-2010.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#if HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include <rtems/system.h>
21#include <rtems/score/wkspace.h>
22#include <rtems/score/interr.h>
23
24#include <stdlib.h>
25
26#if defined(DEBUG_WORKSPACE)
27  #include <stdio.h>
28#endif
29
30/*
31 *  _Workspace_Handler_initialization
32 */
[957ce33]33void _Workspace_Handler_initialization(
34  Heap_Area *areas,
35  size_t area_count,
36  Heap_Initialization_or_extend_handler extend
37)
[abb18dc]38{
39}
40
41/*
42 *  _Workspace_Allocate
43 */
44void *_Workspace_Allocate(
45  size_t   size
46)
47{
48  void *memory;
49
50  memory = calloc( 1, size );
51  #if defined(DEBUG_WORKSPACE)
52    fprintf(
53      stderr,
54      "Workspace_Allocate(%d) from %p/%p -> %p\n",
55      size,
56      __builtin_return_address( 0 ),
57      __builtin_return_address( 1 ),
58      memory
59    );
60  #endif
61  return memory;
62}
63
64/*
65 *  _Workspace_Free
66 */
67void _Workspace_Free(
68  void *block
69)
70{
71  #if defined(DEBUG_WORKSPACE)
72    fprintf(
73      stderr,
74      block,
75      __builtin_return_address( 0 ),
76      __builtin_return_address( 1 )
77    );
78  #endif
79  free( block );
80}
81
82/*
83 *  _Workspace_Allocate_or_fatal_error
84 */
85void *_Workspace_Allocate_or_fatal_error(
86  size_t      size
87)
88{
89  void *memory;
90
91  memory = calloc( 1, size );
92  #if defined(DEBUG_WORKSPACE)
93    fprintf(
94      stderr,
95      "Workspace_Allocate_or_fatal_error(%d) from %p/%p -> %p\n",
96      size,
97      __builtin_return_address( 0 ),
98      __builtin_return_address( 1 ),
99      memory
100    );
101  #endif
102
103  return memory;
104}
Note: See TracBrowser for help on using the repository browser.