From d5e2182ac84b3d54d539f0df7b48fa6316ca3e66 Mon Sep 17 00:00:00 2001 From: Wendy Liang Date: Wed, 2 Jan 2019 16:17:04 -0800 Subject: [PATCH] test: zephyr: remove IRQ As Zephyr's IRQ infrastructure is not lined up with libmetal IRQ infrastructure. And the drivers in Zephyr declare ISR at compile time, we can have libmetal IRQ handling on top of of Zephyr, but it will introduce unnecessary overhead. Signed-off-by: Wendy Liang --- test/system/zephyr/CMakeLists.txt | 1 - test/system/zephyr/irq.c | 80 ------------------------------- test/system/zephyr/main.c | 1 - 3 files changed, 82 deletions(-) delete mode 100644 test/system/zephyr/irq.c diff --git a/test/system/zephyr/CMakeLists.txt b/test/system/zephyr/CMakeLists.txt index 9a94736..14b792c 100644 --- a/test/system/zephyr/CMakeLists.txt +++ b/test/system/zephyr/CMakeLists.txt @@ -1,6 +1,5 @@ collect (PROJECT_LIB_TESTS main.c) collect (PROJECT_LIB_TESTS alloc.c) -collect (PROJECT_LIB_TESTS irq.c) collect (PROJECT_LIB_TESTS mutex.c) collect (PROJECT_LIB_TESTS atomic.c) diff --git a/test/system/zephyr/irq.c b/test/system/zephyr/irq.c deleted file mode 100644 index a1d9f1f..0000000 --- a/test/system/zephyr/irq.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include -#include - -/* We need to find the internal MAX_IRQS limit */ -/* Could be retrieved from platform specific files in the future */ -#define METAL_INTERNAL - -#include -#include -#include -#include -#include -#include "metal-test-internal.h" - -static int irq_handler(int irq, void *priv) -{ - (void)irq; - (void)priv; - - return 0; -} - -static int irq_handler2(int irq, void *priv) -{ - (void)irq; - (void)priv; - - return 0; -} - -static int irq(void) -{ - int rc = 0; - char *err_msg=""; - enum metal_log_level mll= metal_get_log_level(); - - /* Do not show LOG_ERROR or LOG_DEBUG for expected fail case */ - metal_set_log_level(METAL_LOG_CRITICAL); - - rc = metal_irq_register(1, irq_handler, 0, (void *)1); - if (rc) { - err_msg = "register irq 0 fail drv_id 1\n"; - goto out; - } - rc = metal_irq_register(2, irq_handler, 0, (void *)1); - if (rc) { - err_msg = "register irq 1 fail drv_id 1\n"; - goto out; - } - rc = metal_irq_register(2, irq_handler2, 0, (void *)2); - if (rc == 0) { - err_msg = "expect 2nd register irq 1 fail, but succeeded\n"; - goto out; - } - - metal_irq_unregister(1); - rc = metal_irq_register(1, irq_handler, 0, (void *)1); - if (rc) { - err_msg = "register irq 0 after unregistering failed\n"; - goto out; - } - metal_irq_unregister(1); - metal_irq_unregister(2); - - return 0; -out: - metal_set_log_level(mll); - if ((err_msg[0] != '\0') && (!rc)) - rc = -EINVAL; - if (rc) metal_log(METAL_LOG_ERROR, "%s", err_msg); - return rc; -} - -METAL_ADD_TEST(irq); diff --git a/test/system/zephyr/main.c b/test/system/zephyr/main.c index a224b5b..c2bfab5 100644 --- a/test/system/zephyr/main.c +++ b/test/system/zephyr/main.c @@ -67,7 +67,6 @@ void metal_test_add_functions() { metal_test_add_alloc(); metal_test_add_atomic(); - metal_test_add_irq(); metal_test_add_mutex(); }