#ifndef __OSP_RFM_INTERFACE_H__ #define __OSP_RFM_INTERFACE_H__ /************************************************************************************/ /* shell相关接口定义 */ /************************************************************************************/ /* shell命令回调函数类型 */ typedef unsigned long (*OSP_FUNCPTR)(); /* 函数名称:spu_insert_cmd_ext 函数入参:name : shell命令,命令字格式:命令_ape,比如显示任务信息:i_ape,命令字不要超过7个字节 函数入参:pfunc : 对应shell命令的回调函数 函数入参:desc : 对应shell命令的描述 函数入参:argnum : 对应shell命令的参考个数 函数功能:动态注册shell命令 */ void spu_insert_cmd_ext(char *name, OSP_FUNCPTR pfunc, char *desc, uint32_t argnum); /************************************************************************************/ /* 调试信息输出相关 */ /************************************************************************************/ /* 函数名称:osp_sendLog 函数入参:level,固定传1 函数入参:pbuf,申请的buf地址,osp_msg_head预留 函数入参:size,消息大小 函数入参:cell_id,小区标识 函数功能:调试信息输出(字符串型接口) */ void osp_sendLog(int level, char* pbuf, int size, int cell_id); /* 函数名称:osp_sendLog_print 函数入参:level,固定传1 函数入参:pbuf,申请的buf地址,osp_msg_head预留 函数入参:size,消息大小 函数入参:cell_id,小区标识 函数功能:调试信息输出(二进制型接口) */ void osp_sendLog_print(int level,char* pbuf, int size, int cell_id); /************************************************************************************/ /* 消息通信相关接口 */ /************************************************************************************/ /* calback function type */ typedef void(*ECS_HWQUE_IRQ_FUNC)(); /* 函数名称:osp_alloc_msg 函数入参:size,消息大小 函数功能:申请核间消息内存空间(DDR) */ char *osp_alloc_msg(int size); /* 函数名称:osp_send_msg 函数入参:msg_addr,消息地址 函数入参:msg_len,消息长度 函数入参:msg_type,消息类型 函数入参:src_core_id,源核ID 函数入参:dst_core_id,目的核ID 函数入参:src_task_id,源任务ID 函数入参:dst_task_id,目的任务ID 函数功能:将消息通过硬件队列发给到指定硬件队列中 */ int32_t osp_send_msg(uint32_t msg_addr, uint32_t msg_len, uint8_t msg_type, uint8_t src_core_id, uint8_t dst_core_id, uint8_t src_task_id, uint8_t dst_task_id); /* hw queue callback function */ /* 函数名称:ecs_hw_que_irq_callback 函数入参:func,回调函数 函数功能:当指定硬件队列收到消息时,调用回调函数进行后续处理 */ void ecs_hw_que_irq_callback(ECS_HWQUE_IRQ_FUNC func); /* 函数名称:spu_get_oam_handle_id 函数入参:inst_id,小区编号(0/1) 函数功能:根据小区编号,返回对应的OAM队列的handle_id */ int32_t spu_get_oam_handle_id(uint8_t inst_id); /************************************************************************************/ /* 其他相关接口 */ /************************************************************************************/ /* 函数名称:osp_heap_malloc 函数功能:从DDR里分配内存 函数参数:size :需要分配的内存空间 函数返回值:分配到的DDR内存地址 */ extern char *osp_heap_malloc(uint32_t size); /* 函数名称:osp_heap_free 函数功能:释放DDR里分配内存 函数参数:需要释放的内存空间 函数返回值:无 */ extern void osp_heap_free(char *p); #endif