diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-07 10:37:03 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-08 13:59:02 +0000 |
commit | 532d6e84ab7fab9568dabc63a4620a257ea2fdff (patch) | |
tree | 46bb04a1c1fe58340f9c53c504d66fcb2c8014c7 /lib/igt_taints.h | |
parent | 39768c976b920dcf0f159284bce882088aa65c50 (diff) |
lib: Process kernel taints
A small library routine to read '/proc/sys/kernel/taints' and check for
a fatal condition. This is currently used by the runner, but is also
useful for some tests.
v2,3: function docs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/igt_taints.h')
-rw-r--r-- | lib/igt_taints.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/igt_taints.h b/lib/igt_taints.h new file mode 100644 index 00000000..be4195c5 --- /dev/null +++ b/lib/igt_taints.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2021 Intel Corporation + */ + +#ifndef __IGT_TAINTS_H__ +#define __IGT_TAINTS_H__ + +unsigned long igt_kernel_tainted(unsigned long *taints); +const char *igt_explain_taints(unsigned long *taints); + +unsigned long igt_bad_taints(void); + +static inline unsigned long is_tainted(unsigned long taints) +{ + return taints & igt_bad_taints(); +} + +#endif /* __IGT_TAINTS_H__ */ |