From nobody Wed Sep 24 13:02:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cWxpZ4hzNz67pZj; Wed, 24 Sep 2025 13:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cWxpZ41HYz3WML; Wed, 24 Sep 2025 13:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758718966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=frh/NMbS1RzDxnxq6SaMC/A9kQ9VYSpO3JQ5zAvaRzk=; b=BHRuG3bOc1PBwsRmY+x1Ejt/f0YPFYes5U4yxIBojaVqSERnUCN+aCi8Jt5r/Cik6VRgpe UWko07GeBFSDI8TMvnSDxQ9eqkLj76PuwvD7ncrzOG7bn5PsLDsgSbhKxBX9ho71D1ery9 YREpIS6zqkmdZ1fpBt8M5+sf/Xvr6AkgvlKOV9UZRO01QfJDTxWd3/RhbplEte1QlrnNWz VP8JLHhDr1yNRYeP1AjeKOkngLufSogaMfY+GvaVo9zxEB0pYaJIQJyxX090w56eUTJwNu WWTkGW5nrUda62lq+g7g0vPs+b8yrcFin+vOrgqOaQPxRk3240hU2xILs7pcTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758718966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=frh/NMbS1RzDxnxq6SaMC/A9kQ9VYSpO3JQ5zAvaRzk=; b=rnx+buB2k80Jt4Zsr3MWYPabqdEz31MuL6CPzW+k9W+mjV8B6Pe66NPuk9KIWpSMwafvIB ptqoK57uqYXimbNAs/RvWojNU/SbHLbdHduFsTU+71W36OXj/w11E5V7cRb2LSB2/uzhyB VBa6zEyw4/brUmm196uuGY8MsqHfexUcVDa4oTgmCMW2Udye/ShA/sBqXt8Sm7FCMNNKFH 4kJXt2FP9Uj6hkk7suKBDR9K7Pcq36pwqrtB9jX9Dhj9jtcG6LACE9cEMVDQfkIzkiwsWc pVvhK/HLtV+oN9l1l8D3B1DVLbuENiDUuZuIWsFjgyi1aeKglGPVPkRVabAt0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758718966; a=rsa-sha256; cv=none; b=wr0UFxIc9zD9cQrdkfbbs8xo3+Fu00s9/HJGDDEJHHMjRXDFYFnQNgKzLlSHIIrjMEY3b0 GS4oEpagN0XzmNkNY10b11bWp7TTviUW+8AMYXatt19Tl81CbQr2ERTZxJz7X4x4h6zYhx j677zbrW+ppxBrhn3m40Vbfayjqg8IdsEx+ZMCn363HPNo6Frlw/MLp6HmDNUz4NCox9IR vP2uda6cl6Caz1sa3Fqm+wbJyY5TbpQ0gy20iNyS0oWpkJ1EmYByOzppokGE0FibCKke2S 2pCVdORWq4AYHBS+ayYZBv+0KiPjENy2ROoi294HJfEWM7iZ1jKim1xrzUD+rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cWxpZ3bFkzYq2; Wed, 24 Sep 2025 13:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58OD2kfe034404; Wed, 24 Sep 2025 13:02:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58OD2kpJ034401; Wed, 24 Sep 2025 13:02:46 GMT (envelope-from git) Date: Wed, 24 Sep 2025 13:02:46 GMT Message-Id: <202509241302.58OD2kpJ034401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 50ee990e1874 - main - amd64 cpufunc.h: add rcs(), to read code selector List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50ee990e1874d6d40b8e3dc359c37e2ef2ebf477 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=50ee990e1874d6d40b8e3dc359c37e2ef2ebf477 commit 50ee990e1874d6d40b8e3dc359c37e2ef2ebf477 Author: Konstantin Belousov AuthorDate: 2025-09-19 02:37:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-09-24 13:02:27 +0000 amd64 cpufunc.h: add rcs(), to read code selector Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D52607 --- sys/amd64/include/cpufunc.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index e6c9f47ea261..9a4c82275a99 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -572,6 +572,15 @@ rss(void) return (sel); } +static __inline u_short +rcs(void) +{ + u_short sel; + + __asm __volatile("movw %%cs,%0" : "=rm" (sel)); + return (sel); +} + static __inline void load_ds(u_short sel) {