summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2021-01-26 23:02:18 +0000
committerkettenis <kettenis@openbsd.org>2021-01-26 23:02:18 +0000
commitd389400ee986f78a04ce98c081e6f044ef1071e0 (patch)
tree4d5b46e025b42fdbe4959eda7a842c965369d08f
parentFix build with -fno-common. OK deraadt@ (diff)
downloadwireguard-openbsd-d389400ee986f78a04ce98c081e6f044ef1071e0.tar.xz
wireguard-openbsd-d389400ee986f78a04ce98c081e6f044ef1071e0.zip
Recognize Apple Icestorm cores.
-rw-r--r--sys/arch/arm64/arm64/cpu.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c
index 2122e3cef3f..f620770c33c 100644
--- a/sys/arch/arm64/arm64/cpu.c
+++ b/sys/arch/arm64/arm64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.44 2020/12/04 21:18:09 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.45 2021/01/26 23:02:18 kettenis Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@@ -47,6 +47,7 @@
#define CPU_IMPL_ARM 0x41
#define CPU_IMPL_CAVIUM 0x43
#define CPU_IMPL_AMCC 0x50
+#define CPU_IMPL_APPLE 0x61
#define CPU_PART_CORTEX_A34 0xd02
#define CPU_PART_CORTEX_A53 0xd03
@@ -76,6 +77,8 @@
#define CPU_PART_X_GENE 0x000
+#define CPU_PART_ICESTORM 0x022
+
#define CPU_IMPL(midr) (((midr) >> 24) & 0xff)
#define CPU_PART(midr) (((midr) >> 4) & 0xfff)
#define CPU_VAR(midr) (((midr) >> 20) & 0xf)
@@ -127,6 +130,11 @@ struct cpu_cores cpu_cores_amcc[] = {
{ 0, NULL },
};
+struct cpu_cores cpu_cores_apple[] = {
+ { CPU_PART_ICESTORM, "Icestorm" },
+ { 0, NULL },
+};
+
/* arm cores makers */
const struct implementers {
int id;
@@ -136,6 +144,7 @@ const struct implementers {
{ CPU_IMPL_ARM, "ARM", cpu_cores_arm },
{ CPU_IMPL_CAVIUM, "Cavium", cpu_cores_cavium },
{ CPU_IMPL_AMCC, "Applied Micro", cpu_cores_amcc },
+ { CPU_IMPL_APPLE, "Apple", cpu_cores_apple },
{ 0, NULL },
};