yb_arm/app/src/msg_transfer_mem.c
2023-07-12 14:14:31 +08:00

51 lines
1.4 KiB
C

// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : .c
// Author : xianfeng.du
// Created On : 2022-07-22
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include <string.h>
#include "mem_sections.h"
#include "msg_transfer_queue.h"
#include "ucp_printf.h"
#include "ucp_utility.h"
#include "ucp_handshake.h"
#include "ospHeap.h"
#include "pet_sm_mgt.h"
MsgQueueLocalMgt_t gMsgQueueLocalMgt;
MsgQueueLocalMgt_t* get_msg_queue_local_mgt(void)
{
return (MsgQueueLocalMgt_t *)&gMsgQueueLocalMgt;
}
void msg_transfer_mem_init(void)
{
UCP_PRINT_LOG("start initializing memory,limit[%lu]",sizeof(MsgQueueLocalMgt_t));
uint64_t length;
uint8_t* ptr = (uint8_t *)get_static_mem(ARM_APE_MSG,(uint64_t *)&length);
MEM_SECTION_INFO* pMemSection = GetMsgDdrSection();
memSectionInit(pMemSection, (uint64_t)ptr, (uint32_t)length, pMemSection->memSectionName);
MsgQueueLocalMgt_t* pMsgQueueLocalMgt = get_msg_queue_local_mgt();
memset((void *)pMsgQueueLocalMgt,0,sizeof(MsgQueueLocalMgt_t));
pet_sm_alloc();
return;
}