git: cd8abeb1c5e6 - stable/13 - dtrace: Drop illumos ifdefs for CPU register definitions

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 19 Oct 2022 14:40:31 UTC
The branch stable/13 has been updated by markj:

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

commit cd8abeb1c5e687b145571a0a57377cf5fd24a81a
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-10-12 19:59:00 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-10-19 14:15:49 +0000

    dtrace: Drop illumos ifdefs for CPU register definitions
    
    These are fixed, so having upstream's version is not especially useful,
    and the duplicated definitions make for confusing reading.  No
    functional change intended.
    
    (cherry picked from commit b34a6e0fed4af33671c79347deb77e3e93930df3)
---
 sys/cddl/dev/dtrace/amd64/dtrace_isa.c |  8 ------
 sys/cddl/dev/dtrace/x86/regset.h       | 52 ----------------------------------
 2 files changed, 60 deletions(-)

diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
index 71b448a99c1c..55e51cee14d8 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
@@ -501,11 +501,7 @@ dtrace_getreg(struct trapframe *rp, uint_t reg)
 		REG_SS		/* 18 SS */
 	};
 
-#ifdef illumos
-	if (reg <= SS) {
-#else	/* !illumos */
 	if (reg <= GS) {
-#endif
 		if (reg >= sizeof (regmap) / sizeof (int)) {
 			DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP);
 			return (0);
@@ -514,11 +510,7 @@ dtrace_getreg(struct trapframe *rp, uint_t reg)
 		reg = regmap[reg];
 	} else {
 		/* This is dependent on reg.d. */
-#ifdef illumos
-		reg -= SS + 1;
-#else	/* !illumos */
 		reg -= GS + 1;
-#endif
 	}
 
 	switch (reg) {
diff --git a/sys/cddl/dev/dtrace/x86/regset.h b/sys/cddl/dev/dtrace/x86/regset.h
index ad12e26a5aec..b480e411e6c2 100644
--- a/sys/cddl/dev/dtrace/x86/regset.h
+++ b/sys/cddl/dev/dtrace/x86/regset.h
@@ -61,35 +61,6 @@ extern "C" {
 
 #define	REG_GSBASE	27
 #define	REG_FSBASE	26
-#ifdef illumos
-#define	REG_DS		25
-#define	REG_ES		24
-
-#define	REG_GS		23
-#define	REG_FS		22
-#define	REG_SS		21
-#define	REG_RSP		20
-#define	REG_RFL		19
-#define	REG_CS		18
-#define	REG_RIP		17
-#define	REG_ERR		16
-#define	REG_TRAPNO	15
-#define	REG_RAX		14
-#define	REG_RCX		13
-#define	REG_RDX		12
-#define	REG_RBX		11
-#define	REG_RBP		10
-#define	REG_RSI		9
-#define	REG_RDI		8
-#define	REG_R8		7
-#define	REG_R9		6
-#define	REG_R10		5
-#define	REG_R11		4
-#define	REG_R12		3
-#define	REG_R13		2
-#define	REG_R14		1
-#define	REG_R15		0
-#else	/* !illumos */
 #define	REG_SS		25
 #define	REG_RSP		24
 #define	REG_RFL		23
@@ -116,33 +87,11 @@ extern "C" {
 #define	REG_R13		2
 #define	REG_R14		1
 #define	REG_R15		0
-#endif	/* illumos */
 
 /*
  * The names and offsets defined here are specified by i386 ABI suppl.
  */
 
-#ifdef illumos
-#define	SS		18	/* only stored on a privilege transition */
-#define	UESP		17	/* only stored on a privilege transition */
-#define	EFL		16
-#define	CS		15
-#define	EIP		14
-#define	ERR		13
-#define	TRAPNO		12
-#define	EAX		11
-#define	ECX		10
-#define	EDX		9
-#define	EBX		8
-#define	ESP		7
-#define	EBP		6
-#define	ESI		5
-#define	EDI		4
-#define	DS		3
-#define	ES		2
-#define	FS		1
-#define	GS		0
-#else	/* !illumos */
 #define	GS		18
 #define	SS		17	/* only stored on a privilege transition */
 #define	UESP		16	/* only stored on a privilege transition */
@@ -162,7 +111,6 @@ extern "C" {
 #define	DS		2
 #define	ES		1
 #define	FS		0
-#endif	/* illumos */
 
 #define REG_PC  EIP
 #define REG_FP  EBP