OSDN Git Service

First Commit
[vaneos/vaneosmain.git] / include / memory.h
1 /*
2
3 */
4
5 #ifndef _MEMORY_H_VANE_
6 #define _MEMORY_H_VANE_
7
8 #define MEMMAN_FREES    4090
9 #define MEMMAN_ADDR             0x003c0000
10 struct FREEINFO
11 {
12         unsigned int addr,size;
13 };
14
15 struct MEMMAN
16 {
17         int frees,maxfrees,lostsize,losts;
18         struct FREEINFO free[MEMMAN_FREES];
19 };
20
21 void memman_init(struct MEMMAN *man);
22 unsigned int memman_total(struct MEMMAN *man);
23 unsigned int memman_alloc(struct MEMMAN *man,unsigned int size);
24 int memman_free(struct MEMMAN *man,unsigned int addr,unsigned int size);
25 unsigned int memman_alloc_4k(struct MEMMAN* man,unsigned int size);
26 int memman_free_4k(struct MEMMAN* man,unsigned int addr,unsigned int size);
27 #endif