aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/include/pages.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-08-25 23:47:08 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2021-08-25 23:47:08 +0300
commit5dfac4879ce5f34503ae7537eefd3fc48d6fa750 (patch)
tree7ac25f1a14373ae08ea6aa2406d8f83026dba74a /arch/riscv/include/pages.h
parentb235f49f31d11e68019c42f48b6641c37e4c986e (diff)
downloadkmi-5dfac4879ce5f34503ae7537eefd3fc48d6fa750.tar.gz
kmi-5dfac4879ce5f34503ae7537eefd3fc48d6fa750.zip
libfdt seems to work
At least as far as reading memory info, cool. One issue I have is that .(ro)data is apparently accessed by absolute addresses, so I need to know at which address the kernel is going to be loaded. I would prefer completely position independent code, but if that's not possible then eh.
Diffstat (limited to 'arch/riscv/include/pages.h')
-rw-r--r--arch/riscv/include/pages.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/arch/riscv/include/pages.h b/arch/riscv/include/pages.h
index 4ae2ab9..9e16c00 100644
--- a/arch/riscv/include/pages.h
+++ b/arch/riscv/include/pages.h
@@ -1,36 +1,40 @@
#ifndef APOS_RISCV_PAGES_H
#define APOS_RISCV_PAGES_H
-typedef char pagemask_t;
-typedef char lockbit_t;
+#include <apos/types.h>
-struct kilopages {
+typedef uint8_t pagemask_t;
+typedef uint8_t lockbit_t;
+/* assume riscv64 for now */
+typedef uint64_t pm_t;
+
+struct mm_kpages {
pagemask_t page[64];
};
-struct megapages {
+struct mm_mpages {
lockbit_t lockbit[64];
pagemask_t empty[64];
pagemask_t full[64];
- struct kilopages kilo[512];
+ struct mm_kpages kilo[512];
};
/* Sv39 */
-struct gigapages {
+struct mm_gpages {
lockbit_t lockbit[64];
pagemask_t empty[64];
pagemask_t full[64];
- struct megapages mega[512];
+ struct mm_mpages mega[512];
};
-struct terapages {
+struct mm_tpages {
lockbit_t lockbit[64];
pagemask_t empty[64];
pagemask_t full[64];
- struct gigapages giga[512];
+ struct mm_gpages giga[512];
};
-struct mm_pagearr_info {
+struct mm_ptinfo {
short tera_num;
struct terapages *tera_top;