# HG changeset patch # User Mychaela Falconia # Date 1445553335 0 # Node ID 8abeb95e9766d2718a2e85e8e674a4f496b7e1cf # Parent 428835f700ef515b547e3e64ef001ec690167c68 l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c diff -r 428835f700ef -r 8abeb95e9766 chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_func.c --- a/chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_func.c Thu Oct 22 17:21:37 2015 +0000 +++ b/chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_func.c Thu Oct 22 22:35:35 2015 +0000 @@ -130,6 +130,62 @@ *pp_src_mcu = (UWORD16 *) l1_apihisr.dyn_dwnld.running_source_pointer; } +/*--------------------------------------------------------*/ +/* l1_memcpy_16bit() */ +/*--------------------------------------------------------*/ +/* */ +/* Description: */ +/* ------------ */ +/* This function is equivalemt of memcopy. Thid function */ +/* does only 8/16 bit accessed to both source and */ +/* destination */ +/* */ +/* Input parameter: */ +/* --------------- */ +/* "src" - input pointer */ +/* "len" - number of bytes to copy */ +/* */ +/* Output parameter: */ +/* ---------------- */ +/* "dst" - output pointer */ +/* */ +/*--------------------------------------------------------*/ +void l1_memcpy_16bit(void *dst,void* src,unsigned int len) +{ + unsigned int i; + unsigned int tempLen; + unsigned char *cdst,*csrc; + unsigned short *ssrc,*sdst; + + cdst=dst; + csrc=src; + sdst=dst; + ssrc=src; + + if(((unsigned int)src&0x01) || ((unsigned int)dst&0x01)){ + // if either source or destination is not 16-bit aligned do the entire memcopy + // in 8-bit + for(i=0;i>1; + for(i=0;i