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 <wendy.liang@xilinx.com>
This commit is contained in:
Wendy Liang
2019-01-30 10:46:37 -08:00
parent b5ffad0f7d
commit d5e2182ac8
3 changed files with 0 additions and 82 deletions
-1
View File
@@ -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)
-80
View File
@@ -1,80 +0,0 @@
/*
* Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdlib.h>
#include <errno.h>
/* We need to find the internal MAX_IRQS limit */
/* Could be retrieved from platform specific files in the future */
#define METAL_INTERNAL
#include <metal/irq.h>
#include <metal/list.h>
#include <metal/log.h>
#include <metal/sys.h>
#include <metal/utilities.h>
#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);
-1
View File
@@ -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();
}