Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2012 14:47:03 +0000 (UTC)
From:      Sergey Kandaurov <pluknet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r237007 - stable/9/share/man/man9
Message-ID:  <201206131447.q5DEl3Dk030488@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pluknet
Date: Wed Jun 13 14:47:03 2012
New Revision: 237007
URL: http://svn.freebsd.org/changeset/base/237007

Log:
  MFC r234188,r234463,r234465:
  
  - Update the swi_add prototype after struct ithd was split up into
  struct intr_event and struct intr_thread. [1]
  - Update the rest of struct ithd references.
  - net_ih and softclock_ih cookies have gone away.
  - Document swi_remove(9).
  
  PR:		docs/166864 [1]

Modified:
  stable/9/share/man/man9/Makefile
  stable/9/share/man/man9/swi.9
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/Makefile
==============================================================================
--- stable/9/share/man/man9/Makefile	Wed Jun 13 11:59:47 2012	(r237006)
+++ stable/9/share/man/man9/Makefile	Wed Jun 13 14:47:03 2012	(r237007)
@@ -1245,6 +1245,7 @@ MLINKS+=store.9 subyte.9 \
 	store.9 suword32.9 \
 	store.9 suword64.9
 MLINKS+=swi.9 swi_add.9 \
+	swi.9 swi_remove.9 \
 	swi.9 swi_sched.9
 MLINKS+=sx.9 sx_assert.9 \
 	sx.9 sx_destroy.9 \

Modified: stable/9/share/man/man9/swi.9
==============================================================================
--- stable/9/share/man/man9/swi.9	Wed Jun 13 11:59:47 2012	(r237006)
+++ stable/9/share/man/man9/swi.9	Wed Jun 13 14:47:03 2012	(r237007)
@@ -24,25 +24,24 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 30, 2000
+.Dd April 19, 2012
 .Dt SWI 9
 .Os
 .Sh NAME
 .Nm swi_add ,
+.Nm swi_remove ,
 .Nm swi_sched
 .Nd register and schedule software interrupt handlers
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h
 .In sys/interrupt.h
-.Vt "extern struct ithd *tty_ithd" ;
-.Vt "extern struct ithd *clk_ithd" ;
-.Vt "extern void *net_ih" ;
-.Vt "extern void *softclock_ih" ;
+.Vt "extern struct intr_event *tty_intr_event" ;
+.Vt "extern struct intr_event *clk_intr_event" ;
 .Vt "extern void *vm_ih" ;
 .Ft int
 .Fo swi_add
-.Fa "struct ithd **ithdp"
+.Fa "struct intr_event **eventp"
 .Fa "const char *name"
 .Fa "driver_intr_t handler"
 .Fa "void *arg"
@@ -50,6 +49,8 @@
 .Fa "enum intr_type flags"
 .Fa "void **cookiep"
 .Fc
+.Ft int
+.Fn swi_remove "void *cookie"
 .Ft void
 .Fn swi_sched "void *cookie" "int flags"
 .Sh DESCRIPTION
@@ -67,20 +68,21 @@ time, and that they can be run via a lig
 .Pp
 The
 .Fn swi_add
-function is used to register a new software interrupt handler.
+function is used to add a new software interrupt handler to a specified
+interrupt event.
 The
-.Fa ithdp
+.Fa eventp
 argument is an optional pointer to a
-.Vt struct ithd
+.Vt struct intr_event
 pointer.
-If this argument points to an existing software interrupt thread, then this
-handler will be attached to that thread.
-Otherwise a new thread will be created, and if
-.Fa ithdp
+If this argument points to an existing event that holds a list of
+interrupt handlers, then this handler will be attached to that event.
+Otherwise a new event will be created, and if
+.Fa eventp
 is not
 .Dv NULL ,
 then the pointer at that address to will be modified to point to the
-newly created thread.
+newly created event.
 The
 .Fa name
 argument is used to associate a name with a specific handler.
@@ -99,7 +101,7 @@ The
 .Fa pri
 value specifies the priority of this interrupt handler relative to other
 software interrupt handlers.
-If an interrupt thread is created, then this value is used as the vector,
+If an interrupt event is created, then this value is used as the vector,
 and the
 .Fa flags
 argument is used to specify the attributes of a handler such as
@@ -113,6 +115,14 @@ This cookie will be set to a value that 
 and is used to schedule the handler for execution later on.
 .Pp
 The
+.Fn swi_remove
+function is used to teardown an interrupt handler pointed to by the
+.Fa cookie
+argument.
+It detaches the interrupt handler from the associated interrupt event
+and frees its memory.
+.Pp
+The
 .Fn swi_sched
 function is used to schedule an interrupt handler and its associated thread to
 run.
@@ -140,30 +150,29 @@ in earlier versions of
 .El
 .Pp
 The
-.Va tty_ithd
+.Va tty_intr_event
 and
-.Va clk_ithd
-variables contain pointers to the software interrupt threads for the tty and
+.Va clk_intr_event
+variables contain pointers to the software interrupt handlers for the tty and
 clock software interrupts, respectively.
-.Va tty_ithd
+.Va tty_intr_event
 is used to hang tty software interrupt handlers off of the same thread.
-.Va clk_ithd
+.Va clk_intr_event
 is used to hang delayed handlers off of the clock software interrupt thread so
 that the functionality of
 .Fn setdelayed
 can be obtained in conjunction with
 .Dv SWI_DELAY .
 The
-.Va net_ih ,
-.Va softclock_ih ,
-and
 .Va vm_ih
-handler cookies are used to schedule software interrupt threads to run for the
-networking stack, clock interrupt, and VM subsystem respectively.
+handler cookie is used to schedule software interrupt threads to run for the
+VM subsystem.
 .Sh RETURN VALUES
 The
 .Fn swi_add
-function returns zero on success and non-zero on failure.
+and
+.Fn swi_remove
+functions return zero on success and non-zero on failure.
 .Sh ERRORS
 The
 .Fn swi_add
@@ -183,7 +192,7 @@ argument specifies
 .Dv INTR_ENTROPY .
 .It Bq Er EINVAL
 The
-.Fa ithdp
+.Fa eventp
 argument points to a hardware interrupt thread.
 .It Bq Er EINVAL
 Either of the
@@ -195,11 +204,22 @@ arguments are
 .It Bq Er EINVAL
 The
 .Dv INTR_EXCL
-flag is specified and the interrupt thread pointed to by
-.Fa ithdp
-already has at least one handler, or the interrupt thread already has an
+flag is specified and the interrupt event pointed to by
+.Fa eventp
+already has at least one handler, or the interrupt event already has an
 exclusive handler.
 .El
+.Pp
+The
+.Fn swi_remove
+function will fail if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+A software interrupt handler pointed to by
+.Fa cookie
+is
+.Dv NULL .
+.El
 .Sh SEE ALSO
 .Xr ithread 9 ,
 .Xr taskqueue 9
@@ -220,6 +240,10 @@ and
 .Fn schedsoft*
 functions which date back to at least
 .Bx 4.4 .
+The
+.Fn swi_remove
+function first appeared in
+.Fx 6.1 .
 .Sh BUGS
 Most of the global variables described in this manual page should not be
 global, or at the very least should not be declared in



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206131447.q5DEl3Dk030488>