summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2018-10-10 10:59:33 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-11 13:25:51 -0700
commit873e7cd05bd379c4a082a2a99ad8690fa415e172 (patch)
tree272698869385ee554c964844519b0690eedc2167 /include
parent125ca6432b09156967bdfa62aa5af6f91ab2cc6c (diff)
downloadchrome-ec-873e7cd05bd379c4a082a2a99ad8690fa415e172.tar.gz
cr50: minor code revision with macros regarding CCD capabilities.
Defined "Number of bits in CCD cap expression", "Bitmask for a CCD cap expression", and "Number of CCD cap expressions in a Byte," and replaced constant uses with macros in CR50 and gsctool codes. No binary size changes in either CR50 or gsctool. BRANCH=cr50_ccd BUG=none TEST=manually tested with gsctool -I and CR50 console command 'ccd'. Signed-off-by: Namyoon Woo <namyoon@chromium.org> Change-Id: If91305090444395b6a938f920f4e47e2acbba886 Reviewed-on: https://chromium-review.googlesource.com/1274007 Commit-Ready: Namyoon Woo <namyoon@chromium.org> Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/ccd_config.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/ccd_config.h b/include/ccd_config.h
index 7c377f394f..4cc84ae770 100644
--- a/include/ccd_config.h
+++ b/include/ccd_config.h
@@ -172,6 +172,11 @@ struct ccd_capability_info {
#define CCD_STATE_NAMES { "Locked", "Unlocked", "Opened" }
#define CCD_CAP_STATE_NAMES { "Default", "Always", "UnlessLocked", "IfOpened" }
+/* Macros regarding ccd_capabilities */
+#define CCD_CAP_BITS 2
+#define CCD_CAP_BITMASK ((1 << CCD_CAP_BITS) - 1)
+#define CCD_CAPS_PER_BYTE (8 / CCD_CAP_BITS)
+
/*
* Subcommand code, used to pass different CCD commands using the same TPM
* vendor command.