2 * lib_sw_fence.h - library routines for testing N:M synchronisation points
4 * Copyright (C) 2017 Intel Corporation
6 * This file is released under the GPLv2.
10 #ifndef _LIB_SW_FENCE_H_
11 #define _LIB_SW_FENCE_H_
13 #include <linux/timer.h>
15 #include "../i915_sw_fence.h"
18 #define onstack_fence_init(fence) \
20 static struct lock_class_key __key; \
22 __onstack_fence_init((fence), #fence, &__key); \
25 #define onstack_fence_init(fence) \
26 __onstack_fence_init((fence), NULL, NULL)
29 void __onstack_fence_init(struct i915_sw_fence *fence,
31 struct lock_class_key *key);
32 void onstack_fence_fini(struct i915_sw_fence *fence);
35 struct i915_sw_fence fence;
36 struct timer_list timer;
39 void timed_fence_init(struct timed_fence *tf, unsigned long expires);
40 void timed_fence_fini(struct timed_fence *tf);
42 #endif /* _LIB_SW_FENCE_H_ */