2022-03-03 10:14:04 +01:00
|
|
|
/*
|
|
|
|
|
* RTEMS generic MPC83xx BSP
|
|
|
|
|
*
|
|
|
|
|
* This file integrates the IPIC irq controller.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2007 embedded brains GmbH. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2009-10-02 13:39:12 +00:00
|
|
|
|
|
|
|
|
#include <rtems.h>
|
|
|
|
|
|
|
|
|
|
#include <libcpu/powerpc-utility.h>
|
|
|
|
|
|
|
|
|
|
#include <bsp.h>
|
|
|
|
|
#include <bsp/irq.h>
|
2014-10-17 10:08:01 -05:00
|
|
|
#include <bsp/irq-generic.h>
|
2009-10-02 13:39:12 +00:00
|
|
|
#include <bsp/vectors.h>
|
|
|
|
|
|
2014-10-17 10:08:01 -05:00
|
|
|
static int qemuppc_exception_handler(
|
|
|
|
|
BSP_Exception_frame *frame,
|
|
|
|
|
unsigned exception_number
|
|
|
|
|
)
|
2009-10-02 13:39:12 +00:00
|
|
|
{
|
2017-11-21 11:43:13 +01:00
|
|
|
rtems_panic("Unexpected interrupt occured");
|
2009-10-02 13:39:12 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 09:36:29 +02:00
|
|
|
rtems_status_code bsp_interrupt_get_attributes(
|
|
|
|
|
rtems_vector_number vector,
|
|
|
|
|
rtems_interrupt_attributes *attributes
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
return RTEMS_SUCCESSFUL;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-05 13:28:02 +02:00
|
|
|
rtems_status_code bsp_interrupt_is_pending(
|
|
|
|
|
rtems_vector_number vector,
|
|
|
|
|
bool *pending
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
|
|
|
|
|
bsp_interrupt_assert(pending != NULL);
|
|
|
|
|
*pending = false;
|
|
|
|
|
return RTEMS_UNSATISFIED;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 08:44:49 +02:00
|
|
|
rtems_status_code bsp_interrupt_raise(rtems_vector_number vector)
|
|
|
|
|
{
|
|
|
|
|
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
|
|
|
|
|
return RTEMS_UNSATISFIED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtems_status_code bsp_interrupt_clear(rtems_vector_number vector)
|
|
|
|
|
{
|
|
|
|
|
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
|
|
|
|
|
return RTEMS_UNSATISFIED;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 08:20:53 +02:00
|
|
|
rtems_status_code bsp_interrupt_vector_is_enabled(
|
|
|
|
|
rtems_vector_number vector,
|
|
|
|
|
bool *enabled
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
|
|
|
|
|
bsp_interrupt_assert(enabled != NULL);
|
|
|
|
|
*enabled = false;
|
|
|
|
|
return RTEMS_UNSATISFIED;
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-02 13:39:12 +00:00
|
|
|
/*
|
|
|
|
|
* functions to enable/disable a source at the ipic
|
|
|
|
|
*/
|
2021-06-29 14:01:17 +02:00
|
|
|
rtems_status_code bsp_interrupt_vector_enable( rtems_vector_number irqnum)
|
2009-10-02 13:39:12 +00:00
|
|
|
{
|
|
|
|
|
/* FIXME: do something */
|
2017-09-20 10:30:19 +02:00
|
|
|
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(irqnum));
|
2021-06-29 14:01:17 +02:00
|
|
|
return RTEMS_SUCCESSFUL;
|
2009-10-02 13:39:12 +00:00
|
|
|
}
|
|
|
|
|
|
2021-06-29 14:06:03 +02:00
|
|
|
rtems_status_code bsp_interrupt_vector_disable( rtems_vector_number irqnum)
|
2009-10-02 13:39:12 +00:00
|
|
|
{
|
|
|
|
|
/* FIXME: do something */
|
2017-09-20 10:30:19 +02:00
|
|
|
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(irqnum));
|
2021-06-29 14:06:03 +02:00
|
|
|
return RTEMS_SUCCESSFUL;
|
2009-10-02 13:39:12 +00:00
|
|
|
}
|
|
|
|
|
|
2021-07-27 09:58:43 +02:00
|
|
|
void bsp_interrupt_facility_initialize(void)
|
2009-10-02 13:39:12 +00:00
|
|
|
{
|
2021-07-27 09:58:43 +02:00
|
|
|
rtems_status_code sc;
|
2009-10-02 13:39:12 +00:00
|
|
|
|
2021-07-27 09:58:43 +02:00
|
|
|
/* Install exception handler */
|
|
|
|
|
sc = ppc_exc_set_handler( ASM_EXT_VECTOR, qemuppc_exception_handler);
|
|
|
|
|
_Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
|
2009-10-02 13:39:12 +00:00
|
|
|
}
|