Skip to content

Commit

Permalink
Fix double declaration of getauxval() for FreeBSD PPC
Browse files Browse the repository at this point in the history
The extern declaration is only for Linux, move this line
into the right #ifdef section.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Co-authored-by: Martin Matuska <mm@FreeBSD.org>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes openzfs#13934
Closes openzfs#13936
  • Loading branch information
mcmilk authored and andrewc12 committed Oct 1, 2022
1 parent 3c79e9d commit 120d86d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion include/os/freebsd/spl/sys/simd_powerpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <sys/cdefs.h>

#include <machine/pcb.h>
#include <powerpc/cpu.h>
#include <machine/cpu.h>

#define kfpu_allowed() 1
#define kfpu_initialize(tsk) do {} while (0)
Expand Down Expand Up @@ -88,3 +88,5 @@ zfs_isa207_available(void)
{
return ((cpu_features2 & PPC_FEATURE2_ARCH_2_07) != 0);
}

#endif
5 changes: 3 additions & 2 deletions lib/libspl/include/sys/simd.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@ zfs_avx512vbmi_available(void)
#elif defined(__powerpc__)

/* including <sys/auxv.h> clashes with AT_UID and others */
extern unsigned long getauxval(unsigned long type);
#if defined(__FreeBSD__)
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
extern int elf_aux_info(int aux, void *buf, int buflen);
static unsigned long getauxval(unsigned long key)
static inline unsigned long
getauxval(unsigned long key)
{
unsigned long val = 0UL;

Expand All @@ -470,6 +470,7 @@ static unsigned long getauxval(unsigned long key)
#elif defined(__linux__)
#define AT_HWCAP 16 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
extern unsigned long getauxval(unsigned long type);
#endif

#define kfpu_allowed() 1
Expand Down

0 comments on commit 120d86d

Please sign in to comment.