Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\lib\delay.c Create Date:2022-07-28 07:24:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:TSC based delay:

Proto:static void delay_tsc(unsigned long __loops)

Type:void

Parameter:

TypeParameterName
unsigned long__loops
54  loops = __loops
57  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
58  cpu = smp_processor_id()
59  bclock = dtsc_ordered() - read the current TSC in program order* rdtsc_ordered() returns the result of RDTSC as a 64-bit integer.* It is ordered like a load to a global in-memory counter. It should* be impossible to observe non-monotonic rdtsc_unordered() behavior
60  cycle
61  now = dtsc_ordered() - read the current TSC in program order* rdtsc_ordered() returns the result of RDTSC as a 64-bit integer.* It is ordered like a load to a global in-memory counter. It should* be impossible to observe non-monotonic rdtsc_unordered() behavior
62  If now - bclock >= loops Then Break
66  preempt_enable()
67  REP NOP (PAUSE) is a good thing to insert into busy-wait loops.
68  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
80  loops -= now - bclock
85  preempt_enable()