Page MenuHomeFreeBSD

D28495.diff
No OneTemporary

D28495.diff

diff --git a/stand/efi/loader/arch/amd64/elf64_freebsd.c b/stand/efi/loader/arch/amd64/elf64_freebsd.c
--- a/stand/efi/loader/arch/amd64/elf64_freebsd.c
+++ b/stand/efi/loader/arch/amd64/elf64_freebsd.c
@@ -54,7 +54,8 @@
static EFI_GUID acpi_guid = ACPI_TABLE_GUID;
static EFI_GUID acpi20_guid = ACPI_20_TABLE_GUID;
-extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp);
+extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp,
+ bool exit_bs);
static int elf64_exec(struct preloaded_file *amp);
static int elf64_obj_exec(struct preloaded_file *amp);
@@ -186,7 +187,7 @@
printf("Start @ 0x%lx ...\n", ehdr->e_entry);
efi_time_fini();
- err = bi_load(fp->f_args, &modulep, &kernend);
+ err = bi_load(fp->f_args, &modulep, &kernend, true);
if (err != 0) {
efi_time_init();
return(err);
diff --git a/stand/efi/loader/arch/arm/exec.c b/stand/efi/loader/arch/arm/exec.c
--- a/stand/efi/loader/arch/arm/exec.c
+++ b/stand/efi/loader/arch/arm/exec.c
@@ -44,7 +44,7 @@
#include "loader_efi.h"
extern vm_offset_t md_load(char *, vm_offset_t *);
-extern int bi_load(char *, vm_offset_t *, vm_offset_t *);
+extern int bi_load(char *, vm_offset_t *, vm_offset_t *, bool);
static int
__elfN(arm_load)(char *filename, uint64_t dest,
@@ -80,7 +80,7 @@
printf("Kernel entry at %p...\n", entry);
printf("Kernel args: %s\n", fp->f_args);
- if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) {
+ if ((error = bi_load(fp->f_args, &modulep, &kernend, true)) != 0) {
efi_time_init();
return (error);
}
diff --git a/stand/efi/loader/arch/arm64/exec.c b/stand/efi/loader/arch/arm64/exec.c
--- a/stand/efi/loader/arch/arm64/exec.c
+++ b/stand/efi/loader/arch/arm64/exec.c
@@ -55,7 +55,8 @@
static int elf64_exec(struct preloaded_file *amp);
static int elf64_obj_exec(struct preloaded_file *amp);
-int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp);
+int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp,
+ bool exit_bs);
static struct file_format arm64_elf = {
elf64_loadfile,
@@ -114,7 +115,7 @@
entry = efi_translate(ehdr->e_entry);
efi_time_fini();
- err = bi_load(fp->f_args, &modulep, &kernendp);
+ err = bi_load(fp->f_args, &modulep, &kernendp, true);
if (err != 0) {
efi_time_init();
return (err);
diff --git a/stand/efi/loader/arch/i386/elf32_freebsd.c b/stand/efi/loader/arch/i386/elf32_freebsd.c
--- a/stand/efi/loader/arch/i386/elf32_freebsd.c
+++ b/stand/efi/loader/arch/i386/elf32_freebsd.c
@@ -43,7 +43,8 @@
#include "../btx/lib/btxv86.h"
extern void __exec(caddr_t addr, ...);
-extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp);
+extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp,
+ bool exit_bs);
static int elf32_exec(struct preloaded_file *amp);
static int elf32_obj_exec(struct preloaded_file *amp);
@@ -80,7 +81,7 @@
printf("Start @ 0x%x ...\n", entry);
- err = bi_load(fp->f_args, &modulep, &kernend);
+ err = bi_load(fp->f_args, &modulep, &kernend, true);
if (err != 0) {
efi_time_init();
return(err);
diff --git a/stand/efi/loader/arch/riscv/exec.c b/stand/efi/loader/arch/riscv/exec.c
--- a/stand/efi/loader/arch/riscv/exec.c
+++ b/stand/efi/loader/arch/riscv/exec.c
@@ -43,7 +43,7 @@
#include "bootstrap.h"
#include "loader_efi.h"
-extern int bi_load(char *, vm_offset_t *, vm_offset_t *);
+extern int bi_load(char *, vm_offset_t *, vm_offset_t *, bool);
static int
__elfN(exec)(struct preloaded_file *fp)
@@ -66,7 +66,7 @@
printf("Kernel entry at %p...\n", entry);
printf("Kernel args: %s\n", fp->f_args);
- if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) {
+ if ((error = bi_load(fp->f_args, &modulep, &kernend, true)) != 0) {
efi_time_init();
return (error);
}
diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c
--- a/stand/efi/loader/bootinfo.c
+++ b/stand/efi/loader/bootinfo.c
@@ -60,7 +60,8 @@
#include "geliboot.h"
#endif
-int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp);
+int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp,
+ bool exit_bs);
extern EFI_SYSTEM_TABLE *ST;
@@ -284,7 +285,7 @@
}
static int
-bi_load_efi_data(struct preloaded_file *kfp)
+bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs)
{
EFI_MEMORY_DESCRIPTOR *mm;
EFI_PHYSICAL_ADDRESS addr = 0;
@@ -392,6 +393,8 @@
sz = (EFI_PAGE_SIZE * pages) - efisz;
}
+ if (!exit_bs)
+ break;
status = BS->ExitBootServices(IH, efi_mapkey);
if (!EFI_ERROR(status))
break;
@@ -430,7 +433,7 @@
* - Module metadata are formatted and placed in kernel space.
*/
int
-bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp)
+bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs)
{
struct preloaded_file *xp, *kfp;
struct devdesc *rootdev;
@@ -529,7 +532,7 @@
#ifdef LOADER_GELI_SUPPORT
geli_export_key_metadata(kfp);
#endif
- bi_load_efi_data(kfp);
+ bi_load_efi_data(kfp, exit_bs);
/* Figure out the size and location of the metadata. */
*modulep = addr;

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 4:01 PM (8 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15733129
Default Alt Text
D28495.diff (5 KB)

Event Timeline