X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fproportions.h;h=5afc1b23346d1f04536ea9339c1790b1cceeef3a;hb=bb896afe2089575ca1bb1fbf3f07b934e1ba999b;hp=2c3b3cad92bec050b18605cffe39784f774f09d0;hpb=4c5cdb1e1f2a502069f57a60b5c6b97b8106c73c;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/proportions.h b/include/linux/proportions.h index 2c3b3cad92b..5afc1b23346 100644 --- a/include/linux/proportions.h +++ b/include/linux/proportions.h @@ -77,6 +77,19 @@ void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl) local_irq_restore(flags); } +/* + * Limit the time part in order to ensure there are some bits left for the + * cycle counter and fraction multiply. + */ +#define PROP_MAX_SHIFT (3*BITS_PER_LONG/4) + +#define PROP_FRAC_SHIFT (BITS_PER_LONG - PROP_MAX_SHIFT - 1) +#define PROP_FRAC_BASE (1UL << PROP_FRAC_SHIFT) + +void __prop_inc_percpu_max(struct prop_descriptor *pd, + struct prop_local_percpu *pl, long frac); + + /* * ----- SINGLE ------ */