summaryrefslogtreecommitdiff
path: root/firmware/test/alkorr/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/alkorr/memory.h')
-rw-r--r--firmware/test/alkorr/memory.h113
1 files changed, 0 insertions, 113 deletions
diff --git a/firmware/test/alkorr/memory.h b/firmware/test/alkorr/memory.h
deleted file mode 100644
index 37ec4c8c14..0000000000
--- a/firmware/test/alkorr/memory.h
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2//////////////////////////////////////////////////////////////////////////////////
3// __________ __ ___. //
4// Open \______ \ ____ ____ | | _\_ |__ _______ ___ //
5// Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / //
6// Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < //
7// Software |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ //
8// \/ \/ \/ \/ \/ //
9//////////////////////////////////////////////////////////////////////////////////
10//
11// $Id$
12//
13/////////////////////////////////////
14// Copyright (C) 2002 by Alan Korr //
15/////////////////////////////////////
16//
17// All files in this archive are subject to the GNU General Public License.
18// See the file COPYING in the source tree root for full license agreement.
19//
20// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
21// either express or implied.
22//
23//////////////////////////////////////////////////////////////////////////////////
24*/
25
26#ifndef __MEMORY_H__
27#define __MEMORY_H__
28
29enum
30{
31 MEMORY_RETURN_SUCCESS = 1,
32 MEMORY_RETURN_FAILURE = 0
33};
34
35/*
36/////////////////////////////////////////////////////////////////////
37// MEMORY PAGE //
38/////////////////
39//
40//
41*/
42
43#define MEMORY_PAGE_MINIMAL_ORDER ( 9) /* 512 bytes by default */
44#define MEMORY_PAGE_MAXIMAL_ORDER (21) /* 2 Mbytes by default */
45#define MEMORY_PAGE_MINIMAL_SIZE (1 << MEMORY_PAGE_MINIMAL_ORDER)
46#define MEMORY_PAGE_MAXIMAL_SIZE (1 << MEMORY_PAGE_MAXIMAL_ORDER)
47
48#define MEMORY_TOTAL_PAGES (MEMORY_PAGE_MAXIMAL_SIZE / MEMORY_PAGE_MINIMAL_SIZE)
49#define MEMORY_TOTAL_ORDERS (1 + MEMORY_PAGE_MAXIMAL_ORDER - MEMORY_PAGE_MINIMAL_ORDER)
50
51extern void *memory_page_allocate (int order);
52extern int memory_page_release (void *address);
53extern void memory_page_release_range (unsigned int start,unsigned int end);
54
55/*
56//
57/////////////////////////////////////////////////////////////////////
58
59/////////////////////////////////////////////////////////////////////
60// MEMORY CACHE //
61//////////////////
62//
63//
64*/
65
66struct memory_cache;
67
68extern struct memory_cache *memory_cache_create (unsigned int size,int align);
69extern int memory_cache_destroy (struct memory_cache *cache);
70extern void *memory_cache_allocate (struct memory_cache *cache);
71extern int memory_cache_release (struct memory_cache *cache,void *address);
72
73/*
74//
75//
76/////////////////////////////////////////////////////////////////////
77
78/////////////////////////////////////////////////////////////////////
79// MEMORY BLOCK //
80//////////////////
81//
82//
83*/
84
85extern void *memory_block_allocate (int order);
86extern int memory_block_release (int order,void *address);
87
88/*
89//
90//
91/////////////////////////////////////////////////////////////////////
92
93/////////////////////////////////////////////////////////////////////
94// MEMORY //
95////////////
96//
97//
98*/
99
100#define MEMORY_TOTAL_BYTES (MEMORY_PAGE_MAXIMAL_SIZE)
101
102extern void memory_copy (void *target,void const *source,unsigned int count);
103extern void memory_set (void *target,int byte,unsigned int count);
104
105extern void memory_setup (void);
106
107/*
108//
109//
110/////////////////////////////////////////////////////////////////////
111*/
112
113#endif