From be78fcb0acc665d4db8edb9cda53f6863d27dd85 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 7 Jan 2022 16:32:05 +0200 Subject: Improved header dependency tree --- include/arch/arch.h | 8 ++++++++ include/arch/cpu.h | 10 ++++++++++ include/arch/irq.h | 9 +++++++++ include/arch/vmem.h | 22 ++++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 include/arch/arch.h create mode 100644 include/arch/cpu.h create mode 100644 include/arch/irq.h create mode 100644 include/arch/vmem.h (limited to 'include/arch') 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 +#include + +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 + +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 */ -- cgit v1.3