diff mbox series

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

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

Commit Message

Github ODP bot Oct. 13, 2017, 2 p.m. 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: 60a1a4f1cc531d7f0117cd79daf1cbe4206e12ef
 ** Merge commit sha: 2474b4010dd04284d1bd9c312a3f4373d9ed5c5c
 **/
 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;
+
 /**
  * @}
  */