--- /dev/null
+/*
+ * faultd
+ *
+ * Copyright © 2017 Samsung Electronics
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef FAULTD_QUEUE_H
+#define FAULTD_QUEUE_H
+
+#include "list.h"
+
+/*
+ * Simple queue which use list for storing elements
+ */
+
+#define queue_head list_head
+
+#define QUEUE_INIT(name) LIST_HEAD_INIT(name)
+
+#define INIT_QUEUE_HEAD(head) INIT_LIST_HEAD(head);
+
+#define queue_append(head, new) list_add_tail(new, head);
+
+#define queue_pop(head, type, member) ({ \
+ type *elem__; \
+ elem__ = list_first_entry_or_null(head, type, member); \
+ if (elem__) \
+ list_del(&elem__->member); \
+ elem__; \
+})
+
+#define queue_empty(head) list_empty(head)
+
+#define queue_for_each(pos, head) \
+ list_for_each(pos, head)
+
+#define queue_for_each_safe(pos, n, head) \
+ list_for_each_safe(pos, n, head)
+
+#define queue_for_each_entry(pos, head, member) \
+ list_for_each_entry(pos, head, member)
+
+#define queue_for_each_entry_safe(pos, n, head, member) \
+ list_for_each_entry_safe(pos, n, head, member)
+
+#endif /* FAULTD_QUEUE_H */