summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
blob: 78b8cc73f12fc9a9f3ab2aba96c399bd157e76bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_TIMERQUEUE_H
#define _LINUX_TIMERQUEUE_H

#include <linux/rbtree.h>
#include <linux/ktime.h>


struct timerqueue_node {
	struct rb_node node;
	ktime_t expires;
};

struct timerqueue_head {
	struct rb_root head;
	struct timerqueue_node *next;
};


extern bool timerqueue_add(struct timerqueue_head *head,
			   struct timerqueue_node *node);
extern bool timerqueue_del(struct timerqueue_head *head,
			   struct timerqueue_node *node);
extern struct timerqueue_node *timerqueue_iterate_next(
						struct timerqueue_node *node);

/**
 * timerqueue_getnext - Returns the timer with the earliest expiration time
 *
 * @head: head of timerqueue
 *
 * Returns a pointer to the timer node that has the
 * earliest expiration time.
 */
static inline
struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)
{
	return head->next;
}

static inline void timerqueue_init(struct timerqueue_node *node)
{
	RB_CLEAR_NODE(&node->node);
}

static inline void timerqueue_init_head(struct timerqueue_head *head)
{
	head->head = RB_ROOT;
	head->next = NULL;
}
#endif /* _LINUX_TIMERQUEUE_H */
16:42:26 -0800'>2019-11-08hwspinlock: u8500_hsem: Remove redundant PM runtime implementationBaolin Wang 2019-11-08hwspinlock: sprd: Remove redundant PM runtime implementationBaolin Wang 2019-11-08hwspinlock: Let the PM runtime can be optionalBaolin Wang 2019-11-08hwspinlock: Remove BUG_ON() from the hwspinlock coreBaolin Wang 2019-10-04hwspinlock: sprd: Use devm_hwspin_lock_register() to register hwlock controllerBaolin Wang 2019-10-04hwspinlock: sprd: Use devm_add_action_or_reset() for calls to clk_disable_unp...Baolin Wang 2019-10-04hwspinlock: sprd: Check the return value of clk_prepare_enable()Baolin Wang 2019-10-04hwspinlock: sprd: Change to use devm_platform_ioremap_resource()Baolin Wang 2019-10-04hwspinlock: u8500_hsem: Use devm_hwspin_lock_register() to register hwlock co...Baolin Wang 2019-10-04hwspinlock: u8500_hsem: Use devm_kzalloc() to allocate memoryBaolin Wang 2019-10-04hwspinlock: u8500_hsem: Change to use devm_platform_ioremap_resource()Baolin Wang 2019-06-29hwspinlock: add the 'in_atomic' APIFabien Dessenne 2019-06-29hwspinlock: stm32: implement the relax() opsFabien Dessenne 2019-06-29hwspinlock: ignore disabled deviceFabien Dessenne 2019-06-29hwspinlock/omap: Add a trace during probeSuman Anna 2019-06-29hwspinlock/omap: Add support for TI K3 SoCsSuman Anna 2019-01-03hwspinlock: fix return value check in stm32_hwspinlock_probe()Wei Yongjun 2018-12-05hwspinlock: add STM32 hwspinlock deviceBenjamin Gaignard 2018-07-30hwspinlock: Fix incorrect return pointersBaolin Wang 2018-06-26hwspinlock: Fix one comment mistakeBaolin Wang 2018-06-26hwspinlock: Add devm_xxx() APIs to register/unregister one hwlock controllerBaolin Wang 2018-06-26hwspinlock: Add devm_xxx() APIs to request/free hwlockBaolin Wang 2018-06-26hwspinlock: Add one new API to support getting a specific hwlock by the nameBaolin Wang 2018-06-11Merge tag 'hwlock-v4.18' of git://github.com/andersson/remoteprocLinus Torvalds 2018-06-06treewide: Use struct_size() for devm_kmalloc() and friendsKees Cook 2018-06-06treewide: Use struct_size() for kmalloc()-familyKees Cook 2018-05-24hwspinlock/u8500: Switch to SPDX license identifierSuman Anna 2018-05-24hwspinlock: sprd: Switch to SPDX license identifierSuman Anna 2018-05-24hwspinlock/sirf: Switch to SPDX license identifierSuman Anna 2018-05-24hwspinlock: qcom: Switch to SPDX license identifierSuman Anna 2018-05-24hwspinlock/omap: Switch to SPDX license identifierSuman Anna 2018-05-24hwspinlock/core: Switch to SPDX license identifierSuman Anna 2018-04-17hwspinlock: Introduce one new mode for hwspinlockBaolin Wang 2018-04-17hwspinlock: Convert to use 'switch' statementBaolin Wang 2017-11-17Merge tag 'hwlock-v4.15' of git://github.com/andersson/remoteprocLinus Torvalds 2017-11-06hwspinlock: Change hwspinlock to a boolBaolin Wang 2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman