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); +}