diff options
Diffstat (limited to 'bsps/powerpc/qoriq/include/tm27.h')
-rw-r--r-- | bsps/powerpc/qoriq/include/tm27.h | 78 |
1 files changed, 47 insertions, 31 deletions
diff --git a/bsps/powerpc/qoriq/include/tm27.h b/bsps/powerpc/qoriq/include/tm27.h index 5753d6b049..0c43823f0e 100644 --- a/bsps/powerpc/qoriq/include/tm27.h +++ b/bsps/powerpc/qoriq/include/tm27.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2010-2015 embedded brains GmbH. All rights reserved. + * Copyright (C) 2010, 2015 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * 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 OWNER 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. */ #ifndef _RTEMS_TMTEST27 @@ -27,8 +40,6 @@ #ifndef TMTESTS_TM27_H #define TMTESTS_TM27_H -#include <assert.h> - #include <libcpu/powerpc-utility.h> #include <bsp/irq.h> @@ -40,55 +51,60 @@ #define IPI_INDEX_HIGH 2 -RTEMS_INLINE_ROUTINE void Install_tm27_vector(void (*handler)(rtems_vector_number)) +static inline void Install_tm27_vector( rtems_interrupt_handler handler ) { - rtems_status_code sc; + static rtems_interrupt_entry entry_low; + static rtems_interrupt_entry entry_high; rtems_vector_number low = QORIQ_IRQ_IPI_0 + IPI_INDEX_LOW; rtems_vector_number high = QORIQ_IRQ_IPI_0 + IPI_INDEX_HIGH; - sc = rtems_interrupt_handler_install( + rtems_interrupt_entry_initialize( + &entry_low, + handler, + NULL, + "tm17 low" + ); + (void) rtems_interrupt_entry_install( low, - "tm17 low", RTEMS_INTERRUPT_UNIQUE, - (rtems_interrupt_handler) handler, - NULL + &entry_low ); - assert(sc == RTEMS_SUCCESSFUL); - sc = qoriq_pic_set_priority(low, 1, NULL); - assert(sc == RTEMS_SUCCESSFUL); + (void) qoriq_pic_set_priority(low, 1, NULL); - sc = rtems_interrupt_handler_install( + rtems_interrupt_entry_initialize( + &entry_high, + handler, + NULL, + "tm17 high" + ); + (void) rtems_interrupt_entry_install( high, - "tm17 high", RTEMS_INTERRUPT_UNIQUE, - (rtems_interrupt_handler) handler, - NULL + &entry_high ); - assert(sc == RTEMS_SUCCESSFUL); - sc = qoriq_pic_set_priority(high, 2, NULL); - assert(sc == RTEMS_SUCCESSFUL); + (void) qoriq_pic_set_priority(high, 2, NULL); } -RTEMS_INLINE_ROUTINE void qoriq_tm27_cause(uint32_t ipi_index) +static inline void qoriq_tm27_cause(uint32_t ipi_index) { uint32_t self = ppc_processor_id(); qoriq.pic.per_cpu[self].ipidr[ipi_index].reg = UINT32_C(1) << self; } -RTEMS_INLINE_ROUTINE void Cause_tm27_intr(void) +static inline void Cause_tm27_intr(void) { qoriq_tm27_cause(IPI_INDEX_LOW); } -RTEMS_INLINE_ROUTINE void Clear_tm27_intr(void) +static inline void Clear_tm27_intr(void) { /* Nothing to do */ } -RTEMS_INLINE_ROUTINE inline void Lower_tm27_intr(void) +static inline inline void Lower_tm27_intr(void) { qoriq_tm27_cause(IPI_INDEX_HIGH); } |