X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fsched%2Frte_sched_common.h;h=e4cbbd9077d6855f8878d059f0b51084671fd049;hb=8b8dd4451da45ce0419521d7e29fe246a5278251;hp=96706df7bdcba3f2b7c6f77ab79e80bdaa186c0e;hpb=99a2dd955fba6e4cc23b77d590a033650ced9c45;p=dpdk.git diff --git a/lib/sched/rte_sched_common.h b/lib/sched/rte_sched_common.h index 96706df7bd..e4cbbd9077 100644 --- a/lib/sched/rte_sched_common.h +++ b/lib/sched/rte_sched_common.h @@ -51,10 +51,10 @@ rte_min_pos_4_u16(uint16_t *x) * gcd(a, b) = gcd(b, a mod b) * */ -static inline uint32_t -rte_get_gcd(uint32_t a, uint32_t b) +static inline uint64_t +rte_get_gcd64(uint64_t a, uint64_t b) { - uint32_t c; + uint64_t c; if (a == 0) return b; @@ -76,6 +76,15 @@ rte_get_gcd(uint32_t a, uint32_t b) return a; } +/* + * 32-bit version of Greatest Common Divisor (GCD). + */ +static inline uint32_t +rte_get_gcd(uint32_t a, uint32_t b) +{ + return rte_get_gcd64(a, b); +} + /* * Compute the Lowest Common Denominator (LCD) of two numbers. * This implementation computes GCD first: