函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:init\calibrate.c Create Date:2022-07-27 15:17:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:calibrate_delay_direct

函数原型:static unsigned long calibrate_delay_direct(void)

返回类型:unsigned long

参数:

41  good_timer_sum等于0
42  good_timer_count等于0
44  max等于负1
45  min等于负1
48  如果read_current_timer( & pre_start)小于0则返回:0
70 i小于MAX_DIRECT_CALIBRATION_RETRIES循环
71  pre_start等于0
72  read_current_timer( & start)
73  start_jiffies等于jiffies
75  pre_start等于start
78  read_current_timer( & post_start)
80  pre_end等于0
81  end等于post_start
84  pre_end等于end
87  read_current_timer( & post_end)
89  timer_rate_max等于post_endpre_start的差除This routine uses the read_current_timer() routine and gets the* loops per jiffy directly, instead of guessing it using delay().* Also, this code tries to handle non-maskable asynchronous events* (like SMIs)
91  timer_rate_min等于pre_endpost_start的差除This routine uses the read_current_timer() routine and gets the* loops per jiffy directly, instead of guessing it using delay().* Also, this code tries to handle non-maskable asynchronous events* (like SMIs)
98  如果start大于等于post_endprintk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
103  如果start小于post_endpre_start不等于0且pre_end不等于0且timer_rate_maxtimer_rate_min小于timer_rate_max右移3位则
105  good_timer_count自加
108  如果max小于0或timer_rate_max大于measured_times[max]则max等于i
110  如果min小于0或timer_rate_max小于measured_times[min]则min等于i
112  否则measured_times[i]等于0
121 good_timer_count大于1循环
126  estimate等于good_timer_sumgood_timer_count
127  maxdiff等于estimate右移3位
130  如果measured_times[max]减measured_times[min]小于maxdiff则返回:estimate
134  good_timer_sum等于0
135  good_timer_count等于0
141  measured_times[min]等于0
142  min等于max
143  否则
147  measured_times[max]等于0
148  max等于min
152  如果measured_times[i]恒等于0则继续下一循环
154  good_timer_count自加
156  如果measured_times[i]小于measured_times[min]则min等于i
158  如果measured_times[i]大于measured_times[max]则max等于i
164  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
167  返回:0
调用者
名称描述
calibrate_delay计算CPU需要校准的时间