From nobody Fri May 5 14:44:36 2023 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 4QCYP10pL0z49QPC; Fri, 5 May 2023 14:44:37 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QCYP10GkYz3nf8; Fri, 5 May 2023 14:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683297877; 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=6DhMK3Gw0qZf+kxJ3UnW/za0qQ/f8W9c659c7q2tce8=; b=iR1dnG4KXQV4jAyTrc3cEF8nNYimjpmCKjN5doIrtAwpvCs0MwnBQOEGd8ow3XC3zUKj8P If4E/aneLXvIzxMoy8x4lpQyPcYcW+mOO9hRKDHFi/Md8p04IxuDNZARrfu+b5lfrleF/O BrK/YojYsklnVSqXDptuzUqU/OS71amvlxZmtUtOr/dwR43qOyrQeAsUsGckhFHMufAtQ1 4C70XbHYI3URMLROU49/LIhVUdIVmmeCyUj9oiR4k8FGK2upl39lLdxNe+x5ZNSDnC3TyJ KpBqzJ8/tTlsuLwobVYUQv66OPS92Ym9Rxusz9S6TQbml5OYB69cx+bD/o4Hew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683297877; 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=6DhMK3Gw0qZf+kxJ3UnW/za0qQ/f8W9c659c7q2tce8=; b=YWYmhaK4sh+tn7waUaJrhskH3CJP6SxMHLLH3GjgyfJAvB41kmjp0VGNVn/uhasekvRsgT WpZ6fAW0bfq2V/BZbYVJvOjJWu0dNHk/5mj6naVWM1M7QSbSRXM74+uIQi8A2IYzp5R8Ug eGtjxqlb/yH0BJhylDEJqYer4VrM1rw8iLZBnCbRYvkJsMArRGNg66HPuJboK43x1DYusm q/ln7kUszgdPqs4bQZ7W8cCn878yRBQO5V6nE7pXXZ7ShpIVJfSgLYjt8zLLCN45srOI/s AeZEld50IHq+vTP2RoRhLqYNQTREP6Rx+BbMe3iHKEAL5lp92cj+clzeDsHsFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683297877; a=rsa-sha256; cv=none; b=Du74t18xmhw/Gf4o4l1WNmGPCxYDPm3OEDtB0SPs0sPNJQU8Rc2MaeIZutZRKXgr+Znbjy T/V/iIn4Q+hN8wrFzI9uwDrELzXm+KXfiqFwVUJul86NvpIeoSukgu/T3uLrGETH7SFIzw l60l5SslUSf9/zuyANVOe4Fs4S+HlNKnVXeomIphDRbtnvKRAqUowandzODRSGAUIbLApU KHg40JpCAjUToV49bpdFuRcXPT49luipianiTX31PigAwXyyrx4Y1FB7J86DYJAXBaXqN7 /dTiSLlwP5KcQ61A3qbxVw/FkToUgYwlzNKl9HNdhW2NLKvKEpKCkuyuuRrewg== 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 4QCYP06R2wzypg; Fri, 5 May 2023 14:44:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 345EiakB046693; Fri, 5 May 2023 14:44:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 345EiajE046692; Fri, 5 May 2023 14:44:36 GMT (envelope-from git) Date: Fri, 5 May 2023 14:44:36 GMT Message-Id: <202305051444.345EiajE046692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Koshy Subject: git: c2eae5c39adc - main - man9: Add a manual page for kstack_contains(9). 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkoshy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2eae5c39adcad87b9c04aaeefa0bef74e5ccf32 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jkoshy: URL: https://cgit.FreeBSD.org/src/commit/?id=c2eae5c39adcad87b9c04aaeefa0bef74e5ccf32 commit c2eae5c39adcad87b9c04aaeefa0bef74e5ccf32 Author: Joseph Koshy AuthorDate: 2023-05-02 09:37:38 +0000 Commit: Joseph Koshy CommitDate: 2023-05-05 14:42:59 +0000 man9: Add a manual page for kstack_contains(9). Approved by: gnn (mentor) Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D39933 --- share/man/man9/Makefile | 1 + share/man/man9/kstack_contains.9 | 62 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 84b2fbf5e34d..2a320cf0fcba 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -204,6 +204,7 @@ MAN= accept_filter.9 \ kobj.9 \ kproc.9 \ kqueue.9 \ + kstack_contains.9 \ kthread.9 \ ktr.9 \ lock.9 \ diff --git a/share/man/man9/kstack_contains.9 b/share/man/man9/kstack_contains.9 new file mode 100644 index 000000000000..52a6ba9e2ca6 --- /dev/null +++ b/share/man/man9/kstack_contains.9 @@ -0,0 +1,62 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2023 Joseph Koshy +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 2, 2023 +.Dt KSTACK_CONTAINS 9 +.Os +.Sh NAME +.Nm kstack_contains +.Nd determine if an address range lies within the kernel stack for a thread +.Sh SYNOPSIS +.In machine/stack.h +.Ft bool +.Fn kstack_contains "struct thread *td" "vm_offset_t va" "size_t len" +.Sh DESCRIPTION +This function can be used to determine whether a given address range +falls within the kernel stack for the thread pointed to by +.Fa td . +.Sh RETURN VALUES +The function +.Fn kstack_contains +returns +.Dv true +if the range of addresses +.Bo +.Fa va Ns .. Ns ( +.Fa va Ns + Ns +.Fa len Ns - Ns 1 ) +.Bc +(both addresses inclusive) lies within the kernel stack for the thread +pointed to by argument +.Fa td , +or returns +.Dv false +otherwise. +.Sh ERRORS +This function does not return an error. +.Sh SEE ALSO +.Xr kproc 9 , +.Xr kthread 9