aboutsummaryrefslogtreecommitdiff
path: root/include/arch
diff options
context:
space:
mode:
Diffstat (limited to 'include/arch')
-rw-r--r--include/arch/arch.h8
-rw-r--r--include/arch/cpu.h10
-rw-r--r--include/arch/irq.h9
-rw-r--r--include/arch/vmem.h22
4 files changed, 49 insertions, 0 deletions
diff --git a/include/arch/arch.h b/include/arch/arch.h
new file mode 100644
index 0000000..1933555
--- /dev/null
+++ b/include/arch/arch.h
@@ -0,0 +1,8 @@
+#ifndef APOS_ARCH_H
+#define APOS_ARCH_H
+
+/* functions that an arch has to provide */
+
+void arch_setup(void *fdt);
+
+#endif /* APOS_ARCH_H */
diff --git a/include/arch/cpu.h b/include/arch/cpu.h
new file mode 100644
index 0000000..c53a4d6
--- /dev/null
+++ b/include/arch/cpu.h
@@ -0,0 +1,10 @@
+#ifndef APOS_CPU_H
+#define APOS_CPU_H
+
+#include <apos/types.h>
+#include <cpu.h>
+
+id_t cpu_id();
+/* TODO: add more cpu handling functions */
+
+#endif /* APOS_CPU_H */
diff --git a/include/arch/irq.h b/include/arch/irq.h
new file mode 100644
index 0000000..3ce6556
--- /dev/null
+++ b/include/arch/irq.h
@@ -0,0 +1,9 @@
+#ifndef APOS_IRQ_H
+#define APOS_IRQ_H
+
+void init_irq(void *fdt);
+void handle_irq();
+void enable_irq();
+void disable_irq();
+
+#endif /* APOS_IRQ_H */
diff --git a/include/arch/vmem.h b/include/arch/vmem.h
new file mode 100644
index 0000000..8aec154
--- /dev/null
+++ b/include/arch/vmem.h
@@ -0,0 +1,22 @@
+#ifndef APOS_ARCH_PAGES_H
+#define APOS_ARCH_PAGES_H
+
+#include <vmem.h>
+
+void map_vmem(struct vm_branch *branch,
+ pm_t paddr, vm_t vaddr, uint8_t flags, enum mm_order order);
+
+void unmap_vmem(struct vm_branch *branch, vm_t vaddr);
+
+int mod_vmem(struct vm_branch *branch, vm_t vaddr, pm_t paddr, uint8_t flags);
+int stat_vmem(struct vm_branch *branch, vm_t vaddr, pm_t *paddr,
+ enum mm_order *order, uint8_t *flags);
+
+void flush_tlb();
+void flush_tlb_all();
+
+void populate_root_branch(struct vm_branch *b);
+int setup_kernel_io(struct vm_branch *b, vm_t paddr);
+struct vm_branch *init_vmem(void *fdt);
+
+#endif /* APOS_ARCH_PAGES_H */