#ifndef __INTER_MSG_REG_H__ #define __INTER_MSG_REG_H__ #define FUN_IRQ_MAX_NUM 512 #define IRQ_MAX_NUM 32 #define IRQ_SYS_MASK_NUM 16 typedef unsigned int uint32_t; typedef unsigned int UINT32; typedef void (*irq_handler)(); typedef enum { all_irq, fun_s, fun_e, // clear_cnt_error, // irq_check_error }irq_cnt_type_t; typedef unsigned int uint32_t; typedef unsigned short uint16_t; typedef unsigned char uint8_t; typedef signed int int32_t; typedef struct { uint32_t reg_irq_cnt; //0x00 uint32_t reg_irq_val[IRQ_MAX_NUM]; //0x04-0x80 uint32_t reg_irq_cpu_id; //0x84 uint32_t irq_cnt; //0x88 uint32_t fun_start_cnt_all; //0x8c uint32_t fun_end_cnt_all; //0x90 uint32_t cur_irq_num; //0x94 uint32_t fun_run_cnt[FUN_IRQ_MAX_NUM]; //0x98-0x894 // uint32_t last_irq_num; //0x8a4 uint32_t irq_sys_mask[IRQ_SYS_MASK_NUM]; //0x898 -0x8d4 uint32_t irq_sys_status[IRQ_SYS_MASK_NUM]; //0x8d4 -0x914 uint32_t apc_csu_allpendevent0; //0x918 uint32_t apc_csu_intmaskl; //0x91c }irq_debug_t; /* 函数名称:smart_irq_request 输入参数: vector 输入参数:func 返回类型: int 返回值: 小于0 表示失败 返回值: 0 表示成功 函数功能: 中断注册接口 */ extern int smart_irq_request(uint32_t vector,irq_handler func); /* 函数名称:smart_irq_enable 输入参数: vector 返回类型: int 返回值: 小于0 表示失败 返回值: 0 表示成功 函数功能: 中断使能接口 */ extern int smart_irq_enable(uint32_t vector); /* 函数名称:smart_irq_disable 输入参数: vector 返回类型: int 返回值: 小于0 表示失败 返回值: 0 表示成功 函数功能: 中断去使能接口 */ extern int smart_irq_disable(uint32_t vector); /* 函数名称:smart_irq_debug_init 输入参数: debug_base_addr 输入参数:len_bytes 返回类型: int 返回值: 小于0 表示失败 返回值: 0 表示成功 函数功能: 中断调试接口, 注意: 通过地址与,长度指定相应的buf 数据空间,存放相应的中断调试信息。 这些调试信息已经格式化,地址由用户指定,len_bytes 不能小于sizeof(irq_debug_t) 数据格式化内容是 irq_debug_t */ extern int smart_irq_debug_init(uint32_t debug_base_addr, uint32_t len_bytes); /* 函数名称:smart_irq_get_type_cnt 输入参数: num_type 返回类型: int 返回值: 0 表示当前type 类型计数为0 返回值: 非0 表示当前type 类型有计数 函数功能: 获取某种中断计数 */ extern uint32_t smart_irq_get_type_cnt(irq_cnt_type_t num_type); /* 函数名称:smart_irq_get_run_cnt 输入参数: irq_num:中断号 返回类型: int 返回值: 小于0 表示获取失败。输入参数有问题 返回值: 为0 表示相应中断没有触发 返回值: 非0 表示中断产生的次数 函数功能:获取相应中断号的中断计数 */ extern int smart_irq_get_run_cnt(uint32_t irqnum); /* 函数名称:smart_get_cpuid 输入参数: 无 返回类型: int 返回值: 当前的cpuid 号 函数功能:获取当前核cpuid 号 */ extern int smart_get_cpuid(); /* 函数名称:smart_irq_init 输入参数: cpuid 返回类型: int 返回值: 非0 初始化失败 函数功能:中断初始化 */ extern int smart_irq_init(int cpuid); #endif