blob: 4e2add1e81850ebadcc350874453c68f7f380fcc [file] [log] [blame]
/*******************************************************************************
* Copyright (C) 2018 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to use this Software with Cadence processor cores only and
* not with any other processors and platforms, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************/
/*******************************************************************************
* xf-isr.c
*
* DSP processing framework - code running from interrupt context
*
******************************************************************************/
#define MODULE_TAG ISR
/*******************************************************************************
* Includes
******************************************************************************/
#include "xf.h"
/*******************************************************************************
* API functions definitions
******************************************************************************/
/* ...submit command message from interrupt context on local core */
void xf_msg_schedule_isr(xf_message_t *m)
{
u32 core = XF_MSG_DST_CORE(m->id);
xf_core_data_t *cd = XF_CORE_DATA(core);
/* ...interrupt masking protocol is used for protecting local message queue */
if (xf_msg_enqueue(&cd->queue, m))
{
/* ...resume local scheduler if that is the first message */
xf_ipi_resume(core);
}
}
/* ...complete message from interrupt handler */
void xf_msg_complete_isr(xf_message_t *m)
{
u32 core = XF_MSG_DST_CORE(m->id);
xf_core_data_t *cd = XF_CORE_DATA(core);
/* ...place message into response queue */
if (xf_msg_enqueue(&cd->response, m))
{
/* ...notify local scheduler if that is the first message */
xf_ipi_resume(core);
}
}