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:On some AMD platforms, MWAITX has a configurable 32-bit timer, that* counts with TSC frequency. The input value is the loop of the* counter, it will exit when the timer expires.

Proto:static void delay_mwaitx(unsigned long __loops)

Type:void

Parameter:

TypeParameterName
unsigned long__loops
95  loops = __loops
101  If loops == 0 Then Return
104  start = 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
106  cycle
107  delay = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, MWAITX_MAX_LOOPS, loops)
113  __monitorx(raw_cpu_ptr( & cpu_tss_rw), 0, 0)
120  MWAITX allows for a timer expiration to get the core out a wait state in* addition to the default MWAIT exit condition of a store appearing at a* monitored virtual address.* Registers:* MWAITX ECX[1]: enable timer if set
122  end = 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
124  If loops <= end - start Then Break
127  loops -= end - start
129  start = end