Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Aug 2026 10:35:05 +0000
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2947a48bea3b - stable/15 - amd64: try to fix the build with old clang that does not know about FRED
Message-ID:  <6a75b4d9.23eb3.4e62c32c@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by kib:

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

commit 2947a48bea3b720e58f3a2e1d6740789e9cc259a
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-30 09:45:51 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-08-07 10:27:34 +0000

    amd64: try to fix the build with old clang that does not know about FRED
    
    (cherry picked from commit 72952bf6a307391e127d3ab4a6f073664ce62d89)
---
 sys/amd64/amd64/exception.S | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S
index 8eb5c185974d..0e783fe4ff00 100644
--- a/sys/amd64/amd64/exception.S
+++ b/sys/amd64/amd64/exception.S
@@ -1403,6 +1403,23 @@ gsbase_load_fault:
 	movq	$0,PCB_GSBASE(%r8)
 	jmp	doreti
 
+#if defined(__clang__) && (__clang_major__ <= 18)
+	.macro	lkgs	reg
+	.if	\reg != %ax
+	.err	"Only %ax is supported"
+	.endif
+	.byte	0xf2, 0x0f, 0x00, 0xf0
+	.endm
+
+	.macro	eretu
+	.byte	0xf3, 0x0f, 0x01, 0xca
+	.endm
+
+	.macro	erets
+	.byte	0xf2, 0x0f, 0x01, 0xca
+	.endm
+#endif
+
 /*
  * FRED guarantees that on entry, %rflags is set to '2', which in
  * particular means that interrupts are disabled, and DF/AC are clear.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a75b4d9.23eb3.4e62c32c>