Include hwcap.h only in C compilation

Change-Id: I08a75896ebd49634f31a80ed37acf2a1267fe156
Signed-off-by: Taiju Yamada <tyamada@bi.a.u-tokyo.ac.jp>
This commit is contained in:
Taiju Yamada 2022-10-31 15:30:27 +09:00 committed by Greg Tucker
parent c2bec3ea65
commit ad39d7ccfd

View File

@ -31,13 +31,6 @@
#ifndef __aarch64__
#error "This file is for aarch64 only"
#endif
#ifdef __APPLE__
#define SYSCTL_PMULL_KEY "hw.optional.arm.FEAT_PMULL" // from macOS 12 FEAT_* sysctl infos are available
#define SYSCTL_CRC32_KEY "hw.optional.armv8_crc32"
#define SYSCTL_SVE_KEY "hw.optional.arm.FEAT_SVE" // this one is just a guess and need to check macOS update
#else
#include <asm/hwcap.h>
#endif
#include "aarch64_label.h"
#ifdef __ASSEMBLY__
/**
@ -221,7 +214,11 @@
#include <stdint.h>
#if defined(__linux__)
#include <sys/auxv.h>
#include <asm/hwcap.h>
#elif defined(__APPLE__)
#define SYSCTL_PMULL_KEY "hw.optional.arm.FEAT_PMULL" // from macOS 12 FEAT_* sysctl infos are available
#define SYSCTL_CRC32_KEY "hw.optional.armv8_crc32"
#define SYSCTL_SVE_KEY "hw.optional.arm.FEAT_SVE" // this one is just a guess and need to check macOS update
#include <sys/sysctl.h>
#include <stddef.h>
static inline int sysctlEnabled(const char* name){