Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Aug 2001 14:34:02 +0400 (MSD)
From:      seva@riskinv.ru
To:        freebsd-multimedia@freebsd.org
Subject:   dvb driver
Message-ID:  <200108171034.f7HAY2529423@ns.riskinv.ru>
In-Reply-To: <200108130639.f7D6dGZ66537@ns.riskinv.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

Okey.

It is too easy to port qpsk driver from linux to freebsd.
I can turn satellete tuner to channel, switch diseqc to
any LNB and look/listen FTE channel 
(from composit video and audio outs).

But I got trouble next in OSD driver.
What is linux's wait_queue and signal_pending in freebsd?





#if LINUX_VERSION_CODE < 0x020300
#define net_device device
#define DECLARE_MUTEX(foo)         struct semaphore foo = MUTEX
#define DECLARE_MUTEX_LOCKED(foo)  struct semaphore foo = MUTEX_LOCKED
#define WAIT_QUEUE                 struct wait_queue*
#define init_waitqueue_head(wq)    *(wq) = NULL;
#define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL }
#define set_current_state(state_value)			   \
	do { current->state = state_value; } while (0)
#define list_for_each(pos, head) \
	for (pos = (head)->next; pos != (head); pos = pos->next)

#else

#define WAIT_QUEUE                 wait_queue_head_t

#endif

....

static int 
BlitBitmap(struct dvb_struct *dvb, u16 win, u16 x, u16 y, u16 trans)
{
        DECLARE_WAITQUEUE(wait, current);
        
        if (dvb->bmp_state==BMP_NONE)
                return -1;
        if (dvb->bmp_state==BMP_LOADING) {
                add_wait_queue(&dvb->bmpq, &wait);
                while (1) {
                        set_current_state(TASK_INTERRUPTIBLE);
                        if (dvb->bmp_state!=BMP_LOADING
                            || signal_pending(current))
                                break;
                        schedule();
                }
                current->state=TASK_RUNNING;
                remove_wait_queue(&dvb->bmpq, &wait);
        }
        if (dvb->bmp_state==BMP_LOADED)
                return outcom(dvb, COMTYPE_OSD, BlitBmp, 4, win, x, y, trans);
        return -1;
} 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




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