diff options
author | Alan Korr <alkorr@rockbox.org> | 2002-04-17 12:13:43 +0000 |
---|---|---|
committer | Alan Korr <alkorr@rockbox.org> | 2002-04-17 12:13:43 +0000 |
commit | 08dada2df506405d7fa7dc57a19d4a283f51162d (patch) | |
tree | 1f8ebdf5611bd3a86f774c163621a5c786dbab53 /firmware/test/memory/functions.h | |
parent | 87789d71547a7da37512690456f603d6e4d5be24 (diff) | |
download | rockbox-08dada2df506405d7fa7dc57a19d4a283f51162d.tar.gz rockbox-08dada2df506405d7fa7dc57a19d4a283f51162d.zip |
cosmetic changes and additions :
* now we have seperate private headers files
containing private and static or public functions
in memory-* files.
* there is only one .c file of the same name the library.
Zagor: because now there is only one .c file, you could only have a .o file and use it instead of the .a libfile.
* most structures and codes are now private.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@112 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test/memory/functions.h')
-rw-r--r-- | firmware/test/memory/functions.h | 64 |
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 | |||
24 | extern void memory_copy (void *target,void const *source,unsigned int count); | 29 | extern void memory_copy (void *target,void const *source,unsigned int count); |
25 | extern void memory_set (void *target,int byte,unsigned int count); | 30 | extern void memory_set (void *target,int byte,unsigned int count); |
26 | extern int memory_release_page (void *); | 31 | |
27 | extern 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 | |||
40 | extern int memory_release_page (void *address); | ||
41 | extern void *memory_allocate_page (int order); | ||
28 | extern void memory_setup (void); | 42 | extern 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 | |||
59 | extern struct memory_slab *memory_grow_cache (struct memory_cache *cache); | ||
60 | extern int memory_shrink_cache (struct memory_cache *cache,int all); | ||
61 | extern struct memory_cache *memory_create_cache (unsigned int size,int align,int flags); | ||
62 | extern int memory_destroy_cache (struct memory_cache *cache); | ||
63 | extern void *memory_cache_allocate (struct memory_cache *cache); | ||
64 | extern 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 | |||
79 | extern void *memory_allocate_small_block (int order); | ||
80 | extern int memory_release_small_block (int order,void *address); | ||
81 | extern void *memory_allocate_block (unsigned int size); | ||
82 | extern int memory_release_block (void *address); | ||
83 | |||
84 | // | ||
85 | ///////////////////////////////////////////////////////////////////// | ||
86 | |||
87 | |||
88 | |||
29 | # ifdef TEST | 89 | # ifdef TEST |
30 | void memory_spy_page (void *address); | 90 | void memory_spy_page (void *address); |
31 | void memory_dump (int order); | 91 | void memory_dump (int order); |