diff options
author | Alan Korr <alkorr@rockbox.org> | 2002-04-17 13:01:09 +0000 |
---|---|---|
committer | Alan Korr <alkorr@rockbox.org> | 2002-04-17 13:01:09 +0000 |
commit | e0ae9dc0081033be009d3e60b043e89e1e8d243f (patch) | |
tree | 930cf3c912d3d91ea345a1fbfdc60e9c3131408f /firmware/test/memory/memory-misc.c | |
parent | 8a421390916414f37dd411aeff8748f3c1520bc2 (diff) | |
download | rockbox-e0ae9dc0081033be009d3e60b043e89e1e8d243f.tar.gz rockbox-e0ae9dc0081033be009d3e60b043e89e1e8d243f.zip |
Please don't try to compile them... they need to be fixed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@118 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test/memory/memory-misc.c')
-rw-r--r-- | firmware/test/memory/memory-misc.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/firmware/test/memory/memory-misc.c b/firmware/test/memory/memory-misc.c new file mode 100644 index 0000000000..551b0a28c5 --- /dev/null +++ b/firmware/test/memory/memory-misc.c | |||
@@ -0,0 +1,44 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: | ||
9 | * | ||
10 | * Copyright (C) 2002 by Alan Korr | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include <memory.h> | ||
20 | |||
21 | /* NOT VERY OPTIMIZED AT ALL BUT WE WILL DO IT WHEN PRIORITY COMES */ | ||
22 | void memory_copy (void *target,void const *source,unsigned int count) | ||
23 | { | ||
24 | while (count--) | ||
25 | *((char *)target)++ = *((char const *)source)++; | ||
26 | } | ||
27 | |||
28 | /* NOT VERY OPTIMIZED AT ALL BUT WE WILL DO IT WHEN PRIORITY COMES */ | ||
29 | void memory_set (void *target,int byte,unsigned int count) | ||
30 | { | ||
31 | while (count--) | ||
32 | *((char *)target)++ = (char)byte; | ||
33 | } | ||
34 | |||
35 | void memory_setup (void) | ||
36 | { | ||
37 | #if 1 | ||
38 | memory_set (free_page,0,MEMORY_TOTAL_BYTES); | ||
39 | memory_set (free_page_bin,0,MEMORY_TOTAL_ORDERS *sizeof (struct memory_free_page *)); | ||
40 | memory_set (free_page_order + 1,0,MEMORY_TOTAL_PAGES); | ||
41 | #endif | ||
42 | free_page_order[0] = MEMORY_TOTAL_ORDERS - 1; | ||
43 | free_page_bin[MEMORY_TOTAL_ORDERS - 1] = free_page; | ||
44 | } | ||