Page MenuHomeFreeBSD

Add AT_HWCAP flags for VFP settings for FreeBSD/arm.
ClosedPublic

Authored by jhb on Sep 9 2017, 2:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 11:22 AM
Unknown Object (File)
Sun, Oct 27, 3:05 AM
Unknown Object (File)
Oct 23 2024, 11:24 PM
Unknown Object (File)
Oct 12 2024, 10:19 AM
Unknown Object (File)
Oct 4 2024, 12:00 PM
Unknown Object (File)
Oct 4 2024, 5:20 AM
Unknown Object (File)
Oct 3 2024, 6:52 PM
Unknown Object (File)
Oct 1 2024, 6:11 PM

Details

Summary

These flags match the meaning and value of flags in Linux, though
Linux has many more flags.

Test Plan

This is part of a patch series used to test using VFP registers in
gdb on armv7.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

stevek added inline comments.
sys/arm/arm/vfp.c
120 ↗(On Diff #32847)

Instead of specifically tying this to the elf handling code, why not have a variable in the arch-specific files (machdep.c maybe?) that the elf code will reference? Consider a possible future of both 32-bit and 64-bit ARM programs running on aarch64 system.

sys/arm/arm/vfp.c
120 ↗(On Diff #32847)

There are separate elf32_hwcap and elf64_hwcap variables on platforms that support both in case they have different layouts / meanings (I think we should probably try to match Linux's meaning on each architecture when possible). I imagine that we would be setting elf64_hwcap to appropriate values in sys/arm64/arm64/vfp.c along with setting elf32_hwcap under #ifdef COMPAT_FREEBSD32. Alternatively if architectures are known to be the same, then the 64-bit code could just set elf64_hwcap in places and later use a SYSINIT further along in boot that copies the value to elf32_hwcap.

Makes sense. HWCAP_ARM_* values look sane.

This revision is now accepted and ready to land.Sep 9 2017, 6:11 PM
ian added inline comments.
sys/arm/include/elf.h
122 ↗(On Diff #32847)

These names differ from the ones linux uses by having _ARM in the middle of them. I think that implies that every port that tries to do runtime feature detection will need patching. Given that they're defined in an MD header, I'm not sure the _ARM is necessary.

Hmm, we'll probably never escape some need to patch ports, because the linux header file that declares all this stuff is linux/auxvec.h and we'll never have one of those.

This revision now requires review to proceed.Sep 12 2017, 6:45 PM
sys/arm/include/elf.h
122 ↗(On Diff #32847)

Hmm, I thought I had seen them with _ARM_ somewhere (maybe in binutils) but now I can't find them. I'm happy to drop the _ARM_ bit from the name.

  • Trim _ARM from HWCAP names.
jhb marked an inline comment as done.Sep 12 2017, 7:43 PM
jhb added inline comments.
sys/arm/include/elf.h
122 ↗(On Diff #32847)

I had also thought about possibly defining these in elf_common.h instead, but it's probably fine to just leave them here.

This revision was automatically updated to reflect the committed changes.