summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/workspace.c
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2008-02-04 19:37:46 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2008-02-04 19:37:46 +0000
commit6d4940d5086306ebfdc26f27558b1e5859c324b2 (patch)
treea1382bdb215079434f3402cfdb84d969b55ac482 /cpukit/rtems/src/workspace.c
parent2008-02-04 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-6d4940d5086306ebfdc26f27558b1e5859c324b2.tar.bz2
2008-02-04 Jennifer Averett <jennifer.averett@OARcorp.com>
* rtems/Makefile.am, rtems/include/rtems/rtems/support.h: Added workspace manipulation routines for testing. * rtems/src/workspace.c: New file.
Diffstat (limited to 'cpukit/rtems/src/workspace.c')
-rw-r--r--cpukit/rtems/src/workspace.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/cpukit/rtems/src/workspace.c b/cpukit/rtems/src/workspace.c
new file mode 100644
index 0000000000..d5335ebc8d
--- /dev/null
+++ b/cpukit/rtems/src/workspace.c
@@ -0,0 +1,62 @@
+/*
+ * Workspace Handler
+ *
+ * COPYRIGHT (c) 1989-2007.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/wkspace.h>
+#include <rtems/score/interr.h>
+#include <rtems/config.h>
+
+#include <string.h> /* for memset */
+
+boolean rtems_workspace_get_information(
+ Heap_Information_block *the_info
+)
+{
+ Heap_Get_information_status status;
+
+ status = _Heap_Get_information( &_Workspace_Area, the_info );
+ if ( status == HEAP_GET_INFORMATION_SUCCESSFUL )
+ return TRUE;
+ else
+ return FALSE;
+}
+
+/*
+ * _Workspace_Allocate
+ */
+boolean rtems_workspace_allocate(
+ size_t bytes,
+ void **pointer
+)
+{
+ *pointer = _Heap_Allocate( &_Workspace_Area, bytes );
+ if (!pointer)
+ return FALSE;
+ else
+ return TRUE;
+}
+
+/*
+ * _Workspace_Allocate
+ */
+boolean rtems_workspace_free(
+ void *pointer
+)
+{
+ return _Heap_Free( &_Workspace_Area, pointer );
+}
+