summaryrefslogtreecommitdiff
path: root/src/arch/amd64/mboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/amd64/mboot.c')
-rw-r--r--src/arch/amd64/mboot.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/arch/amd64/mboot.c b/src/arch/amd64/mboot.c
index 34424a0..771e911 100644
--- a/src/arch/amd64/mboot.c
+++ b/src/arch/amd64/mboot.c
@@ -68,13 +68,13 @@ struct mboot_tag_mmap {
struct mboot_tag_old_rsdp {
uint32_t type;
uint32_t size;
- uint8_t rsdp[];
+ char rsdp[];
};
struct mboot_tag_new_rsdp {
uint32_t type;
uint32_t size;
- uint8_t rsdp[];
+ char rsdp[];
};
struct mboot_tag_cmdline {
@@ -96,11 +96,10 @@ struct mboot_tag_framebuffer {
};
static void read_symbols(
- struct boot_info *shim_info,
- struct mboot_tag_elf_sections *sections
+ volatile struct boot_info *shim_info,
+ volatile struct mboot_tag_elf_sections *sections
) {
-
- shim_info->symbol_table = sections->sections;
+ shim_info->symbol_table = (void * volatile) sections->sections;
// struct mboot_elf_section_header *section =
// (struct mboot_elf_section_header *) (layout->elf_section_headers);
@@ -136,19 +135,19 @@ static void read_symbols(
}
static void read_cmdline(
- struct boot_info *shim_info,
- struct mboot_tag_cmdline *cmdline
+ volatile struct boot_info *shim_info,
+ volatile struct mboot_tag_cmdline *cmdline
) {
uint32_t size = cmdline->size - 8;
if (size >= CMDLINE_MAX)
size = CMDLINE_MAX; // truncate :(
- memcpy(shim_info->cmdline, cmdline->cmdline, size);
+ memcpyv(shim_info->cmdline, cmdline->cmdline, size);
shim_info->cmdline[size] = '\0';
}
static void read_framebuffer(
- struct boot_info *shim_info,
- struct mboot_tag_framebuffer *framebuffer
+ volatile struct boot_info *shim_info,
+ volatile struct mboot_tag_framebuffer *framebuffer
) {
shim_info->fb.addr = framebuffer->framebuffer_addr;
shim_info->fb.width = framebuffer->framebuffer_width;
@@ -168,8 +167,8 @@ static const char *segment_type[] = {
};
static void read_memory_map(
- struct boot_info *shim_info,
- struct mboot_tag_mmap *map
+ volatile struct boot_info *shim_info,
+ volatile struct mboot_tag_mmap *map
) {
int idx = 0;
uintptr_t i = (uintptr_t)map->entries;
@@ -200,31 +199,31 @@ static void read_memory_map(
}
static void read_old_rsdp(
- struct boot_info *shim_info,
- struct mboot_tag_old_rsdp *rsdp
+ volatile struct boot_info *shim_info,
+ volatile struct mboot_tag_old_rsdp *rsdp
) {
if (shim_info->acpi_table != NULL)
return; // xsdp is newer and has been loaded
- shim_info->acpi_table = rsdp->rsdp;
+ shim_info->acpi_table = (void *volatile) rsdp->rsdp;
}
static void read_new_rsdp(
- struct boot_info *shim_info,
- struct mboot_tag_new_rsdp *rsdp
+ volatile struct boot_info *shim_info,
+ volatile struct mboot_tag_new_rsdp *rsdp
) {
- shim_info->acpi_table = rsdp->rsdp;
+ shim_info->acpi_table = (void *volatile) rsdp->rsdp;
}
void mboot_load_info(
long mboot_magic,
- const void *mboot_data_ptr,
- struct boot_info *shim_info
+ volatile const void *mboot_data_ptr,
+ volatile struct boot_info *shim_info
) {
if (mboot_magic != MBOOT_HEADER_MAGIC)
panic("invalid multiboot magic");
- memset(shim_info, 0, sizeof(struct boot_info));
+ memsetv(shim_info, 0, sizeof(struct boot_info));
struct mboot_info *mboot_info = (struct mboot_info *) mboot_data_ptr;
const char *mboot_end = ((char *) mboot_info) + mboot_info->total_size;