From c5cbed4bf8547f7539acf5948fd388d03fb0b073 Mon Sep 17 00:00:00 2001 From: kettenis Date: Wed, 24 Aug 2022 22:01:16 +0000 Subject: [PATCH] Add DIT CPU feature. ok beck@ --- sys/arch/arm64/arm64/cpu.c | 7 ++++++- sys/arch/arm64/include/armreg.h | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c index c0d7e1ee766..24b7fedaa31 100644 --- a/sys/arch/arm64/arm64/cpu.c +++ b/sys/arch/arm64/arm64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.67 2022/08/23 11:39:34 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.68 2022/08/24 22:01:16 kettenis Exp $ */ /* * Copyright (c) 2016 Dale Rahn @@ -588,6 +588,11 @@ cpu_identify(struct cpu_info *ci) if (ID_AA64PFR0_CSV2(id) >= ID_AA64PFR0_CSV2_SCXT) printf("+SCTX"); + if (ID_AA64PFR0_DIT(id) >= ID_AA64PFR0_DIT_IMPL) { + printf("%sDIT", sep); + sep = ","; + } + #ifdef CPU_DEBUG id = READ_SPECIALREG(id_aa64afr0_el1); printf("\nID_AA64AFR0_EL1: 0x%016llx", id); diff --git a/sys/arch/arm64/include/armreg.h b/sys/arch/arm64/include/armreg.h index 8d26d49a4a9..851f06f8266 100644 --- a/sys/arch/arm64/include/armreg.h +++ b/sys/arch/arm64/include/armreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: armreg.h,v 1.19 2022/01/02 02:26:50 jsg Exp $ */ +/* $OpenBSD: armreg.h,v 1.20 2022/08/24 22:01:16 kettenis Exp $ */ /*- * Copyright (c) 2013, 2014 Andrew Turner * Copyright (c) 2015 The FreeBSD Foundation @@ -510,6 +510,11 @@ #define ID_AA64PFR0_GIC(x) ((x) & ID_AA64PFR0_GIC_MASK) #define ID_AA64PFR0_GIC_CPUIF_NONE (0x0 << ID_AA64PFR0_GIC_SHIFT) #define ID_AA64PFR0_GIC_CPUIF_EN (0x1 << ID_AA64PFR0_GIC_SHIFT) +#define ID_AA64PFR0_DIT_SHIFT 48 +#define ID_AA64PFR0_DIT_MASK (0xfULL << ID_AA64PFR0_DIT_SHIFT) +#define ID_AA64PFR0_DIT(x) ((x) & ID_AA64PFR0_DIT_MASK) +#define ID_AA64PFR0_DIT_UNKNOWN (0x0ULL << ID_AA64PFR0_DIT_SHIFT) +#define ID_AA64PFR0_DIT_IMPL (0x1ULL << ID_AA64PFR0_DIT_SHIFT) #define ID_AA64PFR0_CSV2_SHIFT 56 #define ID_AA64PFR0_CSV2_MASK (0xfULL << ID_AA64PFR0_CSV2_SHIFT) #define ID_AA64PFR0_CSV2(x) ((x) & ID_AA64PFR0_CSV2_MASK) -- 2.20.1