OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [libmem/] [mm/] [alloc_page.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
#ifndef __ALLOC_PAGE_H__
2
#define __ALLOC_PAGE_H__
3
 
4
#include <memcache/memcache.h>
5
 
6
/* List member to keep track of free and unused physical pages.
7
 * Has PAGE_SIZE granularity */
8
struct page_area {
9
        struct link list;
10
        unsigned int used;      /* Used or free */
11
        unsigned int pfn;       /* Base pfn */
12
        unsigned int numpages;  /* Number of pages this region covers */
13
        struct mem_cache *cache;/* The cache used when freeing the page area for
14
                                 * quickly finding where the area is stored. */
15
};
16
 
17
struct page_allocator {
18
        struct link page_area_list;
19
        struct link pga_cache_list;
20
        int pga_free;
21
};
22
 
23
/* Initialises the page allocator */
24
void init_page_allocator(unsigned long start, unsigned long end);
25
 
26
/* Page allocation functions */
27
void *alloc_page(int quantity);
28
int free_page(void *paddr);
29
 
30
#endif /* __ALLOC_PAGE_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.