From 5e0dafa7cfbb90c941fc771f0d157cf13dc1aa91 Mon Sep 17 00:00:00 2001 From: Xander Date: Sat, 19 Aug 2023 19:47:30 +0200 Subject: implement table --- kernel/memory/paging/table.sats | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 kernel/memory/paging/table.sats (limited to 'kernel/memory/paging/table.sats') diff --git a/kernel/memory/paging/table.sats b/kernel/memory/paging/table.sats new file mode 100644 index 0000000..9a103f4 --- /dev/null +++ b/kernel/memory/paging/table.sats @@ -0,0 +1,19 @@ +#define ENTRY_COUNT 512 + +staload "./entry.sats" +staload "lib/SATS/valid.sats" +staload "lib/DATS/valid.dats" + +typedef table_t = @[entry_t][ENTRY_COUNT] + +vtypedef tablePtr1(c : int) = @{ + ptr = [l : agz] (table_t@l , table_t@l - void | ptr l), + level = (uint c | ) + } + +// Set all the entries in the table to unused (zero) +fn set_zero(&table_t): void + +fun get_P4() : tablePtr1(0) + +fun next_table{n : nat | n < 3}(tablePtr1(n), sizeLt(ENTRY_COUNT)) : Valid (tablePtr1(n+1)) -- cgit v1.2.3