Displaying 9 results from an estimated 9 matches for "efi_buffer_too_small".
2015 Sep 16
1
[PATCH] efi: Call ExitBootServices at least twice
...tus;
> + 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);
Why don't you use ReallocatePool()?
Besides, you could just return inside loop when GetMemoryMap() returns
EFI_SUCCESS and thus avoidin...
2015 Nov 02
3
[PATCH] efi: Call ExitBootServices at least twice
...do {
> + size = *allocsize;
> + status = uefi_call_wrapper(BS->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...
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 03
2
[PATCH] efi: Call ExitBootServices at least twice
...as possible with the UEFI specification. (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.)
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(*allocs...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...memory is allocated, and this is a crucial point to comply as
much as possible with the UEFI specification. (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);
>> +...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...ecification. (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.)
>
> No, it's the function you effectively replaced.
>
>>>> + if (status == EFI_BUFFER_TOO_SMALL) {
>>>> + if (map)
>>>> + FreePool(map);
>>>> + allocsizeadd *= 2;
>>>> + *allocsize = size + allocsizeadd;
>>>> + map =...
2015 Aug 26
0
[PATCH] efi: Call ExitBootServices at least twice
...esc_sz,
+ UINT32 *desc_ver)
+{
+ EFI_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);...
2015 Jul 22
13
[PULL 0/8] MultiFS suppport for BIOS and EFI
So last week I was wondering if XFS was still working -- even with its
last on-disk structure changes -- and it _suprisingly_ worked as
expected. Right, now I can finally get rid of GRUB and use Syslinux to
boot my Linux on EFI from a rootfs with xfs. Shit, I have two
partitions (the first one being the required ESP) so there is no way to
access the other partitions since because Syslinux does not
2015 Sep 24
0
[PATCH] com32/disk: add UEFI support
...unsigned long *bdevsno)
+{
+ EFI_STATUS status;
+ unsigned long len = 0;
+
+ *bdevsno = 0;
+
+ status = uefi_call_wrapper(BS->LocateHandle, 5, ByProtocol,
+ &BlockIoProtocol, NULL, &len, NULL);
+ if (EFI_ERROR(status) && status != EFI_BUFFER_TOO_SMALL) {
+ printf("%s: failed to locate BlockIo device handles\n", __func__);
+ return status;
+ }
+
+ *bdevs = malloc(len);
+ if (!*bdevs) {
+ status = EFI_OUT_OF_RESOURCES;
+ return status;
+ }
+
+ status = uefi_call_wrapper(BS->LocateHandle, 5, B...