aboutsummaryrefslogtreecommitdiff
path: root/include/kern/mem.h
blob: 20b09bb07d115b262c446429d3f795aee9e4eb5c (plain) (blame)
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
#ifndef MEM_H_
#define MEM_H_

#include "arch.h"
#include <stddef.h>

void kalloc_init();

/* allocates memory on the head, which is stored in sram2 */
void* kalloc(size_t n);

/* Frees the memory allocated by kalloc. */
void kfree(void* mem);

#ifdef FOR_TESTING

void* debug_kalloc_get_next_ptr(void* ptr);

void* debug_kalloc_get_prev_ptr(void* ptr);

int debug_kalloc_assert_consistency(char* error, size_t len);

void debug_print_blocks();

#endif


#endif