-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cpucap.h header and detect AArch64 systems
Also, allow `FORCE_AARCH64` to double-check that a system is recognized as AArch64. Use this in all AArch64-based CI builds. Signed-off-by: Hanno Becker <[email protected]>
- Loading branch information
1 parent
580c136
commit 157c445
Showing
5 changed files
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef CPUCAP_H | ||
#define CPUCAP_H | ||
|
||
/* Check if we're running on an AArch64 system. _M_ARM64 is set by MSVC. */ | ||
#if defined(__aarch64__) || defined(_M_ARM64) | ||
#define SYS_AARCH64 | ||
#endif | ||
|
||
/* If FORCE_AARCH64 is set, assert that we're indeed on an AArch64 system. */ | ||
#if defined(FORCE_AARCH64) && !defined(SYS_AARCH64) | ||
#error "FORCE_AARCH64 is set, but we don't seem to be on an AArch64 system. | ||
#endif | ||
|
||
#endif |