Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:59

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /*
0004  * Copyright (C) 2012, 2017 embedded brains GmbH & Co. KG
0005  *
0006  * Redistribution and use in source and binary forms, with or without
0007  * modification, are permitted provided that the following conditions
0008  * are met:
0009  * 1. Redistributions of source code must retain the above copyright
0010  *    notice, this list of conditions and the following disclaimer.
0011  * 2. Redistributions in binary form must reproduce the above copyright
0012  *    notice, this list of conditions and the following disclaimer in the
0013  *    documentation and/or other materials provided with the distribution.
0014  *
0015  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0016  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0017  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0018  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0019  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0020  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0021  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0023  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0024  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0025  * POSSIBILITY OF SUCH DAMAGE.
0026  */
0027 
0028 #include <bsp.h>
0029 #include <bsp/irq-generic.h>
0030 #include <bsp/vectors.h>
0031 
0032 rtems_status_code bsp_interrupt_get_attributes(
0033   rtems_vector_number         vector,
0034   rtems_interrupt_attributes *attributes
0035 )
0036 {
0037   return RTEMS_SUCCESSFUL;
0038 }
0039 
0040 rtems_status_code bsp_interrupt_is_pending(
0041   rtems_vector_number vector,
0042   bool               *pending
0043 )
0044 {
0045   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
0046   bsp_interrupt_assert(pending != NULL);
0047   *pending = false;
0048   return RTEMS_UNSATISFIED;
0049 }
0050 
0051 rtems_status_code bsp_interrupt_raise(rtems_vector_number vector)
0052 {
0053   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
0054   return RTEMS_UNSATISFIED;
0055 }
0056 
0057 rtems_status_code bsp_interrupt_clear(rtems_vector_number vector)
0058 {
0059   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
0060   return RTEMS_UNSATISFIED;
0061 }
0062 
0063 rtems_status_code bsp_interrupt_vector_is_enabled(
0064   rtems_vector_number vector,
0065   bool               *enabled
0066 )
0067 {
0068   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
0069   bsp_interrupt_assert(enabled != NULL);
0070   *enabled = false;
0071   return RTEMS_UNSATISFIED;
0072 }
0073 
0074 rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
0075 {
0076     bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
0077     return RTEMS_SUCCESSFUL;
0078 }
0079 
0080 void bsp_interrupt_dispatch(uintptr_t exception_number)
0081 {
0082     if (exception_number == 10) {
0083         t32mppc_decrementer_dispatch();
0084     } else {
0085         bsp_interrupt_handler_default(0);
0086     }
0087 }
0088 
0089 rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
0090 {
0091     bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
0092     return RTEMS_SUCCESSFUL;
0093 }
0094 
0095 rtems_status_code bsp_interrupt_set_priority(
0096   rtems_vector_number vector,
0097   uint32_t priority
0098 )
0099 {
0100   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
0101   return RTEMS_UNSATISFIED;
0102 }
0103 
0104 rtems_status_code bsp_interrupt_get_priority(
0105   rtems_vector_number vector,
0106   uint32_t *priority
0107 )
0108 {
0109   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
0110   bsp_interrupt_assert(priority != NULL);
0111   return RTEMS_UNSATISFIED;
0112 }
0113 
0114 #if defined(RTEMS_SMP)
0115 rtems_status_code bsp_interrupt_get_affinity(
0116   rtems_vector_number  vector,
0117   Processor_mask      *affinity
0118 )
0119 {
0120   (void) vector;
0121   _Processor_mask_From_index( affinity, 0 );
0122   return RTEMS_UNSATISFIED;
0123 }
0124 
0125 rtems_status_code bsp_interrupt_set_affinity(
0126   rtems_vector_number   vector,
0127   const Processor_mask *affinity
0128 )
0129 {
0130   (void) vector;
0131   (void) affinity;
0132   return RTEMS_UNSATISFIED;
0133 }
0134 #endif
0135 
0136 void bsp_interrupt_facility_initialize(void)
0137 {
0138     /* Nothing to do */
0139 }