Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:init\calibrate.c Create Date:2022-07-28 13:55:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:calibrate_delay_direct

Proto:static unsigned long calibrate_delay_direct(void)

Type:unsigned long

Parameter:Nothing

41  good_timer_sum = 0
42  good_timer_count = 0
44  max = -1
45  min = -1
48  If read_current_timer( & pre_start) < 0 Then Return 0
70  When i < MAX_DIRECT_CALIBRATION_RETRIES cycle
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_end - pre_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_end - post_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  If start >= post_end Then 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
103  If start < post_end && pre_start != 0 && pre_end != 0 && timer_rate_max - timer_rate_min < timer_rate_max >> 3 Then
108  If max < 0 || timer_rate_max > measured_times[max] Then max = i
110  If min < 0 || timer_rate_max < measured_times[min] Then min = i
112  Else measured_times[i] = 0
121  When good_timer_count > 1 cycle
126  estimate = good_timer_sum / good_timer_count
127  maxdiff = estimate >> 3
130  If measured_times[max] - measured_times[min] < maxdiff Then Return estimate
134  good_timer_sum = 0
135  good_timer_count = 0
141  measured_times[min] = 0
142  min = max
143  Else
147  measured_times[max] = 0
148  max = min
152  If measured_times[i] == 0 Then Continue
156  If measured_times[i] < measured_times[min] Then min = i
158  If measured_times[i] > measured_times[max] Then 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  Return 0
Caller
NameDescribe
calibrate_delay