Add AT_HWCAP flags for VFP settings for FreeBSD/arm.
These flags match the meaning and value of flags in Linux, though Linux has many more flags. Reviewed by: stevek, Michal Meloun <meloun-miracle-cz> (earlier version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12291
This commit is contained in:
parent
c2f37b9245
commit
19e1bd0104
@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
static boolean_t elf32_arm_abi_supported(struct image_params *);
|
static boolean_t elf32_arm_abi_supported(struct image_params *);
|
||||||
|
|
||||||
|
u_long elf_hwcap;
|
||||||
|
|
||||||
struct sysentvec elf32_freebsd_sysvec = {
|
struct sysentvec elf32_freebsd_sysvec = {
|
||||||
.sv_size = SYS_MAXSYSCALL,
|
.sv_size = SYS_MAXSYSCALL,
|
||||||
.sv_table = sysent,
|
.sv_table = sysent,
|
||||||
@ -86,6 +88,7 @@ struct sysentvec elf32_freebsd_sysvec = {
|
|||||||
.sv_schedtail = NULL,
|
.sv_schedtail = NULL,
|
||||||
.sv_thread_detach = NULL,
|
.sv_thread_detach = NULL,
|
||||||
.sv_trap = NULL,
|
.sv_trap = NULL,
|
||||||
|
.sv_hwcap = &elf_hwcap,
|
||||||
};
|
};
|
||||||
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
|
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
|
||||||
|
|
||||||
|
@ -33,9 +33,11 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
|
#include <sys/imgact_elf.h>
|
||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
|
|
||||||
#include <machine/armreg.h>
|
#include <machine/armreg.h>
|
||||||
|
#include <machine/elf.h>
|
||||||
#include <machine/frame.h>
|
#include <machine/frame.h>
|
||||||
#include <machine/md_var.h>
|
#include <machine/md_var.h>
|
||||||
#include <machine/pcb.h>
|
#include <machine/pcb.h>
|
||||||
@ -115,6 +117,7 @@ vfp_init(void)
|
|||||||
vfp_exists = 1;
|
vfp_exists = 1;
|
||||||
is_d32 = 0;
|
is_d32 = 0;
|
||||||
PCPU_SET(vfpsid, fpsid); /* save the fpsid */
|
PCPU_SET(vfpsid, fpsid); /* save the fpsid */
|
||||||
|
elf_hwcap |= HWCAP_VFP;
|
||||||
|
|
||||||
vfp_arch =
|
vfp_arch =
|
||||||
(fpsid & VFPSID_SUBVERSION2_MASK) >> VFPSID_SUBVERSION_OFF;
|
(fpsid & VFPSID_SUBVERSION2_MASK) >> VFPSID_SUBVERSION_OFF;
|
||||||
@ -122,9 +125,13 @@ vfp_init(void)
|
|||||||
if (vfp_arch >= VFP_ARCH3) {
|
if (vfp_arch >= VFP_ARCH3) {
|
||||||
tmp = fmrx(mvfr0);
|
tmp = fmrx(mvfr0);
|
||||||
PCPU_SET(vfpmvfr0, tmp);
|
PCPU_SET(vfpmvfr0, tmp);
|
||||||
|
elf_hwcap |= HWCAP_VFPv3;
|
||||||
|
|
||||||
if ((tmp & VMVFR0_RB_MASK) == 2)
|
if ((tmp & VMVFR0_RB_MASK) == 2) {
|
||||||
|
elf_hwcap |= HWCAP_VFPD32;
|
||||||
is_d32 = 1;
|
is_d32 = 1;
|
||||||
|
} else
|
||||||
|
elf_hwcap |= HWCAP_VFPv3D16;
|
||||||
|
|
||||||
tmp = fmrx(mvfr1);
|
tmp = fmrx(mvfr1);
|
||||||
PCPU_SET(vfpmvfr1, tmp);
|
PCPU_SET(vfpmvfr1, tmp);
|
||||||
|
@ -115,4 +115,10 @@ __ElfType(Auxinfo);
|
|||||||
|
|
||||||
#define ET_DYN_LOAD_ADDR 0x12000
|
#define ET_DYN_LOAD_ADDR 0x12000
|
||||||
|
|
||||||
|
/* Flags passed in AT_HWCAP. */
|
||||||
|
#define HWCAP_VFP 0x00000040
|
||||||
|
#define HWCAP_VFPv3 0x00000200
|
||||||
|
#define HWCAP_VFPv3D16 0x00000400
|
||||||
|
#define HWCAP_VFPD32 0x00080000
|
||||||
|
|
||||||
#endif /* !_MACHINE_ELF_H_ */
|
#endif /* !_MACHINE_ELF_H_ */
|
||||||
|
@ -38,6 +38,7 @@ extern char sigcode[];
|
|||||||
extern int szsigcode;
|
extern int szsigcode;
|
||||||
extern uint32_t *vm_page_dump;
|
extern uint32_t *vm_page_dump;
|
||||||
extern int vm_page_dump_size;
|
extern int vm_page_dump_size;
|
||||||
|
extern u_long elf_hwcap;
|
||||||
|
|
||||||
extern int (*_arm_memcpy)(void *, void *, int, int);
|
extern int (*_arm_memcpy)(void *, void *, int, int);
|
||||||
extern int (*_arm_bzero)(void *, int, int);
|
extern int (*_arm_bzero)(void *, int, int);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user