diff --git a/lib/irq.h b/lib/irq.h index a8b83775..936d7bd6 100644 --- a/lib/irq.h +++ b/lib/irq.h @@ -93,8 +93,6 @@ void metal_irq_enable(unsigned int vector); */ void metal_irq_disable(unsigned int vector); -#include - /** @} */ #ifdef __cplusplus diff --git a/lib/log.h b/lib/log.h index 4b658309..61c3c9f2 100644 --- a/lib/log.h +++ b/lib/log.h @@ -111,6 +111,4 @@ extern void metal_default_log_handler(enum metal_log_level level, } #endif -#include - #endif /* __METAL_METAL_LOG__H__ */ diff --git a/lib/system/freertos/CMakeLists.txt b/lib/system/freertos/CMakeLists.txt index c4f56a46..0846589a 100644 --- a/lib/system/freertos/CMakeLists.txt +++ b/lib/system/freertos/CMakeLists.txt @@ -3,8 +3,6 @@ collect (PROJECT_LIB_HEADERS assert.h) collect (PROJECT_LIB_HEADERS cache.h) collect (PROJECT_LIB_HEADERS condition.h) collect (PROJECT_LIB_HEADERS io.h) -collect (PROJECT_LIB_HEADERS irq.h) -collect (PROJECT_LIB_HEADERS log.h) collect (PROJECT_LIB_HEADERS mutex.h) collect (PROJECT_LIB_HEADERS sleep.h) collect (PROJECT_LIB_HEADERS sys.h) diff --git a/lib/system/freertos/irq.h b/lib/system/freertos/irq.h deleted file mode 100644 index 72c11d42..00000000 --- a/lib/system/freertos/irq.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/irq.c - * @brief FreeRTOS libmetal irq definitions. - */ - -#ifndef __METAL_IRQ__H__ -#error "Include metal/irq.h instead of metal/freertos/irq.h" -#endif - -#ifndef __METAL_FREERTOS_IRQ__H__ -#define __METAL_FREERTOS_IRQ__H__ - -#endif /* __METAL_FREERTOS_IRQ__H__ */ diff --git a/lib/system/freertos/log.h b/lib/system/freertos/log.h deleted file mode 100644 index f805c8d5..00000000 --- a/lib/system/freertos/log.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Linaro nor the names of its contributors may be used - * to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * @file freertos/log.h - * @brief FreeRTOS libmetal log handler definition. - */ - -#ifndef __METAL_METAL_LOG__H__ -#error "Include metal/log.h instead of metal/freertos/log.h" -#endif - -#ifndef __METAL_FREERTOS_LOG__H__ -#define __METAL_FREERTOS_LOG__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREERTOS_LOG__H__ */ diff --git a/lib/system/generic/CMakeLists.txt b/lib/system/generic/CMakeLists.txt index 9427635b..54f90546 100644 --- a/lib/system/generic/CMakeLists.txt +++ b/lib/system/generic/CMakeLists.txt @@ -3,8 +3,6 @@ collect (PROJECT_LIB_HEADERS assert.h) collect (PROJECT_LIB_HEADERS cache.h) collect (PROJECT_LIB_HEADERS condition.h) collect (PROJECT_LIB_HEADERS io.h) -collect (PROJECT_LIB_HEADERS irq.h) -collect (PROJECT_LIB_HEADERS log.h) collect (PROJECT_LIB_HEADERS mutex.h) collect (PROJECT_LIB_HEADERS sleep.h) collect (PROJECT_LIB_HEADERS sys.h) diff --git a/lib/system/generic/irq.h b/lib/system/generic/irq.h deleted file mode 100644 index dd8ac8d4..00000000 --- a/lib/system/generic/irq.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file generic/irq.c - * @brief Generic libmetal irq definitions. - */ - -#ifndef __METAL_IRQ__H__ -#error "Include metal/irq.h instead of metal/generic/irq.h" -#endif - -#ifndef __METAL_GENERIC_IRQ__H__ -#define __METAL_GENERIC_IRQ__H__ - -#endif /* __METAL_GENERIC_IRQ__H__ */ diff --git a/lib/system/generic/log.h b/lib/system/generic/log.h deleted file mode 100644 index 32611288..00000000 --- a/lib/system/generic/log.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Linaro nor the names of its contributors may be used - * to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * @file generic/log.h - * @brief Generic libmetal log handler definition. - */ - -#ifndef __METAL_METAL_LOG__H__ -#error "Include metal/log.h instead of metal/generic/log.h" -#endif - -#ifndef __METAL_GENERIC_LOG__H__ -#define __METAL_GENERIC_LOG__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_GENERIC_LOG__H__ */ diff --git a/lib/system/linux/CMakeLists.txt b/lib/system/linux/CMakeLists.txt index c34e7a3c..fa37e474 100644 --- a/lib/system/linux/CMakeLists.txt +++ b/lib/system/linux/CMakeLists.txt @@ -4,7 +4,6 @@ collect (PROJECT_LIB_HEADERS cache.h) collect (PROJECT_LIB_HEADERS condition.h) collect (PROJECT_LIB_HEADERS io.h) collect (PROJECT_LIB_HEADERS irq.h) -collect (PROJECT_LIB_HEADERS log.h) collect (PROJECT_LIB_HEADERS mutex.h) collect (PROJECT_LIB_HEADERS sleep.h) collect (PROJECT_LIB_HEADERS sys.h) diff --git a/lib/system/linux/device.c b/lib/system/linux/device.c index 734b473e..b713a1e9 100644 --- a/lib/system/linux/device.c +++ b/lib/system/linux/device.c @@ -14,6 +14,8 @@ #include #include +#include "irq.h" + #define MAX_DRIVERS 64 struct linux_bus; diff --git a/lib/system/linux/log.h b/lib/system/linux/log.h deleted file mode 100644 index a1f0273a..00000000 --- a/lib/system/linux/log.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Linaro nor the names of its contributors may be used - * to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * @file linux/log.h - * @brief Linux libmetal log handler definition. - */ - -#ifndef __METAL_METAL_LOG__H__ -#error "Include metal/log.h instead of metal/linux/log.h" -#endif - -#ifndef __METAL_LINUX_LOG__H__ -#define __METAL_LINUX_LOG__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_LINUX_LOG__H__ */ diff --git a/lib/system/nuttx/CMakeLists.txt b/lib/system/nuttx/CMakeLists.txt index 3c29a432..8e8e1bb6 100644 --- a/lib/system/nuttx/CMakeLists.txt +++ b/lib/system/nuttx/CMakeLists.txt @@ -3,8 +3,6 @@ collect (PROJECT_LIB_HEADERS assert.h) collect (PROJECT_LIB_HEADERS cache.h) collect (PROJECT_LIB_HEADERS condition.h) collect (PROJECT_LIB_HEADERS io.h) -collect (PROJECT_LIB_HEADERS irq.h) -collect (PROJECT_LIB_HEADERS log.h) collect (PROJECT_LIB_HEADERS mutex.h) collect (PROJECT_LIB_HEADERS sleep.h) collect (PROJECT_LIB_HEADERS sys.h) diff --git a/lib/system/nuttx/init.c b/lib/system/nuttx/init.c index 8d59784e..0a7844ef 100644 --- a/lib/system/nuttx/init.c +++ b/lib/system/nuttx/init.c @@ -13,6 +13,8 @@ #include #include +#include "irq.h" + struct metal_state _metal; int metal_sys_init(const struct metal_init_params *params) diff --git a/lib/system/nuttx/irq.c b/lib/system/nuttx/irq.c index 34e0edbf..51b6c3a4 100644 --- a/lib/system/nuttx/irq.c +++ b/lib/system/nuttx/irq.c @@ -13,7 +13,8 @@ #include #include #include -#include + +#include "irq.h" unsigned int metal_irq_save_disable(void) { diff --git a/lib/system/nuttx/log.h b/lib/system/nuttx/log.h deleted file mode 100644 index 5f318c7b..00000000 --- a/lib/system/nuttx/log.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file nuttx/log.h - * @brief NuttX libmetal log handler definition. - */ - -#ifndef __METAL_METAL_LOG__H__ -#error "Include metal/log.h instead of metal/nuttx/log.h" -#endif - -#ifndef __METAL_NUTTX_LOG__H__ -#define __METAL_NUTTX_LOG__H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_NUTTX_LOG__H__ */ diff --git a/lib/system/nuttx/sys.h b/lib/system/nuttx/sys.h index de19568b..0b49368c 100644 --- a/lib/system/nuttx/sys.h +++ b/lib/system/nuttx/sys.h @@ -16,6 +16,8 @@ #ifndef __METAL_NUTTX_SYS__H__ #define __METAL_NUTTX_SYS__H__ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/lib/system/zephyr/CMakeLists.txt b/lib/system/zephyr/CMakeLists.txt index cc1fd534..442d9c93 100644 --- a/lib/system/zephyr/CMakeLists.txt +++ b/lib/system/zephyr/CMakeLists.txt @@ -3,7 +3,6 @@ collect (PROJECT_LIB_HEADERS assert.h) collect (PROJECT_LIB_HEADERS cache.h) collect (PROJECT_LIB_HEADERS condition.h) collect (PROJECT_LIB_HEADERS io.h) -collect (PROJECT_LIB_HEADERS irq.h) collect (PROJECT_LIB_HEADERS log.h) collect (PROJECT_LIB_HEADERS mutex.h) collect (PROJECT_LIB_HEADERS sleep.h) diff --git a/lib/system/zephyr/irq.h b/lib/system/zephyr/irq.h deleted file mode 100644 index 7f317943..00000000 --- a/lib/system/zephyr/irq.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file zephyr/irq.c - * @brief Zephyr libmetal irq definitions. - */ - -#ifndef __METAL_IRQ__H__ -#error "Include metal/irq.h instead of metal/zephyr/irq.h" -#endif - -#ifndef __METAL_ZEPHYR_IRQ__H__ -#define __METAL_ZEPHYR_IRQ__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_ZEPHYR_IRQ__H__ */ diff --git a/lib/system/zephyr/sys.h b/lib/system/zephyr/sys.h index 9c60ecdf..88895efb 100644 --- a/lib/system/zephyr/sys.h +++ b/lib/system/zephyr/sys.h @@ -19,6 +19,8 @@ #include #include +#include "log.h" + #ifdef __cplusplus extern "C" { #endif