X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Flinux%2Fproportions.h;h=5afc1b23346d1f04536ea9339c1790b1cceeef3a;hb=946e2ad040000a14b7316fae722e7e65fa09ffe5;hp=2c3b3cad92bec050b18605cffe39784f774f09d0;hpb=c548f08a4f7b89b93c805e0c4024b8302afa7121;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 ------ */