blob: 7afe9983c082aa310d0d8d7d4510639864970afe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/**
* @file physalloc.h
*
* @author Freya Murphy <freya@freyacat.org>
*
* Physical page allocator functions
*/
#ifndef PHYSALLOC_H_
#define PHYSALLOC_H_
#include <comus/memory.h>
/**
* Initalize the physical page allocator
*/
void physalloc_init(struct memory_map *map);
/**
* Allocates a single physical page in memory
* @preturns the physical address of the page
*/
void *alloc_phys_page(void);
/**
* Allocates count physical pages in memory
* @returns the physical address of the first page
*/
void *alloc_phys_pages(int count);
/**
* Frees a single physical page in memory
* @param ptr - the physical address of the page
*/
void free_phys_page(void *ptr);
/**
* Frees count physical pages in memory
* @param ptr - the physical address of the first page
* @param count - the number of pages in the list
*/
void free_phys_pages(void *ptr, int count);
#endif /* physalloc.h */
|