6 void __lwp_queue_initialize(lwp_queue
*queue
,void *start_addr
,u32 num_nodes
,u32 node_size
)
13 printf("__lwp_queue_initialize(%p,%p,%d,%d)\n",queue
,start_addr
,num_nodes
,node_size
);
16 curr
= __lwp_queue_head(queue
);
17 queue
->perm_null
= NULL
;
18 next
= (lwp_node
*)start_addr
;
24 next
= (lwp_node
*)(((void*)next
)+node_size
);
26 curr
->next
= __lwp_queue_tail(queue
);
30 lwp_node
* __lwp_queue_get(lwp_queue
*queue
)
35 _CPU_ISR_Disable(level
);
36 if(!__lwp_queue_isempty(queue
)) {
37 ret
= __lwp_queue_firstnodeI(queue
);
39 _CPU_ISR_Restore(level
);
43 void __lwp_queue_append(lwp_queue
*queue
,lwp_node
*node
)
47 _CPU_ISR_Disable(level
);
48 __lwp_queue_appendI(queue
,node
);
49 _CPU_ISR_Restore(level
);
52 void __lwp_queue_extract(lwp_node
*node
)
56 _CPU_ISR_Disable(level
);
57 __lwp_queue_extractI(node
);
58 _CPU_ISR_Restore(level
);
61 void __lwp_queue_insert(lwp_node
*after
,lwp_node
*node
)
65 _CPU_ISR_Disable(level
);
66 __lwp_queue_insertI(after
,node
);
67 _CPU_ISR_Restore(level
);