Skip to content

Commit c22936d

Browse files
DavidSpickettkrishna2803
authored andcommitted
[lldb][FreeBSD] Add Auxv numbers for HWCAP3 and HWCAP4 (llvm#151152)
These entries serve the same purpose as the Linux HWCAPs but have been assigned different numbers as FreeBSD had already used the Linux ones. The numbers were assigned in: freebsd/freebsd-src@8500787 In theory we can read these for the purposes of register field detection, even on earlier versions of FreeBSD. As the aux data is a key-value structure, we simply won't find the new numbers on older systems. However, FreeBSD has not defined any feature bits for HWACP3 and 4. It is likley that they will match the Linux feature bits, but I have no proof of that yet. For instance, FEAT_MTE_STORE_ONLY is indicated by a HWCAP3 feature bit on Linux. FreeBSD does not support this feature at all yet. So for now, these values exist for future use and are not used for register field detection on FreeBSD.
1 parent 571fe74 commit c22936d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lldb/source/Plugins/Process/Utility/AuxVector.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ const char *AuxVector::GetEntryName(EntryType type) const {
9292
case ENTRY_NAME(AUXV_AT_L1D_CACHESHAPE); break;
9393
case ENTRY_NAME(AUXV_AT_L2_CACHESHAPE); break;
9494
case ENTRY_NAME(AUXV_AT_L3_CACHESHAPE); break;
95+
case ENTRY_NAME(AUXV_FREEBSD_AT_HWCAP3); break;
96+
case ENTRY_NAME(AUXV_FREEBSD_AT_HWCAP4); break;
9597
}
9698
#undef ENTRY_NAME
9799

lldb/source/Plugins/Process/Utility/AuxVector.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ class AuxVector {
7070
// Platform specific values which may overlap the Linux values.
7171

7272
AUXV_FREEBSD_AT_HWCAP = 25, ///< FreeBSD specific AT_HWCAP value.
73+
// FreeBSD and Linux use the same AT_HWCAP2 value.
74+
AUXV_FREEBSD_AT_HWCAP3 = 38, ///< FreeBSD specific AT_HWCAP3 value.
75+
AUXV_FREEBSD_AT_HWCAP4 = 39, ///< FreeBSD specific AT_HWCAP4 value.
76+
7377
};
7478

7579
std::optional<uint64_t> GetAuxValue(enum EntryType entry_type) const;

0 commit comments

Comments
 (0)