From 08425d9aaff8440eec3a93246b0f3ad7f6fbecab Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sat, 6 Jul 2024 00:06:45 +0800 Subject: [PATCH] util: detect LoongArch architecture Only 64-bit is considered now because 32-bit LoongArch Linux support doesn't exist in upstream yet. Signed-off-by: Icenowy Zheng Reviewed-by: Dave Airlie Part-of: --- src/util/detect_arch.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/util/detect_arch.h b/src/util/detect_arch.h index 35385a02b49..166c4aea1d1 100644 --- a/src/util/detect_arch.h +++ b/src/util/detect_arch.h @@ -112,6 +112,14 @@ #endif #endif +#if defined(__loongarch__) +#ifdef __loongarch_lp64 +#define DETECT_ARCH_LOONGARCH64 1 +#else +#error "detect_arch: unknown target loongarch base ABI type" +#endif +#endif + #ifndef DETECT_ARCH_X86 #define DETECT_ARCH_X86 0 #endif @@ -168,4 +176,8 @@ #define DETECT_ARCH_RISCV64 0 #endif +#ifndef DETECT_ARCH_LOONGARCH64 +#define DETECT_ARCH_LOONGARCH64 0 +#endif + #endif /* UTIL_DETECT_ARCH_H_ */