Files
2026-07-30 11:19:44 +05:30

148 lines
5.1 KiB
C

/*
******************************************************************************
* SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: sec4isr.c,v $ $Revision: 1.5 $
* $Source: /home/interpeak/CVSRoot/ipfreescale/sec4/sec4isr.c,v $
* $Author: dhessing $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
******************************************************************************
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/****************************************************************************
* sec4isr.c -- The Interrupt Service code for SEC4 Driver
* Based on sec2isr.c for SEC2 driver
****************************************************************************
* Copyright (c) Certicom Corp. 1996-2002. All rights reserved
* Copyright (c) 2003, 2004 Freescale Semiconductor
* All Rights Reserved. Proprietary and Confidential.
*
* NOTICE: The information contained in this file is proprietary
* to Freescale Semiconductor, and is being made available to
* Freescale's customers under strict license agreements.
* Use or disclosure of this information is permissible only
* under the terms of the existing license agreement.
****************************************************************************/
/*
* Revision History:
* 1.0 Mar 11,2011 - Based on sec2isr.c v1.2
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include "Sec4Driver.h"
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 EXTERN PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 7 LOCAL PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 8 DATA
****************************************************************************
*/
#ifdef SEC4_USE_SHARED_JOB_QUEUE
SEC4_GLOBAL t_sec4IpcMsg *sec4IpcVector;
SEC4_GLOBAL uint8_t sec4CoreId;
#endif
/*
****************************************************************************
* 9 LOCAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/**************************************************************************
* Function Name: InterruptServiceRoutine
* Purpose: To handle interrupt from the SEC4 job queue
* and call ProcessRequestDone routine
* Input: Interrupt - PKINTERRUPT
* Context - PVOID the request Context
*
*************************************************************************/
void InterruptServiceRoutine(t_Handle h_App,
void* p_JobDesc,
t_Handle h_Context,
uint32_t jobStatus)
{
static COMPLETED_JOB completedJob;
COMPLETED_JOB *pCompletedJob = &completedJob;
STATUS msgQStatus;
#ifdef SEC4_USE_SHARED_JOB_QUEUE
uint32_t submittingCoreID = 0;
#endif
pCompletedJob->jobStatus = jobStatus;
pCompletedJob->req = (GENERIC_REQ *) h_Context;
if(pCompletedJob->req == NULL)
{
/* TODO: If using a shared job queue, the calling task on that core could hang forever */
pCompletedJob->jobStatus = E_INVALID_HANDLE;
}
#ifdef SEC4_USE_SHARED_JOB_QUEUE
else
{
submittingCoreID = (uint32_t) pCompletedJob->req->coreId;
pCompletedJob->req->status = jobStatus;
/* Update shared IPC vector */
sec4IpcVector[submittingCoreID].state = SEC4_IPC_STATE_DONE;
}
#else
/* Send signal with completed job */
msgQStatus = msgQSend(IsrMsgQId, (char*) pCompletedJob, sizeof(COMPLETED_JOB), NO_WAIT, MSG_PRI_NORMAL);
#endif
} /* end of SEC4InterruptService */
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/