require '_h2ph_pre.ph';

unless(defined(&_LINUX_TQUEUE_H)) {
    eval 'sub _LINUX_TQUEUE_H () {1;}' unless defined(&_LINUX_TQUEUE_H);
    require 'linux/spinlock.ph';
    require 'linux/list.ph';
    require 'asm/bitops.ph';
    require 'asm/system.ph';
    eval 'sub PREPARE_TQUEUE {
        local($_tq, $_routine, $_data) = @_;
	    eval q( &do { ($_tq)-> &routine = $_routine; ($_tq)-> &data = $_data; }  &while (0));
    }' unless defined(&PREPARE_TQUEUE);
    eval 'sub INIT_TQUEUE {
        local($_tq, $_routine, $_data) = @_;
	    eval q( &do {  &INIT_LIST_HEAD(($_tq)-> &list); ($_tq)-> &sync = 0;  &PREPARE_TQUEUE(($_tq), ($_routine), ($_data)); }  &while (0));
    }' unless defined(&INIT_TQUEUE);
    eval 'sub DECLARE_TASK_QUEUE {
        local($q) = @_;
	    eval q( &LIST_HEAD($q));
    }' unless defined(&DECLARE_TASK_QUEUE);
    eval 'sub TQ_ACTIVE {
        local($q) = @_;
	    eval q((! &list_empty($q)));
    }' unless defined(&TQ_ACTIVE);
}
1;
