-
Notifications
You must be signed in to change notification settings - Fork 13
/
lrng_testing.h
85 lines (71 loc) · 3.09 KB
/
lrng_testing.h
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/*
* Copyright (C) 2022, Stephan Mueller <[email protected]>
*/
#ifndef _LRNG_TESTING_H
#define _LRNG_TESTING_H
#ifdef CONFIG_LRNG_RAW_HIRES_ENTROPY
bool lrng_raw_hires_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_HIRES_ENTROPY */
static inline bool lrng_raw_hires_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_HIRES_ENTROPY */
#ifdef CONFIG_LRNG_RAW_JIFFIES_ENTROPY
bool lrng_raw_jiffies_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_JIFFIES_ENTROPY */
static inline bool lrng_raw_jiffies_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_JIFFIES_ENTROPY */
#ifdef CONFIG_LRNG_RAW_IRQ_ENTROPY
bool lrng_raw_irq_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_IRQ_ENTROPY */
static inline bool lrng_raw_irq_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_IRQ_ENTROPY */
#ifdef CONFIG_LRNG_RAW_RETIP_ENTROPY
bool lrng_raw_retip_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_RETIP_ENTROPY */
static inline bool lrng_raw_retip_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_RETIP_ENTROPY */
#ifdef CONFIG_LRNG_RAW_REGS_ENTROPY
bool lrng_raw_regs_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_REGS_ENTROPY */
static inline bool lrng_raw_regs_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_REGS_ENTROPY */
#ifdef CONFIG_LRNG_RAW_ARRAY
bool lrng_raw_array_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_ARRAY */
static inline bool lrng_raw_array_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_ARRAY */
#ifdef CONFIG_LRNG_IRQ_PERF
bool lrng_perf_time(u32 start);
#else /* CONFIG_LRNG_IRQ_PERF */
static inline bool lrng_perf_time(u32 start) { return false; }
#endif /*CONFIG_LRNG_IRQ_PERF */
#ifdef CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY
bool lrng_raw_sched_hires_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY */
static inline bool
lrng_raw_sched_hires_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY */
#ifdef CONFIG_LRNG_RAW_SCHED_PID_ENTROPY
bool lrng_raw_sched_pid_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_SCHED_PID_ENTROPY */
static inline bool
lrng_raw_sched_pid_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_SCHED_PID_ENTROPY */
#ifdef CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY
bool lrng_raw_sched_starttime_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY */
static inline bool
lrng_raw_sched_starttime_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY */
#ifdef CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY
bool lrng_raw_sched_nvcsw_entropy_store(u32 value);
#else /* CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY */
static inline bool
lrng_raw_sched_nvcsw_entropy_store(u32 value) { return false; }
#endif /* CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY */
#ifdef CONFIG_LRNG_SCHED_PERF
bool lrng_sched_perf_time(u32 start);
#else /* CONFIG_LRNG_SCHED_PERF */
static inline bool lrng_sched_perf_time(u32 start) { return false; }
#endif /*CONFIG_LRNG_SCHED_PERF */
#endif /* _LRNG_TESTING_H */