函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\posix-cpu-timers.c Create Date:2022-07-27 11:47:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Guts of sys_timer_settime for CPU timers.* This is called with the timer locked and interrupts disabled.* If we return TIMER_RETRY, it's necessary to release the timer's lock* and try again. (This happens when the timer is in the middle of firing.)

函数原型:static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, struct itimerspec64 *new, struct itimerspec64 *old)

返回类型:int

参数:

类型参数名称
struct k_itimer *timer
inttimer_flags
struct itimerspec64 *new
struct itimerspec64 *old
564  clkid等于CPUCLOCK_WHICH(it_clock)
566  ctmr等于cpu
567  p等于task
570  ret等于0
572  如果WARN_ON_ONCE(!p)则返回:负EINVAL
579  new_expires等于Convert ktime_t to nanoseconds
585  sighand等于lock_task_sighand(p, & flags)
590  如果此条件成立可能性小(为编译器优化)(sighand == NULL)则返回:负ESRCH
596  old_incr等于it_interval
597  old_expires等于cpu_timer_getexpires(ctmr)
599  如果此条件成立可能性小(为编译器优化)(firing)则
600  firing等于负1
601  ret等于SPDX-License-Identifier: GPL-2.0
602  否则
603  cpu_timer_dequeue(ctmr)
614  如果CPUCLOCK_PERTHREAD(it_clock)则val等于Sample a per-thread clock for the given task. clkid is validated.
616  否则val等于Sample a process (thread group) clock for the given task clkid. If the* group's cputime accounting is already enabled, read the atomic* store. Otherwise a full update is required. Task's sighand lock must be
619  如果old
620  如果old_expires恒等于0则
621  seconds 等于0
622  nanoseconds 等于0
623  否则
633  如果val小于exp
636  否则
637  nanoseconds 等于1
638  seconds 等于0
643  如果此条件成立可能性小(为编译器优化)(ret)则
650  unlock_task_sighand(p, & flags)
651  转到:out
654  如果new_expires不等于0且非timer_flags按位与The various flags for setting POSIX.1b interval timers:的值则
655  new_expires加等于val
663  cpu_timer_setexpires(ctmr, new_expires)
664  如果new_expires不等于0且val小于new_expires
665  Insert the timer on the appropriate list before any timers that* expire later. This must be called with the sighand lock held.
668  unlock_task_sighand(p, & flags)
673  it_interval等于vert a timespec64 to ktime_t format:
680  it_requeue_pending等于it_requeue_pending加2按位与REQUEUE_PENDING的反
682  it_overrun_last等于0
683  it_overrun等于负1
685  如果new_expires不等于0且非val小于new_expires的值则
691  The timer is locked, fire it and arrange for its reload.
694  ret等于0
695  out :
696  如果oldit_interval等于纳秒转换到64位timespec时间
699  返回:ret
调用者
名称描述
do_cpu_nanosleep