From nobody Tue Nov 05 18:24:42 2024 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 4XjcF62Dhlz5cQDY; Tue, 05 Nov 2024 18:24:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjcF61lLWz4HPk; Tue, 5 Nov 2024 18:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730831082; 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=YJ0HxJLxcx5OZL/n1//1N09hq8qHa92d5oloxmr6utw=; b=r0isAkCUMfbwXK0Tcgd8J1X4m09BFQGeaHAdlQxl/a/4E3QufJbDNirrPvEYy9R/DR4gos MJhoIeAzB97U6NXnatyQKefKqO4xjJ/7qdqdsJgVBJry154rml4LHeXuJO7ZRVD+vjjVws CWCzAgKzL/TrvFr4aFGH+w0LgQSAWruIinxOgsV9E71K5eGiEgx+XD9nTqnjIbIyzIlBdO dJfXXvYfcFFEnD9Ig9DobI5SyF8+K/c+0PRtTDgokBviZ4R1ZB+tCNyWoC5hFrHdEQv1Pg orswIVx0DRj32uQvsTZFZAG3GjWlTdcGvTZSYpONB3JlakYpD3oZhi4NIQkKIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730831082; 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=YJ0HxJLxcx5OZL/n1//1N09hq8qHa92d5oloxmr6utw=; b=ws57MTPWHUl7C4pNbwFoaOf67ZGhr8EfqNNCh/7mJnfQd2+66pFGSEyxYuh5v3kGsEjs9+ KU8aDIPV1VqwTcdwz6PmFP2iG35YNbSDdf94hvoyzlg7eApGmR3TeGDOU241aCbPCbt0i9 D/LSHLqcCe9etoMu6aUIOR2Jz2UuA1M+J7b0Gn9auipHpSHvjmYOwKR5UKZ/z50+rtQydI ypbKpMwI3m+0BvPjuKTFO2ckpynDMOjiQTY73Vbrc3LNZoXiV+p9CGDkkpN62szd14lbZ0 Wi6spAzE0ztut2BHpA7X4iXB/+a0gG9eU/ZEnZxVqhZ2puHNlUjStoQgcplPDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730831082; a=rsa-sha256; cv=none; b=jIn9jF5RWIimagKYK8fUgkTSWSEmP0D5+oEuisRLVpfj2pIAm1ZUPxDQ5xbBjsTwQ+iJ/h jQtIKx7HETXpvqhS4vXk6jVfrqjfhvBcwNiOctedbw9dJMLQDnSTWJmQ7mG+kts4+wr691 eJ7My6UniKFETYfnGB7yVhUn9Bxo50UgZ56EULXHgkONXwkadZ/3BQJj3GlqKALecvjwT8 Mi3tki5g4I5w1Skb1+0IYSH6WFnCQMsP6jC5iyOuFGzjgkpr/eP4hZ/FejanFEqhZSp94C jpLKJv7QQC15JFFKdKqMx9NwxHiqNg8S2JzMn3qxN9853kzmo/sknZrpK+qjWA== 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 4XjcF61LYVzSsG; Tue, 5 Nov 2024 18:24:42 +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 4A5IOgfg024411; Tue, 5 Nov 2024 18:24:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A5IOgbB024408; Tue, 5 Nov 2024 18:24:42 GMT (envelope-from git) Date: Tue, 5 Nov 2024 18:24:42 GMT Message-Id: <202411051824.4A5IOgbB024408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d14c38ceb8aa - main - sys: Avoid relying on pollution from refcount.h 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d14c38ceb8aa10bd94913d0456ec0f726693379b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d14c38ceb8aa10bd94913d0456ec0f726693379b commit d14c38ceb8aa10bd94913d0456ec0f726693379b Author: Mark Johnston AuthorDate: 2024-11-05 14:31:50 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 18:22:20 +0000 sys: Avoid relying on pollution from refcount.h Fix up headers which previously assumed that refcount.h includes systm.h, and make them more self-contained. Then, replace the systm.h include in refcount with kassert.h. Reviewed by: imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47450 --- sys/powerpc/include/counter.h | 2 ++ sys/sys/_lock.h | 4 ++-- sys/sys/_mutex.h | 6 ++++-- sys/sys/_rmlock.h | 10 ++++++++-- sys/sys/_rwlock.h | 6 ++++-- sys/sys/_sx.h | 5 ++++- sys/sys/file.h | 7 +++++-- sys/sys/ktls.h | 3 +++ sys/sys/refcount.h | 7 ++++--- sys/sys/sglist.h | 1 + tools/build/test-includes/badfiles.inc | 1 - 11 files changed, 37 insertions(+), 15 deletions(-) diff --git a/sys/powerpc/include/counter.h b/sys/powerpc/include/counter.h index 68e292cde7f6..90e6400ad562 100644 --- a/sys/powerpc/include/counter.h +++ b/sys/powerpc/include/counter.h @@ -100,6 +100,8 @@ counter_u64_add(counter_u64_t c, int64_t inc) #else /* !64bit */ +#include + #define counter_enter() critical_enter() #define counter_exit() critical_exit() diff --git a/sys/sys/_lock.h b/sys/sys/_lock.h index ef167b9ab5ec..7057463fbde2 100644 --- a/sys/sys/_lock.h +++ b/sys/sys/_lock.h @@ -33,8 +33,8 @@ struct lock_object { const char *lo_name; /* Individual lock name. */ - u_int lo_flags; - u_int lo_data; /* General class specific data. */ + unsigned int lo_flags; + unsigned int lo_data; /* General class specific data. */ struct witness *lo_witness; /* Data for witness. */ }; diff --git a/sys/sys/_mutex.h b/sys/sys/_mutex.h index 0fcd5a2c2809..7241f9f1d31c 100644 --- a/sys/sys/_mutex.h +++ b/sys/sys/_mutex.h @@ -31,6 +31,8 @@ #ifndef _SYS__MUTEX_H_ #define _SYS__MUTEX_H_ +#include +#include #include /* @@ -44,7 +46,7 @@ */ struct mtx { struct lock_object lock_object; /* Common lock properties. */ - volatile uintptr_t mtx_lock; /* Owner and flags. */ + volatile __uintptr_t mtx_lock; /* Owner and flags. */ }; /* @@ -58,7 +60,7 @@ struct mtx { */ struct mtx_padalign { struct lock_object lock_object; /* Common lock properties. */ - volatile uintptr_t mtx_lock; /* Owner and flags. */ + volatile __uintptr_t mtx_lock; /* Owner and flags. */ } __aligned(CACHE_LINE_SIZE); #endif /* !_SYS__MUTEX_H_ */ diff --git a/sys/sys/_rmlock.h b/sys/sys/_rmlock.h index 38375b623a65..9c8893efe19c 100644 --- a/sys/sys/_rmlock.h +++ b/sys/sys/_rmlock.h @@ -32,6 +32,14 @@ #ifndef _SYS__RMLOCK_H_ #define _SYS__RMLOCK_H_ +#include +#include +#include +#include +#include + +struct thread; + /* * Mostly reader/occasional writer lock. */ @@ -66,8 +74,6 @@ struct rm_priotracker { LIST_ENTRY(rm_priotracker) rmp_qentry; }; -#include - struct rmslock_pcpu; struct rmslock { diff --git a/sys/sys/_rwlock.h b/sys/sys/_rwlock.h index d360cfe2a4e9..8c15771cb172 100644 --- a/sys/sys/_rwlock.h +++ b/sys/sys/_rwlock.h @@ -28,6 +28,8 @@ #ifndef _SYS__RWLOCK_H_ #define _SYS__RWLOCK_H_ +#include +#include #include /* @@ -41,7 +43,7 @@ */ struct rwlock { struct lock_object lock_object; - volatile uintptr_t rw_lock; + volatile __uintptr_t rw_lock; }; /* @@ -55,7 +57,7 @@ struct rwlock { */ struct rwlock_padalign { struct lock_object lock_object; - volatile uintptr_t rw_lock; + volatile __uintptr_t rw_lock; } __aligned(CACHE_LINE_SIZE); #endif /* !_SYS__RWLOCK_H_ */ diff --git a/sys/sys/_sx.h b/sys/sys/_sx.h index f70462c9a008..c6fd485620c6 100644 --- a/sys/sys/_sx.h +++ b/sys/sys/_sx.h @@ -31,12 +31,15 @@ #ifndef _SYS__SX_H_ #define _SYS__SX_H_ +#include +#include + /* * Shared/exclusive lock main structure definition. */ struct sx { struct lock_object lock_object; - volatile uintptr_t sx_lock; + volatile __uintptr_t sx_lock; }; #endif /* !_SYS__SX_H_ */ diff --git a/sys/sys/file.h b/sys/sys/file.h index 820ad1015573..a2dc02e523d8 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -37,13 +37,16 @@ #include #include #else -#include -#include +#include #include #include +#include +#include +#include #include struct filedesc; +struct proc; struct stat; struct thread; struct uio; diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 9b3433f4b1fd..0e52d643fe3b 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -28,8 +28,11 @@ #define _SYS_KTLS_H_ #ifdef _KERNEL +#include #include #include + +#include #endif struct tls_record_layer { diff --git a/sys/sys/refcount.h b/sys/sys/refcount.h index 44588fe3c812..ae0ec44fd7a6 100644 --- a/sys/sys/refcount.h +++ b/sys/sys/refcount.h @@ -28,13 +28,14 @@ #ifndef __SYS_REFCOUNT_H__ #define __SYS_REFCOUNT_H__ -#include - -#include +#include +#include #if !defined(_KERNEL) && !defined(_STANDALONE) #include #endif +#include + #define REFCOUNT_SATURATED(val) (((val) & (1U << 31)) != 0) #define REFCOUNT_SATURATION_VALUE (3U << 30) diff --git a/sys/sys/sglist.h b/sys/sys/sglist.h index 96f3c1cd5ffb..3bbada573772 100644 --- a/sys/sys/sglist.h +++ b/sys/sys/sglist.h @@ -55,6 +55,7 @@ struct sglist { struct bio; struct mbuf; +struct thread; struct uio; static __inline void diff --git a/tools/build/test-includes/badfiles.inc b/tools/build/test-includes/badfiles.inc index eb0cd05cb39f..1d648819cd8c 100644 --- a/tools/build/test-includes/badfiles.inc +++ b/tools/build/test-includes/badfiles.inc @@ -100,7 +100,6 @@ BADHDRS= \ sys/prng.h \ sys/qmath.h \ sys/racct.h \ - sys/refcount.h \ sys/resourcevar.h \ sys/rman.h \ sys/rmlock.h \