📄 intr.c
字号:
//
// Copyright(C) Renesas Technology Corp. 2005. All rights reserved.
//
// NK Kernel for ITS-DS7
//
// FILE : intr.c
// CREATED : 2005.08.10
// MODIFIED :
// AUTHOR : Renesas Technology Corp.
// HARDWARE : RENESAS ITS-DS7
// HISTORY :
// 2005.08.10
// - Created release code.
// (based on SMDK2410/MAINSTONEII for WCE5.0)
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
// File: intr.h
//
// This file contains ITS-DS7 board specific interrupt code. The board uses
// as interrupt for SMSC111 ethernet chip.
//
#include <bsp.h>
#include "oalintr.h"
#include "its_ds7.h"
//------------------------------------------------------------------------------
//
// Function: BSPIntrInit
//
BOOL BSPIntrInit()
{
OALMSG(OAL_INTR&&OAL_FUNC, (L"+BSPIntrInit\r\n"));
// IRQ0 - SYSTEM FPGA(LAN,PCMCIA)
OALIntrStaticTranslate(SYSINTR_ETHER, 0);
OALMSG(OAL_INTR&&OAL_FUNC, (L"-BSPIntrInit(rc = 1)\r\n"));
return TRUE;
}
//------------------------------------------------------------------------------
BOOL BSPIntrRequestIrqs(DEVICE_LOCATION *pDevLoc, UINT32 *pCount, UINT32 *pIrqs)
{
BOOL rc = FALSE;
OALMSG(OAL_INTR&&OAL_FUNC, (L"+BSPIntrRequestIrq\r\n"));
// Check for input params
if (pIrqs == NULL || pCount == NULL || *pCount < 1) goto Done;
switch (pDevLoc->IfcType) {
case Internal:
switch ((ULONG)pDevLoc->LogicalLoc) {
case (PF_ETHER_BASE):
pIrqs[0] = 0;
*pCount = 1;
rc = TRUE;
break;
}
break;
}
Done:
OALMSG(OAL_INTR&&OAL_FUNC, (L"-BSPIntrRequestIrq(rc = 1)\r\n"));
return rc;
}
//------------------------------------------------------------------------------
//
// Function: BSPIntrEnableIrq
//
// This function is called from OALIntrEnableIrq to enable interrupt on
// secondary interrupt controller.
//
UINT32 BSPIntrEnableIrq(UINT32 irq)
{
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+BSPIntrEnableIrq(%d)\r\n", irq));
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-BSPIntrEnableIrq(irq = %d)\r\n", irq));
return irq;
}
//------------------------------------------------------------------------------
//
// Function: BSPIntrDisableIrq
//
// This function is called from OALIntrDisableIrq to disable interrupt on
// secondary interrupt controller.
//
UINT32 BSPIntrDisableIrq(UINT32 irq)
{
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+BSPIntrDisableIrq(%d)\r\n", irq));
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-BSPIntrDisableIrq(irq = %d\r\n", irq));
return irq;
}
//------------------------------------------------------------------------------
//
// Function: BSPIntrDoneIrq
//
// This function is called from OALIntrDoneIrq to finish interrupt on
// secondary interrupt controller.
//
UINT32 BSPIntrDoneIrq(UINT32 irq)
{
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+BSPIntrDoneIrq(%d)\r\n", irq));
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-BSPIntrDoneIrq(irq = %d)\r\n", irq));
return irq;
}
//------------------------------------------------------------------------------
//
// Function: BSPIntrActiveIrq
//
// This function is called from interrupt handler to give BSP chance to
// translate IRQ in case of secondary interrupt controller.
//
UINT32 BSPIntrActiveIrq(UINT32 irq)
{
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+BSPIntrActiveIrq(%d)\r\n", irq));
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-BSPIntrActiveIrq(%d)\r\n", irq));
return irq;
}
//------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -