Fill in the bootinfo's memory map.
This commit is contained in:
parent
a6e5348e22
commit
8b43a51e12
@ -13,6 +13,8 @@ CFLAGS+= -fpic -g
|
||||
CFLAGS+= -I${.CURDIR}/../include
|
||||
CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
|
||||
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
|
||||
CFLAGS+= -I${.CURDIR}/../../efi/include
|
||||
CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_ARCH}
|
||||
|
||||
# Pick up the bootstrap header for some interface items
|
||||
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
|
||||
|
@ -33,6 +33,9 @@
|
||||
#include <sys/linker.h>
|
||||
#include <machine/elf.h>
|
||||
#include <machine/bootinfo.h>
|
||||
|
||||
#include <efi.h>
|
||||
|
||||
#include "bootstrap.h"
|
||||
|
||||
/*
|
||||
@ -245,6 +248,7 @@ bi_load(struct bootinfo *bi, struct preloaded_file *fp, char *args)
|
||||
char *kernelname;
|
||||
vm_offset_t ssym, esym;
|
||||
struct file_metadata *md;
|
||||
EFI_MEMORY_DESCRIPTOR *memp;
|
||||
|
||||
/*
|
||||
* Version 1 bootinfo.
|
||||
@ -319,5 +323,19 @@ bi_load(struct bootinfo *bi, struct preloaded_file *fp, char *args)
|
||||
strncpy(bi->bi_kernel, kernelname, sizeof(bi->bi_kernel) - 1);
|
||||
}
|
||||
|
||||
/* Describe the SKI memory map. */
|
||||
bi->bi_memmap = (u_int64_t)(bi + 1);
|
||||
bi->bi_memmap_size = 1 * sizeof(EFI_MEMORY_DESCRIPTOR);
|
||||
bi->bi_memdesc_size = sizeof(EFI_MEMORY_DESCRIPTOR);
|
||||
bi->bi_memdesc_version = 1;
|
||||
|
||||
memp = (EFI_MEMORY_DESCRIPTOR *) bi->bi_memmap;
|
||||
|
||||
memp[0].Type = EfiConventionalMemory;
|
||||
memp[0].PhysicalStart = 2L*1024*1024;
|
||||
memp[0].VirtualStart = 0;
|
||||
memp[0].NumberOfPages = (64L*1024*1024)>>12;
|
||||
memp[0].Attribute = EFI_MEMORY_WB;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
@ -33,6 +33,9 @@
|
||||
#include <sys/linker.h>
|
||||
#include <machine/elf.h>
|
||||
#include <machine/bootinfo.h>
|
||||
|
||||
#include <efi.h>
|
||||
|
||||
#include "bootstrap.h"
|
||||
|
||||
/*
|
||||
@ -245,6 +248,7 @@ bi_load(struct bootinfo *bi, struct preloaded_file *fp, char *args)
|
||||
char *kernelname;
|
||||
vm_offset_t ssym, esym;
|
||||
struct file_metadata *md;
|
||||
EFI_MEMORY_DESCRIPTOR *memp;
|
||||
|
||||
/*
|
||||
* Version 1 bootinfo.
|
||||
@ -319,5 +323,19 @@ bi_load(struct bootinfo *bi, struct preloaded_file *fp, char *args)
|
||||
strncpy(bi->bi_kernel, kernelname, sizeof(bi->bi_kernel) - 1);
|
||||
}
|
||||
|
||||
/* Describe the SKI memory map. */
|
||||
bi->bi_memmap = (u_int64_t)(bi + 1);
|
||||
bi->bi_memmap_size = 1 * sizeof(EFI_MEMORY_DESCRIPTOR);
|
||||
bi->bi_memdesc_size = sizeof(EFI_MEMORY_DESCRIPTOR);
|
||||
bi->bi_memdesc_version = 1;
|
||||
|
||||
memp = (EFI_MEMORY_DESCRIPTOR *) bi->bi_memmap;
|
||||
|
||||
memp[0].Type = EfiConventionalMemory;
|
||||
memp[0].PhysicalStart = 2L*1024*1024;
|
||||
memp[0].VirtualStart = 0;
|
||||
memp[0].NumberOfPages = (64L*1024*1024)>>12;
|
||||
memp[0].Attribute = EFI_MEMORY_WB;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user