summaryrefslogtreecommitdiff
path: root/kernel/memory/virtalloc.h
blob: a5ca84030b5578e9ad13bd7ed5f56a3b64979f97 (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
/**
 * @file virtalloc.h
 *
 * @author Freya Murphy <freya@freyacat.org>
 *
 * Virtural address allocator functions
 */

#ifndef VIRTALLOC_H_
#define VIRTALLOC_H_

/**
 * Initalizes the virtual address allocator
 */
void virtaddr_init(void);

/**
 * Allocate a virtual address of length x pages
 * @param pages - x pages
 * @returns virt addr
 */
void *virtaddr_alloc(int pages);

/**
 * Free the virtual address from virtaddr_alloc
 * @param virtaddr - the addr to free
 * @returns number of pages used for virtaddr
 */
long virtaddr_free(void *virtaddr);

#endif /* virtalloc.h */