7 #include <linux/list.h>
8 #include <linux/slab.h>
13 #define STATUS_ALLOCATED 1
15 #ifdef CONFIG_ETRAX_L2CACHE
16 #define RESERVED_SIZE 66*1024
18 #define RESERVED_SIZE 0
29 static struct list_head intmem_allocations;
30 static void* intmem_virtual;
32 static void crisv32_intmem_init(
void)
34 static int initiated = 0;
38 INIT_LIST_HEAD(&intmem_allocations);
56 crisv32_intmem_init();
60 alignment = alignment ? align - alignment :
alignment;
63 allocation->
size >= size + alignment) {
64 if (allocation->
size > size + alignment) {
68 alloc->
size = allocation->
size - size -
87 ret = (
void*)((
int)intmem_virtual + allocation->
offset);
103 crisv32_intmem_init();
106 if (allocation->
offset == (
int)(addr - intmem_virtual)) {
116 if ((prev != &intmem_allocations) &&
123 if ((next != &intmem_allocations) &&
139 (
unsigned long)intmem_virtual);
144 return (
unsigned long)((
unsigned long )addr -