Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\clocksource.c Create Date:2022-07-28 10:44:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:locks_calc_mult_shift - calculate mult/shift factors for scaled math of clocks*@mult: pointer to mult variable*@shift: pointer to shift variable*@from: frequency to convert from*@to: frequency to convert to*@maxsec: guaranteed runtime conversion range in

Proto:void clocks_calc_mult_shift(unsigned int *mult, unsigned int *shift, unsigned int from, unsigned int to, unsigned int maxsec)

Type:void

Parameter:

TypeParameterName
unsigned int *mult
unsigned int *shift
unsigned intfrom
unsigned intto
unsigned intmaxsec
48  sftacc = 32
54  tmp = maxsec * from >> 32
55  When tmp cycle
56  tmp >>= 1
57  sftacc--
64  When sft > 0 cycle
65  tmp = to << sft
66  tmp += from / 2
67  do_div() is NOT a C function(tmp, from)
68  If tmp >> sftacc == 0 Then Break
71  mult = tmp
72  shift = sft
Caller
NameDescribe
__clocksource_update_freq_scale__clocksource_update_freq_scale - Used update clocksource with new freq*@cs: clocksource to be registered*@scale: Scale factor multiplied against freq to get clocksource hz*@freq: clocksource frequency (cycles per second) divided by scale
sched_clock_register