From 129e782e99ae1c31c9fc51e9123854773b81224f Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 8 Feb 2026 11:38:50 +0000 Subject: [PATCH] kernel: add functions to get/set the bsp boot module location --- include/mango/bsp.h | 13 +++++++++++++ kernel/bsp.c | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 include/mango/bsp.h create mode 100644 kernel/bsp.c diff --git a/include/mango/bsp.h b/include/mango/bsp.h new file mode 100644 index 0000000..9e3ba7f --- /dev/null +++ b/include/mango/bsp.h @@ -0,0 +1,13 @@ +#ifndef MANGO_BSP_H_ +#define MANGO_BSP_H_ + +#include +#include +#include +#include +#include + +extern void bsp_set_location(const struct boot_module *mod); +extern void bsp_get_location(struct boot_module *out); + +#endif diff --git a/kernel/bsp.c b/kernel/bsp.c new file mode 100644 index 0000000..180ff8f --- /dev/null +++ b/kernel/bsp.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include +#include +#include + +static struct boot_module bsp_location = {0}; + +void bsp_set_location(const struct boot_module *mod) +{ + memcpy(&bsp_location, mod, sizeof bsp_location); +} + +void bsp_get_location(struct boot_module *out) +{ + memcpy(out, &bsp_location, sizeof bsp_location); +}