summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c')
-rw-r--r--fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c
new file mode 100644
index 000000000..650e536f1
--- /dev/null
+++ b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2019 Intel Corporation. All rights reserved.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ */
+
+#include "app_manager.h"
+#include "bh_platform.h"
+#include <autoconf.h>
+#include <zephyr.h>
+#include <kernel.h>
+#if 0
+#include <sigverify.h>
+#endif
+typedef struct k_timer_watchdog {
+ struct k_timer timer;
+ watchdog_timer *wd_timer;
+} k_timer_watchdog;
+
+void *
+app_manager_timer_create(void (*timer_callback)(void *),
+ watchdog_timer *wd_timer)
+{
+ struct k_timer_watchdog *timer =
+ APP_MGR_MALLOC(sizeof(struct k_timer_watchdog));
+
+ if (timer) {
+ k_timer_init(&timer->timer, (void (*)(struct k_timer *))timer_callback,
+ NULL);
+ timer->wd_timer = wd_timer;
+ }
+
+ return timer;
+}
+
+void
+app_manager_timer_destroy(void *timer)
+{
+ APP_MGR_FREE(timer);
+}
+
+void
+app_manager_timer_start(void *timer, int timeout)
+{
+ k_timer_start(timer, Z_TIMEOUT_MS(timeout), Z_TIMEOUT_MS(0));
+}
+
+void
+app_manager_timer_stop(void *timer)
+{
+ k_timer_stop(timer);
+}
+
+watchdog_timer *
+app_manager_get_wd_timer_from_timer_handle(void *timer)
+{
+ return ((k_timer_watchdog *)timer)->wd_timer;
+}
+#if 0
+int app_manager_signature_verify(const uint8_t *file, unsigned int file_len,
+ const uint8_t *signature, unsigned int sig_size)
+{
+ return signature_verify(file, file_len, signature, sig_size);
+}
+#endif