summaryrefslogtreecommitdiffstats
path: root/include/asm-s390/queue.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /include/asm-s390/queue.h
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'include/asm-s390/queue.h')
-rw-r--r--include/asm-s390/queue.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/asm-s390/queue.h b/include/asm-s390/queue.h
index 9771d3048..c817d23b3 100644
--- a/include/asm-s390/queue.h
+++ b/include/asm-s390/queue.h
@@ -70,6 +70,35 @@ static __inline__ void add_to_list(list **lhead,list *member)
*lhead=member;
}
+static __inline__ list *remove_listhead(list **lhead)
+{
+ list *oldhead=*lhead;
+
+ if(oldhead)
+ *lhead=(*lhead)->next;
+ return(oldhead);
+}
+
+static __inline__ void add_to_list_tail(list **lhead,list *member)
+{
+ list *curr,*prev;
+ if(*lhead==NULL)
+ *lhead=member;
+ else
+ {
+ prev=*lhead;
+ for(curr=(*lhead)->next;curr!=NULL;curr=curr->next)
+ prev=curr;
+ prev->next=member;
+ }
+}
+static __inline__ void add_to_list_tail_null(list **lhead,list *member)
+{
+ member->next=NULL;
+ add_to_list_tail_null(lhead,member);
+}
+
+
static __inline__ int is_in_list(list *lhead,list *member)
{
list *curr;
@@ -96,6 +125,7 @@ static __inline__ int get_prev(list *lhead,list *member,list **prev)
}
+
static __inline__ int remove_from_list(list **lhead,list *member)
{
list *prev;
@@ -112,6 +142,29 @@ static __inline__ int remove_from_list(list **lhead,list *member)
return(FALSE);
}
+static __inline__ int remove_from_queue(qheader *qhead,queue *member)
+{
+ queue *prev;
+
+ if(get_prev(qhead->head,(list *)member,(list **)&prev))
+ {
+
+ if(prev)
+ {
+ prev->next=member->next;
+ if(prev->next==NULL)
+ qhead->tail=prev;
+ }
+ else
+ {
+ if(qhead->head==qhead->tail)
+ qhead->tail=NULL;
+ qhead->head=member->next;
+ }
+ return(TRUE);
+ }
+ return(FALSE);
+}