Release 4.7 drivers/block/paride/pseudo.h
/*
pseudo.h (c) 1997-8 Grant R. Guenther <grant@torque.net>
Under the terms of the GNU General Public License.
This is the "pseudo-interrupt" logic for parallel port drivers.
This module is #included into each driver. It makes one
function available:
ps_set_intr( void (*continuation)(void),
int (*ready)(void),
int timeout,
int nice )
Which will arrange for ready() to be evaluated frequently and
when either it returns true, or timeout jiffies have passed,
continuation() will be invoked.
If nice is 1, the test will done approximately once a
jiffy. If nice is 0, the test will also be done whenever
the scheduler runs (by adding it to a task queue). If
nice is greater than 1, the test will be done once every
(nice-1) jiffies.
*/
/* Changes:
1.01 1998.05.03 Switched from cli()/sti() to spinlocks
1.02 1998.12.14 Added support for nice > 1
*/
#define PS_VERSION "1.02"
#include <linux/sched.h>
#include <linux/workqueue.h>
static void ps_tq_int(struct work_struct *work);
static void (* ps_continuation)(void);
static int (* ps_ready)(void);
static unsigned long ps_timeout;
static int ps_tq_active = 0;
static int ps_nice = 0;
static DEFINE_SPINLOCK(ps_spinlock __attribute__((unused)));
static DECLARE_DELAYED_WORK(ps_tq, ps_tq_int);
static void ps_set_intr(void (*continuation)(void),
int (*ready)(void),
int timeout, int nice)
{
unsigned long flags;
spin_lock_irqsave(&ps_spinlock,flags);
ps_continuation = continuation;
ps_ready = ready;
ps_timeout = jiffies + timeout;
ps_nice = nice;
if (!ps_tq_active) {
ps_tq_active = 1;
if (!ps_nice)
schedule_delayed_work(&ps_tq, 0);
else
schedule_delayed_work(&ps_tq, ps_nice-1);
}
spin_unlock_irqrestore(&ps_spinlock,flags);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 88 | 85.44% | 3 | 50.00% |
al viro | al viro | 11 | 10.68% | 1 | 16.67% |
david howells | david howells | 3 | 2.91% | 1 | 16.67% |
dave jones | dave jones | 1 | 0.97% | 1 | 16.67% |
| Total | 103 | 100.00% | 6 | 100.00% |
static void ps_tq_int(struct work_struct *work)
{
void (*con)(void);
unsigned long flags;
spin_lock_irqsave(&ps_spinlock,flags);
con = ps_continuation;
ps_tq_active = 0;
if (!con) {
spin_unlock_irqrestore(&ps_spinlock,flags);
return;
}
if (!ps_ready || ps_ready() || time_after_eq(jiffies, ps_timeout)) {
ps_continuation = NULL;
spin_unlock_irqrestore(&ps_spinlock,flags);
con();
return;
}
ps_tq_active = 1;
if (!ps_nice)
schedule_delayed_work(&ps_tq, 0);
else
schedule_delayed_work(&ps_tq, ps_nice-1);
spin_unlock_irqrestore(&ps_spinlock,flags);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 108 | 86.40% | 3 | 42.86% |
david howells | david howells | 6 | 4.80% | 1 | 14.29% |
al viro | al viro | 5 | 4.00% | 1 | 14.29% |
linus torvalds | linus torvalds | 5 | 4.00% | 1 | 14.29% |
dave jones | dave jones | 1 | 0.80% | 1 | 14.29% |
| Total | 125 | 100.00% | 7 | 100.00% |
/* end of pseudo.h */
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 255 | 84.44% | 5 | 38.46% |
al viro | al viro | 16 | 5.30% | 1 | 7.69% |
david howells | david howells | 13 | 4.30% | 1 | 7.69% |
linus torvalds | linus torvalds | 6 | 1.99% | 2 | 15.38% |
ingo molnar | ingo molnar | 5 | 1.66% | 1 | 7.69% |
thomas gleixner | thomas gleixner | 3 | 0.99% | 1 | 7.69% |
dave jones | dave jones | 2 | 0.66% | 1 | 7.69% |
andries brouwer | andries brouwer | 2 | 0.66% | 1 | 7.69% |
| Total | 302 | 100.00% | 13 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.