On 04/01/2013 06:42 PM, Francesco Lavra wrote: > On 04/01/2013 04:16 AM, Vladimir 'φ-coder/phcoder' Serbinenko wrote: >> Could you put the library itself into a separate tar rather than patch? > > I recall you saying a few months ago that you'd prefer rather without > libfdt. In fact, libfdt contains much more than what is needed by GRUB. > I rewrote the FDT-related functions needed by GRUB (using GRUB's naming > convention) and put them in the standalone files grub-core/lib/fdt.c and > include/grub/fdt.h. The .c file would need to be included in the linux > loader module. I also changed loader/arm/linux.c to use the new functions. > Attached are the needed files; the loader code already contains the > changes which I proposed in my review of Leif's patch, but supports EFI > only, not U-Boot. Also, my code is not completely tested yet, I just > wanted to send it out to get your feedback. Now I tested my code more thoroughly and fixed quite a few issues. In attachment you can find the updated version of the fdt.c file. As far as the linux loader is concerned, I had naively assumed that the memory allocated with grub_efi_allocate_loader_memory() could be freed with the usual grub_free(). But then I soon realized this was not the case, and I wrote a small helper function to properly free the memory: void grub_efi_free_memory (void *start, grub_uint32_t size) { grub_efi_free_pages ((grub_addr_t) start, (size >> PAGE_SHIFT) + 1); } This function should go in the same file as grub_efi_allocate_loader_memory(). -- Francesco