aboutsummaryrefslogtreecommitdiff
path: root/triscv/src/tmb.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-10-28 00:00:21 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-10-28 00:00:21 +0300
commitd96b8c7d12fc61ec609d6138627b9d6d18139a9a (patch)
tree82bc9a4c2b22de6c021097fb79a57b6d7756a127 /triscv/src/tmb.c
downloadtri-d96b8c7d12fc61ec609d6138627b9d6d18139a9a.tar.gz
tri-d96b8c7d12fc61ec609d6138627b9d6d18139a9a.zip
move to monorepo
+ Will probably have to make some changes to dir layout to make things make more sense
Diffstat (limited to 'triscv/src/tmb.c')
-rw-r--r--triscv/src/tmb.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/triscv/src/tmb.c b/triscv/src/tmb.c
new file mode 100644
index 0000000..3f6c037
--- /dev/null
+++ b/triscv/src/tmb.c
@@ -0,0 +1,29 @@
+#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;
+}