4.104.114.95
Last change
on this file since 6d4940d was
6d4940d,
checked in by Jennifer Averett <Jennifer.Averett@…>, on 02/04/08 at 19:37:46
|
2008-02-04 Jennifer Averett <jennifer.averett@…>
- rtems/Makefile.am, rtems/include/rtems/rtems/support.h: Added
workspace manipulation routines for testing.
- rtems/src/workspace.c: New file.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * Workspace Handler |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-2007. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #if HAVE_CONFIG_H |
---|
15 | #include "config.h" |
---|
16 | #endif |
---|
17 | |
---|
18 | #include <rtems/system.h> |
---|
19 | #include <rtems/score/wkspace.h> |
---|
20 | #include <rtems/score/interr.h> |
---|
21 | #include <rtems/config.h> |
---|
22 | |
---|
23 | #include <string.h> /* for memset */ |
---|
24 | |
---|
25 | boolean rtems_workspace_get_information( |
---|
26 | Heap_Information_block *the_info |
---|
27 | ) |
---|
28 | { |
---|
29 | Heap_Get_information_status status; |
---|
30 | |
---|
31 | status = _Heap_Get_information( &_Workspace_Area, the_info ); |
---|
32 | if ( status == HEAP_GET_INFORMATION_SUCCESSFUL ) |
---|
33 | return TRUE; |
---|
34 | else |
---|
35 | return FALSE; |
---|
36 | } |
---|
37 | |
---|
38 | /* |
---|
39 | * _Workspace_Allocate |
---|
40 | */ |
---|
41 | boolean rtems_workspace_allocate( |
---|
42 | size_t bytes, |
---|
43 | void **pointer |
---|
44 | ) |
---|
45 | { |
---|
46 | *pointer = _Heap_Allocate( &_Workspace_Area, bytes ); |
---|
47 | if (!pointer) |
---|
48 | return FALSE; |
---|
49 | else |
---|
50 | return TRUE; |
---|
51 | } |
---|
52 | |
---|
53 | /* |
---|
54 | * _Workspace_Allocate |
---|
55 | */ |
---|
56 | boolean rtems_workspace_free( |
---|
57 | void *pointer |
---|
58 | ) |
---|
59 | { |
---|
60 | return _Heap_Free( &_Workspace_Area, pointer ); |
---|
61 | } |
---|
62 | |
---|
Note: See
TracBrowser
for help on using the repository browser.