From owner-freebsd-hackers Sat Sep 7 18:45:16 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA04308 for hackers-outgoing; Sat, 7 Sep 1996 18:45:16 -0700 (PDT) Received: from ns2.accesscom.com (ns2.accesscom.com [205.226.156.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id SAA04299 for ; Sat, 7 Sep 1996 18:45:14 -0700 (PDT) Received: from aic1.accesscom.com (aic1.accesscom.com [205.226.156.10]) by ns2.accesscom.com (8.7.3/8.7.3) with ESMTP id SAA23571; Sat, 7 Sep 1996 18:44:10 -0700 Received: (from giri@localhost) by aic1.accesscom.com (8.7.3/8.7.3) id SAA07732; Sat, 7 Sep 1996 18:44:08 -0700 Date: Sat, 7 Sep 1996 20:43:54 -0500 (CDT) From: Giritharan Rashiyamany To: freebsd-hackers@freebsd.org cc: terry@lambert.org Subject: interrupts in software Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi Hackers, I need to implement an interrupt in software that'll do the following. It's functionality is similar to ipintr() call which will basically enqueue packets, and the continue processing until there aren't any more packets to process. In essence, myintr() should be activated if not active and subsequent calls to it should not activate a second instance. If myintr() is not active, then a call to it will activate it. #define ACTIVE_YES 0 #define ACTIVE_NO 1 int state = ACTIVE+NO; void myintr() { if(state = ACTIVE_YES) return; while (queue_is_not_empty()) { process(); } state = ACIVE_NO; return; } something like this. ANy help appreciated DMC