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

Message ID 1507233631-30788-2-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series
  • api: classification: add random early detection
Related show

Commit Message

Github ODP bot Oct. 5, 2017, 8 p.m.
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: 506bf9dcf0e071cd8b168806b1d279124551af86
 ** Merge commit sha: a6d799f461c7378bd39a574a3b92cd8463d10b39
 **/
 include/odp/api/spec/std_types.h                   | 7 +++++++
 platform/linux-generic/include/odp/api/std_types.h | 2 ++
 2 files changed, 9 insertions(+)

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;
+
 /**
  * @}
  */