From nobody Tue Apr 21 22:27:13 2026 X-Original-To: dev-commits-src-all@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 4g0cRR3QMRz6ZkbH for ; Tue, 21 Apr 2026 22:27:15 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g0cRQ1D92z3Pl5 for ; Tue, 21 Apr 2026 22:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776810434; 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=8+kmw2W7RERRgeyO5DwuoMQesi8eskwi+y6XlM30L5w=; b=K3uzrRUT7Z0TPZ5s05OYJEl+QvbacCw+W4xCq5qUacSZngO6HvUFi+Vz2Py6hgeGjL8j17 b4/8gRoquvu2imeI6ADkWZOIlW3gToEjWROdbRfBVv8Xkepty+JkaO1+mUk5Q/sqMfseg9 VxFP9rZsryeCOk2nLpSerWuTmlpmp0c7OejSodtGWYjkBq0n+yk2P83hrwbdgXBtPrscUK KPJFh8HRDLFpY5ms/3hwkbgIBb0/4dHfR9oB9nOXAG4cDGNZmUvtoT31ibgoPvzgfAfZrU 3L9gCIcbKuOJ9dEGy1+w7HVT3QafZ8LOPjqwl/YiJXkJNWq8GxFB2ZkXZYBJQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776810434; a=rsa-sha256; cv=none; b=t/3UjbOCrbQeTDKD3mttxxivctceia+I7a1BH0sFrSsQv66kPdacsEq9dJ4Qm2N7fP/8ZB +NgLwZGMbvyBX7FN4Qfim9qrTUsV7ZErNTsjexGQOBfhjfyvmbZgOEwuRwMsOsGcMzEacw xs6/x/Fb8uPTXqGLPtQ57INizclIWWhL3EJiZJmC453wsFaJE/OvJ6LU5izxKpaeaUqtu7 v+FsEDzIevnzeBPPi+U4Kk3sj+N3UDGcNcqcddTMHDMk+TtEktOBWlwSiPhr2z8HjvENsW qRZTMw8cMOIMi2RxzL9ZU2ywpD2VJtmjIo782Waup0dAnnjuPBXL6eJO7SnmlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776810434; 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=8+kmw2W7RERRgeyO5DwuoMQesi8eskwi+y6XlM30L5w=; b=k5ba7usHShOEFXXVNUhx42dzy9GU1y2OtBDeAhI4Fo0Ib1uJQzILW6EDWYlM7X+Hzq61e+ NbU+kC2EBV4pRX0V00HjOJxw9viGGr6zJkavGVUM/a3uZEGGGVnGH37gyIPhA2ksrjVYS4 HMHiKz9CVt9xc81ByZT3pm6ZK3dSAni7YEd0JEdS/1M1XM+pK8GV46UNk3nI0V7O3AhAgY U6vdF0X1dzMdpJqdg0xXMA3q5/8hhqpmAO/avzANlkZY5vvoYonc4RoVEVPZFzqYS4VIHh M/pKQcSRqfr3demBgA+8nuFRjVviHXSDzxXFlHjIbreOalvs+UbCdYV5teccyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g0cRP2RDpz13F3 for ; Tue, 21 Apr 2026 22:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38a87 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 21 Apr 2026 22:27:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: cefd0ae770bf - main - linuxkpi: Add several `guid_*()` functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cefd0ae770bfad534ec666099489a869387e8836 Auto-Submitted: auto-generated Date: Tue, 21 Apr 2026 22:27:13 +0000 Message-Id: <69e7f9c1.38a87.42abba7c@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=cefd0ae770bfad534ec666099489a869387e8836 commit cefd0ae770bfad534ec666099489a869387e8836 Author: Jean-Sébastien Pédron AuthorDate: 2026-04-13 22:36:18 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-04-21 22:18:25 +0000 linuxkpi: Add several `guid_*()` functions The DRM generic code and the amdgpu DRM driver started to use several of these functions in Linux 6.12. Likewise for `UUID_SIZE`. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56448 --- sys/compat/linuxkpi/common/include/linux/uuid.h | 27 +++++++++++++++++++++++++ sys/compat/linuxkpi/common/src/linux_compat.c | 3 +++ 2 files changed, 30 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/uuid.h b/sys/compat/linuxkpi/common/include/linux/uuid.h index 4f6f4a8b34f0..0765ef4dcc1e 100644 --- a/sys/compat/linuxkpi/common/include/linux/uuid.h +++ b/sys/compat/linuxkpi/common/include/linux/uuid.h @@ -33,6 +33,7 @@ #include +#define UUID_SIZE 16 #define UUID_STRING_LEN 36 #define GUID_INIT(x0_3, x4_5, x6_7, x8, x9, x10, x11, x12, x13, x14, x15) \ @@ -59,6 +60,8 @@ typedef struct { char x[16]; } guid_t; +extern const guid_t guid_null; + static inline void guid_gen(guid_t *g) { @@ -68,10 +71,34 @@ guid_gen(guid_t *g) g->x[8] = (g->x[8] & 0x3f) | 0x80; } +static inline bool +guid_equal(const guid_t *u1, const guid_t *u2) +{ + return (memcmp(u1, u2, sizeof(guid_t)) == 0); +} + static inline void guid_copy(guid_t *dst, const guid_t *src) { memcpy(dst, src, sizeof(*dst)); } +static inline void +import_guid(guid_t *dst, const uint8_t *src) +{ + memcpy(dst, src, sizeof(guid_t)); +} + +static inline void +export_guid(uint8_t *dst, const guid_t *src) +{ + memcpy(dst, src, sizeof(guid_t)); +} + +static inline bool +guid_is_null(const guid_t *guid) +{ + return (guid_equal(guid, &guid_null)); +} + #endif /* _LINUXKPI_LINUX_UUID_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 8fc644241d79..0c7032fa6e23 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -98,6 +98,7 @@ #include #include #include +#include #if defined(__i386__) || defined(__amd64__) #include @@ -164,6 +165,8 @@ unsigned long linux_timer_hz_mask; wait_queue_head_t linux_bit_waitq; wait_queue_head_t linux_var_waitq; +const guid_t guid_null; + int panic_cmp(struct rb_node *one, struct rb_node *two) {