Module Name: src
Committed By: jdolecek
Date: Wed Jun 24 22:28:08 UTC 2020
Modified Files:
src/sys/arch/x86/x86: multiboot2.c
Log Message:
don't try allocating 16KB of scratch space on stack
it's too early for kmem_alloc(), so use static variable in BSS; it's used
post reloc, so don't need to use the RELOC() macros
XXX compile-tested only on i386
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/x86/multiboot2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/multiboot2.c
diff -u src/sys/arch/x86/x86/multiboot2.c:1.4 src/sys/arch/x86/x86/multiboot2.c:1.5
--- src/sys/arch/x86/x86/multiboot2.c:1.4 Thu Jan 30 01:49:44 2020
+++ src/sys/arch/x86/x86/multiboot2.c Wed Jun 24 22:28:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: multiboot2.c,v 1.4 2020/01/30 01:49:44 manu Exp $ */
+/* $NetBSD: multiboot2.c,v 1.5 2020/06/24 22:28:07 jdolecek Exp $ */
/*-
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: multiboot2.c,v 1.4 2020/01/30 01:49:44 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: multiboot2.c,v 1.5 2020/06/24 22:28:07 jdolecek Exp $");
#include "opt_multiboot.h"
@@ -115,7 +115,7 @@ char multiboot_info[16384] = "\0\0\0\0";
bool multiboot2_enabled = false;
bool has_syms = false;
struct multiboot_symbols Multiboot_Symbols;
-
+static char bimbuf[16384];
#define RELOC(type, x) ((type)((vaddr_t)(x) - KERNBASE))
@@ -448,7 +448,6 @@ mbi_modules(char *mbi, uint32_t mbi_size
size_t bim_len;
struct bi_modulelist_entry *bie;
struct btinfo_modulelist *bim;
- char bimbuf[16384];
bim_len = sizeof(*bim) + (module_count * sizeof(*bie));
if (bim_len > sizeof(bimbuf))
@@ -518,7 +517,6 @@ mbi_bootdev(struct multiboot_tag_bootdev
static void
mbi_mmap(struct multiboot_tag_mmap *mbt)
{
- char bimbuf[16384];
struct btinfo_memmap *bim;
char *cp;
@@ -616,15 +614,14 @@ mbi_efi64(struct multiboot_tag_efi64 *mb
static void
mbi_efi_mmap(struct multiboot_tag_efi_mmap *mbt)
{
- char biebuf[16384];
- struct btinfo_efimemmap *bie = (struct btinfo_efimemmap *)biebuf;
+ struct btinfo_efimemmap *bie = (struct btinfo_efimemmap *)bimbuf;
size_t bie_len;
if (mbt->descr_vers != 0)
goto out;
bie_len = sizeof(*bie) + mbt->size - sizeof(*mbt);
- if (bie_len > sizeof(biebuf))
+ if (bie_len > sizeof(bimbuf))
goto out;
bie->num = (mbt->size - sizeof(*mbt)) / mbt->descr_size;