git: 72952bf6a307 - main - amd64: try to fix the build with old clang that does not know about FRED
Konstantin Belousov <[email protected]> Thu, 30 Jul 2026 17:08:58 +0000
| Newsgroups | gmane.os.freebsd.devel.cvs.src |
|---|---|
| Message-ID | <6a6b852a.389ab.200b7087__1468.93796497665$1785431358$gmane$org@gitrepo.freebsd.org> |
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=72952bf6a307391e127d3ab4a6f073664ce62d89 commit 72952bf6a307391e127d3ab4a6f073664ce62d89 Author: Konstantin Belousov <[email protected]> AuthorDate: 2026-07-30 09:45:51 +0000 Commit: Konstantin Belousov <[email protected]> CommitDate: 2026-07-30 17:08:24 +0000 amd64: try to fix the build with old clang that does not know about FRED Reported by: jhb Reviewed by: jhb, jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58550 --- 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 6dfb8a431fe7..458a7c405793 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.