summaryrefslogtreecommitdiffstats
path: root/sys/i386/include
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-05-11 07:44:40 +0000
committerbde <bde@FreeBSD.org>1995-05-11 07:44:40 +0000
commitef98a885661c3d2f2fe8570c56dba5723d570c13 (patch)
tree0d5164dc358e5c6acd11b945b1b53af7244beb76 /sys/i386/include
parent561eb80e564511caf11e035642fba1a429106466 (diff)
downloadFreeBSD-src-ef98a885661c3d2f2fe8570c56dba5723d570c13.zip
FreeBSD-src-ef98a885661c3d2f2fe8570c56dba5723d570c13.tar.gz
Add variable `idelayed' and macros setdelayed() and schedsofttty()
to access it. setdelayed() actually ORs the bits in `idelayed' into `ipending' and clears `idelayed'. Call setdelayed() every (normal) clock tick to convert delayed interrupts into pending ones. Drivers can set bits in `idelayed' at any time to schedule an interrupt at the next clock tick. This is more efficient than calling timeout(). Currently only software interrupts can be scheduled.
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/spl.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/i386/include/spl.h b/sys/i386/include/spl.h
index 3ffc50f..1db479f 100644
--- a/sys/i386/include/spl.h
+++ b/sys/i386/include/spl.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: spl.h,v 1.6 1994/12/30 12:42:15 bde Exp $
+ * $Id: spl.h,v 1.7 1995/05/11 00:13:01 wollman Exp $
*/
#ifndef _MACHINE_IPL_H_
@@ -74,6 +74,7 @@
extern unsigned bio_imask; /* group of interrupts masked with splbio() */
extern unsigned cpl; /* current priority level mask */
+extern volatile unsigned idelayed; /* interrupts to become pending */
extern volatile unsigned ipending; /* active interrupts masked by cpl */
extern unsigned net_imask; /* group of interrupts masked with splimp() */
extern unsigned stat_imask; /* interrupts masked with splstatclock() */
@@ -85,11 +86,14 @@ extern unsigned tty_imask; /* group of interrupts masked with spltty() */
* it is changed. Pretending that ipending is a plain int happens to give
* suitable atomic code for "ipending |= constant;".
*/
+#define setdelayed() (*(unsigned *)&ipending |= loadandclear(&idelayed))
#define setsoftast() (*(unsigned *)&ipending |= SWI_AST_PENDING)
#define setsoftclock() (*(unsigned *)&ipending |= SWI_CLOCK_PENDING)
#define setsoftnet() (*(unsigned *)&ipending |= SWI_NET_PENDING)
#define setsofttty() (*(unsigned *)&ipending |= SWI_TTY_PENDING)
+#define schedsofttty() (*(unsigned *)&idelayed |= SWI_TTY_PENDING)
+
void unpend_V __P((void));
#ifdef __GNUC__
OpenPOWER on IntegriCloud