search for: e820buf

Displaying 11 results from an estimated 11 matches for "e820buf".

2008 Jun 16
0
Com32/PXELINUX issues when booting on certain hardware
...3 2008-06-16 11:09:01.000000000 -0700 @@ -42,6 +42,9 @@ #include <com32.h> #include <syslinux/movebits.h> +#define PAGE_SIZE 4096 +#define PAGE_MASK (PAGE_SIZE - 1) + struct e820_entry { uint64_t start; uint64_t len; @@ -87,8 +90,22 @@ break; type = e820buf->type == 1 ? SMT_FREE : SMT_RESERVED; - start = e820buf->start; - len = e820buf->len; + + /* + * If the start and length of a usable region in the BIOS + * memory map are not page-aligned, we may end up passing + * an initrd to the kernel that shares a page with a rese...
2015 Aug 26
5
[PATCH] Call ExitBootServices twice
From: Sylvain Gault <sylvain.gault at gmail.com> On some architecture, including my hardware, the function ExitBootServices may need to be called twice in order to successfully exit the boot services. As stated by the UEFI spec, the first call to ExitBootServices may perform a partial shutdown of the services. It seems that during this partial shutdown, the memory map can be modified, thus
2020 Jun 11
2
[PATCH] efi/main: add retry to exit_boot()
...i.systab = (uint32_t)(unsigned long)ST; bp->efi.desc_size = desc_sz; bp->efi.desc_version = desc_ver; @@ -1033,6 +1098,7 @@ static int exit_boot(struct boot_params *bp) * e820 map because it will most likely have changed in the * interim. */ + nr_entries = map_sz / desc_sz; e = e820buf = bp->e820_map; for (i = 0; i < nr_entries && i < E820MAX; i++) { struct e820_entry *prev = NULL; @@ -1089,13 +1155,6 @@ static int exit_boot(struct boot_params *bp) bp->e820_entries = e - e820buf; - status = uefi_call_wrapper(BS->ExitBootServices, 2, image_handle,...
2015 Nov 02
3
[PATCH] efi: Call ExitBootServices at least twice
...{ > + *nr_entries = size / *desc_sz; > + return map; > + } > + > + if (map) > + FreePool(map); > + return NULL; > +} > + > static int exit_boot(struct boot_params *bp) > { > struct e820_entry *e820buf, *e; > EFI_MEMORY_DESCRIPTOR *map; > EFI_STATUS status; > uint32_t e820_type; > - UINTN i, nr_entries, key, desc_sz; > + UINTN i, nr_entries, key, desc_sz, allocsize; > UINT32 desc_ver; > + int retry; > > - /* Build...
2015 Aug 26
0
[PATCH] efi: Call ExitBootServices at least twice
...izeadd; + map = AllocatePool(*allocsize); + } + } while (status == EFI_BUFFER_TOO_SMALL); + + if (status == EFI_SUCCESS) { + *nr_entries = size / *desc_sz; + return map; + } + + if (map) + FreePool(map); + return NULL; +} + static int exit_boot(struct boot_params *bp) { struct e820_entry *e820buf, *e; EFI_MEMORY_DESCRIPTOR *map; EFI_STATUS status; uint32_t e820_type; - UINTN i, nr_entries, key, desc_sz; + UINTN i, nr_entries, key, desc_sz, allocsize; UINT32 desc_ver; + int retry; - /* Build efi memory map */ - map = get_memory_map(&nr_entries, &key, &desc_sz, &desc...
2020 Jun 18
0
[PATCH] efi/main: add retry to exit_boot()
...->efi.systab = (uint32_t)(unsigned long)ST; bp->efi.desc_size = desc_sz; bp->efi.desc_version = desc_ver; @@ -1033,6 +1098,7 @@ static int exit_boot(struct boot_params *bp) * e820 map because it will most likely have changed in the * interim. */ + nr_entries = map_sz / desc_sz; e = e820buf = bp->e820_map; for (i = 0; i < nr_entries && i < E820MAX; i++) { struct e820_entry *prev = NULL; @@ -1089,13 +1155,6 @@ static int exit_boot(struct boot_params *bp) bp->e820_entries = e - e820buf; - status = uefi_call_wrapper(BS->ExitBootServices, 2, image_handle, key...
2015 Sep 16
1
[PATCH] efi: Call ExitBootServices at least twice
...EFI_BUFFER_TOO_SMALL); > + > + if (status == EFI_SUCCESS) { > + *nr_entries = size / *desc_sz; > + return map; > + } > + > + if (map) > + FreePool(map); > + return NULL; > +} > + > static int exit_boot(struct boot_params *bp) > { > struct e820_entry *e820buf, *e; > EFI_MEMORY_DESCRIPTOR *map; > EFI_STATUS status; > uint32_t e820_type; > - UINTN i, nr_entries, key, desc_sz; > + UINTN i, nr_entries, key, desc_sz, allocsize; > UINT32 desc_ver; > + int retry; > > - /* Build efi memory map */ > - map = get_memory_map(...
2015 Nov 03
2
[PATCH] efi: Call ExitBootServices at least twice
...rn map; >>> + } >>> + >>> + if (map) >>> + FreePool(map); >>> + return NULL; >>> +} >>> + >>> static int exit_boot(struct boot_params *bp) >>> { >>> struct e820_entry *e820buf, *e; >>> EFI_MEMORY_DESCRIPTOR *map; >>> EFI_STATUS status; >>> uint32_t e820_type; >>> - UINTN i, nr_entries, key, desc_sz; >>> + UINTN i, nr_entries, key, desc_sz, allocsize; >>> UINT32 desc_ver; &gt...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...*desc_sz; >> + return map; >> + } >> + >> + if (map) >> + FreePool(map); >> + return NULL; >> +} >> + >> static int exit_boot(struct boot_params *bp) >> { >> struct e820_entry *e820buf, *e; >> EFI_MEMORY_DESCRIPTOR *map; >> EFI_STATUS status; >> uint32_t e820_type; >> - UINTN i, nr_entries, key, desc_sz; >> + UINTN i, nr_entries, key, desc_sz, allocsize; >> UINT32 desc_ver; >> + int retry;...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...gt;>> + >>>> + if (map) >>>> + FreePool(map); >>>> + return NULL; >>>> +} >>>> + >>>> static int exit_boot(struct boot_params *bp) >>>> { >>>> struct e820_entry *e820buf, *e; >>>> EFI_MEMORY_DESCRIPTOR *map; >>>> EFI_STATUS status; >>>> uint32_t e820_type; >>>> - UINTN i, nr_entries, key, desc_sz; >>>> + UINTN i, nr_entries, key, desc_sz, allocsize; >>>>...
2012 Jun 26
2
[GIT PULL] elflink bug fixes
...iff --git a/com32/mboot/mem.c b/com32/mboot/mem.c index 6a31fac..6e3995b 100644 --- a/com32/mboot/mem.c +++ b/com32/mboot/mem.c @@ -49,9 +49,10 @@ struct e820_entry { static int mboot_scan_memory(struct AddrRangeDesc **ardp, uint32_t * dosmem) { com32sys_t ireg, oreg; - struct e820_entry *e820buf = __com32.cs_bounce; + struct e820_entry *e820buf; struct AddrRangeDesc *ard; size_t ard_count, ard_space; + int rv = 0; /* Use INT 12h to get DOS memory */ __intcall(0x12, &__com32_zero_regs, &oreg); @@ -65,10 +66,14 @@ static int mboot_scan_memory(struct AddrRa...