summaryrefslogtreecommitdiff
path: root/firmware/test/memory/functions.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/memory/functions.h')
-rw-r--r--firmware/test/memory/functions.h64
1 files changed, 62 insertions, 2 deletions
diff --git a/firmware/test/memory/functions.h b/firmware/test/memory/functions.h
index e0f6aeac97..c856a934cf 100644
--- a/firmware/test/memory/functions.h
+++ b/firmware/test/memory/functions.h
@@ -21,11 +21,71 @@
21#endif 21#endif
22# ifndef __LIBRARY_MEMORY_FUNCTIONS_H__ 22# ifndef __LIBRARY_MEMORY_FUNCTIONS_H__
23# define __LIBRARY_MEMORY_FUNCTIONS_H__ 23# define __LIBRARY_MEMORY_FUNCTIONS_H__
24
25/////////////////////////////////////////////////////////////////////
26// MEMORY :
27///////////
28
24extern void memory_copy (void *target,void const *source,unsigned int count); 29extern void memory_copy (void *target,void const *source,unsigned int count);
25extern void memory_set (void *target,int byte,unsigned int count); 30extern void memory_set (void *target,int byte,unsigned int count);
26extern int memory_release_page (void *); 31
27extern void *memory_allocate_page (int); 32/////////////////////////////////////////////////////////////////////
33// MEMORY PAGE :
34////////////////
35//
36// - memory_allocate_page : allocate a page
37// - memory_release_page : release a page
38//
39
40extern int memory_release_page (void *address);
41extern void *memory_allocate_page (int order);
28extern void memory_setup (void); 42extern void memory_setup (void);
43
44//
45/////////////////////////////////////////////////////////////////////
46
47/////////////////////////////////////////////////////////////////////
48// MEMORY SLAB :
49////////////////
50//
51// - memory_grow_cache : allocate a new slab for a cache
52// - memory_shrink_cache : release free slabs from a cache
53// - memory_create_cache : create a new cache of size-fixed blocks
54// - memory_destroy_cache : destroy the cache and release all the slabs
55// - memory_cache_allocate : allocate a block from the cache
56// - memory_cache_release : release a block in the cache
57//
58
59extern struct memory_slab *memory_grow_cache (struct memory_cache *cache);
60extern int memory_shrink_cache (struct memory_cache *cache,int all);
61extern struct memory_cache *memory_create_cache (unsigned int size,int align,int flags);
62extern int memory_destroy_cache (struct memory_cache *cache);
63extern void *memory_cache_allocate (struct memory_cache *cache);
64extern int memory_cache_release (struct memory_cache *cache,void *address);
65
66//
67/////////////////////////////////////////////////////////////////////
68
69///////////////////////////////////////////////////////////////////////////////
70// MEMORY BLOCK :
71/////////////////
72//
73// - memory_allocate_small_block : allocate a small block (no page)
74// - memory_release_small_block : release a small block (no page)
75// - memory_allocate_block : allocate a block (or a page)
76// - memory_release_block : release a block (or a page)
77//
78
79extern void *memory_allocate_small_block (int order);
80extern int memory_release_small_block (int order,void *address);
81extern void *memory_allocate_block (unsigned int size);
82extern int memory_release_block (void *address);
83
84//
85/////////////////////////////////////////////////////////////////////
86
87
88
29# ifdef TEST 89# ifdef TEST
30void memory_spy_page (void *address); 90void memory_spy_page (void *address);
31void memory_dump (int order); 91void memory_dump (int order);