aboutsummaryrefslogtreecommitdiff
path: root/triscv/src/tmb.c
blob: 950c9bf896981068b92ff4d07bf4294c835c79a4 (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
29
30
31
/* SPDX-License-Identifier: copyleft-next-0.3.1 */

#include <triscv/tmb.h>

struct map {
	vm_t to;
	tri_t val;
	size_t width;
	bool valid;
};

#define TMB_SIZE 3
struct tmb {
	struct map map[TMB_SIZE];
};

struct tmb *tmb_create()
{
	return calloc(1, sizeof(struct tmb));
}

void tmb_destroy(struct tmb *tmb)
{
	free(tmb);
}

size_t tmb_size(struct cpu *cpu)
{
	(void)cpu;
	return TMB_SIZE;
}