Page MenuHomeFreeBSD

Add support for ARM to the efi boot1 and loader
ClosedPublic

Authored by andrew on Apr 6 2015, 1:55 PM.
Tags
None
Referenced Files
F106137737: D2238.diff
Thu, Dec 26, 12:44 AM
Unknown Object (File)
Wed, Dec 18, 4:11 AM
Unknown Object (File)
Wed, Dec 18, 3:21 AM
Unknown Object (File)
Sat, Dec 7, 7:07 PM
Unknown Object (File)
Nov 20 2024, 5:13 AM
Unknown Object (File)
Oct 20 2024, 12:56 PM
Unknown Object (File)
Oct 1 2024, 2:29 PM
Unknown Object (File)
Sep 17 2024, 7:43 AM
Subscribers

Details

Summary

This adds support to boot ARM with the efi loader. The kernel side
is still missing.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

andrew retitled this revision from to Add support for ARM to the efi boot1 and loader.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: emaste, imp.
emaste edited edge metadata.

overall looks fine to me

sys/arm/include/metadata.h
37–38

What do you think about making these uint64_ts with the intent that the same metatada could be used everywhere?

sys/boot/efi/boot1/Makefile
40

Out of curiosity why does only arm boot1 need it?

sys/boot/efi/include/arm/efibind.h
1–3

can we share a common efibind.h?

This revision is now accepted and ready to land.Apr 6 2015, 2:30 PM
sys/boot/efi/boot1/Makefile
40

Also, this should be LDADD+= ${LIBSTAND}, no?

sys/arm/include/metadata.h
37–38

They probably should be, we could have > 4GiB of ram with LPAE.

sys/boot/efi/boot1/Makefile
40

It's for the runtime functions the compiler assumes are available. As an alternative may be able to use compiler-rt. I'll add a comment explaining this.

I think this is correct, it should have DPADD+= ${LIBSTAND}. LIBSTAND is only correct when DESTDIR is set so may not be in buildenv.

sys/boot/efi/include/arm/efibind.h
1–3

I think we could share large chunks, but would need to investigate further.

sys/boot/efi/boot1/Makefile
40

It turns out we also need it for i386. Perhaps it makes sense to just include it unconditionally, and let the linker use it if needed or not.

sys/boot/efi/include/arm/efibind.h
1–3

Yeah, perhaps with a few #ifdefs in it.

sys/boot/efi/loader/arch/arm/reloc.c
38

ElfW_Dyn instead?

71–76

I think we should use a common reloc.c with a bit of #ifdefery instead, actually - the i386/amd64/arm/arm64 implementations of this file are going to be >80% common, without more divergence over time I think.

#if defined(__arm__)
case R_ARM_RELATIVE:
#elif defined(__i386__)
case R_386_RELATIVE:
#endif
    /* Address relative to the base address. */
    newaddr = (unsigned long *)(ImageBase + rel->r_offset);
    *newaddr += ImageBase;
    break;
andrew updated this revision to Diff 4699.

Closed by commit rS281156 (authored by @andrew).