aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/arch/smp.h22
-rw-r--r--include/arch/tcb.h10
-rw-r--r--include/kmi/assert.h1
-rw-r--r--include/kmi/tcb.h6
-rw-r--r--include/libfdt.h17
5 files changed, 41 insertions, 15 deletions
diff --git a/include/arch/smp.h b/include/arch/smp.h
new file mode 100644
index 0000000..16c29d5
--- /dev/null
+++ b/include/arch/smp.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
+/**
+ * @file smp.h
+ * Arch specific multicore bringup stuff.
+ */
+
+#ifndef KMI_ARCH_SMP_H
+#define KMI_ARCH_SMP_H
+
+#include <kmi/vmem.h>
+
+/**
+ * Bring up other cores in system.
+ *
+ * @param b Direct + kernel mappin virtual memory to use.
+ * @param fdt Flattened device tree.
+ */
+void smp_bringup(struct vmem *b, void *fdt);
+
+#endif /* KMI_ARCH_SMP_H */
diff --git a/include/arch/tcb.h b/include/arch/tcb.h
index 0687954..f4c80c6 100644
--- a/include/arch/tcb.h
+++ b/include/arch/tcb.h
@@ -15,4 +15,14 @@
#include "../../arch/riscv32/include/tcb.h"
#endif
+/**
+ * Force store tcb \p t in arch-specific way.
+ * cpu_assign() is allowed to assume there's always a valid tcb
+ * set, so during init we have to force set a tcb before cpu_assign() can be
+ * used.
+ *
+ * @param t tcb to set.
+ */
+void tcb_assign(struct tcb *t);
+
#endif /* KMI_ARCH_TCB_H */
diff --git a/include/kmi/assert.h b/include/kmi/assert.h
index 4512a21..291f15f 100644
--- a/include/kmi/assert.h
+++ b/include/kmi/assert.h
@@ -26,6 +26,7 @@
/**
* The kernel is in an irrepairable state, just give up.
+ * Should maybe call kernel_panic()?
*
* @param x Condition to check for.
*/
diff --git a/include/kmi/tcb.h b/include/kmi/tcb.h
index b7211e8..4f2eb1b 100644
--- a/include/kmi/tcb.h
+++ b/include/kmi/tcb.h
@@ -9,6 +9,9 @@
* Process/thread handling.
*/
+/* forward declaration */
+struct tcb;
+
#include <kmi/mem_regions.h>
#include <kmi/caps.h>
#include <kmi/types.h>
@@ -60,9 +63,6 @@
*/
#define get_rproc(t) (get_tcb(t->rid))
-/* forward declaration */
-struct tcb;
-
/** Convenience structure for \ref tcb. */
struct tcb_ctx {
/** Virtual address space of context. */
diff --git a/include/libfdt.h b/include/libfdt.h
index 58173f9..c603840 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -35,15 +35,6 @@ struct cell_info {
*/
struct cell_info get_cellinfo(const void *fdt, const int offset);
-/**
- * Get information about a register.
- *
- * @param fdt Pointer to the global fdt.
- * @param path Path to be searched.
- * @return Register information.
- */
-struct cell_info get_reginfo(const void *fdt, const char *path);
-
#if defined(DEBUG)
/**
* Print FDT node at specified location.
@@ -89,7 +80,7 @@ void __dbg_fdt(const void *fdt, int node_offset, int depth);
* Load int{32,64} from FDT at location specified by pointer.
*
* @param c Size of int, where 2 == int64 and everything else int32. Query int
- * size from FDT with \ref get_cellinfo() and \ref get_reginfo().
+ * size from FDT with \ref get_cellinfo().
* @param p Pointer to int{32,64} inside the global FDT.
* @return Value of integer at location p.
*/
@@ -105,7 +96,8 @@ void __dbg_fdt(const void *fdt, int node_offset, int depth);
* @param i Index of address to read.
* @return Address in reg cell.
*/
-static inline fdt64_t fdt_load_reg_addr(struct cell_info ci, void *p, size_t i)
+static inline fdt64_t fdt_load_reg_addr(struct cell_info ci, const void *p,
+ size_t i)
{
hard_assert(ci.addr_cells == 2 || ci.addr_cells == 1, 0);
size_t offset = i * (ci.addr_cells + ci.size_cells) * sizeof(fdt32_t);
@@ -121,7 +113,8 @@ static inline fdt64_t fdt_load_reg_addr(struct cell_info ci, void *p, size_t i)
* @param i Index of size to read.
* @return Size in reg cell.
*/
-static inline fdt64_t fdt_load_reg_size(struct cell_info ci, void *p, size_t i)
+static inline fdt64_t fdt_load_reg_size(struct cell_info ci, const void *p,
+ size_t i)
{
hard_assert(ci.size_cells == 2 || ci.size_cells == 1, 0);
size_t offset = i * (ci.addr_cells + ci.size_cells) * sizeof(fdt32_t);