arm linux µÈ´ý¶ÓÁмòµ¥·ÖÎö
Author-------Dansen-----xzd2734@163.com
wait_queue_head_t wait_q;
Ê×ÏÈ¿´¿´
wait_queue_head_tÕâ¸öµÈ´ý¶ÓÁеĽṹ
ÔÚwait.hÖж¨ÒåÁËÕâ¸ö½á¹¹
typedef struct
__wait_queue_head wait_queue_head_t;
struct __wait_queue_head {
wq_lock_t
lock;
struct list_head task_list;
};
# define wq_lock_t
spinlock_t
typedef struct {
volatile unsigned int lock;
}
spinlock_t;
struct list_head {
struct list_head *next, *prev;
};
Õâ
ÑùÆäʵ×ܹ²ÓÐÁË3¸ö±äÁ¿
wait_q.lock.lock volatile unsigned int
wait_q.task_list.next struct
list_head *
wait_q.task_list.prev struct list_head *
¶¨ÒåÁ˵ȴý¶ÓÁкóÐèÒª½ø
Ðгõʼ»¯
init_waitqueue_head(&wait_q);
static inline void
init_waitqueue_head(wait_queue_head_t *q)
{
q->lock =
WAITQUEUE_RW_LOCK_UNLOCKED;
INIT_LIST_HEAD(&q->task_list);
}
#define
WAITQUEUE_RW_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED
#define
SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#define INIT_LIST_HEAD(ptr) do {
\
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
Õâ
ÑùÔÚ³õʼ»¯µÈ´ý¶ÓÁÐwait_qºó£¬
wait_q.lock.lock=0;
wait_q.task_list.next=&(wait_q.task_list)
wait_q.task_list.prev=&(wait_q.task_list)
µ±
Ȼϵͳ»¹¸øÁËÁíÍâÒ»ÖÖÔÚ±àÒëʱ³õʼ»¯µÄ¶¨Òå·½·¨
#define DECLARE_WAIT_QUEUE_HEAD(name) \
wait_queue_head_t
name = __WAIT_QUEUE_HEAD_INITIALIZER(name)
#define
__WAIT_QUEUE_HEAD_INITIALIZER(name) { \
lock: WAITQUEUE_RW_LOCK_UNLOCKED, \
task_list: {
&(name).task_list, &(name).task_list }
}
½á¹ûÏÔÈ»ºÍÉÏÒ»ÖÖ·½·¨Ïàͬ,²»¹ý
Õâ¸öms±È½Ï¼òµ¥.
ÏÂÃæ˵µÄÊÇÒª¼ÓÈëµÈ´ý¶ÓÁÐÖеĵȴýÏî
DECLARE_WAITQUEUE(wait, current);
Ò»
ÖÖ¼òµ¥µÄ¶¨Òå·½·¨
#define DECLARE_WAITQUEUE(name, tsk) \
wait_queue_t
name = __WAITQUEUE_INITIALIZER(name, tsk)
#define
__WAITQUEUE_INITIALIZER(name, tsk) { \
task:
Ïà¹ØÎĵµ£º
ÔÚLinuxÖÐÖ´ÐÐ.sh½Å±¾£¬Òì³£/bin/sh^M
www.firnow.com ʱ¼ä £º 2009-07-29 ×÷ÕߣºÄäÃû ±à¼£ºtoman µã»÷£º 199 [ ÆÀÂÛ ]
-
-
ÔÚLinuxÖÐÖ´ÐÐ.sh½Å±¾£¬Òì³£/bin/sh^M: bad interpreter: No such file or directory¡£
·ÖÎö£ºÕâÊDz»Í¬ÏµÍ³±àÂë¸ñʽÒýÆðµÄ£ºÔÚwindowsÏ ......
In my embedded platform, I want to use tftp command,
run tftp, it will output:
Usage: tftp [OPTION]... HOST [PORT]
Transfer a file from/to tftp server
Options:
-l FILE Local FILE
-r FILE Remote FILE
&n ......
Tab Tab Tab
±ÈÈ磺ÓÐÒ»¸öÎļþµÄÃû×Ö½Ð×÷alsa-divers-0.39.tar.gz£¬Õ⻹²»ËãºÜ³¤°É¡£ µ±ÄãÐèҪƵ·±µÄÊäÈëÕâ¸öÎļþµÄÃû×ÖµÄʱºò£¬ÄѵÀÄã²»¾õµÃÕâÊÇÒ»ÖÖÎÞÒÔÃû×´µÄÍ´¿àÂð£¿ÄÇôÎÒÏë¶ÔÄã˵һ¾ä£º²»ÒªÐÄ·³£¬Äã¿ÉÒÔÊÔÒ»ÊÔÔÚÊäÈëalsaºó°´Ò»Ï£ÃapsLock¼üÉÏ·½µÄ£Ôab¼ü¡£ÔõôÑùʹÄãÑÛÇ°Ò»ÁÁ°É£¬linuxÒѾÆæ¼£°ãµÄ×Ô¶¯²¹È«ÁËÎļþÃû¡ ......