summaryrefslogtreecommitdiff
path: root/firmware/test/memory/memory-misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/memory/memory-misc.c')
-rw-r--r--firmware/test/memory/memory-misc.c44
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 */
22void 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 */
29void memory_set (void *target,int byte,unsigned int count)
30 {
31 while (count--)
32 *((char *)target)++ = (char)byte;
33 }
34
35void 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 }