/* memory copy routine impletemented using DCP channel 1 
@para dst pointer to destination address @para src pointer to source address @para size bytes to copy  */
int dcp_memcpy(void *dst, void *src, uint32_t size)
/* memory copy routine impletemented using DCP channel 1 
@para dst pointer to destination address @para src pointer to source address @para size bytes to copy  */
int dcp_memcpy(void *dst, void *src, uint32_t size)
{
    dcp_work_pkt_p pkt = (dcp_work_pkt_p)malloc(sizeof(dcp_work_pkt_t));
    pkt->next_pkt = 0;
    pkt->ctrl0.U = 0;
    pkt->ctrl0.B.ENABLE_MEMCOPY = 1;
    pkt->ctrl0.B.DECR_SEMAPHORE = 1;
    pkt->ctrl0.B.ENABLE_BLIT = 0;
    pkt->ctrl0.B.INTERRUPT = 1;
    pkt->ctrl1.U = 0;
    pkt->dst_buf = dst;
    pkt->src_buf = src;
    pkt->buf_size = size;
    HW_DCP_CHnCMDPTR_WR(DCP_CHANNEL_1, (unsigned int)pkt);
    dcp_start_channel(DCP_CHANNEL_1, 1);
    dcp_wait_channel_cmpl(DCP_CHANNEL_1);
    free(pkt);
    return 0;
}