aboutsummaryrefslogtreecommitdiff
path: root/product/rdn2/scp_ramfw/rtx_config.c
diff options
context:
space:
mode:
authorAditya Angadi <aditya.angadi@arm.com>2020-11-04 14:12:10 +0530
committerThomas Abraham <thomas.abraham@arm.com>2020-11-28 01:48:28 +0530
commit11d30407a17919deb6aec54c8443b18772e6dc40 (patch)
tree5af30c1219efadd89ad77328ea549c009291b0ca /product/rdn2/scp_ramfw/rtx_config.c
parenta8a36e93cbed9e75761b12c16252bbfccbac5957 (diff)
product/rdn2: add platform specific definitions for rtx
Add platform specific definitions for callback functions for cmsis rtx. Change-Id: Iaaa9b3e6887696932d23ed6a42b2f224819f7a54 Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Diffstat (limited to 'product/rdn2/scp_ramfw/rtx_config.c')
-rw-r--r--product/rdn2/scp_ramfw/rtx_config.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/product/rdn2/scp_ramfw/rtx_config.c b/product/rdn2/scp_ramfw/rtx_config.c
new file mode 100644
index 00000000..ce88d98f
--- /dev/null
+++ b/product/rdn2/scp_ramfw/rtx_config.c
@@ -0,0 +1,57 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "clock_soc.h"
+
+#include <rtx_lib.c>
+#include <rtx_os.h>
+
+#include <fwk_mm.h>
+
+#include <fmw_cmsis.h>
+
+#include <stdbool.h>
+#include <stdint.h>
+
+/*
+ * Required by RTX to configure the SysTick timer.
+ */
+uint32_t SystemCoreClock = CLOCK_RATE_REFCLK;
+
+/*
+ * Idle thread
+ */
+__NO_RETURN void osRtxIdleThread(void *argument)
+{
+ while (true)
+ __WFI();
+}
+
+/*
+ * OS error handler
+ */
+uint32_t osRtxErrorNotify(uint32_t code, void *object_id)
+{
+ osRtxIdleThread(object_id);
+}
+
+uint32_t osRtxMemoryInit(void *mem, uint32_t size)
+{
+ return 1;
+}
+
+void *osRtxMemoryAlloc(void *mem, uint32_t size, uint32_t type)
+{
+ return fwk_mm_alloc(1, size);
+}
+
+uint32_t osRtxMemoryFree(void *mem, void *block)
+{
+ fwk_mm_free(block);
+
+ return 1;
+}