kernel: add functions to get/set the bsp boot module location
This commit is contained in:
13
include/mango/bsp.h
Normal file
13
include/mango/bsp.h
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef MANGO_BSP_H_
|
||||||
|
#define MANGO_BSP_H_
|
||||||
|
|
||||||
|
#include <mango/compiler.h>
|
||||||
|
#include <mango/status.h>
|
||||||
|
#include <mango/types.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
extern void bsp_set_location(const struct boot_module *mod);
|
||||||
|
extern void bsp_get_location(struct boot_module *out);
|
||||||
|
|
||||||
|
#endif
|
||||||
18
kernel/bsp.c
Normal file
18
kernel/bsp.c
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#include <mango/bsp.h>
|
||||||
|
#include <mango/printk.h>
|
||||||
|
#include <mango/sched.h>
|
||||||
|
#include <mango/util.h>
|
||||||
|
#include <mango/vm-object.h>
|
||||||
|
#include <mango/vm-region.h>
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user