| 1 | /*	$OpenBSD: elf.h,v 1.3 2025/02/19 18:25:03 jca Exp $	*/ |
| 2 | |
| 3 | /* |
| 4 | * This file is in the public domain. |
| 5 | */ |
| 6 | |
| 7 | #ifndef	_MACHINE_ELF_H_ |
| 8 | #define	_MACHINE_ELF_H_ |
| 9 | |
| 10 | /* |
| 11 | * CPU Feature Attributes |
| 12 | * |
| 13 | * These are defined in the PowerPC ELF ABI for the AT_HWCAP vector, |
| 14 | * and are exported to userland via the elf_aux_info(3) function. |
| 15 | */ |
| 16 | |
| 17 | #ifdef _KERNEL |
| 18 | # define __HAVE_CPU_HWCAP |
| 19 | # define __HAVE_CPU_HWCAP2 |
| 20 | extern unsigned long hwcap; |
| 21 | extern unsigned long hwcap2; |
| 22 | #endif /* _KERNEL */ |
| 23 | |
| 24 | #define	PPC_FEATURE_32		0x80000000	/* Always true */ |
| 25 | #define	PPC_FEATURE_64		0x40000000	/* Defined on a 64-bit CPU */ |
| 26 | #define	PPC_FEATURE_601_INSTR	0x20000000 |
| 27 | #define	PPC_FEATURE_HAS_ALTIVEC	0x10000000 |
| 28 | #define	PPC_FEATURE_HAS_FPU	0x08000000 |
| 29 | #define	PPC_FEATURE_HAS_MMU	0x04000000 |
| 30 | #define	PPC_FEATURE_UNIFIED_CACHE 0x01000000 |
| 31 | #define	PPC_FEATURE_HAS_SPE	0x00800000 |
| 32 | #define	PPC_FEATURE_HAS_EFP_SINGLE	0x00400000 |
| 33 | #define	PPC_FEATURE_HAS_EFP_DOUBLE	0x00200000 |
| 34 | #define	PPC_FEATURE_NO_TB	0x00100000 |
| 35 | #define	PPC_FEATURE_POWER4	0x00080000 |
| 36 | #define	PPC_FEATURE_POWER5	0x00040000 |
| 37 | #define	PPC_FEATURE_POWER5_PLUS	0x00020000 |
| 38 | #define	PPC_FEATURE_CELL	0x00010000 |
| 39 | #define	PPC_FEATURE_BOOKE	0x00008000 |
| 40 | #define	PPC_FEATURE_SMT		0x00004000 |
| 41 | #define	PPC_FEATURE_ICACHE_SNOOP	0x00002000 |
| 42 | #define	PPC_FEATURE_ARCH_2_05	0x00001000 |
| 43 | #define	PPC_FEATURE_HAS_DFP	0x00000400 |
| 44 | #define	PPC_FEATURE_POWER6_EXT	0x00000200 |
| 45 | #define	PPC_FEATURE_ARCH_2_06	0x00000100 |
| 46 | #define	PPC_FEATURE_HAS_VSX	0x00000080 |
| 47 | #define	PPC_FEATURE_TRUE_LE	0x00000002 |
| 48 | #define	PPC_FEATURE_PPC_LE	0x00000001 |
| 49 | |
| 50 | #define	PPC_FEATURE2_ARCH_2_07	0x80000000 |
| 51 | #define	PPC_FEATURE2_HTM	0x40000000 |
| 52 | #define	PPC_FEATURE2_DSCR	0x20000000 |
| 53 | #define	PPC_FEATURE2_EBB	0x10000000 |
| 54 | #define	PPC_FEATURE2_ISEL	0x08000000 |
| 55 | #define	PPC_FEATURE2_TAR	0x04000000 |
| 56 | #define	PPC_FEATURE2_HAS_VEC_CRYPTO	0x02000000 |
| 57 | #define	PPC_FEATURE2_HTM_NOSC	0x01000000 |
| 58 | #define	PPC_FEATURE2_ARCH_3_00	0x00800000 |
| 59 | #define	PPC_FEATURE2_HAS_IEEE128	0x00400000 |
| 60 | #define	PPC_FEATURE2_DARN	0x00200000 |
| 61 | #define	PPC_FEATURE2_SCV	0x00100000 |
| 62 | #define	PPC_FEATURE2_HTM_NOSUSPEND	0x00080000 |
| 63 | #define	PPC_FEATURE2_ARCH_3_1	0x00040000 |
| 64 | #define	PPC_FEATURE2_MMA	0x00020000 |
| 65 | |
| 66 | #endif /* !_MACHINE_ELF_H_ */ |