/* ============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ===========================================================================
*/
#ifndef _CSL_INTC0_H_
#define _CSL_INTC0_H_
#include <csl_types.h>
#include <csl_error.h>
#include <cslr_intc0.h>
/**************************************************************************\
* INTC0 global macro declarations
\**************************************************************************/
/**************************************************************************\
* INTC0 global typedef declarations
\**************************************************************************/
/* ARM processor modes */
typedef enum {
_CSL_INTC0_MODE_USR = 0x10,
_CSL_INTC0_MODE_FIQ = 0x11,
_CSL_INTC0_MODE_IRQ = 0x12,
_CSL_INTC0_MODE_SVC = 0x13,
_CSL_INTC0_MODE_ABT = 0x17,
_CSL_INTC0_MODE_UND = 0x1B,
_CSL_INTC0_MODE_SYS = 0x1F
} _CSL_Intc0Mode;
/* ARM CPU exceptions */
typedef enum {
_CSL_INTC0_EXCP_RESET = 0,
_CSL_INTC0_EXCP_UNDEF = 1,
_CSL_INTC0_EXCP_SWI = 2,
_CSL_INTC0_EXCP_PREABT = 3,
_CSL_INTC0_EXCP_DATABT = 4,
_CSL_INTC0_EXCP_IRQ = 6,
_CSL_INTC0_EXCP_FIQ = 7
} _CSL_Intc0Exception;
/* IRQ exception enable/disable state */
typedef enum {
_CSL_INTC0_IRQSTATE_ENABLE = 0,
_CSL_INTC0_IRQSTATE_DISABLE = 1
} _CSL_Intc0IrqEnableState;
/* FIQ exception enable/disable state */
typedef enum {
_CSL_INTC0_FIQSTATE_ENABLE = 0,
_CSL_INTC0_FIQSTATE_DISABLE = 1
} _CSL_Intc0FiqEnableState;
/**************************************************************************\
* INTC0 global function declarations
\**************************************************************************/
/*
* ======================================================
* @func csl_intc0EnableIRQ.c
* @desc Enable IRQ exception
*
*
* @ret IrqEnableState
*
* Enable IRQ exception
*
*
* @eg
* Enable IRQ exception
*
*
* ======================================================
*/
_CSL_Intc0IrqEnableState _CSL_intc0EnableIRQ(
void
);
/*
* ======================================================
* @func csl_intc0DisableIRQ.c
* @desc Disable IRQ exception
*
*
* @ret IrqEnableState
*
* Disable IRQ exception
*
*
* @eg
* Disable IRQ exception
*
*
* ======================================================
*/
_CSL_Intc0IrqEnableState _CSL_intc0DisableIRQ(
void
);
/*
* ======================================================
* @func csl_intc0RestoreIRQ.c
* @desc Disable IRQ exception
*
*
* @arg prevState
* the enable-state to restore to
* @ret IrqEnableState
*
* Restore the IRQ exception enable-state
*
*
* @eg
* Restore the IRQ exception enable-state
*
*
* ======================================================
*/
_CSL_Intc0IrqEnableState _CSL_intc0RestoreIRQ(
_CSL_Intc0IrqEnableState prevState
);
/*
* ======================================================
* @func csl_intc0EnableFIQ.c
* @desc Enable FIQ exception
*
*
* @ret FiqEnableState
*
* Enable FIQ exception
*
*
* @eg
* Enable FIQ exception
*
*
* ======================================================
*/
_CSL_Intc0FiqEnableState _CSL_intc0EnableFIQ(
void
);
/*
* ======================================================
* @func csl_intc0DisableFIQ.c
* @desc Disable FIQ exception
*
*
* @ret FiqEnableState
*
* Disable FIQ exception
*
*
* @eg
* Disable FIQ exception
*
*
* ======================================================
*/
_CSL_Intc0FiqEnableState _CSL_intc0DisableFIQ(
void
);
/*
* ======================================================
* @func csl_intc0RestoreFIQ.c
* @desc Disable FIQ exception
*
*
* @arg prevState
* the enable-state to restore to
* @ret FiqEnableState
*
* Restore the FIQ exception enable-state
*
*
* @eg
* Restore the FIQ exception enable-state
*
*
* ======================================================
*/
_CSL_Intc0FiqEnableState _CSL_intc0RestoreFIQ(
_CSL_Intc0FiqEnableState prevState
);
/**************************************************************************\
* INTC0 inline function declarations
\**************************************************************************/
inline void _CSL_intc0Init(
void
);
inline void _CSL_intc0HookVector(
_CSL_Intc0Exception exception,
void *handler
);
/**************************************************************************\
* INTC0 inline function definitions
\**************************************************************************/
inline void _CSL_intc0Init(
void
)
{
}
/*------------------------------------------------------------------------*/
inline void _CSL_intc0HookVector(
_CSL_Intc0Exception exception,
void * handler
)
{
int *AddrFIQ;
int *AddrIRQ;
AddrIRQ = (int *)0x34;
AddrFIQ = (int *)0x38;
if (exception == _CSL_INTC0_EXCP_IRQ)
*AddrIRQ = (int)handler;
if (exception == _CSL_INTC0_EXCP_FIQ)
*AddrFIQ = (int)handler;
}
/*------------------------------------------------------------------------*/
#endif
_csl_intc0.zip_The Program
版权申诉
196 浏览量
2022-09-20
20:24:36
上传
评论
收藏 1KB ZIP 举报
钱亚锋
- 粉丝: 88
- 资源: 1万+
最新资源
- DHCP+NAPT+RIP+ACL
- Qt实战Qt项目(7)Qt实现网页浏览器
- Unity-WebGL配置系统教程(含iis本地部署)
- GIS图幅号计算工具,用于计算图幅号
- Python中Hadoop MapReduce的一个简单示例.zip
- Panoply软件是大名鼎鼎的NASA下属的GISS研究所开发的可视化软件,该软件可以实现对地学常用数据的读取,其中包括netC
- 一些高质量的学习Ruby的资源清单.zip
- 基于STM32智能家居(智能云)
- 适合江苏地带的别墅小院子图纸D038-两层-11.04&11.94米-施工图.dwg
- 农村小别墅图纸四合院图纸D037-两层-13.20&12.90米-施工图.dwg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈