From nobody Sun Oct 30 14:07:51 2022 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 4N0dQv6HlKz4h06C; Sun, 30 Oct 2022 14:07:51 +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 4N0dQv5pvdz3s9N; Sun, 30 Oct 2022 14:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667138871; 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=7rsUjmImn5K2WP9iPOgvM+8EqZLLWY1Mt+YBK/h+uCs=; b=mCeE8MODWQ5nm4rdUwJppIwLu4DQG6EGGvICSSsjfYlnC+JU3o3Hkq4xt0Dpx1StRwc7lE akPVRznjEJW7yd4axXk30Od+1PZoCilYmXdq3DFNaxB9fiZdoNyUZds+yPPProoTXFBdLs QDzwZPLfHlTb8hwSJ1/4onMCuH9g47z1P8E0Lm0D4YUAt/GMZA/7rIyAKc95o8Dhyh0X+p v3DYfDjTyGZvZNH+oLPA0WkgqNB6XgWIXXV+nqGftJQanCKta1dx7BceUP5aG8EDhp/QHU cM4ZBvPrN82ZmV8ZZo5kfrydYfdWV+eV5OTo/J7vCl66DSS9enEi5Tkx+eKLGg== 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 4N0dQv4sqrz106V; Sun, 30 Oct 2022 14:07:51 +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 29UE7p7P000845; Sun, 30 Oct 2022 14:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29UE7ptu000844; Sun, 30 Oct 2022 14:07:51 GMT (envelope-from git) Date: Sun, 30 Oct 2022 14:07:51 GMT Message-Id: <202210301407.29UE7ptu000844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 334fc46f05b4 - main - intr_event(9): document intr_event_handle() 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 334fc46f05b4e149b8e23dbce0147a86caf3a8b0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667138871; 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=7rsUjmImn5K2WP9iPOgvM+8EqZLLWY1Mt+YBK/h+uCs=; b=HojyS/xtTDkg0zn24JNmUzVJ8VOPwpP/75hG//WeRgVzaCSGFw2tHWl8zZP5RmF40Ij2hK QEEY0mDbZcLYaQqveKYY+hq0T5y5O6Nve77DKaTQqjEA+0AanvB16X8AJMgNuRoQKor1pi 5uFMuAm+4FstxS4l6qtMqR18j3Uz2oA+HKm91FXJs1rSen7FqNfcQPlDRPuZuJThjmciwc IeTw8FfEC2ttlgAVsRyl3jLKc/E8XYiO1G/idr0hu6a6SstL97ddbcztoHNu5XVBIY/+xX 5nQCp+QNNOEQO27tsTnS+fjmqdQNpSmMEGHd0ZraX9JauJoK7OXNa82pfp11ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667138871; a=rsa-sha256; cv=none; b=D2Vce0in+ipvqSJpFPEKuNIVdHPtJoJvQpe1vO/Bkyv7BJcnJnMobDvlMVK64UH+eKmMrt 2Cegtbux5iAr//sPOSu1rjPnW+IpFAYY4PvT53VHP/sQ6lWgfaKHjUiUqbVkFD1B4q4fYw k//zBD6FRfQxf7aQkdc7iGIc4BUdgKpVW2ftaK/VJovvdnGlDDa7yWHpVjh7AuYfZ9zdPh 2rd8zK0Y+dTfY8LVfBzhf03hyuSWOFm9k+KurgY8hkZSWRIPRO8KUg2taZOviz5wDuOyfZ t0RBBF7gPdxuUEKq4gr26qlTUKSsSD+JDBCWlvt/1NlwXrYFIJ4UM/aQDGi9fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=334fc46f05b4e149b8e23dbce0147a86caf3a8b0 commit 334fc46f05b4e149b8e23dbce0147a86caf3a8b0 Author: Mitchell Horne AuthorDate: 2022-10-30 14:02:20 +0000 Commit: Mitchell Horne CommitDate: 2022-10-30 14:07:04 +0000 intr_event(9): document intr_event_handle() Reviewed by: pauamma MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36934 --- share/man/man9/Makefile | 1 + share/man/man9/intr_event.9 | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 9cc98bb6329b..908f3edec3a2 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1322,6 +1322,7 @@ MLINKS+=insmntque.9 insmntque1.9 MLINKS+=intr_event.9 intr_event_add_handler.9 \ intr_event.9 intr_event_create.9 \ intr_event.9 intr_event_destroy.9 \ + intr_event.9 intr_event_handle.9 \ intr_event.9 intr_event_remove_handler.9 \ intr_event.9 intr_priority.9 MLINKS+=kernacc.9 useracc.9 diff --git a/share/man/man9/intr_event.9 b/share/man/man9/intr_event.9 index 3ae2d051074c..70ea1e1bfc43 100644 --- a/share/man/man9/intr_event.9 +++ b/share/man/man9/intr_event.9 @@ -29,13 +29,14 @@ .\" .\" $FreeBSD$ .\" -.Dd October 15, 2022 +.Dd October 30, 2022 .Dt INTR_EVENT 9 .Os .Sh NAME .Nm intr_event_add_handler , .Nm intr_event_create , .Nm intr_event_destroy , +.Nm intr_event handle , .Nm intr_event_remove_handler , .Nm intr_priority .Nd "kernel interrupt handler and thread API" @@ -70,6 +71,8 @@ .Ft int .Fn intr_event_destroy "struct intr_event *ie" .Ft int +.Fn intr_event_handle "struct intr_event *ie" "struct trapframe *frame" +.Ft int .Fn intr_event_remove_handler "void *cookie" .Ft u_char .Fn intr_priority "enum intr_type flags" @@ -242,6 +245,23 @@ then it will be assigned a cookie that can be used later to remove this handler. .Pp The +.Fn intr_event_handle +function is the main entry point into the interrupt handling code. +It must be called from an interrupt context. +The function will execute all filter handlers associated with the interrupt +event +.Fa ie , +and schedule the associated interrupt thread to run, if applicable. +The +.Fa frame +argument is used to pass a pointer to the +.Vt struct trapframe +containing the machine state at the time of the interrupt. +The main body of this function runs within a +.Xr critical 9 +section. +.Pp +The .Fn intr_event_remove_handler function removes an interrupt handler from the interrupt event specified by .Fa ie . @@ -313,6 +333,7 @@ The .Fn intr_event_add_handler , .Fn intr_event_create , .Fn intr_event_destroy , +.Fn intr_event_handle , and .Fn intr_event_remove_handler functions return zero on success and non-zero on failure. @@ -416,6 +437,23 @@ has at least one handler which has not been removed with .El .Pp The +.Fn intr_event_handle +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa ie +argument is +.Dv NULL . +.It Bq Er EINVAL +There are no interrupt handlers assigned to +.Fa ie . +.It Bq Er EINVAL +The interrupt was not acknowledged by any filter and has no associated thread +handler. +.El +.Pp +The .Fn intr_event_remove_handler function will fail if: .Bl -tag -width Er @@ -426,6 +464,7 @@ argument is .Dv NULL . .El .Sh SEE ALSO +.Xr critical 9 , .Xr kthread 9 , .Xr locking 9 , .Xr malloc 9 ,