summaryrefslogtreecommitdiff
path: root/src/shared/condition.h
diff options
context:
space:
mode:
authorGiedrius Statkevičius <giedriuswork@gmail.com>2020-11-11 22:45:58 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-02-17 15:31:29 +0900
commit68337e55f62cf49b7bdfb73dc5662e23b0ea17fa (patch)
tree494f0944d4b54579df479c6a9dd06ef0809376a3 /src/shared/condition.h
parentb1b4e9204c8260956825e2b9733c95903e215e31 (diff)
downloadsystemd-68337e55f62cf49b7bdfb73dc5662e23b0ea17fa.tar.gz
condition: add CPUFeature
Taking a stab at implementing #14479. Add {Condition,Assert}CPUFeature to `systemd-analyze` & friends. Implement it by executing the CPUID instruction. Add tables for common x86/i386 features. Tested via unit tests + checked that commands such as: ```bash systemd-analyze condition 'AssertCPUFeature = rdrand' ``` Succeed as expected and that commands such as ```bash systemd-analyze condition 'AssertCPUFeature = foobar' ``` Fail as expected. Finally, I have amended the `systemd.unit` manual page with the new condition and the list of all currently supported flags.
Diffstat (limited to 'src/shared/condition.h')
-rw-r--r--src/shared/condition.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/condition.h b/src/shared/condition.h
index 7853490290..75c430e9e0 100644
--- a/src/shared/condition.h
+++ b/src/shared/condition.h
@@ -19,6 +19,7 @@ typedef enum ConditionType {
CONDITION_MEMORY,
CONDITION_CPUS,
CONDITION_ENVIRONMENT,
+ CONDITION_CPU_FEATURE,
CONDITION_NEEDS_UPDATE,
CONDITION_FIRST_BOOT,