summaryrefslogtreecommitdiff
path: root/kernel/Helpers/memory.c
blob: 44c0e9072a07e5a54646ee9e9cb7a40e78fd3ac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "./memory.h"
#include "./types.h"

//Fonction to copy data into memory
int memcpy(u32 source, u32 dest, u32 size){

    //Init source and destination pointer
	u32 *sourceTmp=(u32 *)source;
	u32 *destTmp=(u32 *)dest;

    //Init progression
	u32 progress=0;

    //Start copy
	while(progress != size){

        //Copy
		*destTmp=*sourceTmp;

        //Update source and destination
		sourceTmp++;
		destTmp++;

        //Update progression
		progress++;
	}

    //End and return progression
	return progress;

}