diff options
author | Xander <xander@biltopia.org> | 2023-08-19 19:47:30 +0200 |
---|---|---|
committer | Xander <xander@biltopia.org> | 2023-08-19 21:26:28 +0200 |
commit | 5e0dafa7cfbb90c941fc771f0d157cf13dc1aa91 (patch) | |
tree | ca2810bcc0d2261f98580723de43018e2d82c646 /kernel/memory/paging/table.sats | |
parent | a76c89dc3932f0b5e60ff871b08f4bc745727ae4 (diff) | |
download | ats-os-5e0dafa7cfbb90c941fc771f0d157cf13dc1aa91.tar.xz ats-os-5e0dafa7cfbb90c941fc771f0d157cf13dc1aa91.zip |
implement table
Diffstat (limited to 'kernel/memory/paging/table.sats')
-rw-r--r-- | kernel/memory/paging/table.sats | 19 |
1 files changed, 19 insertions, 0 deletions
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 -<lin,prf> 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)) |