Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:get_device_system_crosststamp - Synchronously capture system/device timestamp*@get_time_fn: Callback to get simultaneous device time and* system counter from the device driver*@ctx: Context passed to get_time_fn()*@history_begin: Historical reference

Proto:int get_device_system_crosststamp(int (*get_time_fn)(ktime_t *device_time, struct system_counterval_t *sys_counterval, void *ctx), void *ctx, struct system_time_snapshot *history_begin, struct system_device_crosststamp *xtstamp)

Type:int

Parameter:

TypeParameterName
int (*get_time_fn
void *ctx
struct system_time_snapshot *history_begin
struct system_device_crosststamp *xtstamp
1126  tk = timekeeper
1128  clock_was_set_seq = 0
1136  Do
1137  seq = ad_seqcount_begin - begin a seq-read critical section*@s: pointer to seqcount_t* Returns: count to be passed to read_seqcount_retry* read_seqcount_begin opens a read critical section of the given seqcount
1142  ret = get_time_fn( & device, & system_counterval, ctx)
1143  If ret Then Return ret
1151  If clock != cs Then Return -ENODEV
1153  cycles = cycles
1159  now = k_clock_read - atomic clocksource read() helper* This helper is necessary to use in the read paths because, while the* seqlock ensures we don't return a bad value while structures are updated,* it doesn't protect from potential crashes
1160  interval_start = cycle_last
1165  do_interp = true
1166  Else
1167  do_interp = false
1170  base_real = Add two ktime_t variables. res = lhs + rhs: (base, offs_real)
1172  base_raw = base
1174  nsec_real = timekeeping_cycles_to_ns( & tkr_mono, cycles)
1176  nsec_raw = timekeeping_cycles_to_ns( & tkr_raw, cycles)
1178  When ad_seqcount_retry - end a seq-read critical section*@s: pointer to seqcount_t*@start: count, from read_seqcount_begin* Returns: 1 if retry is required, else 0* read_seqcount_retry closes a read critical section of the given seqcount cycle
1180  sys_realtime = Add a ktime_t variable and a scalar nanosecond value.* res = kt + nsval:(base_real, nsec_real)
1181  sys_monoraw = Add a ktime_t variable and a scalar nanosecond value.* res = kt + nsval:(base_raw, nsec_raw)
1187  If do_interp Then
1196  If Not history_begin || Not ycle_between - true if test occurs chronologically between before and after || cs_was_changed_seq != cs_was_changed_seq Then Return -EINVAL
1201  partial_history_cycles = cycles - cycles
1202  total_history_cycles = cycles - cycles
1203  discontinuity = clock_was_set_seq != clock_was_set_seq
1206  ret = adjust_historical_crosststamp - adjust crosstimestamp previous to current interval*@history: Snapshot representing start of history*@partial_history_cycles: Cycle offset into history (fractional part)*@total_history_cycles: Total history length in
1210  If ret Then Return ret
1214  Return 0