summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/wkspacemallocinitdefault.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-30 11:31:58 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-01 19:05:33 +0200
commitf2185d109930fb5db31a5c228a3f46178072f270 (patch)
tree166d29b19bcf7ff01b4368f351e3fab52b750c19 /cpukit/score/src/wkspacemallocinitdefault.c
parentrtems: Canonicalize name and id checks (diff)
downloadrtems-f2185d109930fb5db31a5c228a3f46178072f270.tar.bz2
Decouple the C Program Heap initialization
Before this patch RTEMS_Malloc_Initialize() had a fixed dependency on _Workspace_Area. Introduce _Workspace_Malloc_initializer to have this dependency only if CONFIGURE_UNIFIED_WORK_AREAS is defined by the application configuration.
Diffstat (limited to 'cpukit/score/src/wkspacemallocinitdefault.c')
-rw-r--r--cpukit/score/src/wkspacemallocinitdefault.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/cpukit/score/src/wkspacemallocinitdefault.c b/cpukit/score/src/wkspacemallocinitdefault.c
new file mode 100644
index 0000000000..586c3eef7c
--- /dev/null
+++ b/cpukit/score/src/wkspacemallocinitdefault.c
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreWorkspace
+ *
+ * @brief This source file provides the default definition of
+ * _Workspace_Malloc_initializer.
+ */
+
+/*
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/wkspacedata.h>
+
+struct Heap_Control *( * const _Workspace_Malloc_initializer )( void ) =
+ _Workspace_Malloc_initialize_separate;