Displaying 13 results from an estimated 13 matches for "freepool".
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
2015 Nov 02
3
[PATCH] efi: Call ExitBootServices at least twice
...t;GetMemoryMap, 5, &size, map, key,
> + desc_sz, desc_ver);
Why not check for NULL and call get_memory_map() first?
> + if (status == EFI_BUFFER_TOO_SMALL) {
> + if (map)
> + FreePool(map);
> + allocsizeadd *= 2;
> + *allocsize = size + allocsizeadd;
> + map = AllocatePool(*allocsize);
> + }
Why guess at the exact size needed? GetMemoryMap is required to tell
us the exact resize needed...
2015 Sep 16
1
[PATCH] efi: Call ExitBootServices at least twice
...allocsizeadd = sizeof(*map) * 2;
> +
> + do {
> + size = *allocsize;
> + status = uefi_call_wrapper(BS->GetMemoryMap, 5,
> &size, map, key,
> + desc_sz, desc_ver);
> +
> + if (status == EFI_BUFFER_TOO_SMALL) {
> + if (map)
> + FreePool(map);
> + allocsizeadd *= 2;
> + *allocsize = size + allocsizeadd;
> + map = AllocatePool(*allocsize);
Why don't you use ReallocatePool()?
Besides, you could just return inside loop when GetMemoryMap() returns
EFI_SUCCESS and thus avoiding to check twice for EFI_BUFFER_TOO_SMAL...
2020 Jun 11
2
[PATCH] efi/main: add retry to exit_boot()
...emory map */
- map = get_memory_map(&nr_entries, &key, &desc_sz, &desc_ver);
- if (!map)
+ map_sz = buf_sz;
+ status = uefi_call_wrapper(BS->GetMemoryMap,
+ 5,
+ &map_sz,
+ map,
+ &key,
+ &desc_sz,
+ &desc_ver);
+ if (!map) {
+ FreePool(map);
+ return -1;
+ }
+
+ status = uefi_call_wrapper(BS->ExitBootServices, 2, image_handle, key);
+
+ if (status == EFI_INVALID_PARAMETER) {
+ /*
+ * Retry GetMemoryMap() and ExitBootServices() if the
+ * first try fails per UEFI Spec v2.6, Section 6.4:
+ * EFI_BOOT_SERVICES.ExitBootSe...
2015 Aug 26
0
[PATCH] efi: Call ExitBootServices at least twice
...FI_STATUS status;
+ UINTN size, allocsizeadd;
+
+ allocsizeadd = sizeof(*map) * 2;
+
+ do {
+ size = *allocsize;
+ status = uefi_call_wrapper(BS->GetMemoryMap, 5, &size, map, key,
+ desc_sz, desc_ver);
+
+ if (status == EFI_BUFFER_TOO_SMALL) {
+ if (map)
+ FreePool(map);
+ allocsizeadd *= 2;
+ *allocsize = size + allocsizeadd;
+ 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 in...
2015 Nov 03
2
[PATCH] efi: Call ExitBootServices at least twice
...unction provided by
> gnu-efi and GetMemoryMap is the one provided by the firmware.)
No, it's the function you effectively replaced.
>>> + if (status == EFI_BUFFER_TOO_SMALL) {
>>> + if (map)
>>> + FreePool(map);
>>> + allocsizeadd *= 2;
>>> + *allocsize = size + allocsizeadd;
>>> + map = AllocatePool(*allocsize);
>>> + }
>>
>> Why guess at the exact size needed? GetMemoryMa...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...gnu-efi and GetMemoryMap is the one provided by the firmware.)
>
> No, it's the function you effectively replaced.
>
>>>> + if (status == EFI_BUFFER_TOO_SMALL) {
>>>> + if (map)
>>>> + FreePool(map);
>>>> + allocsizeadd *= 2;
>>>> + *allocsize = size + allocsizeadd;
>>>> + map = AllocatePool(*allocsize);
>>>> + }
>>>
>>> Why guess at the exact s...
2020 Jun 18
0
[PATCH] efi/main: add retry to exit_boot()
...f_sz);
+
/* Build efi memory map */
- map = get_memory_map(&nr_entries, &key, &desc_sz, &desc_ver);
- if (!map)
+ map_sz = buf_sz;
+ status = uefi_call_wrapper(BS->GetMemoryMap,
+ 5,
+ &map_sz,
+ map,
+ &key,
+ &desc_sz,
+ &desc_ver);
+ if (!map) {
+ FreePool(map);
+ return -1;
+ }
+
+ status = uefi_call_wrapper(BS->ExitBootServices, 2, image_handle, key);
+
+ if (status == EFI_INVALID_PARAMETER) {
+ /*
+ * Retry GetMemoryMap() and ExitBootServices() if the
+ * first try fails per UEFI Spec v2.6, Section 6.4:
+ * EFI_BOOT_SERVICES.ExitBootS...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...(See below.)
(BTW, I hope we agree that get_memory_map is the function provided by
gnu-efi and GetMemoryMap is the one provided by the firmware.)
>
>> + if (status == EFI_BUFFER_TOO_SMALL) {
>> + if (map)
>> + FreePool(map);
>> + allocsizeadd *= 2;
>> + *allocsize = size + allocsizeadd;
>> + map = AllocatePool(*allocsize);
>> + }
>
> Why guess at the exact size needed? GetMemoryMap is required to tell
&g...
2015 Aug 26
4
[PATCH 0/3] efi: A few warning fixes
From: Sylvain Gault <sylvain.gault at gmail.com>
I don't know if I should merge those trivial warning fix into one commit. I
can reformat it as requested. Those are a few warning fixes for the efi part.
The code involved has mainly been introduced in recent commits.
Sylvain Gault (3):
efi: fix warnings about argument types
efi: fix pointer-type mismatch assigment warning
efi: fix
2018 May 21
1
UEFI support for chain.c32 in 6.04 syslinux
On Fri, 2016-12-23 at 08:43 -0500, Gene Cumm via Syslinux wrote:
> On Thu, Dec 15, 2016 at 2:59 PM, Robin Mathews (robimath) via
> Syslinux
> <syslinux at zytor.com> wrote:
> >
> > Hi Folks ,
> >
> > Can you please let me know if there is any fix for chain
> > loading??UEFI boot loader using chain.c32??in 6.04 release ?
> > I am booting my
2012 Aug 16
0
[RFC v1 3/5] VBD: enlarge max segment per request in blkfront
...free_list);
- list_del(&req->free_list);
- }
- spin_unlock_irqrestore(&blkbk->pending_free_lock, flags);
- return req;
-}
+ unsigned short op, int nr_page, int st);
/*
* Return the ''pending_req'' structure back to the freepool. We also
@@ -155,6 +146,12 @@ static void free_req(struct pending_req *req)
unsigned long flags;
int was_empty;
+ kfree(req->map);
+ kfree(req->unmap);
+ kfree(req->biolist);
+ kfree(req->seg);
+ kfree(req->pages);
+
spin_lock_irqsave(&blkbk->pending...
2015 Sep 24
0
[PATCH] com32/disk: add UEFI support
...;
+
+ while (start < end) {
+ if (*start)
+ printf("%c", *start);
+ start++;
+ }
+ printf("\n");
+}
+
+static void print_dev_path(const EFI_DEVICE_PATH *path)
+{
+ CHAR16 *s;
+
+ s = DevicePathToStr(path);
+ __print_dev_path(s);
+ FreePool(s);
+}
+#endif
+
+static EFI_DEVICE_PATH *find_hdd_pci_dev_path(EFI_HANDLE dh)
+{
+ EFI_DEVICE_PATH *path;
+ EFI_DEVICE_PATH *cur;
+
+ path = DuplicateDevicePath(DevicePathFromHandle(dh));
+ cur = path;
+ do {
+ if (DevicePathType(cur) == MEDIA_DEVICE_PATH &&
+...