MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / lwp_memcpy

Function lwp_memcpy

components/lwp/lwp_user_mm.c:735–780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

733}
734
735void *lwp_memcpy(void * __restrict dst, const void * __restrict src, size_t size)
736{
737 void *rc = dst;
738 long len;
739
740 if (lwp_in_user_space(dst))
741 {
742 if (!lwp_in_user_space(src))
743 {
744 len = lwp_put_to_user(dst, (void *)src, size);
745 if (!len)
746 {
747 LOG_E("lwp_put_to_user(lwp=%p, dst=%p,src=%p,size=0x%lx) failed", lwp_self(), dst, src, size);
748 }
749 }
750 else
751 {
752 /* not support yet */
753 LOG_W("%s(dst=%p,src=%p,size=0x%lx): operation not support", dst, src, size, __func__);
754 }
755 }
756 else
757 {
758 if (lwp_in_user_space(src))
759 {
760 len = lwp_get_from_user(dst, (void *)src, size);
761 if (!len)
762 {
763 LOG_E("lwp_get_from_user(lwp=%p, dst=%p,src=%p,size=0x%lx) failed", lwp_self(), dst, src, size);
764 }
765 }
766 else
767 {
768 if (_can_unaligned_access(dst) && _can_unaligned_access(src))
769 {
770 rc = memcpy(dst, src, size);
771 }
772 else
773 {
774 rt_memcpy(dst, src, size);
775 }
776 }
777 }
778
779 return rc;
780}
781
782int lwp_user_accessible_ext(struct rt_lwp *lwp, void *addr, size_t size)
783{

Callers 10

lwp_argscopyFunction · 0.85
_sys_cloneFunction · 0.85
_sys_forkFunction · 0.85
sys_sigactionFunction · 0.85
sys_gethostbyname2_rFunction · 0.85
arch_kuser_initFunction · 0.85

Calls 6

lwp_in_user_spaceFunction · 0.85
lwp_put_to_userFunction · 0.85
lwp_selfFunction · 0.85
lwp_get_from_userFunction · 0.85
_can_unaligned_accessFunction · 0.85
rt_memcpyFunction · 0.85

Tested by

no test coverage detected