Import app manager, samples and test-tools
This commit is contained in:
54
core/app-mgr/app-manager/platform/linux/app_mgr_linux.c
Normal file
54
core/app-mgr/app-manager/platform/linux/app_mgr_linux.c
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "app_manager.h"
|
||||
|
||||
void*
|
||||
app_manager_timer_create(void (*timer_callback)(void*),
|
||||
watchdog_timer *wd_timer)
|
||||
{
|
||||
/* TODO */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void app_manager_timer_destroy(void *timer)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
void app_manager_timer_start(void *timer, int timeout)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
void app_manager_timer_stop(void *timer)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
watchdog_timer *
|
||||
app_manager_get_wd_timer_from_timer_handle(void *timer)
|
||||
{
|
||||
/* TODO */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int app_manager_signature_verify(const uint8_t *file, unsigned int file_len,
|
||||
const uint8_t *signature, unsigned int sig_size)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
72
core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c
Normal file
72
core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "app_manager.h"
|
||||
#include "bh_platform.h"
|
||||
#include "bh_memory.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 = bh_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)
|
||||
{
|
||||
bh_free(timer);
|
||||
}
|
||||
|
||||
void app_manager_timer_start(void *timer, int timeout)
|
||||
{
|
||||
k_timer_start(timer, timeout, 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
|
||||
Reference in New Issue
Block a user