git: 196f6aaa29d7 - stable/13 - Add the arch field to the arm64 MIDR macros

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Mon, 23 Jan 2023 12:37:39 UTC
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=196f6aaa29d7d9809b4225981e0bbc0d363f9b99

commit 196f6aaa29d7d9809b4225981e0bbc0d363f9b99
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-11-14 15:48:43 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-01-23 12:36:28 +0000

    Add the arch field to the arm64 MIDR macros
    
    For completeness add accessors for the MIDR field. As the field is
    always 0xf on arm64 it is unneeded in the current MICR handling, but
    will be used in the vmm module for bhyve.
    
    Obtained from:  https://github.com/FreeBSD-UPB/freebsd-src (earlier version)
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 80ba994bfacd8a843af4eb9cb7558b62e8de26ee)
---
 sys/arm64/include/cpu.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h
index e913716be7d2..f74944977b47 100644
--- a/sys/arm64/include/cpu.h
+++ b/sys/arm64/include/cpu.h
@@ -129,16 +129,19 @@
 #define	CPU_IMPL(midr)	(((midr) >> 24) & 0xff)
 #define	CPU_PART(midr)	(((midr) >> 4) & 0xfff)
 #define	CPU_VAR(midr)	(((midr) >> 20) & 0xf)
+#define	CPU_ARCH(midr)	(((midr) >> 16) & 0xf)
 #define	CPU_REV(midr)	(((midr) >> 0) & 0xf)
 
 #define	CPU_IMPL_TO_MIDR(val)	(((val) & 0xff) << 24)
 #define	CPU_PART_TO_MIDR(val)	(((val) & 0xfff) << 4)
 #define	CPU_VAR_TO_MIDR(val)	(((val) & 0xf) << 20)
+#define	CPU_ARCH_TO_MIDR(val)	(((val) & 0xf) << 16)
 #define	CPU_REV_TO_MIDR(val)	(((val) & 0xf) << 0)
 
 #define	CPU_IMPL_MASK	(0xff << 24)
 #define	CPU_PART_MASK	(0xfff << 4)
 #define	CPU_VAR_MASK	(0xf << 20)
+#define	CPU_ARCH_MASK	(0xf << 16)
 #define	CPU_REV_MASK	(0xf << 0)
 
 #define	CPU_ID_RAW(impl, part, var, rev)		\