summaryrefslogtreecommitdiffstats
path: root/hal/memory.h
blob: 659263ccf1697db07df3a31625d942615d357d91 (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
#ifndef _JOVE_HAL_MEMORY_H
#define _JOVE_HAL_MEMORY_H 1

#include "obj.h"

typedef struct jove_obj_untyped
{
    size_t limit;
} jove_untyped_t;

#define JOVE_UNTYPED_MINSIZE 0x10

void mem_setup_untyped(void);

void *phys_tovirt(uintptr_t phys);

size_t untyped_size(jove_owned_obj_t *tgt);
size_t untyped_align(jove_owned_obj_t *tgt);

int untyped_split(jove_owned_obj_t *tgt, jove_owned_obj_t *dst, size_t bytes);
int untyped_merge(jove_owned_obj_t *a, jove_owned_obj_t *b);
int untyped_retype(jove_owned_obj_t *tgt, uint8_t newtype);

#endif