diff mbox series

[API-NEXT,v7,1/3] api: std_types: add odp_percent_t data type

Message ID 1507161625-18077-2-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v7,1/3] api: std_types: add odp_percent_t data type | expand

Commit Message

Github ODP bot Oct. 5, 2017, midnight UTC
From: Balasubramanian Manoharan <bala.manoharan@linaro.org>


odp_percent_t is used to express values which are percentages

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

---
/** Email created from pull request 172 (bala-manoharan:random_early_discard)
 ** https://github.com/Linaro/odp/pull/172
 ** Patch: https://github.com/Linaro/odp/pull/172.patch
 ** Base sha: 75cfc6f70d5b21d6f04082e1d03a7e677a895280
 ** Merge commit sha: 63b45c733af2661b5e33305c895876296b6c7e74
 **/
 include/odp/api/spec/std_types.h                   | 7 +++++++
 platform/linux-generic/include/odp/api/std_types.h | 2 ++
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h
index ec6a6df6d..97f5ad994 100644
--- a/include/odp/api/spec/std_types.h
+++ b/include/odp/api/spec/std_types.h
@@ -32,6 +32,13 @@  extern "C" {
  */
 
 /**
+ * @typedef odp_percent_t
+ * Use odp_percent_t for specifying fields that are percentages. It is a fixed
+ * point integer whose units are expressed as one-hundredth of a percent.
+ * Hence 100% is represented as integer value 10000.
+ */
+
+/**
  * @}
  */
 
diff --git a/platform/linux-generic/include/odp/api/std_types.h b/platform/linux-generic/include/odp/api/std_types.h
index b61f33f4c..2104db03d 100644
--- a/platform/linux-generic/include/odp/api/std_types.h
+++ b/platform/linux-generic/include/odp/api/std_types.h
@@ -29,6 +29,8 @@  extern "C" {
 
 typedef int odp_bool_t;
 
+typedef uint16_t odp_percent_t;
+
 /**
  * @}
  */