]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
RISC-V: expose extension bits in AT_HWCAP
authorMitchell Horne <mhorne@FreeBSD.org>
Tue, 11 Jun 2019 00:55:54 +0000 (00:55 +0000)
committerMitchell Horne <mhorne@FreeBSD.org>
Tue, 11 Jun 2019 00:55:54 +0000 (00:55 +0000)
commitffedb98b3e06af48ee6d87051ce28ab995ac7cc1
tree8f0a4be6e72f2b6a65f4d15b75ff88580ef8ecf9
parent8c9ca28b31afc642ff266e2ef2b1615310ee8b6b
RISC-V: expose extension bits in AT_HWCAP

AT_HWCAP is a field in the elf auxiliary vector meant to describe
cpu-specific hardware features. For RISC-V we want to use this to
indicate the presence of any standard extensions supported by the CPU.
This allows userland applications to query the system for supported
extensions using elf_aux_info(3).

Support for an extension is indicated by the presence of its
corresponding bit in AT_HWCAP -- e.g. systems supporting the 'c'
extension (compressed instructions) will have the second bit set.

Extensions advertised through AT_HWCAP are only those that are supported
by all harts in the system.

Reviewed by: jhb, markj
Approved by: markj (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20493
sys/riscv/include/elf.h
sys/riscv/include/md_var.h
sys/riscv/riscv/elf_machdep.c
sys/riscv/riscv/identcpu.c