PiegOS/kernel/Helpers/memory.cpp

24 lines
289 B
C++
Raw Normal View History

2015-07-20 20:06:20 +04:00
#include "./memory.hpp"
#include "./types.hpp"
2015-07-21 14:23:57 +04:00
int memcpy(u32 source, u32 dest, u32 size){
2015-07-20 20:06:20 +04:00
2015-07-21 14:23:57 +04:00
u32 *sourceTmp=(u32 *)source;
u32 *destTmp=(u32 *)dest;
2015-07-20 20:06:20 +04:00
2015-07-21 14:23:57 +04:00
u32 progress=0;
2015-07-20 20:06:20 +04:00
while(progress != size){
*destTmp=*sourceTmp;
sourceTmp++;
destTmp++;
progress++;
}
return progress;
}