aboutsummaryrefslogtreecommitdiff
path: root/include/arch
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-05 20:14:46 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-05 20:14:46 +0300
commit83a6fc687cab3ee87c6cae1324728521f9877ad0 (patch)
treec94d811e702c7bc517886052b42f4b27309ece98 /include/arch
parente09edb5d54e39bd9509a1dc450df5ab320759f97 (diff)
downloadkmi-83a6fc687cab3ee87c6cae1324728521f9877ad0.tar.gz
kmi-83a6fc687cab3ee87c6cae1324728521f9877ad0.zip
formatting and documentation
Diffstat (limited to 'include/arch')
-rw-r--r--include/arch/vmem.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/arch/vmem.h b/include/arch/vmem.h
index 238b12a..8f94e07 100644
--- a/include/arch/vmem.h
+++ b/include/arch/vmem.h
@@ -140,6 +140,14 @@ struct vmem *init_vmem(void *fdt);
vm_t setup_kernel_io(struct vmem *b, vm_t paddr);
#endif
+/**
+ * Create a direct mapping, with 1:1 physical addresses in one half of the
+ * address space and the kernel address space in the other.
+ * Called at boot, not allowed to allocate memory.
+ *
+ * @return The vmem node used to build the address space. Probably statically
+ * allocated.
+ */
struct vmem *direct_mapping();
/**
@@ -173,7 +181,19 @@ stat_t destroy_vmem(struct vmem *b);
*/
void clone_uvmem(struct vmem * restrict r, struct vmem * restrict b);
-__noreturn void to_kernelspace(void *fdt, uintptr_t load_addr,
- struct vmem *direct_mapping, pm_t ram_base,
+/**
+ * Jump into kernelspace from a physical address space.
+ * Really only called by main() during boot so the parameters are kind of weird.
+ *
+ * @param fdt Flattened devicetree.
+ * @param load_addr Address where kernel was loaded to.
+ * @param direct_mapping Direct mapping vmem.
+ * @param ram_base Physical base address of ram.
+ * @param dmap \ref VM_DMAP.
+ */
+__noreturn void to_kernelspace(void *fdt,
+ uintptr_t load_addr,
+ struct vmem *direct_mapping,
+ pm_t ram_base,
pm_t dmap);
#endif /* KMI_ARCH_PAGES_H */