aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-12-20 12:28:30 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2021-12-20 12:37:55 +0200
commitdc2e2cc9dc9d7790e23dd9a4ccc265d7bb6d76aa (patch)
treeee12863bb4aab536810bbe13638bf21317b37658 /arch/riscv/include
parent98255910aa82c27d04ba79704086eca2310b3075 (diff)
downloadkmi-dc2e2cc9dc9d7790e23dd9a4ccc265d7bb6d76aa.tar.gz
kmi-dc2e2cc9dc9d7790e23dd9a4ccc265d7bb6d76aa.zip
Added init back
Diffstat (limited to 'arch/riscv/include')
-rw-r--r--arch/riscv/include/csr.h9
-rw-r--r--arch/riscv/include/vmem.h8
2 files changed, 9 insertions, 8 deletions
diff --git a/arch/riscv/include/csr.h b/arch/riscv/include/csr.h
index 70e60bb..bd02b04 100644
--- a/arch/riscv/include/csr.h
+++ b/arch/riscv/include/csr.h
@@ -37,6 +37,9 @@
#define EXC_LOAD_PAGE_FAULT 13
#define EXC_STORE_PAGE_FAULT 15
+/* status CSR bits */
+#define SSTATUS_SUM (1 << 18)
+
/* directly lifted from Linux:/arch/riscv/include/asm/asm.h:9-13 */
#ifdef __ASSEMBLY__
#define __ASM_STR(x) x
@@ -50,4 +53,10 @@
#define csr_write(csr, val)\
__asm__ ("csrw " __ASM_STR(csr) ", %0" : : "rK" (val) : "memory")
+#define csr_set(csr, val)\
+ __asm__ ("csrs " __ASM_STR(csr) ", %0" : : "rK" (val) : "memory")
+
+#define csr_clear(csr, val)\
+ __asm__ ("csrc " __ASM_STR(csr) ", %0" : : "rK" (val) : "memory")
+
#endif /* APOS_CSR_H */
diff --git a/arch/riscv/include/vmem.h b/arch/riscv/include/vmem.h
index 2cd3ac7..d17aaf1 100644
--- a/arch/riscv/include/vmem.h
+++ b/arch/riscv/include/vmem.h
@@ -3,7 +3,6 @@
#include <apos/types.h>
#include <apos/attrs.h>
-#include <apos/pmem.h>
#define VM_V (1 << 0)
#define VM_R (1 << 1)
@@ -25,11 +24,4 @@ struct __packed vm_branch_t {
struct vm_branch_t *leaf[512];
};
-
-void map_vmem(struct vm_branch_t *b,
- pm_t paddr, vm_t vaddr, uint8_t flags, enum mm_order_t order);
-
-void unmap_vmem(struct vm_branch_t *b,
- vm_t vaddr, enum mm_order_t order);
-
#endif /* APOS_RISCV_VMAP_H */