Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mekeeping_init - Initializes the clocksource and common timekeeping values

Proto:void __init timekeeping_init(void)

Type:void

Parameter:Nothing

1535  tk = timekeeper
1539  ad_persistent_wall_and_boot_offset - Read persistent clock, and also offset* from the boot.* Weak dummy function for arches that do not yet support it.* The default function calculates offset based on the current value of* local_clock()
1540  If timespec64_valid_settod( & wall_time) && mespec64_to_ns - Convert timespec64 to nanoseconds*@ts: pointer to the timespec64 variable to be converted* Returns the scalar nanosecond representation of the timespec64* parameter. > 0 Then
1542  Flag for if there is a persistent clock on this platform = true
1543  Else if mespec64_to_ns - Convert timespec64 to nanoseconds*@ts: pointer to the timespec64 variable to be converted* Returns the scalar nanosecond representation of the timespec64* parameter. != 0 Then
1544  pr_warn("Persistent clock returned invalid value")
1545  wall_time = (struct timespec64){0}
1548  If lhs < rhs: return <0* lhs == rhs: return 0* lhs > rhs: return >0 < 0 Then boot_offset = (structtimespec64){0}
1555  wall_to_mono = sub = lhs - rhs, in normalized form
1557  raw_spin_lock_irqsave( & timekeeper_lock, flags)
1558  write_seqcount_begin( & seq)
1559  ntp_init()
1561  clock = clocksource_default_clock()
1562  If enable Then enable(clock)
1564  k_setup_internals - Set up internals to use clocksource clock
1566  tk_set_xtime(tk, & wall_time)
1567  raw_sec = 0
1569  tk_set_wall_to_mono(tk, wall_to_mono)
1571  must hold timekeeper_lock
1573  write_seqcount_end( & seq)
1574  raw_spin_unlock_irqrestore( & timekeeper_lock, flags)